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
Surfaceand choose the surface in the Rhino. If you check this with a
Panel, it'll be shown as a
- Export the surface to a GHdata file via
- Open another Rhino instance, and open another GH instance.
- Import the saved surface via
Data Inputcomponent from the GHdata file.
- In this 2nd GH file, the
Referenced Surfaceis recognised (you can check with a
Panel) 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
Deconstruct Brepcomponent. The "Faces" output shows the corresponding surface (
Untrimmed Surfacein my case). Happy.
- Somehow the
Deconstruct Brepmesses up the tree structure, so use the
Path Mapperif you want, and choose
Create Trim Mappingby right-clicking ((
Trim Treedoesn't work here, as it's the innermost branches not the outermost branches that are added by the
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