meta data for this page
  •  

Differences

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

Link to this comparison view

Next revision
Previous revision
en:design_guide_ellipse [2020/11/28 02:52]
JSCAD Editor created
en:design_guide_ellipse [2022/04/13 07:19] (current)
rozek included "require" statements, corrected mistakes
Line 1: Line 1:
-==== Circle ====+==== Ellipse ====
  
-A two dimensional shape made by drawing a curve that is always the same distance from a center. All points are the same distance from the center.+{{ :wiki:jscad-ellipse.svg?nolink | Ellipse }}
  
-{{ :wiki:mathisfun_circle.svg?nolink&145 |Circle}} +A two dimensional shape that surrounds two focal points, such that for all points on the curve, the sum of the two distances to the focal points is a constant.
-//[[http://www.mathsisfun.com/algebra/circle-equations.html|Learn about circles at MathIsFun.com]]//+
  
-The following show examples of creating circles. The radius specifies the size. The resolution option determines the number of segments to create in 360 degrees of rotation. +The ''radius'' determines the size of the ellipsoid about X and Y axis. Ellipsoids can be created at a requested ''center''. The ''segments'' specify the number of segments to create per full rotation. 
- +
-//Note: See the start of 2D Primitives for information about the resolution of two dimensional shapes.//+
  
 Defaults: Defaults:
-  * radius : 1 +  * radius : [1, 1] 
-  * center : [0,0] +  * center : [0, 0] 
-  * resolutiondefaultResolution2D (32)+  * startAngle : 0 
 +  * endAngle : PI * 2 
 +  * segments: 32
  
 <code javascript> <code javascript>
-let c1 circle(1)  +const { ellipse } require('@jscad/modeling').primitives 
-let c2 circle({r: 2, fn:5})            // fn = number of segments to approximate the circle + 
-let c3 circle({r3, center: true})+const myshape ellipse({radius[5, 10]}) 
 +const myshape ellipse({radius[5, 10], center: [5, 5], startAngle: Math.PI / 2, endAngle: Math.PI, segments: 64})
 </code> </code>
  
-The CSG library functions can also be used. //NOTEDeprecated in the V2 API//+=== Circle === 
 + 
 +A two dimensional shape made by drawing a curve that is always the same distance from a centerAll points are the same distance from the center. 
 + 
 +{{ :wiki:jscad-circle.svg?nolink | Circle }} 
 + 
 +//[[http://www.mathsisfun.com/algebra/circle-equations.html|Learn about circles at MathIsFun.com]]// 
 + 
 +The ''radius'' specifies the size across both X and Y axis. Circles can be created at a requested ''center''. The ''segments'' specify the number of segments to create per full rotation.  
 + 
 +Defaults: 
 +  * radius : 1 
 +  * center : [0, 0] 
 +  * segments: 32
  
 <code javascript> <code javascript>
-let c4 CAG.circle({center: [0,0], radius3resolution32}) +const { circle } require('@jscad/modeling').primitives 
-</code>j+ 
 +const myshape = circle({radius: 10}) 
 +const myshape = circle({radius: 10, center: [55], startAngleMath.PI / 2, endAngle: Math.PIsegments64}) 
 +</code>