[OpenSCAD] XOR

Brad Pitcher bradpitcher at gmail.com
Sun Jul 15 23:07:52 CEST 2012


This openscad implementation causes non 2-manifold errors for me, with
something as simple as two intersecting spheres:

 xor() {

sphere(10);

translate([19, 0, 0]) sphere(10);

}

Do you know if this CGAL implementation would fix that problem?

On Sun, Jul 15, 2012 at 1:45 PM, Don Bright <hugh.m.bright at gmail.com> wrote:

> Johannes that is very cool,
>
> If this is needed by a lot of people maybe there could be a builtin
> 'xor' or 'symmetric_difference' function added to OpenSCAD? CGAL
> itself actually has  'symmetric difference'  code inside of it, its
> just not exposed by OpenSCAD.
>
>
> http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Boolean_set_operations_2/Chapter_main.html
>
> http://en.wikipedia.org/wiki/Symmetric_difference
>
>
> http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Nef_3/Chapter_main.html
>
> -DB
>
> On Sun, Jul 15, 2012 at 11:41 AM, Johannes Reinhardt
> <jreinhardt at ist-dein-freund.de> wrote:
> > Hi everybody,
> >
> > I just made a xor module to accompany union, intersection and
> > difference. After drawing some truth tables I figured out that the
> > difference of union and intersection should give xor, or in OpenSCAD
> > code:
> >
> > module xor(){
> >   difference(){
> >     for(i = [0 : $children - 1])
> >       child(i);
> >     intersection_for(i = [0: $children -1])
> >       child(i);
> >   }
> > }
> >
> > Maybe this is of use for someone.
> >
> > Regards
> >
> > Johannes
> >
> >
> > --
> > Johannes Reinhardt <jreinhardt at ist-dein-freund.de>
> > _______________________________________________
> > OpenSCAD mailing list
> > OpenSCAD at rocklinux.org
> > http://rocklinux.net/mailman/listinfo/openscad
> > http://openscad.org - https://flattr.com/thing/121566
> _______________________________________________
> OpenSCAD mailing list
> OpenSCAD at rocklinux.org
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rocklinux.net/pipermail/openscad/attachments/20120715/0eee2cb3/attachment.html


More information about the OpenSCAD mailing list