FreeCAD

/media/images/2025-05-03_19-45_couche.png

I've been reluctant to jump into 3d design for a few reasons. Primarily, the open source options are bad. Today the king of hobbyist CAD is Fusion360, but I refuse to learn a tool that can be taken away from me on a whim.

There are few open source alternatives. OpenSCAD lets you describe your 3d primitives with text, adding and subtracting faces or writing code to handle transformations. I like the idea of keeping my models in a git repository but the few times I've tried it I found it awkward. The recommended way to do fillets and chamfers in OpenSCAD is to export your model to FreeCAD, make the change there, and then import it back.

FreeCAD is like a herd of warthogs hidden under a parachute. It's a single program containing dozens of workbenches. These specialize in architectural drawings, finite element analysis, animated mechanical assemblies, and a half dozen workbenches are for designing parts.

FreeCAD has two different approaches for modeling parts. Each has a gang of rabid users who refuse to settle on a single method. Just read this discussion about an effort to remove one of the two ways to create a sketch.

The FreeCAD developers are well aware of this problem and have been doing a ton of work to herd these cats/warthogs into consensus. See the huge list of open issues. Surprisingly they might actually be making progress. They released version 1.0.0 in January 2025.

Shamara recently got a 3d printer and our local library is setting up a maker space, so I decided it was time to learn FreeCAD. I found a simple project and spent a painful ten hours wrestling with the interface. I wanted to create a single rectangular solid with a few holes and a some detentes, involving, in total, less than 10 primitive shapes, but it was so difficult.

The FreeCAD project has a wiki, but it was down when I tried to do this and google returns results from FreeCAD v0.14, v0.20 and v0.21 with warnings that things had changed significantly between versions.

I had a few problems learning the tool. The getting started guide (like everything they have several poor options rather that one really good one) wasn't well written. They didn't make it clear how important it was to fully constrain your sketches, and they should have chosen a model that required a datum plane to show how to create a sketch in arbitrary space. But my biggest problem was with the modal sidebar and a bad color scheme which made it impossible to tell when a line or point was selected.

When I realized I had a problem with the color scheme and not the default setting, I tried to change the color options in the preferences, but they didn't seem to have any effect. After hours of frustration I hit the 'reset all' button in the preferences and everything became much better. I think I had a configuration file from an older version of FreeCAD and this old file completely broke the updated application. Normally software would attempt to fix the config for you, or at least give you a warning that the old configuration was incompatible, but instead they decided to just fail.

I hate video tutorials. The instructors dither, trip over their words, and often spend too much time explaining things that are obvious. But I admit they're useful for visual utilities. When I was designing Crazy Chef in Inkscape I found a good video channel that helped me get on my feet.

Here's the video channel to follow for FreeCAD v1.0.0. He shows how to fully constrain your sketches, create 'datum planes', and demonstrates 'additive loft'.

For me, the promise of 3d printing has been for making toys and cheap replacements for broken plastic things. Oven knobs cost $80-$120 if you buy one from the manufacturer. Now I'm reasonably sure I could design my own.

I can recommend FreeCAD over fusion360 if you're unwilling to trust a for-profit company, but be sure to reset your preferences, stick with part designer, don't mess with the sidebar modal settings, fully constrain your sketches, and watch a few video tutorials first.

Units

I recently re-installed the units utility to do some temperature conversion. I could do this by hand but 9/5 + 32 is just complicated enough I prefer to ask a computer to do it for me. The biggest problem I have with asking a search engine about this is knowing how to spell 'fahrenheit' and 'celsius'. I'd be ok if we just moved to kelvin - it's much easier to spell.

Units is an old school GNU utility. I've been using it forever, but I've never explored the depths of its conversion database.

To use it, type units and you'll be dropped into a prompt where you can type what you have and what you want. Here's an animated example:

I encourage you to explore the units database. It can do crazy things

The area of sheets of paper:

You have: 3 lettersize
You want: ft^2
        * 1.9479167
        / 0.51336898

Just hitting 'Enter' at the 'you want' prompt will show you the definition.

You have: eggyolk
You want:
        Definition: 18.6 grams = 0.0186 kg

The weight of scooped flour (not to be confused with sifted or bread flour)

You have: 2 cups flour_scooped
You want: grams
        * 283.49523
        / 0.0035273962

In a recent discussion on lobste.rs, someone mentioned the frink database. Frink is a programming language designed to do these same sort of calculations. It's closed source, but there's an open source clone called rink. The rink page has an example of computing the surface gravity of the moon if it was made of solid gold.

> volume of moon * (19.283 g/cm^3) * G / (radius of moon)^2
approx. 9.365338 meter / second^2 (acceleration)
> ans to gravity
approx. 0.9549987 gravity (acceleration)

The frink database is a similar text file, but it has much more colorful comments. I encourage you to check out the editorializing around Candela and Hertz.

Incidentally both units and frink/rink have a workaround for the difficulty of spelling temperature units.

You have: tempF(250)
You want: tempC
        121.11111

Rink uses 'degC()' and 'degF()'

Tight Grip

This story from Tales of the Crypt #38 published in 1953 by EC comics and illustrated by Jack Davies was done before the comics code authority (CCA) started restricting the content of comic books in America. The publisher of EC comics, William Gaines fought with congress and the CCA and was blacklisted after a CCA judge objected to a story in "Weird Tales" called Judgement Day.

/media/images/ec_judgementday.jpg

In this story a human astronaut, a representative of the Galactic Republic, is visiting the planet Cybrinia, inhabited by robots. He finds the robots divided into functionally identical orange and blue races, with one having fewer rights and privileges than the other. The astronaut determines that due to the robots' bigotry, the Galactic Republic should not admit the planet until these problems are resolved. In the final panel, the astronaut removes his helmet revealing he's a black man.

The judge demanded, without any authority in the Code, that the Black astronaut had to be removed and when Gaines told him to fuck off, the CCA restricted sales of the comic, ultimately destroying the comic book line.

The writing in these anthology stories is pretty simple, but I liked this story. It's unusually gory and told from a strange point of view.

/media/images/tight_grip_131.jpg /media/images/tight_grip_132.jpg /media/images/tight_grip_133.jpg /media/images/tight_grip_134.jpg /media/images/tight_grip_135.jpg /media/images/tight_grip_136.jpg /media/images/tight_grip_137.jpg /media/images/tight_grip_138.jpg

Re: Martial Arts

/media/images/breaking_kungfu05.jpg

I am a practitioner myself. Every day I dig a hole and jump in and out of it 100 times. Then I run through a paddy field taking as light a step as possible. One day I will fly. How can an earth bound attack hope to deal with my gravity defying martial arts expertise? I will be like a wasp to him or her.

rust-analyzer

Why didn't anyone tell me that in addition to checking your code for errors and lints you could get rust-analyzer to write code for you?

Using <Space a> in helix brings up a context-sensitive menu that will generate missing methods, convert qualified paths to use statements or vice-verse, and otherwise clean up your code for you.

To think that all this time I've been programming with my fingers like a chump.

Do you know where your PATH is?

/media/images/2025-03-21_15-19_system_prompt.png

Yesterday I had a program fail because an update had modified my PATH. This led to an hours long investigation into just how my system PATH is getting generated.

The system PATH is a list of directories that will be searched when you run a binary from the command line. I live in a tmux session running on top of the fish shell, in alacritty, on xfce, in manjaro, an arch based, linux distribution. There are many agents that can monkey with my PATH.

You can view your current PATH with:

echo $PATH

When I ran this during the failure I saw this:

na@hydra ~> echo $PATH
/home/na/source/gocode/bin
/home/na/bin
.
.
.
/home/na/.pyenv/libexec/pyenv
/home/na/.pyenv/libexec
/home/na/.pyenv/shims
/home/na/.pyenv/bin
/opt/rocm/bin
.
/home/na/.pyenv/libexec/pyenv
/home/na/.pyenv/libexec
/home/na/.pyenv/shims
/home/na/.pyenv/bin
.
/home/na/.cargo/bin
/home/na/.local/bin
/usr/local/bin /usr/bin
/bin
/usr/local/sbin
/var/lib/flatpak/exports/bin
/usr/lib/jvm/default/bin
/usr/bin/site_perl
/usr/bin/vendor_perl
/usr/bin/core_perl

There were duplicates and missing paths and I wanted to know who was responsible for this mess. Unfortunately I couldn't find any good way to determine who is modifying your PATH. I wanted something like this:

~/.config/fish/config.fish  added   '~/bin' to your $PATH
~/.profile called '~/.cargo.env' which added '~/.cargo/bin' to your $PATH
/etc/login.defs added '/usr/bin' to your $PATH

Fish has some pretty cool debug flags, but nothing like this.

I like fish. It does a good job of shipping with batteries included, but I don't like how they handle environment variables. The fact that the first entry in their FAQ is how to view, set, and clear your environment variables illustrates the complexity.

The set command has flags to set the scope of variables to local (-l), global (-g), and function (-f). It can also use -U to set a 'universal variable' which will persist across restarts, and an -x option to export variables to child processes. They also have a helper function that will check if a PATH entry already exists before adding it again.

My $PATH had a bunch of duplicates and questionable entries. I tracked them down by grepping through my system config and dotfiles. Several hours later, here's my current PATH and where they are populated.

path                               where it comes from
----                               -------------------
/home/na/.pyenv/bin                # fish env
/home/na/.pyenv/shims              # fish env
/home/na/.pyenv/libexec            # fish env
/home/na/source/gocode/bin         # fish env
/home/na/bin                       # fish env
.                                  # ???
.                                  # ???
.                                  # ???
.                                  # ???
/home/na/.cargo/bin                # ~/.profile -> ~/.cargo/env
/home/na/.nix-profile/bin          # /etc/profile.d/nix.fish
/home/na/.nix-profile/bin          # /etc/profile.d/nix-daemon.fish
/nix/var/nix/profiles/default/bin  # /etc/profile.d/nix-daemon.fish
/home/na/.local/bin                # /etc/profile.d/home-local-bin.sh
/usr/local/bin                     # /etc/login.defs
/usr/bin                           # /etc/login.defs
/bin                               # ???
/usr/local/sbin                    # /etc/login.defs
/var/lib/flatpak/exports/bin       # /etc/profile.d/flatpak-bindir.sh
/usr/lib/jvm/default/bin           # /etc/profile.d/jre.sh
/usr/bin/site_perl                 # /etc/profile.d/perlbin.sh
/usr/bin/vendor_perl               # /etc/profile.d/perlbin.sh
/usr/bin/core_perl                 # /etc/profile.d/perlbin.sh
/opt/rocm/bin                      # /etc/profile.d/rocm.sh

It took several hours to compile this list because some of the entries were added by child processes, and many of the settings persisted in my login shell and fish cache. Also, the PATH will be different depending on if you're running in an interactive shell or a login shell.

One result of this investigation is I removed my pyenv fish plugin. It was inexplicably adding two lists to my PATH including a path to a binary file. This raised enough red flags I just removed the plugin and manually configured the three paths in my fish config.

I also learned that .profile is automatically loaded on every login. To test modifications to this file you need to log out after making changes.

Many of the paths are set up by the system. Scripts in /etc/profile.d/ are run according to your shell and /etc/login.defs sets up some system-wide paths. I could not find who was setting up /bin. Since this is the old school binary path, it might be built into the kernel. The fish scripts found in profile.d were responsible for the nix duplicates. Duplicates aren't bad, but it's sloppy, and I like my system maintainers to be careful.

Finally, there's a bunch of '.' duplicates. I couldn't find where these were being added, and I obviously didn't bother grepping for '.'. I remember working with a windows engineer who was forced by extremity to write code for linux. He was surprised to learn that '.' wasn't in the path. I always appreciated this as a security measure. Writing:

./blow_up_the_world.bin

Is so much more deliberate than writing:

blow_up_the_world.bin

and having your system go looking for a binary that will destroy everything.

I don't know how long distros have been adding '.' to the PATH, but I would remove it if I could.

That windows engineer made his project a subdirectory in a folder called 'linsux'

You can see my updated fish config in the dotfiles project in my gitforge.