osresearch / plotter-vision

Hidden Wireframe removal demo in p5.js
GNU General Public License v2.0
89 stars 17 forks source link

On load, scale object to 1:1:1 unit size #16

Closed msurguy closed 3 years ago

msurguy commented 3 years ago

When STL is loaded, it would be helpful to always have the same initial size for any STL. For example, ln does this with a unit cube and fits the object inside the unit cube: https://github.com/fogleman/ln/blob/master/ln/mesh.go , https://github.com/fogleman/ln/blob/12e6c6e7445909f817f1b8d5581be4255ffa1437/examples/slicer.go#L18

This way, no matter what STL you load, your zoom level and camera position can remain the same.

osresearch commented 3 years ago

That would also make the eye separation adjustment easier since it gets weird for really large objects.

osresearch commented 3 years ago

I've added code to do this. https://github.com/osresearch/plotter-vision/commit/bc72ec1a7ab577d9abd4c8a61bb9adf52420dea3

We'll see how well it works in practice.

msurguy commented 3 years ago

Thank you, @osresearch !