FOSSPicks
CadQuery Editor
3D printing has brought many of us into contact with Computer Aided Design (CAD) when we might otherwise have remained ignorant, or perhaps have kept our 3D-modeling ambitions to Blender. As a result, Linux now has several excellent CAD tools that range from point-and-click 3D construction (Blender) and parametric modeling (FreeCAD), to programmable solid 3D modeling (OpenSCAD) and even Python libraries (CadQuery). Programmable 3D modeling is particularly well suited to 3D printing because it's often easier to describe what you want algorithmically than it is by dragging and dropping shapes into a canvas. You might start with a cube, for example, but then carve exact shapes out of it using intersection operators with a programmable set of instructions. This allows for objects to be created exactly in code, according to measurements and requirements, and also for parametric modification of a single element without affecting any other elements in the construction.
Blender and even FreeCAD offer their own programmable interfaces to achieve the same thing, but CadQuery has been developed solely around this ability. It's similar to OpenSCAD, which is also entirely driven through a programmable interface with an editor and 3D preview so you can see what you're creating. OpenSCAD uses its own functional programming language with a JavaScript syntax that's easy to learn but can't be used anywhere else. As CadQuery is a Python library, however, you obviously use Python, and that means Python from your favorite editor or development environment. All it takes to create a rectangle, for example, is:
cadquery.Workplane("front").box(2.0, 2.0, 0.5)
This is more portable and reusable than a custom code engine, but it does have the downside of not having a 3D preview to help with your coding. This is where CadQuery editor helps. It's a GUI application that brings together Python coding with the visual output, in much the same way OpenSCAD does. Alongside a 3D preview of the object you're building, there are panels to provide an interpreter, a traceback and log viewer, and a variable and object explorer. These work a little like debuggers for your own code, and they're useful when what you expect to happen doesn't happen. While modeling, the 3D view updates each time you run your changes, and you can step into or through individual lines in your code much like a debugger to see how an object is constructed, which is something you can't do in OpenSCAD. When you've finished modeling, objects can be exported from the editor as either an STL or STEP file without any further programming.
Writing in Python with CadQuery can make more sense than using OpenSCAD because the scripts you build are fully functional without the editor. This means they can be run independently when you've finished your modeling. One example of this is the brilliant CadQuery VS Code extension, which is almost equivalent to the editor when it comes to capabilities and 3D preview and is a great alternative if you're already using VS Code. Either way, CadQuery very much feels like the next generation of modeling for 3D printing and all kinds of Computer Aided Design.
Project Website
https://github.com/CadQuery/CQ-editor
Flight simulator
FSHistory
Despite the CPU and RAM limitations of 1980s home computers, they were capable of remarkable things. And nowhere was this more evident than in the video games they ran. Games developers were able to push computer capabilities way beyond what was ever expected from a decade that started off with Breakout and ended with Ghouls 'n Ghosts. The most impressive games threw entire 3D worlds at the CRT, all from 8-bit integers stored in just 32,768 bytes of RAM. There was no better example of this than Elite, and then Microsoft Flight Simulator, first released in November 1982. Flight Simulator let you fly a variety of aircraft between various real-world airports in 3D with a moderate degree of instrument and flight mechanics realism, especially for the time. Sometimes you only got a few frames a second, and at other times the simulator became completely unresponsive, but it nevertheless felt like the future – something the 2020 edition of Microsoft Flight Simulator is only truly getting close to when you use a HOTAS and virtual reality headset (and a $2,000 graphics card).
Amazingly, especially considering the publisher, the decompiled version of Flight Simulator 4 is available under an MIT license, and FSHistory adds the supporting code and infrastructure necessary to make this build on modern hardware. In a humbling indication of progress, it takes just a few seconds to build FSHistory, and launching it takes an instant longer. The game now runs at hundreds of frames a second and is unlikely to ever become unresponsive, but it still feels like an authentic experience, requiring careful mouse and keyboard control to get anywhere. Because the code is identical, so too is the game, from the clunky menu system to the controls, graphics options, and windows configuration. You can't even resize the window because you couldn't in 1989 either. But if you can adapt your system to make it fit and you used to play Flight Simulator, it's the perfect nostalgia trip, virtually, from Oakland International runway number 28.
Project Website
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.
-
VirtualBox 7.1.4 Includes Initial Support for Linux kernel 6.12
The latest version of VirtualBox has arrived and it not only adds initial support for kernel 6.12 but another feature that will make using the virtual machine tool much easier.
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.