meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
en:design_guide_rectangular_extrude [2020/12/05 05:22] JSCAD Editor |
en:design_guide_rectangular_extrude [2020/12/08 06:55] (current) JSCAD Editor |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== Rectangular Extrude ==== | ==== Rectangular Extrude ==== | ||
| - | {{ : | + | {{ : |
| 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(), | + | The two dimensional shape is extruded to the '' |
| - | * w: width (default: 1), | + | |
| - | * h: height | + | |
| - | * fn: resolution (default: 8), and | + | |
| - | * closed: whether path is closed or not (default: false) | + | |
| - | <code javascript> | + | //Note: The extrusion process uses Linear Extrude underneath, so the extrusion can be rotated '' |
| - | rectangular_extrude([ [10,10], [-10,10], [-20,0], [-10,-10], [10,-10] ], | + | |
| - | {w: 1, h: 3, closed: true}); | + | |
| - | </code> | + | |
| - | or more low-level | + | Defaults: |
| - | * width of the extrusion, in the z=0 plane | + | * size: 1 (width of rectangle during |
| - | * height | + | * height : 1 |
| - | * resolution, number of segments per 360 degrees for the curve in a corner | + | |
| - | * roundEnds: if 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 |
| - | var path = new CSG.Path2D([ [10,10], [-10,10], [-20,0], [-10,-10], [10,-10] ], / | + | const myshape |
| - | var csg = path.rectangularExtrude(3, 4, 16, true); // w, h, resolution, roundEnds | + | |
| - | return csg; | + | |
| </ | </ | ||