Project ALTius
Part II: Getting our feet wet with 2D and 3D software workflows.
In the first part of this series the author described performance glider projects as quite complex with a lot of repetitive and complex operations. He went on to explain how CAD software can be automated in standalone separate SAD (software assisted design) apps and manufacturing can be simplified with homemade HAM (hardware assisted manufacturing) devices. With that knowledge in hand, he now proceeds with examples of how these tools are used. — Ed.
CAD ➡ CAM has evolved to SAD ➡ CAD ➡ CAM ➡ HAM
At the moment my collection of SAD apps is quite small. I plan to release these via my ALT3dRC GitHub repo — see Software Referenced in This Series below. My SAD apps are:
3dat2dxf
— an app for drawing ribs and other wing elements such as spars, leading and trailing edges and D-boxes for a Drela-type wing. It currently supports three airfoils: center, joiner and tip.arrow
— an app for drawing ribs and other wing elements for a flying wing with a low drag and bell-shaped lift distribution based on Prandtl-D project from NASA.geodetic
— an app for drawing normal and geodetic ribs for a Taylor-type wing with 3D model computed byxflrwing
immediately below.xflrwing
— an app for 3D models of wings, molds and plug segments for a Taylor-type wing. This app can currently be found in my GitHub repo.fuselage
— an app for 3D modelling for a F5J-type fuselage.
One clarification is necessary: these ‘apps’ are not your iOS or Android phone apps you can download from Apple or Google stores. Rather, they are programs written in the C programming language with a very simple, text-only interface. You can run them on any computer with a GCC compiler: a cheap Raspberry Pi / Orange PI, Windows laptop / desktop or a Mac with Intel or ARM processor.
I usually test my programs on four different platforms: Linux/ARM (RaspberryPi and a TV Box with Linux), Windows/X64 (a MacBook Pro with Bootcamp laptop and a desktop), MacOS/X64 (a MacBook Pro with Intel) and MacOS/ARM (a MacMini with M1). I started writing these programs in Windows but the goal was to be able to use these programs from a cheap SBC (single board computer) or the latest MacBook Pro or Mac Pro — with a 100x-200x price tag compared to the humble SBC! In other words I wanted to cover as much as possible from the ‘90% Windows — 9% MacOS — 1% Linux’ mix of computer users today. So don’t worry, whatever computer you have can run my SAD apps.
In the xflrwing
repository there is a short README
file with brief instructions how to get the GCC compiler for Windows (MinGW) and for MacOS (Xcode) and how to compile (g++ xflrwing.cpp -o xflrwing.exe
). For a detailed tutorial on using xfrlwing please refer to the topic in the RC Groups thread linked in Resources below.
Essential CAD / CAM programs
I have provided a hyperlinked list of all the software used or mentioned in this series: see Software Referenced in This Series at the end of this and future articles.
The good news is that these programs are available for free. Most of them are open source or at least you can use them for free or in some case you can pay an optional small fee. The not so good news is that it’s not my intention to provide a tutorial on how to use these 3rd-party programs. You will find enough tutorials in their web pages or on YouTube and I will provide some tips and tricks for some apps in order to make your life easier.
QCAD / LibreCAD and the Typical 2D Workflow
The main 2D CAD program is QCAD for creating drawings in .dxf
format. You can download the trial program and on the first run it will ask you to do some selections. In the Trial
sub-window on the right you can press the Remove
button and the program will instruct you to delete some files from the plugins
folder in order to remove the QCAD Pro Trial functionality and convert it to QCAD Community Edition It’s not limited in time and free to use. After you delete those files you will have only three files in the plugins
folder but that’s all we need. Right hand on the mouse — for selecting lines / circles with left click or deselecting with right click — eyes on the screen, left hand on keyboard ready to enter two-letters commands for lines (LI
/LA
/LH
/LV
/LB
), circles (CI
/CR
/CA
/CD
/C2
/C3
), ellipses (EP
/EA
/EA
/ED
), arcs (AR
/AD
/A2
/A3
), splines (SP
) then move (MV
), rotate (RO
), resize (SZ
), mirror (MI
), flip horizontal (FH
), flip vertical (FV
), offset (OF
), chamfer(CH
), round (RN
), measure distances (IP
) or angles (IA
). Just explore Draw
, Modify
and Info
in the menu. I’m pretty sure you will love this program and soon you will be quite proficient in QCAD.
LibreCAD has almost the same functionality but the two-letter commands are not available and you will need to get the same results with a lot more clicks of the menu. LibreCAD is available for some platforms where QCAD is not like Linux / ARM on Raspberry Pi / Orange Pi / TV box with Linux.
A typical 2D balsa project workflow:
3dat2dxf
/arrow
/geodetic
—For drawing the ribs and other wing elements.- QCAD / LibreCAD — For validating / cleaning up / divide on individual balsa sheets.
- DXF2Gcode / Estlcam — For generating the G-code for the laser cutter.
- LaserGRBL / K40 Whisperer — For sending the G-code to the laser cutter.
Again, you can find all of these in the Software section below. Please note that in the case you have a K40 CO2 laser cutter you don’t need step 3, above. K40 Whisperer will read the .dxf
file resulted in step 2 and generate the code used in K40 controller.
OpenSCAD and NetFabb and the Typical 3D Workflow
My favourite 3D CAD app is OpenSCAD. It’s a script-based modeller for 3D solids — in other words you can ‘program’ your model. With just a few lines you can define very complex 3D models by using some building blocks like sphere()
, cube()
and cylinder().
You can scale()
, translate()
, rotate()
and also do intersection()
, union()
and difference()
between objects. And of course you can import()
some drawings (.dxf
and .svg
) or 3D objects (.stl
/.off
/.3mf
) and linear_extrude()
or rotate_extrude()
some elements.
A typical 3D project workflow:
xflrwing
/fuselage
— For generating the 3D models of wing mold and plug segments.- STLviewer — For initial visualization of results.
- NetFabb — For validation and repairing the 3D model.
- STLviewer — For a follow-up visualization of results.
- OpenSCAD — For additional changes in the model.
- Estlcam or UltiMaker Cura (or other slicer) — For generation of G-code for subtractive manufacturing (that is, CNC) or additive manufacturing (that is, a 3D printer).
- A G-code sender to transmit the results of the previous step to CNC or #D printer. It may be a Java app or a simple Python script or be included in the slicer.
NetFabb — A Tool for ‘Patching’ 3D Models
The 3D models of wing segments, molds and plugs are extremely complex, there are a lot of fine details and very small surfaces. Sometimes for certain conditions the 3D model seems to be fine in STLviewer but the slicer complains that model needs small repairs. These are minor changes — ‘patching’ a very small hole in the 3D model, for example. It’s entirely probable that in the future versions of the program there will be no need for this step. For repairing a 3D STL model in NetFabb.
NetFabb
> I accept the terms of usage…
Project
> Open
or Add part
> select the STL file you want to repair:
Extras
> New Analysis
> Standard analysis
| In the right panel look for the surface is closed
value (Yes
with green, No
with red)…if No
then:
Repair part
> Automatic repair
> Default repair
> Execute
> Apply repair
> Remove old part
Extras
> New Analysis
> Standard analysis
| In the right panel look for the surface is closed
value. Now you should have a Yes
part.
Export part
> as STL
| Give it a new name (I usually keep the old name and insert a_ at the start),
OpenSCAD Advanced Scripted Processing of 3D Models
The OpenSCAD step is needed for another reason: in my app I do not use complex binary operations between solids like intersections, differences and unions. xflrwing
is just computing 3D coordinates and writing the STL for the wing surface and some standard mold or plug contour around the surface. Even if I do not use a complex 3D solid math, the program is quite large — around 3000 lines of code. If we want to progress from this design / CAD phase to manufacture / CAM we will definitely need these complex 3D binary operations such as intersections, unions and differences.
For instance: we need joiners between wing segments and the simplest joiner we can use is a carbon rod which is cylinder. If a wing segment has no dihedral angle (it’s horizontal) and the next segment has a 4° dihedral the simplest model for the joiner is a cylinder with a 2° inclination long enough to be able to sustain the load and short enough to be enclosed in the wing. It enters the wing closer to the upper surface and the tip of the joiner is closer to the lower surface of the wing. We need to ‘carve’ inside the wing segments the necessary space for this joiner. This is done by defining a simple cylinder with the good dimensions, rotate it, translate it in the area between wing segments and finally subtracting this cylinder from the wing segments. This is done very simply in OpenSCAD with a program of several lines. The joiner is an 80mm cylinder with a 6mm diameter rotated by 90 — 2 = 88 degrees and translated with 30mm on the X-axis and 900mm on Y-axis and 5mm on Z-axis to get it in the right position:
difference()
{
import(“wing_segment.stl”);
translate([30,900,5])
rotate([88,0,0])
cylinder(h=80,r=3,center=true);
};
Another typical use of OpenSCAD is for further segmentation of a wing segment, mold or plug in a 3D object with dimensions suitable for your CNC or 3D printer:
intersection()
{
import("mold_segment.stl");
translate([126,900,0])
cube(250,center=true);
};
A Little Bit Of Homework
Beside these joiners we will need some additional ‘carving’ in the wing for some very usefull features like servo wire channels and maybe whatever you call that piece connecting the servo arm to the control surface. Try to write the code and see what you get.
Some advice: before a complex function like difference()
and intersection()
try to visualize all the components inside the function — just comment out with //
the difference{}
and then {
and finally the };
. Save the small program (click on the floppy icon), then Preview
(the dotted cube with fast forward), then Render
(the cube with the hour-glass) and assuming you want to save the result as an STL file, press the paper with STL.
On more trick: in the above examples translate()
and rotate()
are modifiers for cylinder()
and cube()
and the order is important. For a better view of the components you can use different colors beside the default yellow like color(“red”)
or color(“blue”)
.
What’s Next
Once you get a pretty good set of STL files you can start planning the manufacturing. For that, you’ll have to wait until next month. Between now and then, if you have any questions feel free to add them in the Responses section. You get there by clicking the little 💬 below.
Thanks for reading. Until next time, best of luck with your project.
©2023 Tiberiu Atudorei
Software Referenced in This Series (alphabetical)
- ALT3dRC — The author’s GitHub repository. Currently it contains xflrwing with plans to upload his other SAD apps in the near future.
- AutoCAD — “2D and 3D CAD software trusted by millions to draft, engineer, and automate designs anywhere, anytime…”
- DraftSight — “The Ultimate Editor for DWG and DXF Files From The Makers of SOLIDWORKS…”
- DXF2GCode — “a tool for converting 2D (dxf, pdf, ps) drawings to CNC machine compatible GCode.…”
- Estlcam — “easy-to-use software that converts both 2D and 3D designs into CNC programs…”
- Fusion 360 — “Unified CAD, CAM, and PCB software…”
- K40 Whisperer — “reads SVG and DXF files, interprets the data and sends commands to the K40 controller to move the laser head and control the laser accordingly…”
- LaserGRBL — “it is specifically developed for use with hobbist laser cutter and engraver and could be a good free and easy alternative to [other programs] for who don’t need more then a simple and effective tool…”
- LibreCAD — “LibreCAD started as a project to build CAM capabilities into the community version of QCad for use with a Mechmate CNC router…”
- MeshLab — “open source system for processing and editing 3D triangular meshes. It provides a set of tools for editing, cleaning, healing, inspecting, rendering, texturing and converting meshes…”
- MinGW — “a native Windows port of the GNU Compiler Collection (GCC), with freely distributable import libraries and header files for building native Windows applications…”
- NetFabb — “a free … software for 3D Printing and the STL file format…”
- OpenSCAD — “software for creating solid 3D CAD models. It is free software…”
- QCAD — “a free, open source application for computer aided drafting (CAD) in two dimensions (2D)…”
- SolidWorks — “SOLIDWORKS® and the 3DEXPERIENCE® Works portfolio unite your entire ecosystem…”
- STL Viewer — “simple application to view STL files…”
- XFLR5 — “an analysis tool for airfoils, wings and planes operating at low Reynolds Numbers…”
- UltiMaker Cura — “prepare prints with a few clicks, integrate with CAD software for an easier workflow, or dive into custom settings for in-depth control…”
- Xcode — “includes everything you need to develop, test, and distribute apps across all Apple platforms…”
- xflrwing — “STL generator for an XFLR project wing…”
- XFOIL — “an interactive program for the design and analysis of subsonic isolated airfoils…”
Resources
- G-code on Wikipedia. — “the most widely-used computer numerical control (CNC) programming language. It is used mainly in computer-aided manufacturing to control automated machine tools, as well as from a 3D-printing slicer app…”
- Project ALTius | Part I: A simpler approach to high-performance glider development using CAD/CAM. — “altius, citius, fortius — sounds familiar? That’s the Olympic motto where ‘altius’ means ‘higher’. But the spelling (ALTius) is related also to my initials — Atudorei Lucian Tiberiu…”
- Prandtl-D — “the aircraft features a new method for determining the shape of the wing with a twist that could lead to an 11-percent reduction in drag…”
- Project ALTius on RCGroups. — “altius, citius, fortius — sounds familiar? That’s the Olympic motto where ‘altius’ means ‘higher’. But the spelling (ALTius) is related also to my initials — Atudorei Lucian Tiberiu…”
All images by the author. Read the next article in this issue, return to the previous article in this issue or go to the table of contents. A PDF version of this article, or the entire issue, is available upon request.