[OpenSCAD] This could be interesting...
nop head
nop.head at gmail.com
Wed Nov 2 16:52:35 CET 2011
Can you start with an arbitrary large cube and create each facet by
differencing another large cube positioned to slice it off?
On 2 November 2011 15:44, Dan Zuras 3D <threedee at nonabelian.com> wrote:
>
>
> Andrew,
>
> Your suggestion is interesting. Indeed, my original code called
> for a 2D shape that coincided with the Y-axis & was rotate_extruded
> from there. Marius said that the bug I triggered involved just
> that problem. So I introduced the overlap (I believe) on his
> suggestion & here we are today. I'm not quite sure I completely
> understand your code snippet but it may be a bit complex for my
> actual application.
>
> You see, the code snippets I have been showing here are greatly
> simplified from the actual code which involves differences with
> many circles. I simplified it on the grounds that the simple
> code still exhibits the problem & is easier to read.
>
> However, I fear if I were to try your approach it would involve
> a great many ANDs, ORs, & differences, each of which would be
> far more involved than I had hoped.
>
> Still, your approach looks interesting. I will cogitate on it
> to see if I can solve the original problem in a similar way.
>
> Thanks for the suggestion,
>
>
> Dan
>
>
> > From: openscad-request at rocklinux.org
> > Subject: OpenSCAD Digest, Vol 24, Issue 4
> > To: openscad at rocklinux.org
> > Date: Wed, 02 Nov 2011 16:18:15 +0100
> >
> > . . .
> >
> > Today's Topics:
> >
> > 1. . . .
> > 2. . . .
> > 3. . . .
> > 4. . . .
> > 5. . . .
> > 6. . . .
> > 7. Re: Still lost on my journey... (Andrew Plumb)
> > 8. . . .
> > 9. . . .
> >
> >
> > ----------------------------------------------------------------------
> >
> > . . .
> >
> > Message: 7
> > Date: Wed, 2 Nov 2011 10:51:55 -0400
> > From: Andrew Plumb <andrew at plumb.org>
> > Subject: Re: [OpenSCAD] Still lost on my journey...
> > To: openscad at rocklinux.org
> > Message-ID: <04255B7C-FB2E-4E53-A586-D3F8ADC53C82 at plumb.org>
> > Content-Type: text/plain; charset=us-ascii
> >
> > Hey Dan,
> >
> > You can work around the problem by intersection-masking the two parts of
> the 2D shape at the y-axis and unioning the rotate_extruded parts. Here's
> how I'd tackle it with an "operator" module:
> >
> > --snip--
> >
> > module unitCircle() circle(1,$fn=400);
> > module unitSquare() square([1,1],center=true);
> >
> > module rotate_extrude_masked(mask_window_l=4,convexity=1,fn=5) {
> > union() for(i=[0:$children-1]) {
> > rotate_extrude(convexity=convexity,$fn=fn) render() intersection() {
> > child(i);
> > translate([0,-mask_window_l/2])
> square([mask_window_l,mask_window_l],center=false);
> > }
> > rotate_extrude(convexity=convexity,$fn=fn) render() intersection() {
> > child(i);
> > mirror([0,1]) translate([0,-mask_window_l/2])
> square([mask_window_l,mask_window_l],center=false);
> > }
> > }
> > }
> >
> > translate([0,0,25]) scale([25,25,25*sqrt(2)])
> > rotate_extrude_masked(mask_window_l=4,convexity=1,fn=5)
> > translate([1/2,0]) scale([2,sqrt(2)]) unitSquare();
> >
> > --end-snip--
> >
> > Just set the "mask_window_l" variable to be "sufficiently large" to
> enclose all your pre-extruded 2D shapes.
> >
> > Aside: Out of habit, I limit my 2D operations (like translate(),
> scale(), rotate(), etc) to 2D so I can keep track of when I'm in 2D vs 3D
> operation space.
> >
> > Andrew.
> >
> _______________________________________________
> OpenSCAD mailing list
> OpenSCAD at rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20111102/12923a7b/attachment.html
More information about the OpenSCAD
mailing list