Method CreateShapeFromPolygon
CreateShapeFromPolygon(PolyShape)
Creates a custom polygon shape from a set of points on a plane. The points must be ordered.
Declaration
public static ActionResult CreateShapeFromPolygon(this PolyShape poly)
Parameters
Type | Name | Description |
---|---|---|
PolyShape | poly | The PolyShape component to rebuild. |
Returns
Type | Description |
---|---|
ActionResult | An action result indicating the status of the operation. |
CreateShapeFromPolygon(ProBuilderMesh, IList<Vector3>, float, bool)
Rebuilds a mesh from an ordered set of points.
Declaration
public static ActionResult CreateShapeFromPolygon(this ProBuilderMesh mesh, IList<Vector3> points, float extrude, bool flipNormals)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The target mesh. This method clears and repopulates the mesh values with the shape extruded from points. |
IList<Vector3> | points | A path of points to triangulate and extrude. |
float | extrude | The distance to extrude. |
bool | flipNormals | True to invert the faces when creating the PolyShape. |
Returns
Type | Description |
---|---|
ActionResult | An ActionResult with the status of the operation. |
CreateShapeFromPolygon(ProBuilderMesh, IList<Vector3>, float, bool, IList<IList<Vector3>>)
Rebuilds a mesh from an ordered set of points.
Declaration
public static ActionResult CreateShapeFromPolygon(this ProBuilderMesh mesh, IList<Vector3> points, float extrude, bool flipNormals, IList<IList<Vector3>> holePoints)
Parameters
Type | Name | Description |
---|---|---|
ProBuilderMesh | mesh | The target mesh. Clears and repopulates the mesh values with the shape extruded from points. |
IList<Vector3> | points | A path of points to triangulate and extrude. |
float | extrude | The distance to extrude. |
bool | flipNormals | True to invert the faces when creating them. |
IList<IList<Vector3>> | holePoints | Holes in the polygon. Specify null if you want this method to ignore this value. |
Returns
Type | Description |
---|---|
ActionResult | An ActionResult with the status of the operation. |