@@ -1276,8 +1276,10 @@ Like all shape nodes, has no size, fill, or stroke by default unless you set one
1276
1276
``` js
1277
1277
// Add a red triangle to the document and select it
1278
1278
var polygon = new Polygon ();
1279
- polygon .cornerCount = 3 ;
1280
- polygon .width = 50 ;
1279
+ polygon .cornerCount = 5 ;
1280
+ polygon .starRatio = 55 ;
1281
+ polygon .setAllCornerRadii (15 );
1282
+ polygon .width = 100 ;
1281
1283
polygon .height = 100 ;
1282
1284
polygon .fill = new Color (" red" );
1283
1285
selection .insertionParent .addChild (polygon);
@@ -1291,6 +1293,7 @@ selection.items = [polygon];
1291
1293
* [ .cornerRadii] ( #Polygon-cornerRadii ) : <code >!Array< ; number> ; </code >
1292
1294
* [ .hasRoundedCorners] ( #Polygon-hasRoundedCorners ) : <code >boolean</code >
1293
1295
* [ .setAllCornerRadii(radius)] ( #Polygon-setAllCornerRadii )
1296
+ * [ .starRatio] ( #Polygon-starRatio ) : <code >number</code >
1294
1297
1295
1298
1296
1299
* * *
@@ -1363,6 +1366,24 @@ Set the corner radius of all corners of the Polygon to the same value.
1363
1366
1364
1367
* * *
1365
1368
1369
+ <a name =" Polygon-starRatio " ></a >
1370
+
1371
+ ### polygon.starRatio : <code >number</code > (number >= 1 && <= 100)
1372
+ The star ratio percentage.
1373
+
1374
+ Ratio, expressed as a percentage, used to determine how much of a star is this polygon,
1375
+ with values ranging between 1 and 100 percent.
1376
+ A value of 100 percent gives us a star that looks like a convex polygon, while a value of
1377
+ 1 percent should give us something similar to lines drawn from the center.
1378
+
1379
+ The star inner vertices are placed on a circle. The ratio is the percentage of that circle
1380
+ from the inscribed circle of the polygon formed from the star outer vertices.
1381
+
1382
+ ** Kind** : instance property of [ <code >Polygon</code >] ( #Polygon )
1383
+ ** Since** : XD 26
1384
+
1385
+ * * *
1386
+
1366
1387
1367
1388
<a name =" Line " ></a >
1368
1389
0 commit comments