7BIndustries / Semblage

Semblage is an open source CAD GUI backed by a programmatic CAD API named CadQuery.
https://semblage.7bindustries.com/en/latest/
GNU Lesser General Public License v2.1
48 stars 3 forks source link

Make Faces Selectable #52

Closed jmwright closed 2 years ago

jmwright commented 3 years ago

Faces need to be selectable in order to enable selector synthesis. For Godot's 3D view, faces are broken down into triangles (meshes are created by tessellating the 3D b-rep object).

In the JSON that is returned from CadQuery, this hierarchy should be recorded and triangles should have an ID and a way to trace their parent face. Then when a triangle is intersected by the raycast from the mouse cursor, the top level face can be highlighted and selected.

jmwright commented 2 years ago

Finished in commit 05392e417cc2e676d8340c09fa5baccd8908703c

In the end it was not required to track the triangles. A collision object was created for each separate face mesh, and that was used to change the material color of the entire mesh at once.