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_linear_extrude [2020/12/05 04:58]
JSCAD Editor
en:design_guide_linear_extrude [2022/05/02 08:02] (current)
JSCAD Editor
Line 1: Line 1:
 ==== Linear Extrude ==== ==== Linear Extrude ====
 +
 +{{ :wiki:jscad-extrudelinear.png?nolink | Extrude Linear}}
  
 Extrude a two dimensional shape in an upward linear direction. Extrude a two dimensional shape in an upward linear direction.
Line 10: Line 12:
   * height : 1   * height : 1
   * twist : 0   * twist : 0
-  * twistSteps : 1 +  * twistSteps : 1 (Note: Increasing the value of twistSteps improves the overall shape.)
  
 <code javascript> <code javascript>
-linear_extrude(height: 10 }, square()); +const extrudeLinear = require('@jscad/modeling').extrusions
-linear_extrude({ height: 10, twist: 90 }, square([1,2])); +
-linear_extrude({ height: 10, twist: 360, slices: 50}, circle().translate([1,0,0]) );+
  
-linear_extrude({ height: 10, center: true, twist: 360, slices: 50}, translate([2,0,0], square([1,2])) ); +const myshape = extrudeLinear({height: radiusZ * 2}, shape1
-linear_extrude({ height: 10centertruetwist360, slices: 50}, square([1,2]).translate([2,0,0]) );+const myshape = extrudeLinear({height: radiusZ * 2twistAngleMath.PI / 2twistSteps10}, shape2)
 </code> </code>
- 
-Linear extrusion of 2D shape, with optional twist. The 2d shape is placed in in z=0 plane and extruded into direction offset (a CSG.Vector3D). The final face is rotated twistangle degrees. Rotation is done around the origin of the 2D shape (i.e. x=0, y=0) twiststeps determines the resolution of the twist (should be >= 1), returns a CSG object: