03-18-2022, 08:54 PM
(03-18-2022, 06:42 PM)Ottia Tuota Wrote:(03-18-2022, 06:20 PM)Ofnuts Wrote: Pretty cool. But any way to prevent loops?
No, except by changing the values for the parameters. Of course we could develop the theory further. I modified it to take into account edge lengths, and we could of course use some other criteria. The question is, what criteria, and who would do it ...
Ok, I stumbled on the problem by making a quick test: take a "natural" shape, make a path (with only anchors), and apply the script to see how close the resulting path is to the real thing. This wants to represent the rather frequent use case of having a shape with long curves and not wanting to adjusts all the tangents.
Since it was a plane, there were sharp angles and protruding antennas. The script does a fairly good job on smooth curves, even on relatively tight bends:
(blue: anchors-only manual path, red: G2-continuity, click for bigger size)
But of course it softens angles even where it is not wanted, but then on such angles a user would put tangents... So a possible criterion is to stop the smoothing on anchors where one or more tangents are defined, and of course, keep the tangents as boundary conditions.