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_cylinder [2020/12/03 00:33]
JSCAD Editor
en:design_guide_cylinder [2022/04/13 06:54] (current)
rozek included "require" statements
Line 16: Line 16:
  
 <code javascript> <code javascript>
 +const { cylinder } = require('@jscad/modeling').primitives
 +
 const myshape = cylinder({radius: 5, height: 10}) const myshape = cylinder({radius: 5, height: 10})
 const myshape = cylinder({radius: 5, height: 10, center: [5, 5, 5], segments: 64}) const myshape = cylinder({radius: 5, height: 10, center: [5, 5, 5], segments: 64})
Line 28: Line 30:
  
 Defaults: Defaults:
-  * radius : 1 
   * height : 2   * height : 2
-  * startRadius: [1, 1] +  * startRadius : [1, 1] 
-  * endRadius: [1, 1]+  * endRadius : [1, 1]
   * center : [0, 0, 0]   * center : [0, 0, 0]
   * segments : 32   * segments : 32
-  * startAngle: 0 +  * startAngle : 0 
-  * endAngle: PI * 2+  * endAngle : PI * 2
  
 <code javascript> <code javascript>
-let myshape = cylinderElliptic({height: 2, startRadius: [10, 5], endRadius: [8, 3]})+const { cylinderElliptic } = require('@jscad/modeling').primitives 
 + 
 +const myshape = cylinderElliptic({height: 2, startRadius: [10, 5], endRadius: [8, 3]})
 </code> </code>
  
 === Rounded Cylinder === === Rounded Cylinder ===
 +
 +{{ :wiki:jscad-roundedCylinder.png?nolink | Rounded Cylinder}}
  
 Cylinders can be created with rounded ends by specifying ''roundRadius''. Cylinders can be created with rounded ends by specifying ''roundRadius''.
Line 53: Line 58:
  
 <code javascript> <code javascript>
 +const { roundedCylinder } = require('@jscad/modeling').primitives
 +
 const myshape = roundedCylinder({radius: 5, height: 10, roundRadius: 0.5}) const myshape = roundedCylinder({radius: 5, height: 10, roundRadius: 0.5})
 const myshape = roundedCylinder({radius: 5, height: 10, roundRadius: 0.5, center: [5, 5, 5], segments: 64}) const myshape = roundedCylinder({radius: 5, height: 10, roundRadius: 0.5, center: [5, 5, 5], segments: 64})
 </code> </code>