@Hermann-SW this is one of many thing we would like to implement, but it is not implemented, or even specified as a possible future feature.
Current 3d engine is regl, and I am working on interchangeable support for Three.js and Babylon.js.
regl has slowed down with development but Three.js and Babylon.js are very much active
Getting info what object is clicked or mouse over is easy in Three.js and Babylon , but for regl I am not sure (it may or may not be easy to do).
You likely want to use jacad to generate geometries, give them some identifiers, interact with them and then upon interaction change the model with performance in mind by updating only things that changed.
This is something we could colaborate on, but it is not something that can be simply implemented as part of jscad script runner. Because the current workflow for jscad is:
make a script
expose getParameterDefinitions - jscad can generate params form
expose main method - jscad will call it with parameters and display result
As you can see there is no concept of partial interactions or reactive changes, it is more like a commandline program that you write, and jscad calls to display it's output in 3d (and provide export option)
there are several building blocks that make this combo getParameterDefinitions + main work, with proper separation of those building blocks users would be allow to create much more than just scripts that produce 3d geometry. But such efforts take time, and we are low on man-power.
One such reusable block I started creating is code editor https://github.com/hrgdavor/jsx6/tree/main/libs/editor-monaco although there are nice code editors, they are not too easy to use or combine with JS projects (takes too much knowledge) so I am aiming to create more friendly wrappers. Each editor is stuck with their own cool build process and tooling that was popular at the time of the project start.
I am also improving my skills with web workers, and babel transformations to provide building blocks for script execution with proper line numbers in stack traces and built-in browser's debugger integration.
so, slowly something is comming along ... slowly...
@platypii Thank you for this investigation. I remember that I tried to get JSCAD to union those groups but then it loses colors. I use Wings 3d to colorize my models, and it does not split them into separate objects (on my screenshot I have only one geometry), only materials are separated into groups.
Capture d’écran du 2022-06-14 10-11-33.png
Capture d’écran du 2022-06-14 10-29-42.png
I splitted the model into 3 geometries and then exported it to .obj and the difference is that it contains 3 lines starting with "o " that defines start of an object. Maybe for the moment JSCAD translate lines starting with "g " like "o ".
I have just made another step forward: mesh support (but with some quirks ATM)
I have some lighting to fix, and also babylonjs for some weird rason uses left handed system (this adds a bit of complexity to the worker to support it properly)
Also when switching viewers, if they are different orioentation currently I need to run the script again manually to get properly oriented triangles
@gilboonet I finally take advantage of geometries id and class preservation, and created a small js node script that creates a group for all paths having the same class, and at the same time I solve another annoyance that was the impossibility to search by numbers by creating id. That's very nice.