GH: convert a Referenced Surface to a Surface
I encountered an issue related to the Referenced object (surface) in the following situation:
- Launch a Rhino instance, place a surface.
- Launch a GH instance, place a
Surface
and choose the surface in the Rhino. If you check this with aPanel
, it'll be shown as aReferenced Surface
. - Export the surface to a GHdata file via
Data Output
component. - Open another Rhino instance, and open another GH instance.
- Import the saved surface via
Data Input
component from the GHdata file. - In this 2nd GH file, the
Referenced Surface
is recognised (you can check with aPanel
) but the preview won't actually show up in the 2nd Rhino window. Oops...?
I'm not 100% sure why this is happening but I suspect that for a "referenced" geometry to work, the corresponding object must be available in THE Rhino file that corresponds to the current GH file. The easiest solution came up to my mind is to convert the Referenced Surface in the 1st GH file into something else (before Data Output)... an "actual" surface. There may be many ways for this and perhaps the right way is to use GH_Convert.ObjRefToGeometry
Method (GH_Convert.ObjRefToGeometry Method) but I just wanted to be simpler... and tried something else.
- Pass the
Referenced Surface
toDeconstruct Brep
component. The "Faces" output shows the corresponding surface (Untrimmed Surface
in my case). Happy. - Somehow the
Deconstruct Brep
messes up the tree structure, so use thePath Mapper
if you want, and chooseCreate Trim Mapping
by right-clicking ((Trim Tree
doesn't work here, as it's the innermost branches not the outermost branches that are added by theDeconstruct Brep
.)).
I haven't tried the similar method for other object types such as Brep or Line or Points, but hoping something similar might work (or, I should probably actually use the GH API Method above... I know...).
Hope this helps to somebody having hard time in treating Referenced object with Data Output
/Data Input
...