User Tools


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
design_guide_3d_primitives [2018/02/12 14:16]
z3dev
design_guide_3d_primitives [2018/04/14 03:12] (current)
z3dev [3D Primitives]
Line 1: Line 1:
 ===== 3D Primitives ===== ===== 3D Primitives =====
  
-Introduction+‘3D’ stands for three (3) dimensional. A 3D primitive is any shape that has three dimensions, which are often called width, depth, and height (or X, Y, Z.) 3D shapes have a known volume if closed. 
 + 
 +{{ :​wiki:​mathisfun-3d.svg?​nolink&​145 |}} 
 + 
 +The mathematical study of 3D shapes and dimensions is called [[https://​simple.m.wikipedia.org/​wiki/​Solid_geometry|solid geometry]].
  
 ==== Resolution of Shapes ==== ==== Resolution of Shapes ====
Line 12: Line 16:
  
 If the ''​resolution''​ option is omitted, the following resolution is used. If the ''​resolution''​ option is omitted, the following resolution is used.
-  * CSG.defaultResolution3D+  * CSG.defaultResolution3D ​= 12
  
 OpenSCAD like functions support the ''​fn''​ parameter, which is the same as ''​resolution''​. OpenSCAD like functions support the ''​fn''​ parameter, which is the same as ''​resolution''​.
Line 20: Line 24:
 {{page>​design_guide_sphere}} {{page>​design_guide_sphere}}
  
-==== Cylinder ==== +{{page>​design_guide_cylinder}}
- +
-Cylinders and cones can be created like this: +
- +
-<code javascript>​ +
-cylinder({r: 1, h: 10});                 // openscad like +
-cylinder({d: 1, h: 10}); +
-cylinder({r:​ 1, h: 10, center: true});   // default: center:​false +
-cylinder({r:​ 1, h: 10, center: [true, true, false]}); ​ // individual x,y,z center flags +
-cylinder({r:​ 1, h: 10, round: true}); +
-cylinder({r1:​ 3, r2: 0, h: 10}); +
-cylinder({d1:​ 1, d2: 0.5, h: 10}); +
-cylinder({start:​ [0,0,0], end: [0,0,10], r1: 1, r2: 2, fn: 50}); +
- +
-CSG.cylinder({ ​                     //using the CSG primitives +
-  start: [0, -1, 0], +
-  end: [0, 1, 0], +
-  radius: 1,                        // true cylinder +
-  resolution: 16 +
-}); +
-CSG.cylinder({ +
-  start: [0, -1, 0], +
-  end: [0, 1, 0], +
-  radiusStart:​ 1,                   // start- and end radius defined, partial cones +
-  radiusEnd: 2, +
-  resolution: 16 +
-}); +
-CSG.roundedCylinder({ ​              // and its rounded version +
-  start: [0, -1, 0], +
-  end: [0, 1, 0], +
-  radius: 1, +
-  resolution: 16 +
-}); +
-</​code>​+
  
 {{page>​design_guide_torus}} {{page>​design_guide_torus}}
 +
 +{{page>​design_guide_polyhedron}}