Open stockholmux opened 1 year ago
I can understand the confusion as WASM is using an stl viewer without any origin or grid markers. So you can mistaken the 3D-gizmo as origin. But you will see a similar thing also in the lower left corner of the OpenSCAD view window
But the position of the objects is identical - and the exported files also contain the same positions.
Yep, it seems the axis marker is positioned at the bounding box of the model. At first glance, I'm not seeing a property to enable some sort of grid.
Hmm, there's https://github.com/gabotechs/react-stl-viewer/blob/master/src/StlViewer/SceneElements/Floor.tsx which sounds like there's support for some x/y plane thingy.
Humm. I noticed it when I experimented with positionX
and positionY
to 0 in StlViewer
(file: ViewerPanel.tsx
) and it corrected the axes.
Now, if we want the 3D gizmo @UBaer21 it should probably position it in a fixed position and have rulers.
I'm wrestling with gabotechs/react-stl-viewer
currently, there doesn't seem like there are many options, especially regarding the camera. Seems like pmndrs/react-three-fiber
has more options but less turnkey.
As you can see it is now the center of the bounding box but not the origin - I would assume this would be even more confusing. You could add a ruler as an object but as we have no real preview that object would render and need to be removed for the export. like this
but as we have no colors in the viewer (which could work if 3mf color export would be implemented in openSCAD) And you see that the axis marking will also influence the camera and bounding box - so i think this is not a solution.
in https://ochafik.com/openscad is just nothing - so i think that bounding box edge gizmo is an improvement - but sure it is not ideal .
Filed https://github.com/gabotechs/react-stl-viewer/issues/55 for origin-bound axes
Although TBH on the long run I feel like we'd need either OpenGL emscripten support OR... gltf export + some color viewer such as https://modelviewer.dev/
Note that axes have currently disappeared in the deployed Web Playground as I'm in the process of overhauling it (see https://github.com/openscad/openscad-playground/pull/37 ). I'm thinking of how best to reintroduce them (maybe a separate modelviewer w/ arrows synced on the main viewer for the feedback / control, and some BOSL2 rulers for the axes).
If you run the script
playground.scad
in OpenSCAD proper, the model is centred on the x/y/z axes.Example:
In the playground, it seems to be at the lower left of the bounding box.
Example:
Someone learning OpenSCAD with the playground will be quite thrown off by this, especially of they are doing 0 centred modelling.