Thursday, December 15, 2016

Reduce Hard Drive Size When Running Windows 10 in a VM


If you are running Windows 10 in a VM chance are you could use every bit of hard drive space available. Get a few gigs back by disabling hibernation, which you probably aren't using if you're running in a VM. Here's a link to the Microsoft support article here but the directions are copied below just to make things easier.

  1. Click Start, and then type cmd in the Start Search box.
  2. In the search results list, right-click Command Prompt, and then click Run as Administrator.
  3. When you are prompted by User Account Control, click Continue.
  4. At the command prompt, type powercfg.exe /hibernate off, and then press Enter.
  5. Type exit, and then press Enter to close the Command Prompt window.

Tuesday, December 6, 2016

Bash Script Arugments

I write a lot of bash scripts. It's really out of laziness. Here is a script that allows parsing of specific arguments and passthrough of all other arguments. There are obviously many ways to do this but this is one of the ways that I've found to work best.

# Here is a boolean argument
ARG_NAME_1="-arg1"
ARG_VALUE_1=false

# Here is an argument with a value
ARG_NAME_2="-debug:"
ARG_VALUE_2=""

# Argument parsing.
ARGS=()
for i in "$@"; do
  if [[ "$i" == ${ARG_NAME_1} ]]; then
    ARG_VALUE_1=true
  if [[ "$i" == ${ARG_NAME_2}* ]]; then
        ARG_VALUE_2 =${i:${#ARG_NAME_2}}
  else
    ARGS+=("\"$i\"")
  fi
done

eval AppToLaunch $(IFS=$' '; echo "${ARGS[*]}")


Thursday, December 1, 2016

CAD for 3D Printing

I've been doing a lot of 3D printing with a Lulzbot Taz 5 lately and I've been working with lots of different CAD programs. I purchased ViaCAD and it's a pretty good program but it crashes once in a while and when it crashes, I loose the entire file, not just my work but the entire file! So I've been looking for an alternative. I run a Mac so I'd prefer to use something native to the platform rather than run a Windows VM. Here's a short list of the paid programs:

  • SolidWorks
  • Inventor
  • Rhino
  • Fusion360
  • Moment of Inspiration
  • SketchUp
  • Metasequoia
SolidWorks is by far the industry standard. If you pickup any product most likely it's been designed with SolidWorks. But it's expensive. Very expensive. Inventor is Auto Desk's version of solid works with about 20% of the market. It's good, but also expensive. Rhino is pretty darn good but they made a huge user interface change in the last few years making it terrible in my opinion. It isn't exactly inexpensive either. Fusion360 is a much less expensive cloud version of Inventor with less features and a monthly fee. Moment of Inspiration is $300. I actually rather like it but it is limited. On Mac it uses Wine which is less than ideal for a $300 piece of software in my opinion. SketchUp is both free and paid, but if you want to generate STL files you need the paid version. SketchUp is really good at architectural drawings but not good to non-geometric stuff. In order to get good prints from SketchUp you have to create your model really big and then scale it down. Even doing this you'll get funny odd jagged edges.

Now for the free stuff:
  • FreeCAD
  • LibreCAD
  • OpenSCAD
  • 123 Design
  • Antimony
  • TinkerCAD
Antimony has an interesting user interface. I'll keep my eye on it but it isn't usable. TinkerCAD is good for kids. LibreCAD and FreeCAD are powerful but extremely difficult to work with in my opinion. As it is I tend to build things in either 123 Design or OpenSCAD. I'll post more about 123 Design or OpenSCAD later.