Tracking Object Changes - CustomBrepObject Grips & Sub Object Modifications

@stevebaer @menno @dale
I am developing a C# Plugin to automatically offset any non-solid Brep (mostly trimmed surfaces) into a multi-layered solid (see image 1). When the original control Brep is modified, the offset solid is automatically updated. The user must never modify the offset geometry directly. Object snaps on the offset geometry should work though.
In future versions, I would like to extend this functionality to Meshes and SubDs.

I tried to make a CustomBrepObject to achieve this. I am struggling with the simple task to track geometry changes when grips or sub objects are used to modify the Brep. I lose the connection to the Brep (please see video below). I found the following, unfortunately without a solution:

  1. RhinoCommon Custom Objects - #20 by wfcook
  2. [RhinoCommon] Grip-editing of CustomMeshObject turns it into a normal mesh

Questions:

  1. Is CustomBrepObject the right approach for what I would like to achieve or is UserData the way to go?
  2. For CustomBrepObject, I assume I have to implement CustomObjectGrips. Does this work in rhinocommon and is there an example available for Breps? I found one for curves: rhino-developer-samples/rhinocommon/cs/SampleCsRectangleGrips at 6 · mcneel/rhino-developer-samples · GitHub.
  3. How could I address sub object modifications like ctrl+shift clicking on edges/faces and dragging those?
  4. Are there any plans to provide a custom SubD object?

For testing I made a rudimentary example project with an automatically updating bounding box. Please find it attached. CustomObjectTest.zip (109.6 KB)


Image 1: CustomBrepObject: Control brep/surface in cyan, offset solids in gray


Test project: Bounding box loosing connection to custom object when Brep is grip edited.

1 Like

@silvano, did you possibly found answers on the issue of modifying the geometry of custom objects? I am facing similar issues.

2 Likes

@looslennert I did it via custom grips as demonstrated by @dale in the rectangle example linked above. Not sure if this is the best way to do it. I also did not finish this yet, since I am busy with other things.

1 Like