Joining
Methods
JoinSurfaces
#Join surface-like objects into as few outputs as possible. Each input is resolved in the following order, most-specific first:
- Sphere, Box — closed primitives, always pass through unchanged. Already-solid inputs are never broken apart or re-joined.
- Tube, Triangle — GH2 shape types, joinable.
- SubD — joined among themselves via SubD.JoinSubDs, remain SubDs.
- Surface, Brep — RhinoCommon base types, joinable.
- SurfaceBroker.CastOrConvert — catch-all for any other registered surface type. The broker may yield a Surface, Brep, or SubD which is then bucketed accordingly.
Parameters:
| surfaces (object[]) | The surface-like objects to join. May contain any mix of Box, Sphere, SubD, Surface, Brep, Tube, Triangle, or any type with a registered SurfaceBroker assistant. |
| retainCreases (bool) | If true, joined subds will retain sharp creases along their joins and joined surfaces retain edges between them. |
| joinSubdsToBrepsIfPossible (bool) | When false, SubDs and Breps live in entirely separate worlds and a SubD will never end up in the same output as a Brep. When true, after the two separate join passes a third pass converts the joined SubD results to Breps and tries to merge them with the Brep results. SubDs that successfully merge become part of a Brep output; those that don't remain SubDs. |
| tolerance (double) | 3D distance tolerance for detecting shared edges. |
| mapping (out int[]) | One entry per input. mapping[i] is the index into the returned array where input i ended up. Inputs that joined together share the same mapping value. This can be used to transfer metadata from inputs to the appropriate outputs. |
| messages (List<Message> = null) | Optional list to receive warnings when an input cannot be converted or is not a recognised surface type. |
Returns: The joined outputs, one per connected component. Each element is either the original object (for pass-throughs and un-joined inputs) or a new Brep/SubD representing the joined result.