folkertdev / freestyle-svg-exporter

a Blender addon for exporting stylized lines created by the Freestyle render engine to an SVG format.
54 stars 18 forks source link

Is it possible to know the index of the vertex on freestyle lines on the whole mesh? #21

Closed lisiyao21 closed 1 year ago

lisiyao21 commented 1 year ago

Dear @folkertdev , thank you so much to offer this useful tool. I am so new to Blender. If I understand right, the svg exporter first get the vertices from the 3D mesh and then string them up on the topology. My question is, is this possible to not only know the vertex positions, but also know its index in the original 3D mesh? Thank you!!!

folkertdev commented 1 year ago

I'm not entirely sure what you mean.

The exporter uses the freestyle renderer to compute the lines. The freestyle renderer is an artistic render engine, which in practice means that the lines it draws don't correspond to vertices of your mesh. It may look like they do, if you use the right settings, but the line in practice has no direct connection to the 3D geometry.

So then anything you do to map the freestyle lines to 3D vertices is guesswork. Basically you would have to walk over all vertices of the mesh and see which one is closest. It might work well for certain models (but not all!), you could make it reasonably efficient, but it's not easy.

lisiyao21 commented 1 year ago

Thank you so much for your fast and kind reply!!! Your answer exactly address my question. I am trying to find a way to map vertex of line art to the 3D object. It seems it is not feasible to use FreeStyle to do so...

lisiyao21 commented 1 year ago

Thank you again for your answering! I appreciate it so much if you have any further suggestion!! Have a nice day!