Ultimaker / Cura

3D printer / slicing GUI built on top of the Uranium framework
GNU Lesser General Public License v3.0
6.18k stars 2.08k forks source link

Question: Where is the code for the Raft generation? #2819

Closed nathanjosiah closed 6 years ago

nathanjosiah commented 6 years ago

I'm working on a project that requires a very similar 2d mesh generation to that which is found in the raft line pattern in Cura. I have searched the codebase but I can't seem to find where the raft layers are actually generated. Can somebody point me in the right direction?

diegopradogesto commented 6 years ago

The raft is generated in CuraEngine. You can start taking a look to our repository: https://github.com/Ultimaker/CuraEngine

Ghostkeeper commented 6 years ago

The code to generate the areas that must be filled with raft is here: https://github.com/Ultimaker/CuraEngine/blob/master/src/raft.cpp

Those areas are filled with lines here: https://github.com/Ultimaker/CuraEngine/blob/f8697149514f0f7cc0677b7c2b426354321c7326/src/FffGcodeWriter.cpp#L487

But what you're looking for, I think, is our infill patterns. The line pattern for rafts is actually just an infill pattern, generated in the same way that support, skin and infill is generated. So what you're actually looking for is probably the zig-zag infill pattern: https://github.com/Ultimaker/CuraEngine/blob/f8697149514f0f7cc0677b7c2b426354321c7326/src/infill.cpp#L290