@@ -1276,8 +1276,10 @@ Like all shape nodes, has no size, fill, or stroke by default unless you set one
12761276``` js
12771277// Add a red triangle to the document and select it
12781278var 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 ;
12811283polygon .height = 100 ;
12821284polygon .fill = new Color (" red" );
12831285selection .insertionParent .addChild (polygon);
@@ -1291,6 +1293,7 @@ selection.items = [polygon];
12911293 * [ .cornerRadii] ( #Polygon-cornerRadii ) : <code >!Array< ; number> ; </code >
12921294 * [ .hasRoundedCorners] ( #Polygon-hasRoundedCorners ) : <code >boolean</code >
12931295 * [ .setAllCornerRadii(radius)] ( #Polygon-setAllCornerRadii )
1296+ * [ .starRatio] ( #Polygon-starRatio ) : <code >number</code >
12941297
12951298
12961299* * *
@@ -1363,6 +1366,24 @@ Set the corner radius of all corners of the Polygon to the same value.
13631366
13641367* * *
13651368
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+
13661387
13671388<a name =" Line " ></a >
13681389
0 commit comments