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/11/29 06:02]
JSCAD Editor
en:design_guide_cylinder [2022/04/13 06:54] (current)
rozek included "require" statements
Line 7: Line 7:
 //[[http://www.mathsisfun.com/geometry/cylinder.html|Learn about cylinders at MathIsFun.com]]// //[[http://www.mathsisfun.com/geometry/cylinder.html|Learn about cylinders at MathIsFun.com]]//
  
-The 'radius' specifies the circular size about the Z axis, while the 'height' specifies the size. Cylinders can be created at a requested 'center'. The 'segments' specify the number of segments to create per full rotation. +The ''radius'' specifies the circular size about the Z axis, while the ''height'' specifies the size. Cylinders can be created at a requested ''center''. The ''segments'' specify the number of segments to create per full rotation. 
  
 Defaults: Defaults:
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 21: Line 23:
  
  
-=== Elliptical Cylinders ===+=== Elliptical Cylinder ===
  
 +{{ :wiki:jscad-cylinderElliptic.png?nolink | Cylinder Elliptic}}
  
 +Various cylindrical shapes can be created using the elliptical cylinder, including cylinders with changing radius (cones).
 +
 +Defaults:
 +  * height : 2
 +  * startRadius : [1, 1]
 +  * endRadius : [1, 1]
 +  * center : [0, 0, 0]
 +  * segments : 32
 +  * startAngle : 0
 +  * endAngle : PI * 2
 +
 +<code javascript>
 +const { cylinderElliptic } = require('@jscad/modeling').primitives
 +
 +const myshape = cylinderElliptic({height: 2, startRadius: [10, 5], endRadius: [8, 3]})
 +</code>
 +
 +=== Rounded Cylinder ===
 +
 +{{ :wiki:jscad-roundedCylinder.png?nolink | Rounded Cylinder}}
 +
 +Cylinders can be created with rounded ends by specifying ''roundRadius''.
 +
 +Defaults:
 +  * radius : 1
 +  * height : 2
 +  * roundRadius: 0.5
 +  * center : [0, 0, 0]
 +  * segments : 32
 +
 +<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, center: [5, 5, 5], segments: 64})
 +</code>