LeoCAD | Free Lego® CAD Software on openSUSE Linux

LeoCAD-00-Title.png

CAD is not only what I do for my profession, I also do it for fun. For personal projects, I have been having a great time with using FreeCAD, a very capable and feature-full parametric modeler. With a recent resurgence of Legos in my house and falling into some web-searching rabbit holes, I stumbled upon this Lego CAD software called LeoCAD. I am currently using the AppImage on openSUSE that works fantastically well. I’m sure it will work on any modern Linux Distribution. It is also available for those “other” platforms. It can be downloaded from here:

https://www.leocad.org/download.html

The nice thing about AppImages is that there is nothing to do to install it. I created a folder where I keep all my AppImage files. Using Dolphin, I made the .AppImage executable so that you can just double-click to execute the file and run LeoCAD.

LeoCAD-01-Permissions.png

Um… Why?

Beyond the cool factor of creating Legos in virtual space or loading up those childhood models and modifying them in ways that you didn’t have the parts for as a child, there are lessons you can teach kids with this software.

LeoCAD-02-Invader.png

LeoCAD is not only an extremely enjoyable toy but it is a great tool for teaching my kids the principles of Assembly, Sub-Assembly and Master Assemblies and the some understandings of spacial relations. At the very basic level, using LeoCAD to create, you are putting pieces together to create a very basic “assembly” or model.

LeoCAD-03-Invader Cockpit Partial.png

To put together a model you create it, much like in real life, piece by piece. There is an extensive library of parts from which to choose. You can search through by category or use the part numbers to more rapidly locate what it is that you need. Those parts can be colored from what you see in the pallet which are, from my understanding, actual Lego colors. Here is a fun fact. On Legos that are made in the 1990s-ish or newer, will have a part number molded into each part on a “non visual” surface. If your eyes are older… you might need a magnifying glass.

Another very cool feature of LeoCAD is the ability to order steps on a model. If you have a desire to create your very own instruction booklet, that can be done with LeoCAD.

LeoCAD-04-Invader Cockpit.png

Once you have created a Sub-Assembly, or as LeoCAD calls them, “Submodel” you can bring each Assembly / model in together in a “Master Assembly”.

LeoCAD-05-Invader Ship.png

Any assemblies or Submodels can be treated like any other Lego part. Objects are objects whether they are individual pieces or Submodels.

For whatever Submodel Tab you have selected, you can view the parts used by selecting: Submodel > Properties… then select the “Parts Used” tab. This gives you a complete list of all the individual pieces you have used in your model. If you so choose, you can take this list and purchase the necessary pieces to build your creation.

LeoCAD-07-Parts List.png

Unfortunately, I was unable to find a way to export this list into a spreadsheet, so that does complicate matters somewhat.

If you want to download some Lego Sets to spin around LeoCAD, check out the Ldraw site. You will need to know the set number to look up to get the CAD files. If you would like to look at this the previously pictured Blacktron Invader, from 1987, see here.

Lego Project

After some playing with LeoCAD, my boy and I began talking about what we should build. We are both fans of Star Wars and he liked all these old 1980s themed Lego space sets so we decided to put two of them together and made a “Blacktron AT-ST”. It was a good way to go head-first in really learning and understanding this software and it’s quirks.

LeoCAD-10-Blackktron AT-ST.png

Just building the model in LeoCAD took about a week of work. That was a few hours here and there. Much of the time spent was learning how to effectively navigate the software and fine the proper parts in the library. The actual assembly process of the pieces is pretty intuitive. You do have to play with the snap points when doing less common assembly angles but it is in no way difficult. This was probably a bit too ambitious for a first project but it was completed. There are a total of 428 parts divided into 24 submodels one of which is the Master Assembly (submodel) that all the individual models assemble into.

We took the parts list and went through the Legos we had to determine what was on hand, then we put the rest into a “wishlist” on Bricklink.com where we were then able to order the parts necessary to build it. My boy used this an entry for a craft project for the local county fair. It was fun for the both of us. Maybe me more so than him but this application along with the resources through the Internet is essentially a childhood fantasy come reality.

Blacktron AT-ST-01
Blacktron AT-ST

I want to note that this is not in any way an original design. This is heavily based on an actual licensed model and essentially recolored to look like it could fit with the rest of the Blacktron theme. Now, it is just another Lego model toy on our Lego table.

What I like

Assembling Legos in the virtual space, although not as satisfying as the snap of the genuine article, is fun and can really allow you to flesh out some ideas somewhat rapidly. The benefit is, you can take that virtual model and turn it into a real model.

Another thing I like to do with LeoCAD is documenting changes I make to a design. If I come up with an idea, I like it, I can make it in the LeoCAD and date stamp it. This way, I have the freedom to make the changes to the real model and I have a point I can go back to as a reference.

LeoCAD is very fast and snappy using only the Intel GPU. I have run it on my AMD GPU as well as and I am sure it is performing better but not so much that I can tell the difference.

LeoCAD-11-ColorsIt is easy to change the colors of parts of the Legos and if you are doing a virtual prototype, it is much easier to swap out the colors of parts on LeoCAD than it it is with Actual Legos.

There are all kinds of 3D models to download, look at and modify to your hearts content from Ldraw.org. If you need to look up set numbers, use this resource: brickset.com.

What I don’t Like

There isn’t much to not like about this software. There are only two issues that I have with it. There is no way to export the Bill of Material / Parts list to any kind of file. Even a way to export to CSV would be fantastic. As it stands today, you can copy only one cell at a time. Hopefully there will be an export feature in the future.

There is no collision detection between parts and pieces. So, it is possible to bury parts within parts. Some kind of “align” and “orient” option would be great too when assembling components.

Lastly, and really, least important, the UI is too light. I would prefer a dark theme. Not a big deal but it would be nice.

Final Thoughts

LeoCAD is not only a great tool for teaching the concepts of Computer Aided Design but it is an incredibly fun toy with which to play. I didn’t realize what kind of fun-spiral I could fall into. LeoCAD is an incredibly useful tool to teach CAD and many CAD concepts.

If you have a passing interest in Legos or CAD or both, this is worth checking out. Opening up Lego models from your childhood, spinning them around and modifying them like you would have done so many years ago is a great way to spend a weekend where the weather isn’t cooperative. Being able to create, modify and document your ideas is fantastic but the best part about LeoCAD is, at no time will playing with these Legos pose any risk to your feet.

Further Reading

LeoCAD Site

LDraw.org, open standard for LEGO® CAD programs

LeoCAD on GitHub

BrickLink.com Lego® Marketplace

Brickset.com, Lego® Set Guide

Advertisements

FreeCAD 0.18 Pre Release

FreeCAD-Pre.18-09-Title Mod.png

In my continued excitement to use FreeCAD at home, I downloaded the latest Pre Release of FreeCAD to test it out. For starters, I like the new look of the start page. It has a nice clean and even more welcoming feel to it. It shows little previews of recent CAD documents too which is a fantastic touch.

I had some real work to do with it in modifying a design and it worked very nicely. It is extremely easy to update a design with FreeCAD. I have a few criticisms but they might be based on what I am used to using as opposed to a problem with FreeCAD. What is important is that I was able to update the design and print the parts and put them to work.

Downloading and Running

To download the pre-release, visit their GitHub page, at the time of writing it was, FreeCAD_0.18.14796.glibc2.17-x86_64.AppImage.

I created a folder where I keep all my AppImage files. Using Dolphin, I made the .AppImage executable so that you can just double-click to execute the file and run FreeCAD.

FreeCAD-Pre.18-02-Executable

No special work is needed to run this AppImage, no installation or anything of that nature. It’s kind of nice but it also has its drawbacks. I generally prefer the openSUSE software management system to automatically take care of my software but I’ll make an exception in this case.

First Run

The new Start Page looks great. I really appreciate the tabs and how they have separated out the information into sections. The first tab shows you your recent documents and some example parts.

FreeCAD-Pre.18-05-Start Page.png

The Help Section is more than just a help getting started but gives you a great snapshot about your current FreeCAD Setup: General documentation, Workbench documentation, getting help from the community and available addons for FreeCAD.

FreeCAD-Pre.18-07-Help.png

You can click on the different available addons and read more about them and install them. It will even indicate what addons are installed from this screen.

The third tab shows the “Activity” of this FreeCAD project. I appreciate how much work is going into FreeCAD, to make it a better product.

FreeCAD-Pre.18-06-Activity.png

Modifying an Existing Part

I have a Home Education Command Center where I created some parts to hold the Geography Maps in place. After some time of using my first revision of parts, it became apparent that they were not meeting expectations. I took the previously design parts, modified the necessary dimensions based on the usability failures I experienced with the first design

FreeCAD-Pre.18-03-Reworking part

I had to not only make the whole part taller and wider with more overlap for the holder to map interface. When increasing the size of the base part, the child features adjusted as expected which is a great sign for the quality of the parametric modeling “intelligence” of this software. I have only one criticism with the sketch mode. I often have to redo lines because I am unable to make coincident constraints stick to where I want them to stick. It’s not bad but just mildly irritating at times.

FreeCAD-Pre.18-04-Reworking part.png

The resulting update was complete in short time and I was happy with how it looked. The rounds and chamfers calculated to look exactly as I expected.

Exporting for Printing

Since the whole purpose of creating this part was to print it and a mirrored version of it off, I needed to export the model as an STL.

As a note, when exporting the part to STL, you must select the last feature on the model tree then go to File > Export…

There is a drop down where STL file type is an option.

FreeCAD-Pre.18-01-Exporting

If you do not select the last feature, it will export up to the feature you select in the tree when it makes the calculations.

Assembly Module

I thought I’d give the Assembly module another shot as I was not able to get it to work under the official release. This time, the module loaded in without any issues. I became very excited at this point. Here is what I did to install it, instructions adapted from the Assembly2 Module GitHub page:

On other Linux distros you may try to install manually via Bash and git but I use openSUSE Tumbleweed as my daily driver and this is how I installed it:

In order for the Assembly Module to work, there are some more python software packages that are required. To install them, oen up a terminal and enter:

sudo zypper install git python-pyside python2-numpy

Next was to install the Assembly Module from GitHub. This is installed within the User home directory.

First will be to create the necessary directory for the modules. If the directory doesn’t already exist.

mkdir ~/.FreeCAD/Mod

Change to that directory

cd ~/.FreeCAD/Mod

Then perform the cloning operation from GitHub

git clone https://github.com/hamish2014/FreeCAD_assembly2.git

That’s all there is to it. Run FreeCAD and you should see the assembly module.

You may want to periodically update the Assembly Module. Since you have already performed the cloning, you will need to pull for updates to get the latest version:

cd ~/.FreeCAD/Mod/FreeCAD_assembly2
git pull
rm *.pyc

It’ll give you a nice little output of the updates and your done.

I will cover the Assembly Module at a later date as I need to learn how to use it properly. I am still working on an assembly and will subsequently work on the assembly drawings for another project.

What I like

There are MANY things that I like but most notably as a comparison of Official v.17 to Pre-.18 are the incremental improvements happening within FreeCAD. Even though this is a Pre-Release, there are already many improvements over the official .17 release. Most notably, the start page and the reintroduction of the Navigation Cube.

FreeCAD-Pre.18-08-Navigation CubeThe navigation Cube is a fantastic way to see what your orientation is around the part. I know that there are other CAD packages that use a similar tool but my regular proprietary package I use professionally does NOT have this feature.

The part design module seems to have become more intuitive and it’s ability to automatically adjust dependent features seems to have improved dramatically.

What I wish it would do

Thankfully, FreeCAD is under active development so it is only a matter of time that these little paper-cut issues will all be resolved. One issue I have, from a usability standpoint, the select to recompute function doesn’t always recompute recursively through the tree. I might also suggest that selecting the base node to have it all recomputed or have the recompute option default to top level if nothing specific is selected.

Some of the geometric constraints don’t seem to work as expected so I do have to delete and redraw some of the lines in order to complete the sketch. When doing this, it often makes child features, like fillets and rounds fail and it can be a challenge to figure out which one has failed.

Final Thoughts

As I continue to use FreeCAD, I am becoming a bigger and bigger fan of the project. They are really doing a fantastic job of making a professional level parametric modeler, among other CAD functions, that can really enable the regular folk to do some real CAD work. I will continue to follow this project and use it whenever possible to perform the various problem solving activities I do. I can only hope that there will be continued momentum behind this such as other large open source projects.

Links

FreeCAD Project Home

FreeCAD Pre Release .18 Download

FreeCAD Assembly Module GitHub Page

openSUSE Tumbleweed

Business Card Holder Design

Designing and building is something of a hobby of mine that also happens to be a component of my profession. I like to flex my CAD muscle outside of the professional setting whenever possible so if someone tells me about a need for something and the design and 3D printing of it is within my bandwidth of available time, I like to help them out. Because… why not?

Demand Signal

A buddy of mine was telling me how he wanted to add a 2 inch by 2 inch card holder for a small sign to advertise his Tour Services. He kicked around an idea of what he wanted: to hold business cards on a placard but didn’t have an immediate solution in mind. So I offered to help out.

Design process

I took a card measured it and made the holder as such that it wouldn’t cover up any of the information on the card. I printed it off and evaluated how the cards fit on the initial design but wasn’t happy with it .

Card Holder Design Change
Initial Design on the left; revised design on the right

There was too much slop, side to side, so retaining the cards could get all catty wampus and potentially fall out. I determined that falling out was an unacceptable failure mode. A card holder must hold the card. I tightened up the space between the walls and the card by a few millimeters and it felt purposefully correct. The final design is available on Thingiverse for you to download and see if it can potentially fit one of your needs.

I initially designed this using PTC Creo but since I am making a point to do more design work on Linux, specifically openSUSE Linux, have since recreated it using FreeCAD with a little variation. Feel free to download the STEP or FreeCAD file and modify it to your heart’s content.

FreeCAD Card Holder

The only real difference between the two designs is that one has sides that are open and the other is solid. The solid sides do print better. I suppose could have added some other flair to it but seeing how this part is not the focus of the placard, why bother.

Final Thoughts

CAD is a fun problem solving tool, once you know how to use it. The fact that there is FreeCAD on Linux, which is a pretty decent tool opens up a whole world of problem solving for the masses. Having a resource like Thingiverse to share how you have solved problems makes these times we live in a lot of fun.

SWMI Brew Tour Placard

Resources

Thingiverse link

FreeCAD Project

FreeCAD from openSUSE

FreeCAD First Timer

SWMI Brew Tours

Samsung Galaxy S5 CAD Project

FreeCAD First Timer

FreeCAD Logo

I have had a need for doing 3D CAD work in Linux but I don’t have the budget to invest in any  high dollar software to hobby around. FreeCAD fit the bill. It’s a free and open source 3D CAD modeler but it does a bunch of other things too. Although I could probably run something through Wine or in Virtual Machine, I don’t want to get further locked into proprietary software that doesn’t support Linux. The CAD package I am most familiar with is PTC Creo, formally Pro/Engineer and Wildfire. It is a fine piece of software that I am very adept and creating whatever I can dream up.

The problem with Creo is, even if I could afford to purchase a license, the software doesn’t run on Linux. PTC used to support Linux but does not any longer, which is very unfortunate.

After trying a few things, I have settled on FreeCAD as my open sourced software of choice. At the time of writing, I am running FreeCAD v 0.17. FreeCAD is written in C++ and Python and is extensible so it allows for you to create functions in Python. This is a 3D CAD, BIM, FEM modeler. At this time, I only do Mechanical CAD (Computer Aided Drafting) work with it but am interested in BIM (Building Information Modeler) and FEM (Finite Element Method) modules as well. More on those at another time.

Installing FreeCAD in openSUSE is can be done using the 1-Click method or my favorite method, through the terminal:

sudo zypper install FreeCAD

I wasn’t completely vanilla in using FreeCAD as I used it as a part viewer for years but I hadn’t taken the time to create any any parts in it. After watching a video from Sudo Sergeant on using FreeCAD, I was able to see how too use the different functions. I was rather inspired to try it myself.

Running FreeCAD for the first time you are welcomed with a pleasant start center. Since I am most focused on part design, that was the Workbench that I selected.

Screenshot_20180703_092729

My only initial displeasure with the usage of FreeCAD was the color gradient of the background.

Screenshot_20180703_092804

I am quite sure it is the most acceptable default for most but it is a bit too bright for me. I like everything to be dark. This is easy enough to fix by opening the preferences dialog box.

Edit > Preferences…

Screenshot_20180703_092900

Select Display then the Colors Tab where you can change your gradient however you like.

Screenshot_20180703_092919

The Combo View pane is real nice at guiding you through the process of designing parts the way FreeCAD wants you to do it. I find this to be just a bit better than how Creo does it. Unless you KNOW how to use Creo, you won’t know where to get started. FreeCAD, on the other hand will begin guiding you after you select Create body you can begin with your first sketch.

Screenshot_20180703_093143

From here you can select to Create sketch or Start Boolean from the Task tab, the menu or the toolbar icons. Thankfully, FreeCAD doesn’t have the silly Ribbon interface. You can move your icon groups around any way you like.

When starting a sketch FreeCAD will create your 3 basic datum planes, immediately. You just have to determine the default orientation of your part you are designing. It should be noted, those that are more accustomed to video game 3D think of the X and Y of the screen with Z being depth through the world. With engineering, you swap the Y and the Z axis. Z is the height of the part while Y goes “into the screen” as it were.

Screenshot_20180703_093224

For my purposes, I am going to build this part as though I was looking down at it on a table. This is, of course, design intent dependent.

In going through the process of constraining the sketch, the picks and clicks are a bit different then Creo but the concepts are the same. One area where FreeCAD shines is the listing of constraints in the Left-panel Combo view. I would appreciate this feature in Creo.

Once the sketch is complete, the next step is to “pad” the sketch into the 3rd dimension which is nothing more than selecting the pad tool and setting the depth and direction of extrusion.

Screenshot_20180705_123905

As the model grows in complexity, you can take advantage of some of the other padding tools, such as to pad to a selected face of the part. A similar feature I use frequently in Creo, though, named differently.

The next task is to add rounds or fillets to the part. For FreeCAD the process is a bit different than what I’m used to but still makes perfectly logical sense. Select the edges you want to add rounds and select Fillet tool.

Screenshot_20180705_124125

It is possible to add multiple edges and later edit the feature to change references or values.

Screenshot_20180705_124146

I do appreciate, again, the left-side panel that displays valuable information when you are going through the process.

The process for adding chamfers is the same as fillets. FreeCAD also respects the practice of rounds and chamfers following along tangent edges.

Screenshot_20180705_125136

Although I am used to an extrude feature that is either adding or removing material, FreeCAD separates out similar functions, one for adding, the other for removing material. In this case, I want to create a “pocket” from a sketch. The options for how to remove material does what I need. You can do a blind cut at a depth of your choosing, through all, to a selected surface and so forth.

Screenshot_20180705_130006

For this part, I want a through hole

Screenshot_20180705_130050

Then I want a chamfer around the hole… just because.

Screenshot_20180705_165057

What I like

This is very easy to use, stable and quite feature rich. There are a few things I cannot do with FreeCAD that I would like but that is just another reason to get involved in the project.

FreeCAD is built using the Qt toolkit so it just looks great and respects my KDE Plasma Theme. Everything has that fine Qt polish that really makes for a great user experience. I don’t like light-in-color user interface so this alone makes FreeCAD nicer to work with than Creo.

What I don’t Like

There is no assembly module that I could get to work, however, there is a module that is actively being worked on. I have not yet been able to get it to work for me but it is only a matter of time before I’ll have it working. It is likely that this module will be included in the future releases as well.

Final Thoughts

FreeCAD is a fine piece of software that is easy to use. You really just have to get into it and play around a bit. This is a fine parametric modeler. There are a few “niggles” about the application but I have yet to use any piece of 3D design software that doesn’t have it’s own flavor of niggles.

The only thing I can’t do, at this time, with FreeCAD is create an assembly. It is being actively worked on so it is only a matter of time before it is possible without having to fiddle with the software.

I have started to use FreeCAD for all my little side projects instead of the commercial software from my employer. It is just as easy to use, well, maybe easier to use, actually, since FreeCAD guides you through the process very nicely. I hope to see this project continue to grow and improve. Although I have only scratched the surface of what FreeCAD can do, I am already impressed.

For more information or to get involved check out their site at FreeCADweb.org

If you find this to be useful software and would like to support the project you can do so here.

I really encourage you to check it out. It’s available for Linux, Windows and a slightly dated version for MacOS here.

Further Reading

openSUSE 1-Click Install for FreeCAD

FreeCAD on GitHub

FreeCAD Website

Sudo Sergeant FreeCAD video

Help FreeCAD