## AddPointInteriorToPolygon

### Introduced

v4.0

### Description

Adds a point inside a given polygon. The point is defined with barycentric coordinates using three nodes (called offsets) of the polygon each one with a proper weight:
Pt = Weight1 * Polygon.Node(Offset1).Pos
+ Weight2 * Polygon.Node(Offset2).Pos
+ Weight3 * Polygon.Node(Offset3).Pos
The final point can be lifted above or below the polygon plane using the height parameter.
Note: It only makes sense to call this command after starting a new edge sequence using the AddEdge command and completing the final edge next by calling the command TerminateAddEdgeWithInteriorPoints (with possibly many interior points so created).

### Scripting Syntax

    AddPointInteriorToPolygon( Operator, PolygonID, FirstOffset, SecondOffset, ThirdOffset, FirstWeight, SecondWeight, ThirdWeight, [Height] );

### Parameters

Parameter | Type | Description
--- | --- | ---
Operator | String | Specifies the add-edge operator used to create the final edge sequence.
PolygonID | Integer | ID of the polygon
FirstOffset | Integer | Index where to find the barycentric first point in the polygon's list of points.
SecondOffset | Integer | Index where to find the barycentric second point in the polygon's list of points.
ThirdOffset | Integer | Index where to find the barycentric third point in the polygon's list of points.
FirstWeight | Double | Barycentric weight of the first point.
SecondWeight | Double | Barycentric weight of the second point.
ThirdWeight | Double | Barycentric weight of the third point.
Height | Double | Height above or below the polygon plane. Default Value: 0.0

### Examples

#### VBScript Example

    '

    ' The following example uses add-edge and at some point adds a

    ' point in the interior of a quad. The edge is terminated using

    ' TerminateAddEdgeWithInteriorPoints.

    '

    NewScene , false

    CreatePrim "Grid", "MeshSurface"

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

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

    SplitEdge "grid.edge[1]", 64.9271844660194, False, True, siPersistentOperation

    ApplyOp "AddEdge", "grid.pnt[LAST];grid.edge[3];grid.poly[0]"

    AddPointInteriorToPolygon "grid.polymsh.addedgeop", 0, 0, 1, 2, _

    	0.394370594438662, 0.102825667243581, 0.502803738317757

    TerminateAddEdgeWithInteriorPoints "grid.polymsh.addedgeop", 0, 3, 27.7912621359223

### See Also

ApplyOp ConnectNewPolygonToEdge ConnectNewPolygonToPoint AddPointToNewPolygon RemovePointFromPolygon RemoveLastPointInteriorToPolygon TerminateAddEdgeWithInteriorPoints SnapOffsetToPointForSlicePolygons