Tuesday, December 22, 2015

Convert .a png to .icns for Mac App Bundle

Here is a bash script to convert a .png to .icns for Mac App Bundle. Usage:

pngtoicns.sh image.png AppImage

and it will generate AppImage.icns

#!/bin/bash

INFILE=$1
OUTFILE=$2

mkdir $OUTFILE.iconset
sips -z 16 16     $INFILE --out $OUTFILE.iconset/icon_16x16.png
sips -z 32 32     $INFILE --out $OUTFILE.iconset/icon_16x16@2x.png
sips -z 32 32     $INFILE --out $OUTFILE.iconset/icon_32x32.png
sips -z 64 64     $INFILE --out $OUTFILE.iconset/icon_32x32@2x.png
sips -z 128 128   $INFILE --out $OUTFILE.iconset/icon_128x128.png
sips -z 256 256   $INFILE --out $OUTFILE.iconset/icon_128x128@2x.png
sips -z 256 256   $INFILE --out $OUTFILE.iconset/icon_256x256.png
sips -z 512 512   $INFILE --out $OUTFILE.iconset/icon_256x256@2x.png
sips -z 512 512   $INFILE --out $OUTFILE.iconset/icon_512x512.png
cp $INFILE $OUTFILE.iconset/icon_512x512@2x.png
iconutil -c icns $OUTFILE.iconset
rm -R $OUTFILE.iconset

Thursday, December 17, 2015

3D Printers

I've been doing a fair bit of 3D printing lately which has kept me busy and is why this blog hasn't been updated in some time. But I'm now at a point where I'm going to start talking a bit about 3D printers and my experience. It's a big industry and growing rapidly so it takes a bit to get your head wrapped around it.

Most of my experience comes from using friend's printers, but nothing comes even close to being thrown into the deep end and having to use one all by yourself. I originally wrote this post going over my decision making process, but I actually purchased a printer and it was defective so I went back and rewrite this post including my new decision making process for my second 3D printer including some of my hands on experience with that printer. At work we also have a few different machines. So I researched just about everything else out there but mostly the Ultimaker 2, Zortrax M200, Lulzbot Taz 5, Type A Machine Series 1 and Fusion3 F306 as well as a few dozen others. My budget was no more than $3000. I wanted to get a good printer and not one that I'd want to replace in a year.

Every 3D printer design has tradeoffs, and reviews are only half the equation. So here's what I've found and what I decided to go with. The things I decided to look for are:

1. The ability to level the build plate.
2. Heated plate.
3. Simplicity of the extruder. Some are very complex and not easy to clean if filament gets stuck (and it will get stuck).
4. Print speed (this is extremely tricky and has many tradeoffs including resonance).
5. 3mm filament instead of the more popular 1.75mm (this is a new requirement since my returning of the printer I originally purchased).

I decided against the PrinterBot because it's just too small and the quality of prints I've seen come off it aren't up to what the other printers produce. But I do like the design and price! It is a very solid printer. You really can't go wrong with this printer if the size is big enough for what you want to print.

The Zortrax M200 seems to be the world's best kept secret it seems. It's half Ultimaker 2 and half Type A Machines Series 1. The stepper motor for the filament lives on the print head so technically it's a little slower to print but as I wrote earlier about the Ultimaker 2 I prefer this design given the tradeoffs. The problem with the Zortrax is I just don't know enough about it because it is the world's best kept secret.

The Ultimaker 2, which is what I have the most experience with, while a good printer it has some serious flaws that only show up after using it for some time. No review will find these. The print head moves in X and Y while the build plate moves down Z as the print is assembled. To increase print speed the Ultimaker 2 reduces the weight of the print head by moving the stepper motor that moves the filament off the print head and onto the frame by using a Bowden tube and using the filament from the roll to the print head. The Bowden tube is made of teflon which is slippery and has a higher melting temperature than the filament which is good because when the filament gets stuck you can simply get a blowtorch, stick some new filament in the tube melt the stuck piece and pull it out. Don't cut the tube like others have done because you'll just have to buy a new $30 Bowden tube. So while this is a slick way to make the print head go faster (less mass means easier to throw the print head around at faster speeds), it has the side effect of requiring 3mm filament which I used to not like but now I prefer. But there is another side effect. The print bed is cantilevered and isn't super solid so when it goes down fast it oscillates making the print not come out so good.  The only way to counteract this is to print slower. So what's the point of the print head being able to go faster? Well there are a couple reasons, balance of the print head is key. Without an a stepper on the print head the center of mass is easy to get accurate and right over the extruder tip. The Ultimaker 2 has a screen and an SD card but no wireless printing or USB to be connected to a computer. The SD card is nice because I'd prefer not to be tied to having a computer drive it, but requires a screen so originally I didn't care about the screen and thought it'd be good to have wireless printing but I've now found that you need to have a computer right next to the printer if you don't have the ability to start prints from the printer itself. Actually mainly for diagnosing problems and to extrude small bits of filament when swapping filament or cleaning the print head. The build platform is 8in x 8in x 8in which is fairly big but not huge but pretty standard. The Ultimaker 2 is a bit difficult to work on, but it is a pretty good printer overall.

The Lulzbot Taz 5 was actually my runner up choice but was not my first choice. The sales rep at a Santa Clara 3D printer show was right. He said "sure, you can go with a different brand, but you'll eventually be back looking at the Taz". He was right. The build plate moves in the Y direction while the print head moves in the X and Z. But the build plate is heavy and as the print gets larger it gets heavier. Common sense says this large amount of mass takes a lot of work to move and if it isn't quite dry the print can move. Just a slight move will cause an uneven print. The only way to counteract this is to print slower. Other than that I think the Taz 5 is a great machine and like I said was my runner up. I like that it's open source and has a huge community around it. It's print volume is a little bigger than the Ultimaker 2 at 11.7in x 10.8in x 9.8in. Very odd size. A friend of mine was in the market for a 3D printer so I shared my thoughts and he decided to go with a Taz 5 and has been printing right out of the box without any problems. There is a slight issue with the weight of the print head and when the print head is at X = MaxX / 2, the print head moves about 100 microns about (1 layer or half a layer depending on layer resolution). It isn't a huge problem, but I think it's the biggest issue I have with the Taz 5 at this point. There are a few solutions, wait until the Taz 6, they are putting larger rods on the X axis, and there are a few solutions users have published (http://www.thingiverse.com/thing:866604). One thing I really like about the Taz 5 is it uses a 24volt power supply. That means the print head heats up fast! They also use very high gauge wires to the print head which is important.

Type A Machine Series 1 Pro is what I decided to get, and unfortunately had to returned it. It prints the biggest of all these at 12in x 12in x 12in, and all the specs look great. At first I thought the cantilevered print bed would be a problem but it's super solid. The printer has wifi and a web server instead of an SD card and display. However, my experience of actually using the printer for two weeks changed my opinion and I would only buy a printer for my needs if it has a display, SD card and controls on the printer. I'll elaborate more on this later. I visited their facility since it's near Oakland and only an hours drive away. First off, they are super nice, but I will tell my store exactly how it happened. I spoke with Type A Machines and they had a two or more month waiting list. Alternatively they had a refurbished unit that I could get right away. I really wanted it sooner than later because of my daughter's Maker's Club and a few projects I'm working on so I went against my better judgement and got it. I never buy refurbished and I never will again. The $500 savings tipped my decision from the Taz 5, brought the price under my budget, and the larger build volume was important for one thing I wanted to print and I really didn't like at the time how the Taz bed moves. It's all engineering compromises but now after working with the Type A I prefer the Taz design. So, the printer shows up, I open it up and there are no directions besides this way up sign and don't grab here. At this point there should be directions right on top for what to do and I think they'll fix this but I had no directions, so I cut the box and slid the printer out. It was well packaged but wasn't difficult to get it out of the foam protection armor. I set it up, opened up the box on the side with the build plate but had no instructions, power cord or wifi antenna. I looked around on the website for instructions but couldn't find any. The wifi antenna and power cord were in another box but under the print bed wedged in. I finally figured out that I had to manually twist a knob on the back to raise the print bed to get the box out. After opening this new box and finding no directions I dug around and finally found them. The instructions turned out where shoved down the size of the box. I skimmed through the instructions to figure out how to connect to the printer since I had already set it up. And here's where things went really south but I'll just point out the highlights so this isn't a 10 page post. I had no filament. The filament I ordered from Type A didn't ship. They did a next day air but it arrived 2 days after the print. A friend however had some 1.75mm ABS, so I did a quick level of the bed and went to print. My workflow is to have my computer inside the house and the 3D printer in the garage. I could bring my laptop out to the garage but that's less than ideal. I ended up using my iPad, but the web browser interface is extremely clunky with the iPad. In order to use this printer you need a computer right next to it. This is why I prefer the SD card design. Having to require a computer is either handy if you want the printer sitting on your desk but if you want it in the garage or somewhere the order from the melted plastic won't bother everyone in the house then you need another computer adding to the expense of the device. So the prints were turning out really odd. The print head would never go to X = 0. I'd have to restart the printer, physically move the print head and turn it back on. About a 10 minute procedure. Also the loading of the model on the iPad took forever, but I couldn't start a print from my computer because you need to be right next to the printer and even more so for me since all the problems I had. I also found out that that the filament would get tangled up. To make a long story short, there was a Bowden tube in the box but because of my problems with the directions I never noticed it. I saw it but thought it was a small piece of sample filament. Also, all the photos of the printer on the website or manual do not have this Bowden tube attached. There's one little sentence in the directions buried in a long paragraph that describes it. I ended up getting my own Bowden tube to avoid the tanglement but it still has major problems because of the range of motion of the print head, 12" in both X and Y and it can move fast! I ended up giving up on the ABS since it stinks! So in addition to the print head not returning to X = 0, turned out there was dust and hair in all the fans that started blowing out on my earlier prints, one of the belts was worn, the two rail slides were rusted and the L bracket holding the fan was bent. Not so refurbished like new up to the most recent spec of the Series 1 2015 model as they claimed. Turned out the rusted rail slides had been replaced in newer units with a stainless steel version but mine didn't get that fix. I also ran into some sort of head clog after very little printing that I could never figure out and Type A Machines tried but after 20 minutes gave up and blamed it on the fact that I ran about 12" of ABS through the printer which apparently isn't supported contrary to all the specs supporting it and verbal approval from multiple people on my visit saying it can print ABS. I guess it isn't in their "supported" filament list and "voids the warranty". It extruded fine for 2 days after the use of ABS so I don't think that was the problem. To finish up the story, I personally delivered the printer to Type A, returned it, and spent over an hour going over all the problems that I had. Eventually 6 days later of going back and forth I got a refund since that is their policy (good policy and good to know they honor it), but since it wasn't my fault but a faulty unit I requested a refund of the unused filament and the shipping that I paid to get the printer. It was a bit of a hassle to be honest but they did honor everything. Last thought is I know the Type A uses a 24volt power supply, but the print head doesn't heat up as fast as the Taz 5. I think this is due to the ribbon cable they use to supply power and data to the print head stepper. I don't see how the tiny wires in the ribbon cable can support enough amps to heat the print head up. There'd be a lot of waste in the ribbon cable at any rate.

So, I prefer 3mm filament because it has more pressure and doesn't tangle as easily. I prefer the print bed to move in the Y direction rather than the Z so the movement of the print head is simpler. I prefer the open model of the Taz because if something doesn't work you can modify it. I'm ordering a Taz 5 and plan to upgrade or modify the X axis to the Taz 6 version or some other modification at some point. I also plan to build a housing for the printer so it doesn't smell.

Last thought, the Type A Series 1 has a very small footprint but is very tall. The Taz 5 isn't as tall but has a much larger footprint because the bed moves.

Wednesday, December 16, 2015

How to Stop Your Cursor from Getting Bigger in OS X El Capitan

Ever since installing El Capitan I've noticed the mouse cursor getting bigger once in a while. It thought it was a bug at first but, it isn't. This article will show you how to turn it off:

http://www.tekrevue.com/tip/cursor-bigger-shake-to-locate-el-capitan/