MeshPatch

Creates a polygon mesh from curves and points.

Syntax

Rhino.MeshPatch ([strOuterBoundaryPolyline[, strPullbackSurface [, arrInnerBoundaryCurves [, arrInnerBothsideCurves [, arrInputInnerPoints [, blnTrimback [, intDivisions]]]]]]])

Parameters

strOuterBoundaryPolyline

Optional.  String.  The identifier of the outer boundary closed polyline curve. If provided, this will become the outer boundary of the resulting mesh. Note: Any of the below input that is completely outside the outer boundary will be ignored and have no impact on the result.  If any of the below input intersects the outer boundary the result will be unpredictable and is likely to not include the entire outer boundary.

strPullbackSurface

Optional.  String.  The identifier of the initial surface where, if provided, 3-D input will be pulled to make a 2-D representation used by the function that generates the mesh.  Providing a pullback surface can be helpful, for when it is similar in shape to the pattern of the input, the pulled 2-D points will be a better representation of the 3-D points. If all of the input is more or less coplanar to start with, providing pullback surface has no real benefit.

arrInnerBoundaryCurves

Optional.  Array.  An array of closed polyline curve identifiers. These closed polylines will create holes in the output mesh.  Note: If arrInnerBothsideCurves are the only input, then the result may be Null if blnTrimback is set to false (see comments for blnTrimback) because the resulting mesh could be invalid (all faces created contained vertexes from the perimeter boundary).

arrInnerBothsideCurves

Optional.  Array.  An array of polyline curve identifiers. These polylines will create faces on both sides of the edge.  Note: If there are only input points (arrInputInnerPoints) there is no way to guarantee a triangulation that will create an edge between two particular points. Adding a line, or polyline, to arrInnerBothsideCurves that includes points from arrInputInnerPoints will help guide the triangulation.

arrInputInnerPoints

Optional.  Array.  An array of point object identifiers. These are points to be used to generate the mesh.  Note: If strOuterBoundaryPolyline is not Null, points outside of that boundary after it has been pulled to strPullbackSurface (or the best plane through the input if strPullbackSurface is Null) will be ignored.

blnTrimback

Optional.  Boolean. Only used when a strOuterBoundaryPolyline has not been provided.  When that is the case, the function uses the perimeter of the surface as the outer boundary instead.  If blnTrimback is true, any face of the resulting triangulated mesh that contains a vertex of the perimeter boundary will be removed.  The default value is True.

intDivisions

Optional.  Number.  This is only used when a strOuterBoundaryPolyline has not been provided.  When that is the case, intDivisions becomes the number of divisions each side of the surface's perimeter will be divided into to create an outer boundary to work with. The default value is 10.

Returns

Array

The identifier of the new object if successful.

Null

If not successful, or on error.

Example

Dim strOuterBoundaryPolyline, strPullbackSurface

Dim arrInnerBoundaryCurves, arrInnerBothsideCurves, arrInputInnerPoints

strOuterBoundaryPolyline = Rhino.GetObject("Select closed polyline for boundary, press enter to skip", 4)

strPullbackSurface = Rhino.GetObject("Select surface to pull points to, press enter to skip", 8)

arrInnerBoundaryCurves = Rhino.GetObjects("Select additional closed polylines for holes, press enter to skip", 4)

arrInnerBothsideCurves = Rhino.GetObjects("Select additional polylines, press enter to skip", 4)

arrInputInnerPoints = Rhino.GetObjects("Select points, press enter to skip", 1)

Call Rhino.MeshPatch(strOuterBoundaryPolyline, strPullbackSurface, arrInnerBoundaryCurves, arrInnerBothsideCurves, arrInputInnerPoints)

Also See

AddMesh