SplitPolygon

Introduced

v1.5

Description

Splits the given set of polygons using the split pattern passed as an argument (e.g.: cross, diamond, triangles, etc).

Note: This command uses output arguments. C# and some scripting languages (such as JScript, PerlScript and Python) don't support arguments passed by reference. Normally you can get the output arguments via either XSIApplication.ExecuteCommand method (C#) or the ISIVTCollection (scripting languages), but this command already returns a value.

The only available workaround in this case is to create a VBScript custom command which returns both the output arguments and the return value in one array. For details, see What Happens when the Function Already Returns a Value?.

Scripting Syntax

oReturn = SplitPolygon( [ConnectionSet], [TanX], [TanY], [TanZ], [SplitPolygonType], [ImmediateMode], [NewPointID] );

Return Value

Returns the collection of SplitPolygon operators created by the command.

Parameters

Parameter Type Description
ConnectionSet ConnectionSet Specifies the polygons to split. See Operator Presets for details on the connection set required for this operator.

Default Value: Currently selected components are used.

Warning: An error occurs if the connection set is invalid. Please verify the connection set required for this operator to avoid breaking your scripts.

TanX Double X parameter w/r to the local frame of the polygon(s) where to put the split point
TanY Double Y parameter w/r to the local frame of the polygon(s) where to put the split point
TanZ Double Z parameter w/r to the local frame of the polygon(s) where to put the split point

Default Value:

This is effectively a signed distance from the polygon plane where the split point is.

This only makes sense if SplitPolygonType is "siByTheVertices"; otherwise the polygon will become nonplanar.

SplitPolygonType siSplitPolygonType type of split

Default Value: siUnspecified

ImmediateMode siOperationMode Specifies whether or not the operator should be immediately frozen.

Default Value: siPersistentOperation

NewPointID Integer ID of the new point created at (TanX,TanY) by the operation (-1 is returned if SplitPolygonType is "siDiamond..." as no point is created)

Examples

1. VBScript Example

NewScene

CreatePrim "Cylinder", "MeshSurface" 

SplitPolygon "cylinder.poly[12-36]", 0.0, 0.0, 0.5, siByTheVertices, True

2. VBScript Example

' Create a grid and split some polygons by the Edges MidPoints 

NewScene

CreatePrim "Grid", "MeshSurface"

SetValue "grid.polymsh.geom.subdivu", 4

SetValue "grid.polymsh.geom.subdivv", 4

SplitPolygon "grid.poly[0,2,5,7,8,10,13,15]", 0.0, 0.0, 0.5, siByTheEdgesMidPoints, True

See Also

ApplyTopoOp