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:design_guide_linear_extrude [2020/11/28 03:06]
JSCAD Editor created
en:design_guide_linear_extrude [2022/05/02 08:02] (current)
JSCAD Editor
Line 1: Line 1:
-===== Extrusions =====+==== Linear Extrude ====
  
-{{page>design_guide_linear_extrude}}+{{ :wiki:jscad-extrudelinear.png?nolink | Extrude Linear}}
  
-{{page>design_guide_rectangular_extrude}}+Extrude a two dimensional shape in an upward linear direction.
  
-{{page>design_guide_rotate_extrude}}jag@development:~/dev/jscad/dataV1/pages$ cat design_guide_linear_extrude.txt +The two dimensional shape is extruded to the ''height'', upwards along the Z axis. The two dimensional shape is be rotated ''twistAngle'' about the Z axis during the extrusion, creating ''twistSteps'' during the extrusion.
-==== Linear Extrude ====+
  
-Extruding 2D shapes into 3D, given heighttwist (degrees), and slices (if twist is made):+//Note: The two dimensional shape can be placed anywhere to create various twisted shapes.// 
 + 
 +Defaults: 
 +  * height : 1 
 +  * twist : 0 
 +  * twistSteps : 1 (NoteIncreasing 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: 
- 
-<code javascript> 
-// CAG built in method 
-var c = CAG.circle({radius: 3}); 
-extruded = c.extrude({offset: [0,0,10], twistangle: 360, twiststeps: 100}); 
-</code>