Usage (signatures)
board.create('polygonalchain', [vertices]);
Parameters
| Name | Type | Description |
|---|---|---|
vertices |
Array | The polygon's vertices. |
Example
var attr = {
snapToGrid: true
},
p = [];
p.push(board.create('point', [-4, 0], attr));
p.push(board.create('point', [-1, -3], attr));
p.push(board.create('point', [0, 2], attr));
p.push(board.create('point', [2, 1], attr));
p.push(board.create('point', [4, -2], attr));
var chain = board.create('polygonalchain', p, {borders: {strokeWidth: 3}});
board.create('polygonalchain', [pol, t]);
Additionally, a polygonal chain can be created by providing a polygonal chain and a transformation (or an array of transformations). The result is a polygonal chain which is the transformation of the supplied polygonal chain.
Parameters
| Name | Type | Description |
|---|---|---|
pol |
PolygonalChain | |
t |
Transformation |
Attributes
Own
none
Inherited
Members
Own
none
Inherited
Methods
Own
none
Inherited
Events
Own
none
Inherited
Throws
-
If the element cannot be constructed with the given parent objects an exception is thrown.
- Type
- Exception
Details
- Type
- Polygon
- Source
- base/polygon.js, line 1412