[OpenSCAD] partial rotate_extrude
marius at kintel.net
Thu Feb 23 12:45:59 CET 2012
On Feb 23, 2012, at 12:09 PM, Gordon Wrigley wrote:
> It would be very handy for the project I'm currently working on if rotate_extrude could be limited to a portion of the full circle. So in an attempt to realize that I've gone digging around in the code. I found the rotateDxfData function and "improved" it to only extrude part way round. I also found the dxf_tesselate function which is used to cap the ends of the linear extrusions. However to cap the rotate extrusion I need to rotate and re-position the caps beyond what is provided by the dxf_tesselate function. Does anyone have any pointers on how best to achieve that?
Hi and thanks for looking into this!
This has been on the wishlist for a while; TODO.txt:
- rotate_extrude(): Allow for specification of start/stop/sweep angle?
Tessellation of the endcaps should already be done by the 2D polygon tessellation, so if you use the connectivity from that one, you won't have to retessellate.
Note one particular weakness of rotate_extrude() module:
It rotates around it's own Y axis, so if the 2D object intersects the Y axis, your get a self-intersecting volume. This is one of the reasons why I have postponed looking at this - we should look at how this is done other places and see how to best do it. One option is always to rename the module and rewrite it, and keep the old for backwards compatibility.
Also note the "hollow donut problem":
When extruding a 2D CSG tree (e.g. a polygon with a hole), the hole
information is lost when performing the extrusion. For linear
extrusions, this has only a minor visual impact, but for rotate
extrusion, the resulting CGAL models will lose the hole. The OpenCSG
rendering keeps the hole, but renders slightly incorrect.
More information about the OpenSCAD