Idiomatic way to traverse Rhino's scene graph?

Hi all,

Say I create a Rhino model with a box, bezier surface, and sphere, each with its own transformation matrix. Now I’d like to export this model information as parametric objects (i.e. a file encoding “model has: a cube of dimension <1,1,1> with transformation T1; a bezier surface with control points <0.5,0.5>, <0.5,0.5> and transformation T2; a sphere or radius <1> with transformation T3”). Ideally I’d just be able to export my model as a X3D file (as it supports these object types natively), but Rhino is triangulating all geometry on export. If I can’t retain this parametric information through standard export formats, can I traverse the model database to generate such a file myself? Any pointers on what parts of the API might be relevant? Is this information even recoverable from within the API?

Thanks in advance!

It is possible to traverse Rhino’s object table with both the Rhino C++ SDK and the RhinoCommon (.NET) SDK.

Rhino objects do not maintain a transformation matrix. Rather, their geometry reflects their precise position in 3-D space. Not sure how this effects your plans…

1 Like

Thanks Dale! Much appreciated. Looks like Rhino.DocTables.Tables.ObjectTable should get me started. As long as the exact position and orientation of the object is in the ObjectTable, I should be able to reconstruct the matrix w.r.t. WCS origin. Thanks again!

1 Like