oriedita / oriedita

Oriedita (fork of Orihime) is an origami crease pattern editor and folding simulator.
https://oriedita.github.io
Other
78 stars 19 forks source link

Draw aux lines on foldedfigure #69

Open qurben opened 3 years ago

qurben commented 3 years ago

It should be possible to show where aux lines end up on the folded figure.

qurben commented 3 years ago

One approach would be to texture the foldedfigure using the crease pattern, we know where locations in the creasepattern are based on faces in the foldedfigure. Drawing the creasepattern with only aux lines on an offscreen buffer allows us to sample from that image and draw on the foldedfigure. Similar to how ssi is implemented.

undertrox commented 2 years ago

doing it exclusively via textures wouldn't allow for exporting the aux lines to svg, which I think is the main use case, to generate a good starting point for diagrams. In the Oripa implementation of this, each face remembers which aux lines are on it (since aux lines get split automatically, every aux line will be on exactly one face), and then applies the same calculations that are used to find out the folded position of the face, on the aux lines as well. Alternatively, maybe a hybrid approach could be used, where textures are used to find out the position of the lines on the folded model, but the lines are then converted into actual vector lines, maybe by determining the position of the endpoint pixels of the aux lines in the folded model.

qurben commented 2 years ago

Good point! I agree that actually keeping track of the aux lines is probably the best approach here.