Sunday, August 13, 2006
Acute Inner Angle Clipping
So I didn't get a lot of time to work on this during the weekend. After thinking about this problem more, I think the mathematically 'correct' way to create the perimeters, the infill material, and the support material would be to operate on the model while it is still in 3D rather than to slice it and then attempt to maniplate it for wall perimeter. Trying to solve the problem in 2D planes will reduce the tolerances in the Z direction. If you, for example, are attempt to print as perfect a sphere as possible, you'll end up making an ellipsoid that is slightly taller than it is wide (by up to whatever the thread width happens to be? Not sure on this, it probably also depends on how the thread squishes around once it leaves the nozzle.)
One idea to get the mathematically exact solution would be to create an algorithm to generate 3 separate 3D models: one to defines a surface containing the center of the perimeter thread, one to define the surface interior inside the perimeter threads, and one to define the surface of the support material. Turning these three models into a set of extruder paths is almost trivial -- just trace the Z-Plane intersections of the perimeter model, add alternating scans using the infill model, and add support material scans using the third model.
In any case, I thought I'd finish up with where I've stopped on the 2D slicing; I started working on line intersection clipping, and decided to give it up for now. Since it isn't the mathematically perfect solution afterall, it lost much of it's appeal. Using a simple model pictured at the start of the blog, I created 2 Z-Plane slices, and added the perimeter path. The red line is extruder head center, and the blue line shows an approximation of how the thread fills the space. (The sphere with a square knocked out and a wavy/fiddly bit added required too much accuracy and exposed too many bugs with my code -- as indicated in other messages, points and segments need to be removed to reduce the amplification of small errors.)
These are the traces without the acute inner angle clipping turned off.
And here are the traces with the acute inner angle clipping turned on, set to clip any interior angle that is less than 90 degrees.
It seems pretty obvious to me that the second perimeter traces would create a stronger object, even if intersection clipping was added to resolve the the degenerate case where the thread pierces the opposite side of the object.
That offset problem with the sharp point is handles completely correctly with the CSG representation in the Java code. I have to go to bed now (it's nearly 1 am here, and I have to drive to Southampton tomorrow...). When I get back I'll plot out an example and blog it here.
Links to this post: