meta data for this page
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:design_guide_polygon [2020/11/28 02:53] JSCAD Editor created |
en:design_guide_polygon [2022/05/03 06:53] (current) JSCAD Editor |
||
---|---|---|---|
Line 6: | Line 6: | ||
// | // | ||
+ | |||
+ | //NOTE: The ordering of points is VERY IMPORTANT. If the polygon is going to be extruded then the points must be in counter-clockwise order, otherwise the faces of the object will be facing inwards. See [[en: | ||
+ | |||
+ | //HINT: Polygons should have a positive area.// | ||
The following show examples of creating polygons from a list of points. | The following show examples of creating polygons from a list of points. | ||
Line 13: | Line 17: | ||
<code javascript> | <code javascript> | ||
- | let p1 = polygon([ [0, | + | const { polygon |
- | let p2 = polygon({ points: [ [0, | + | |
- | </ | + | |
- | The CSG library functions can also be used. //NOTE: Deprecated in the V2 API// | + | const myshape |
- | + | ||
- | <code javascript> | + | |
- | let p3 = CAG.fromPoints([ [0,0],[5,0],[3,5],[0,5] ]) | + | |
</ | </ | ||
+ |