Thread Tools
Aug 25, 2019, 05:58 AM
Registered User
Thread OP

What's next?

First: I would like to ask the 6 brave colleagues who downloaded the software to give me some feedback (either here or in a PM). Let me know your impressings, if you can use the program for your projects, what features are need in the next versions and so on.
Second: as you probably know the program is a shortcut between the XFLR project and the manufacturing proccess. Is is just a workaround so you don't need Solidworks, Catia, Rhino3D, Fusion360 anymore. But you still need to take this STL output and process is with a CAM programm in order to obtain the G-code. BTW, if you don't like the STL format then import it with your favorite CAD programm, I will not create output in STEP, IGES, 3DM or other formats.
Back to the "you still need a CAM programm" ... not quite true. I have a programm that is starting from the same input (.def /.cfg / .dats), computes the 3D model of the wing the same way but instead of STL file the output is a set of .cnc file with G-code for CNC.
The program (xflr2cnc) is almost ready for testing on my CNC. Don't expect too much from it, it is designed for generating G-code for cutting foam in my DIY CNC. Four operations (roughing / finish / planeity / centering holes) and simple toolpaths. Optimized for speed and accuracy with a built-in tool compensation. Main goal is to create either mold that can be used directly with some mylar or similar film on top of it or a plug and to pour some resin & filler on top and create a proper mold (after polishing of course). And also to cut cores using foam molds as vacuum beds.
First version of the programm is ready but it is made for my "wide CNC" (1000x600 mm active). In this version you cut on a single sheet of foam a mold / plug / core and the mirror of it (when a cut along the chord the program stores all the moves in a buffer and then replays them with adjusted coordinates in reverse order ...this way you have both segments on the same stock). In the next version (probably finished by the end of this month) I will add a parameter for "narrow CNC" (arround 300 mm or more on X axis so you can't accomodate 2 "wings" side by side).
Third: with the OFFSET parameter you can cut cores, molds and plugs with a small gap between them. This feature allows some compensation for composite material and you can use it both in "hollow wing" and "solidcore" technologies. I would like to try both types of wing but with a "twist":
- for hollow wing I would like to try some internal structure using geodetic balsa ribs ( I will post also a programm for computing these geodetic ribs for this purpose)
- for solidcore I would like to replace this rohacell with a 3D printed resin structure (to be honest this is my main project right now, building the 3D printers and writing the software to generate G-code for these printers).
Here I will post plans for CNC and 3D printers and also programs for generation g-code for CNC.
And finally, don't forget that beside the "wing programm" there is also a "fuselage programm". The STL part for 2 segment fuselage is readym quite easy to change for a 3 piece fuselage in case we need this feature. What still needs to be done is generating the G-code for CNC and SLA printers but this is quite easy. In fact genrerating the G-code is quite easy, we just "walk" on the surface of the wing or fuselage and write G0/G1/G2/G3 instructions for these adjusted coordinates.
That's all for new. I'm waiting for some sort fo feedback and please let me know what would you like to see in the future post: fuselage / geodetic ribs / CNC plans / G-code generator?
Sign up now
to remove ads between posts
Aug 25, 2019, 06:38 AM
Registered User
Congratulations on your work, I am playing with the program to understand and get progress. I have access to cnc machine and I will try to make my ground cores to make bagged wings
I wait for your fuselage program in two parts
Aug 25, 2019, 01:42 PM
Registered User
Thread OP

Fuselage programm (pod + boom)

The fuselage program for pod+boom is actually ready (for generating the 3D models for creating molds and plugs). It was posted some time ago in the CAD/CAM section of this forum. What I would like to improve:
- "reversed neck": classical fuselages have a neck on the pod and the boom is quite simple. My type of fuselage is reverted, the boom has a neck (where are the servo located). I want to add some flexibility here so you can use whatever solution you want
- "straight boom": right now the boom is shaped like in Volo /Viator / Explorer and so on. Sometimes simpler is better, maybe adding a parameter that will enforce a straight boom with no curvature and circular section that can be rolled and easier to manufacture
- "tail piece" ...either for X-tail of Vtail, a 3rd piece to be mounted on top of straight boom in order to simplify manufacturing and have some flexibility ...
- right now the STL files contain some end elements on Y axis but no additional elements on X axis (like walls / trenches / centering holes).
Well, that's the battle plan anyway. In the next 2 -3 days I will "publish" the current version of the fuselage programm and explain the parameters like I did for xflrwing (severeal posts with para,eters grouped in categories).
However the above features are not very high on my list of priorities, my focus is right now on SLA 3D printers and G-code generator and light but strong infills. Once I will get some results on the 3Dprinting part I will get back to molds because I need to cover the 3D printed wing in textreme but to be honest my plan is that the first molds will also be 3D printed (just a shell, then the rest will be filled with some resin).
This is one goal for project ALTius, "rapid prototyping", from XFLR project to something ready to fly in under 1 week. Not only for my projects but for any builder (with a decent cost of course).
Aug 25, 2019, 02:00 PM
Registered User
Thread OP
Originally Posted by Danindoor
Congratulations on your work, I am playing with the program to understand and get progress. I have access to cnc machine and I will try to make my ground cores to make bagged wings
I wait for your fuselage program in two parts
About "ground cores" ... I guess this is the main issue, how to mill the cores with good results. Here is what I had in mind for a segment:
- mill the "mold lo"
- mill the "plug hi"
- these 2 should be complimentary so they can fit perfect on top of each other (see the attched picture)
- because the "real Z coords" with a "narrow CNC" you have to do some rotation of the part before cutting it, with a "wide CNC" the problem was somehow easier to solve because you cut both (segment + mirror) in one go
- once "mold lo" and "plug hi" are fitted together if you cut "core hi" you should end up having a "wing" on top of the "mold lo" ("plug hi" is destroyed)
- you need to cut also a "mold hi" part
- sand the resulting "wing" part to compensate for composite material
Of course you can reduce this sanding (and also the sanding for molds & plugs) by using OFFSET (maybe I wasn't mentioning in that section, positive offset is towards inner wing, negative offset is towards outside).
Well, that's the plan anyway, to use the program's flexibility to create all kind of parts and to use off-the -shelf common materials like 5 cm / 2" XPS isolation sheets. Or rohacell ..if you can afford it.
But you mentioned "bagged wings" ... I still recommend the cut these molds from foam, cover them with some cling film or similar (maybe use some mylar), cut the wing as described above and vacuum the wing between "mold lo" and "mold hi" with some weight on top.
Aug 27, 2019, 03:17 PM
jpecar's Avatar
So, "opensource" ... any chance of a git repo or something so we can read the code and build it ourselves?

Thumbs up for the work. I was (and still am) dreaming of doing something like this in python or julia sometime ...
Aug 27, 2019, 05:15 PM
Registered User
Thread OP
Originally Posted by jpecar
So, "opensource" ... any chance of a git repo or something so we can read the code and build it ourselves?

Thumbs up for the work. I was (and still am) dreaming of doing something like this in python or julia sometime ...
Yes, opensource as in GPL. I used a simple cubic spline interpolation library without external dependencies (tk spline) licensed unde GPL2 or later xflrwing is opensource as well.
Probably I will publish it here before setting up a git repo ... oh wait, I just did. Enjoy.
PS Sorry for the ugly code. If you need some additonal details just let me know (and the line number of the code).
PPS The fuselage program(s), xflr2cnc and xflr2dxf (for normal and geodetic ribs) will be also GPL2 (they also use this spline library). xflr2sla (for generating G-code for my homemade SLA 3D printer) will be not (I'm not using the spline library in order to keep some "code privacy", it contains some advanced infills and slicer techniques I don't want to share for the moment).
Last edited by ender67; Aug 27, 2019 at 05:36 PM.
Aug 28, 2019, 05:29 AM
Registered User
Thread OP
OK, I see a couple of downloads for the program but no downloads for the spline library. If you just want to look at the code and use the .exe program I posted it's fine, if you want to complile you need to download spline.h (unless if you have it from a previous project).
For Windows: install MinGW (,then put xflrwing.cpp, spline.h in the folder with xflrwing.cfg, xflrwing.def and the .dat files. Then:
g++ xflrwing.cpp -o xflrwing.exe
If you want to share the .exe file with frineds and they don't have MinGW installed please use the static link option:
g++ xflrwing.cpp -o xflrwing.exe -static
MacOSX: ionstall Xcode, then the process is similar to the one described for Windows.
Linux: do you really need help on this one?
Aug 29, 2019, 02:56 AM
jpecar's Avatar
Quick comment on code: it's maybe ok for a "quick and dirty proof of concept" to do your own stl reading, matrix math etc, but for the long term maintainability and if you have any ambition to "productize" this I'd use already existing, tested and verified building blocks such as CGAL and Intel MKL. It also allows you to push all the "boring" housekeeping routines out to existing libraries and focus on the logic you want to implement.
Aug 29, 2019, 03:58 AM
Registered User
Thread OP
I don't have any ambition to transform this in a software product, it was intended to be just a tool to create STL files fast and accurate. Thtat's why I was reluctant to publish it because it just code that grew (quite ugly) over 3 years. It started just with STL output for 3D printing the wings and I added features in time and the code became "ugly".
Even if the results are OK for the moment it is a closed line because I will try to "shortcut" also ythe CAM software to generate G-code for milling foam. And even this approach is a second priority for me because before milling solidcores and plugs in foam and then create molds with resin and fillerI want to speed up the process a little bit by using 3D printing of cores and molds for prototype. Only after the protoype is validated I will get back to classical approach with molds in corian and cores with XPS/rohacell or hollow wing with internal geodetic ribs.
But for the monent don't look at the code, evaluate the output.
Last edited by ender67; Aug 29, 2019 at 05:16 AM.
Aug 29, 2019, 04:44 PM
Registered User
Thread OP
I've got a request on PM to go on and continue this mini-series with xflr2cnc. As I've told you before xflr2stl was coded to "scratch an itch" ... but it time my focus shifted from using the output of this program as an input to a CAM program like EstlCAM (or similar) to use it more like a "visualisation tool". If I'm computing the wing coordinates quite precise (double precision) and then I use only 2 or 3 significant digits after decimal point to write coordinates in ASCII STL files ...why use another commercial / trial / free program to generate G-code ? It's quite easy to write G-code, it's similar to writing DXF files (there I used some routines to write lines and circles, in G-code G0,G1,G2 and G3 are our friends). The trick is we will not have a [(.def/.cfg/.dat) =>. stl => .cnc] workflow , we simplify it [(.def/.cfg/.dat) => .cnc]. From textr files we get G-code (also text files).
The "proof of concept" .cnc G-code is quite old (Aug 3rd 2018) and not be able to use the whole set of parameters used now in xflrwing. It was meant for internal use on my "wide cnc" (1000x600 mm) and in the beginning just on foam. On a wide CNC every segment of the wing was mirrored on the second half of the stock. In December I started working on a new version of the program to be used for a "narrow CNC" (with X axis like 300-400 mm).
The POC CNC G-code (let's call it xflr2cnc_v1) generates G-code for 4 basic operations: roughing, finish, planeity and centering holes. First 2 operations you do on a foam stock, you got like a "foam plug" (of "foam mold" if you like), you fill this plug with resin & filler, then you do the leveling on the upper surface (operation 3) and then drill centering holes (opetation 4). At this stage you discard the foam plug, sand and polish the resin mold, finish it and glue it on a solid backplane (like MDF or similar). If you don't want something too complicated you can do a "foam mold", use some cling film or mylar and use it for vacuum bagging. The main point here: the stock was XPS foam and this is pretty forgiving for DOC and feed rate.
The generated toolpath (for rough and finish) was very simple:
- on a "Z parking" coordinate position the tool in front of the leading edge coord minus the additional elements (wall and trech and space)
- follow this elements then the contour of the upper or lower wing, then elements from trailing edge
- go on the second half on X axis and repeat in reversed order (for the mirrored segment)
- advance on Y , repeat in the other direction
- repeat these steps till you finish the element
There is a "Z over" parameter (you don't follow the exact coordinates but you can specify like a Z offset for toolpath) and also for the X axis there is a tool diameter comensation (the tool is considered to be of cylindrical shape and we compensate if the cutting edge is on the left, on the right or the plane of the tool).
What's missing here?
a. DOC was just a proof of concept for foam where we don't care too much about DOC (and I was just trying to see if the generated toolpath was valid before complicating G-code with DOC)
b. the shape of the elements before LE and after TE
In order to simplify the code I considered walls and trenches with a simple form: the width of these elements was measured along the X axis on the same Y position, perpendicular on the long axis of the wing (let's call it "V1 style"). The latest version of xflrwing is using a "V2 style" for walls and trenches: when we measure the width of these elements we consider the perpendicular on the leading edge or traling edge (in this way the walls and trenches follow the curvature of the wing edges in a more "natural" manner.
"V1 style" is suitable for a "quick and dirty" approach because the movement of the tool is on the same Y coord and easier to debug; for "V2 style" the elements @ LE & TE will have some Y displacement but the toolpath for the surface of the wing wil be on the same Y coord. Of course for "V2 style" at the end we will have to do some toolpath parallel with TE and LE to smooth the surfaces ...
Probably I can post here the "cnc V1" code and ask you to test on foam. With a small change in code I can create a "cnc V1.5" including DOC (in V1 there is a simple movement from Zparking to Zcoord+over i.e. somewhere above the real Z, for v1.5 with DOC we will start somewhere @Zstart, the advance on Z will be to maximum between Zcurrent-Zdoc and Zreal+over, after one pass over the whole area Zcurrent wil be adjusted with -Zdoc and repeat the procedure till we get near Z=0). With DOC the G-code can be used also for MDF & corian.
And last, in V2 we will have also DOC and nice rounded shape of walls and trenches.
Also I need to change the number of output files to be in synch with what we have now in xflrwing.
And, of course, to adjust the program for both wide and narrow CNCs.
That's the plan anyway and I expect the progress to be quite fast, it's much easier to write G-code compared to the STL ASCII output.

Quick Reply

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Woodworking ............recently completed a simple first project . rockyboy2 Life, The Universe, and Politics 33 Mar 08, 2018 09:23 PM