meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
en:design_guide_cylinder [2020/11/28 02:41] Admin |
en:design_guide_cylinder [2022/04/13 06:54] (current) rozek included "require" statements |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== Cylinder ==== | ==== Cylinder ==== | ||
| - | A three dimensional shape with two flat ends that are circular | + | A three dimensional shape with two flat ends that are circular. The cylinder has the same cross-section from one end to the other, extending about the Z axis. |
| {{ : | {{ : | ||
| Line 7: | Line 7: | ||
| // | // | ||
| - | The following show examples of creating cylinders. The radius specifies the size about the axis. The resolution option determines | + | The '' |
| - | If necessary then additional options can be provide for start and end points of the axis. As well as start and end radius. | + | Defaults: |
| + | * radius | ||
| + | * height : 2 | ||
| + | * center : [0, 0, 0] | ||
| + | * segments : 32 | ||
| - | //Note: See the start of 3D Primitives for information about the resolution of three dimensional shapes.// | + | <code javascript> |
| + | const { cylinder } = require(' | ||
| - | Defaults: | + | const myshape = cylinder({radius: |
| - | * radius : 1 or | + | const myshape = cylinder({radius: 5, height: 10, center: [5, 5, 5], segments: 64}) |
| - | * radiusStart | + | </ |
| - | * radiusEnd | + | |
| - | * axis : | + | |
| - | * start : [0,0,-1], end : [0,0,1] | + | |
| - | * resolution : Resolution3D (12) | + | |
| - | //Note: A start or end radius | + | |
| + | === Elliptical Cylinder === | ||
| + | |||
| + | {{ :wiki: | ||
| + | |||
| + | Various cylindrical shapes can be created using the elliptical cylinder, including cylinders with changing | ||
| + | |||
| + | Defaults: | ||
| + | * height : 2 | ||
| + | * startRadius : [1, 1] | ||
| + | * endRadius : [1, 1] | ||
| + | * center : [0, 0, 0] | ||
| + | * segments : 32 | ||
| + | * startAngle : 0 | ||
| + | * endAngle : PI * 2 | ||
| <code javascript> | <code javascript> | ||
| - | cylinder({r: 1, h: 10}) | + | const { cylinderElliptic |
| - | cylinder({r: 1, h: 10, center: true}) | + | |
| - | cylinder({r: | + | const myshape = cylinderElliptic({height: 2, startRadius: [10, 5], endRadius: [8, 3]}) |
| - | cylinder({r: | + | |
| - | cylinder({r1: 3, r2: 0, h: 10}) | + | |
| - | cylinder({start: | + | |
| </ | </ | ||
| - | The CSG library functions can also be used. //NOTE: Deprecated in the V2 API// | + | === Rounded Cylinder === |
| - | <code javascript> | + | {{ :wiki:jscad-roundedCylinder.png? |
| - | CSG.cylinder({ | + | |
| - | start: [0, -1, 0], | + | |
| - | end: [0, 1, 0], | + | |
| - | radius: 1, // true cylinder | + | |
| - | resolution: 16 | + | |
| - | }); | + | |
| - | CSG.cylinder({ | + | Cylinders can be created with rounded ends by specifying '' |
| - | | + | |
| - | | + | Defaults: |
| - | | + | |
| - | | + | * height : 2 |
| - | | + | * roundRadius: |
| - | }); | + | |
| + | | ||
| + | |||
| + | <code javascript> | ||
| + | const { roundedCylinder | ||
| - | CSG.roundedCylinder({ | + | const myshape = roundedCylinder({radius: 5, height: 10, roundRadius: 0.5}) |
| - | start: [0, -1, 0], | + | const myshape = roundedCylinder({radius: |
| - | end: [0, 1, 0], | + | |
| - | radius: 1, | + | |
| - | resolution: 16 | + | |
| - | }); | + | |
| </ | </ | ||