meta data for this page
  •  
Your (re)login has failed.

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_rectangular_extrude [2020/12/05 05:21]
JSCAD Editor
en:design_guide_rectangular_extrude [2020/12/08 06:55] (current)
JSCAD Editor
Line 1: Line 1:
 ==== Rectangular Extrude ==== ==== Rectangular Extrude ====
 +
 +{{ :wiki:jscad-extruderectangular.png?nolink | Extrude Rectangular}}
  
 Extrude a rectangle (upright, perpendicular) along the outlines of the two dimensional shape. Extrude a rectangle (upright, perpendicular) along the outlines of the two dimensional shape.
  
-Simplified (openscad like, even though OpenSCAD doesn't provide this) via rectangular_extrude(), where as  +The two dimensional shape is extruded to the ''height''upwards along the Z axis.
-  * w: width (default: 1),  +
-  * h: height (default: 1) +
-  * fn: resolution (default: 8), and  +
-  * closed: whether path is closed or not (default: false)+
  
-<code javascript> +//NoteThe extrusion process uses Linear Extrude underneathso the extrusion can be rotated ''twistAngle'' about the Z axis during the extrusioncreating ''twistSteps'' during the extrusion.//
-rectangular_extrude([ [10,10], [-10,10], [-20,0], [-10,-10], [10,-10] ],  // path is an array of 2d coords +
-    {w1h: 3closed: true}); +
-</code>+
  
-or more low-level  via rectangularExtrude(), with following unnamed variables+Defaults
-  * width of the extrusion, in the z=0 plane +  * size: 1 (width of rectangle during extrusion) 
-  * height of the extrusion in the z direction +  * height : 1
-  * resolution, number of segments per 360 degrees for the curve in a corner +
-  * roundEndsif true, the ends of the polygon will be rounded, otherwise they will be flat+
  
 <code javascript> <code javascript>
-// first creating a 2D path, and then extrude it +const myshape extrudeRectangular({height: radiusZ * 2size: 0.25}shape1
-var path new CSG.Path2D([ [10,10], [-10,10], [-20,0][-10,-10], [10,-10] ], /*closed=*/true); +const myshape extrudeRectangular({height: radiusZ * 2, size: 3, twistAngle: Math.PI / 2twistSteps: 10}shape2)
-var csg path.rectangularExtrude(3, 416true);   // w, h, resolution, roundEnds +
-return csg;+
 </code> </code>