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:quick_reference_conversion [2020/11/28 01:51]
Admin created
en:quick_reference_conversion [2021/06/10 01:45] (current)
JSCAD Editor
Line 1: Line 1:
-===== Dimension Conversions ===== +===== Extrusions =====
-^  2D to Path Conversions +
-| var Path2DArray = 2Dshape.getOutlinePaths();  |+
  
-^  2D to 3D Extrusions +The 'extrusions' are accessed through the modeling API using the following:
-| 3DShape = 2Dshape.extrude(); **/* offset[0,0,1], twistangle: 0, twiststeps: 12 */**  | +
-| 3DShape = 2Dshape.extrude({offset: [0,0,50], twistangle: 360, twiststeps: 100}); +
-| 3DShape = 2Dshape.rotateExtrude({offset: [0,0,50], twistangle: 360, twiststeps: 100}); **/* angle: 360, resolution: 12 */**  | +
-| 3Dshape = 2Dpath.rectangularExtrude(3, 4, 16, true);   **/* w, h, resolution, round ends */**  |+
  
-^  3D to 2D Conversions  ^ +<code javascript> 
-tbw |+const { extrudeLinear, extrudeRegtangular, extrudeRotate, project  } = require('@jscad/modeling').extrusions 
 +</code> 
 + 
 +^  Extrusion of 2D Shapes  ^  Notes  ^ 
 +const newshape = extrudeLinear({height: 20, twistAngle: Math.PI, twistSteps: 20}, oldshape))  | [[https://www.openjscad.xyz/docs/module-modeling_extrusions.html#.extrudeLinear | API]]  | 
 +| const newshape = extrudeRectangular({size: 3, height: 15}, oldshape)  | [[https://www.openjscad.xyz/docs/module-modeling_extrusions.html#.extrudeRectangular | API]]  | 
 +| const newshape = extrudeRotate({startAngle: Math.PI, angle: Math.PI / 2, overflow: 'cap', segments: 64}, oldshape)  | [[https://www.openjscad.xyz/docs/module-modeling_extrusions.html#.extrudeRotate | API]]  | 
 +| const newshape = project({axis: [0, 0, 1], origin: [0, 0, 0]}, oldshape)  | [[https://www.openjscad.xyz/docs/module-modeling_extrusions.html#.project | API]]  |