@stevebaer Good question given all of the unusual requests and comments I’ve been making lately!
I’m trying to:
Display information about selected objects:
A) For things that implement GeometryBase, I show various physical quantities like boundaries, area, volume, centroid
1) for “free” - don’t have to code it myself
2) exactly consistent with the values Rhino would get
B) graphically - it would be nice if when I draw an entity it’s visually consistent with the way Rhino does. So far, this shows up in the Drawing Conduit where not all classes are supported. Two examples of the inconsistency: SubD (Rhino API has no function so I draw the edges), MeshFace (Rhino seems to by default shade the face when selected as a subobject- if there’s a reason for that and if it varies by user settings I’d like to get it for free by calling a function which ‘just does it’ consistently with other Rhino UI.
A(2) can be important for things like summing up the areas of faces or other geometrical values, so if SubD and MeshFace aren’t geometry I have to do various calcs myself and risk being inconsistent. That second part isn’t much of a risk for MeshFace unless I create a bug through not understanding how Rhino passes things (nature of vertices, etc.) in weird corner cases.
Maintain a record of current user selections and run my own tree view UI to describe Rhino objects:
for RhinoObjects obviously I can store the RhinoObject or just an ID.
For objects implementing GeometryBase, I’ve got a class to bundle them in an object variable or create a series of variables for RhinoObject, SubDComponent, MeshFace, and so on.
I understand the rationale of keeping things lean for objects like Line, but I can promote that to LineObject. SubDFace is a relatively complicated thing, and has nontrivial 3D properties both geometrically and visually, so it would be nice if I got Rhino’s power to deal with such things free out of the box instead of trying to reimplement it.
And for the “Why?” I want all of that to work cleanly:
I want to derive and maintain a record of selected objects including components. The user should be able to select in either direction: from my tree display or through graphical or command selection in the usual Rhino way. This lets them pick, say, an Extrusion in Rhino and then view information about the base curve and a wall curve.
Here are some examples (real code, not mockups).
Extrusion, summary of the Extrusion itself:
Extrusion, details of the top profile curve:
PolyCurve, summary of the whole curve:
Polycurve, details of an arbitrarily selected segment:
SubD, the object summary:
SubD, details of a face-this illustrates one of the things I’m asking about. It doesn’t support GeometryBase and doesn’t seem to have an independent implementation of Surface values like area or centroid and I had to ‘fake’ the display by drawing a polygon based on the edges:
I’d like to do the same very cleanly with all Rhino types. There’s a Rhino patch pending to facilitate passing the data from in-Rhino selection of Extrusion components to plugins (now not reasonably possible to get from Rhino-selected temporary Brep component index back to the original profile curve or wall curve or what have you). We have this discussion here about SubD components (Faces, Edges). Mesh Faces would be handy to address as well: in assessing mesh quality for various types of analysis, it would be nice to be able to directly work with the face like any other Rhino polygon or surface to check whether for example it incorporates an unreasonably small angle in one corner.