meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
en:design_guide_polygon [2021/05/12 08:18]
JSCAD Editor
en:design_guide_polygon [2022/05/03 06:53] (current)
JSCAD Editor
Line 7: Line 7:
 //[[http://www.mathsisfun.com/geometry/polygons.html|Learn about polygons at MathIsFun.com]]// //[[http://www.mathsisfun.com/geometry/polygons.html|Learn about polygons at MathIsFun.com]]//
  
-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:math_guide_orientation|Orientation]].+//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:math_guide_orientation|Orientation]].// 
 + 
 +//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 15: Line 17:
  
 <code javascript> <code javascript>
 +const { polygon } = require('@jscad/modeling').primitives
 +
 const myshape = polygon({ points: [ [0,0],[3,0],[3,3] ] }) const myshape = polygon({ points: [ [0,0],[3,0],[3,3] ] })
 </code> </code>