Unwrapping, editing and rewrapping surface

Hello blenderartists community,

I’m trying to use blender to create/modify toolpaths for multiaxis 3D-printing onto (almost) arbitrary surfaces.
Here is the workflow I have been thinking of and which also partially works (marked with done):

  1. Place model onto printing surface (done)
  2. Slice the model (done):
    2.1 Create offset layers from the printing surface with the distance of the required layer height (done)
    2.2 Boolean operation of these layers with the model to actually get the slices: (done)
    2.2.1 Extrude the offset layer (because boolean with flat surface isn’t possible in blender (?) ) (done)
    2.2.2 Boolean operation of the extruded offset layer with the model (done)
    2.2.3 Discard the extruded parts to get a flat layer again with the outline of the model (done)
  3. “Unwrap” each layer to get a flat mesh without changing the surface area to prevent distortions later (done using UV-map)
  4. Export the UV-map of each layer as .svg (done)
  5. Import the UV-map of each layer again (done)
  6. Transform imported curves to mesh (done)
  7. Extrude the mesh of each layer by the required layer height (done)
  8. Export those flat layers as .stl file (done)
  9. Slice the layers using standard slicing software (done)
  10. Import the created G-Code back into slicer using vertices as waypoints.
    I did this using the python api and accomplished to import the waypoints as vertices. But now the vertice normals all point to the blender coordinate system origin. Ideally they would all point upwards, perpendicular to the x,y-plane. (partially done)
  11. Project the vertices onto the slices created in 2. This is probably the biggest challenge and I don’t have any solution yet. I thought about somehow using the UV-mapping feature again, but afaik it only works with images, not with meshes. How could I project the vertices onto the meshes of the slices created in 2?
  12. Export the coordinates of the vertices projected onto the slices
  13. Success: Print in 5 degrees of freedom onto arbitrary surfaces.

I hope this is the right support forum to ask for help. This problem also involves Python scripting to automate the single steps later but i thought it is primary a modeling question right now.

I am open to any ideas, so I you have different ideas for doing all of this, please suggest.

Thanks in advance for any help!

Hello there, your method is really interesting.

I happen to want to do similar work for 3D printing using a 6-axis robot using UV mapping and the Blender API. Any Github repo, code or scientific paper that you would be willing to share?

Any help is much appreciated!

Have a good day