Viewer interaction #133
njourdane
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
nice! What is your overall goal? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Following the discussion in #126, I wanted to play with viewer interactivity today.
Demo
The example below is not really useful but it's a fun proof of concept: it creates a smaller box on the selected face.
How
The base principle is inherited from my project bd_shape_history and consists in indexing shapes with their hash. Each hash is based on shape tessellation in order to compare them in different program executions (you can see them in the tree view above). Then, using the listener function from the ocp viewer backend, I can handle clicks on the object, which gives me the shape label, which is the shape hash, which is used to get the actual shape. I can then modify the object and update the viewer. Note that what I pass in the viewer function is not the object but a compound containing all the object faces.
Source
Beta Was this translation helpful? Give feedback.
All reactions