Welcome! Log In Create A New Profile

Advanced

3D Infill Algorithms, Experimenting

Posted by rptynan 
3D Infill Algorithms, Experimenting
December 31, 2013 04:17AM
So I've been working on some scripts in OpenSCAD and C++ , to automate testing of 3D infills, mostly cell tessellations of different polyhedra.

My approach is
- Importing a model (in .off format because CGAL, the C++ library I'm using, doesn't support .stl)
- Hollowing it out (which is giving me a bit of trouble, see below)
- Generating the infill just big enough to cover the model (the size is fed into OpenSCAD through my C++ program)
- Union and export to an stl, which is sliced as normal

I'm having a lot of trouble just trying to hollow out, or shell, the input model, because my current implementation requires a Minkowski sum in OpenSCAD, which is very slow and crashes on any shapes which are even slightly complex, but I can get some test prints of simple shapes, like cubes and tetrahedrons, to work.
Also, I had more trouble with OpenSCAD, because of an issue whereby it doesn't properly generate internal voids, pointing their faces the wrong way around (see here). This is ok, except for the fact that my slicer of choice, Slic3r, (somewhat correctly) ignores these invalid cavities. But I've got it working with Cura now.

It's all available on git, here, there's some sample models which have been generated there too.

Also here's some test prints, it works reasonably well, and some infills might not be too difficult to implement in slicers (although admittedly, I know little about that).
If anyone has suggestions for new more dynamic infills (as in, not tessellations)or could help with the hollowing problem, I'd be grateful.



-Richard

[tynan.me]
Re: 3D Infill Algorithms, Experimenting
January 06, 2014 07:49PM
How did you choose OpenSCAD instead of OpenCASCADE in FreeCAD? I would think it would be more robust, but I don't really have even an inkling of the programming behind such a project as this.

For my other ideas on infill, see my comments on Gary Hodgson's blog post here.
Re: 3D Infill Algorithms, Experimenting
January 06, 2014 08:05PM
To be honest I had just used OpenSCAD before and never had used OpenCASCADE, so I didn't really know the pros/cons of choosing one over the other. OpenSCAD is definitely a bit too slow for this kind of stuff, but it works well for experimenting.
I have actually read your comment before. For any elements of the mesh I need to read, I used CGAL, and that's why the model is loaded in .off format first, to allow CGAL to read it and select vertices, etc.


-Richard

[tynan.me]
Sorry, only registered users may post in this forum.

Click here to login