2020.12-RC2 bogus model does not give CGAL error

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

2020.12-RC2 bogus model does not give CGAL error

adrianv
I wrote the code below to help a user on another thread, but I noticed a
weird thing.  With the parameters below, the sweep gives a bad polyhedron
with self-intersections.  And yet, with the RC I do not get a CGAL error, at
least under Linux.   With 2019.05 I do get a CGAL error, but under the RC:

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
Geometries in cache: 7
Geometry cache size in bytes: 1662680
CGAL Polyhedrons in cache: 0
CGAL cache size in bytes: 0
Total rendering time: 0:00:00.582
   Top level object is a list of objects:
   Objects:    2
Rendering finished.


include<BOSL2/std.scad>
include<BOSL2/skin.scad>

$fn=16;
ofs = 1;
r=4;
number=5;
radius=1.4;  

path = [for(i=[0:2:359]) (r+ofs*sin(number*i))*[cos(i),sin(i)]];
path_sweep(circle(r=radius), path, closed=true);
cube(8);


I've also noticed that the RC doesn't always print blank lines before
starting a new computation, which can make it hard to read the output.  




--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: 2020.12-RC2 bogus model does not give CGAL error

MichaelAtOz
Administrator
Windows 7, I get CGAL errors on both 2019.05 & RC2.

I get different console output.
On 2019.05, similar to Adrian's, but with the CGAL error after 'Rendering Polygon Mesh using
CGAL...'.

RC2 is truncated:

Parsing design (AST generation)...
Compiling design (CSG Tree generation)...
Rendering Polygon Mesh using CGAL...
ERROR: CGAL error in CGALUtils::applyUnion3D: CGAL ERROR: assertion violation! Expr:
G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1) File:
/mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_overlayer.h Line: 303, location
unknown
UI-WARNING: No top level geometry to render location unknown

i.e no cache stats or time.

Adrian, see https://github.com/openscad/openscad/issues/3517 
Did you use a snapshot to test Lazy-Union?

Wrap the path_sweep & cube in a union.

> -----Original Message-----
> From: Discuss [mailto:[hidden email]] On Behalf Of adrianv
> Sent: Sat, 12 Dec 2020 12:00
> To: [hidden email]
> Subject: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error
>
> I wrote the code below to help a user on another thread, but I noticed a
> weird thing.  With the parameters below, the sweep gives a bad polyhedron
> with self-intersections.  And yet, with the RC I do not get a CGAL error, at
> least under Linux.   With 2019.05 I do get a CGAL error, but under the RC:
>
> Parsing design (AST generation)...
> Compiling design (CSG Tree generation)...
> Rendering Polygon Mesh using CGAL...
> Geometries in cache: 7
> Geometry cache size in bytes: 1662680
> CGAL Polyhedrons in cache: 0
> CGAL cache size in bytes: 0
> Total rendering time: 0:00:00.582
>    Top level object is a list of objects:
>    Objects:    2
> Rendering finished.
>
>
> include<BOSL2/std.scad>
> include<BOSL2/skin.scad>
>
> $fn=16;
> ofs = 1;
> r=4;
> number=5;
> radius=1.4;
>
> path = [for(i=[0:2:359]) (r+ofs*sin(number*i))*[cos(i),sin(i)]];
> path_sweep(circle(r=radius), path, closed=true);
> cube(8);
>
>
> I've also noticed that the RC doesn't always print blank lines before
> starting a new computation, which can make it hard to read the output.
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


--
This email has been checked for viruses by AVG.
https://www.avg.com


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain;
to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.
Reply | Threaded
Open this post in threaded view
|

Re: 2020.12-RC2 bogus model does not give CGAL error

adrianv
I didn't even think of possible lazy union here.  I know that lazy union is
enabled for my RC---I previously tested this.  And yes, I did turn it on in
a snapshot, so that seems to explain why.  

I wrapped with a union() and then I get a CGAL error as expected.  

What happens with lazy union if you don't union the top level items?  I took
my bad (?) file (without the top level union) and saved an STL and my slicer
seemed happy.  (But I don't have the various mesh analysis tools everybody
uses to figure out just how bad the STL might be.  Maybe PrusaSlicer is
really good at repairing/interpreting bad inputs.)  


MichaelAtOz wrote

> Windows 7, I get CGAL errors on both 2019.05 & RC2.
>
> I get different console output.
> On 2019.05, similar to Adrian's, but with the CGAL error after 'Rendering
> Polygon Mesh using
> CGAL...'.
>
> RC2 is truncated:
>
> Parsing design (AST generation)...
> Compiling design (CSG Tree generation)...
> Rendering Polygon Mesh using CGAL...
> ERROR: CGAL error in CGALUtils::applyUnion3D: CGAL ERROR: assertion
> violation! Expr:
> G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1) File:
> /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_overlayer.h
> Line: 303, location
> unknown
> UI-WARNING: No top level geometry to render location unknown
>
> i.e no cache stats or time.
>
> Adrian, see https://github.com/openscad/openscad/issues/3517 
> Did you use a snapshot to test Lazy-Union?
>
> Wrap the path_sweep & cube in a union.
>
>> -----Original Message-----
>> From: Discuss [mailto:

> discuss-bounces@.openscad

> ] On Behalf Of adrianv
>> Sent: Sat, 12 Dec 2020 12:00
>> To:

> discuss@.openscad

>> Subject: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error
>>
>> I wrote the code below to help a user on another thread, but I noticed a
>> weird thing.  With the parameters below, the sweep gives a bad polyhedron
>> with self-intersections.  And yet, with the RC I do not get a CGAL error,
>> at
>> least under Linux.   With 2019.05 I do get a CGAL error, but under the
>> RC:
>>
>> Parsing design (AST generation)...
>> Compiling design (CSG Tree generation)...
>> Rendering Polygon Mesh using CGAL...
>> Geometries in cache: 7
>> Geometry cache size in bytes: 1662680
>> CGAL Polyhedrons in cache: 0
>> CGAL cache size in bytes: 0
>> Total rendering time: 0:00:00.582
>>    Top level object is a list of objects:
>>    Objects:    2
>> Rendering finished.
>>
>>
>> include&lt;BOSL2/std.scad&gt;
>> include&lt;BOSL2/skin.scad&gt;
>>
>> $fn=16;
>> ofs = 1;
>> r=4;
>> number=5;
>> radius=1.4;
>>
>> path = [for(i=[0:2:359]) (r+ofs*sin(number*i))*[cos(i),sin(i)]];
>> path_sweep(circle(r=radius), path, closed=true);
>> cube(8);
>>
>>
>> I've also noticed that the RC doesn't always print blank lines before
>> starting a new computation, which can make it hard to read the output.
>>
>>
>>
>>
>> --
>> Sent from: http://forum.openscad.org/
>>
>> _______________________________________________
>> OpenSCAD mailing list
>>

> Discuss@.openscad

>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
>
> --
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
>
> _______________________________________________
> OpenSCAD mailing list

> Discuss@.openscad

> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: 2020.12-RC2 bogus model does not give CGAL error

MichaelAtOz
Administrator

> What happens with lazy union if you don't union the top level items?

 

It does not do CSG so all top level objects are fully present.

 

i.e Cut in half to see internals.

 

 

With a union() the cube would be empty, and cube bits would not be inside the sweep'ed part.

 

BTW, the sweep has self-intersections.

 

 

 

 

 

 

> -----Original Message-----

> From: Adrian Mariano [mailto:[hidden email]]

> Sent: Sat, 12 Dec 2020 14:47

> To: MichaelAtOz

> Subject: Re: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error

>

> STL attached.

>

> It seems like a big gotcha for lazy union if forgetting to wrap your

> top level in union() results in a bad STL output without a warning.

>

> On Sat, Dec 12, 2020 at 02:39:46PM +1100, MichaelAtOz wrote:

> > (not posted to mailing-list)

> >

> > Adrian,

> >

> > Send me the STL if you want me to have a look at it.

> >

> > Michael

> >

> > > -----Original Message-----

> > > From: Discuss [mailto:[hidden email]] On Behalf Of adrianv

> > > Sent: Sat, 12 Dec 2020 14:25

> > > To: [hidden email]

> > > Subject: Re: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error

> > >

> > > I didn't even think of possible lazy union here.  I know that lazy union is

> > > enabled for my RC---I previously tested this.  And yes, I did turn it on in

> > > a snapshot, so that seems to explain why.

> > >

> > > I wrapped with a union() and then I get a CGAL error as expected.

> > >

> > > What happens with lazy union if you don't union the top level items?  I took

> > > my bad (?) file (without the top level union) and saved an STL and my slicer

> > > seemed happy.  (But I don't have the various mesh analysis tools everybody

> > > uses to figure out just how bad the STL might be.  Maybe PrusaSlicer is

> > > really good at repairing/interpreting bad inputs.)

> > >

> > >

> > > MichaelAtOz wrote

> > > > Windows 7, I get CGAL errors on both 2019.05 & RC2.

> > > >

> > > > I get different console output.

> > > > On 2019.05, similar to Adrian's, but with the CGAL error after 'Rendering

> > > > Polygon Mesh using

> > > > CGAL...'.

> > > >

> > > > RC2 is truncated:

> > > >

> > > > Parsing design (AST generation)...

> > > > Compiling design (CSG Tree generation)...

> > > > Rendering Polygon Mesh using CGAL...

> > > > ERROR: CGAL error in CGALUtils::applyUnion3D: CGAL ERROR: assertion

> > > > violation! Expr:

> > > > G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1) File:

> > > > /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_overlayer.h

> > > > Line: 303, location

> > > > unknown

> > > > UI-WARNING: No top level geometry to render location unknown

> > > >

> > > > i.e no cache stats or time.

> > > >

> > > > Adrian, see https://github.com/openscad/openscad/issues/3517

> > > > Did you use a snapshot to test Lazy-Union?

> > > >

> > > > Wrap the path_sweep & cube in a union.

> > > >

> > > >> -----Original Message-----

> > > >> From: Discuss [mailto:

> > >

> > > > discuss-bounces@.openscad

> > >

> > > > ] On Behalf Of adrianv

> > > >> Sent: Sat, 12 Dec 2020 12:00

> > > >> To:

> > >

> > > > discuss@.openscad

> > >

> > > >> Subject: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error

> > > >>

> > > >> I wrote the code below to help a user on another thread, but I noticed a

> > > >> weird thing.  With the parameters below, the sweep gives a bad polyhedron

> > > >> with self-intersections.  And yet, with the RC I do not get a CGAL error,

> > > >> at

> > > >> least under Linux.   With 2019.05 I do get a CGAL error, but under the

> > > >> RC:

> > > >>

> > > >> Parsing design (AST generation)...

> > > >> Compiling design (CSG Tree generation)...

> > > >> Rendering Polygon Mesh using CGAL...

> > > >> Geometries in cache: 7

> > > >> Geometry cache size in bytes: 1662680

> > > >> CGAL Polyhedrons in cache: 0

> > > >> CGAL cache size in bytes: 0

> > > >> Total rendering time: 0:00:00.582

> > > >>    Top level object is a list of objects:

> > > >>    Objects:    2

> > > >> Rendering finished.

> > > >>

> > > >>

> > > >> include&lt;BOSL2/std.scad&gt;

> > > >> include&lt;BOSL2/skin.scad&gt;

> > > >>

> > > >> $fn=16;

> > > >> ofs = 1;

> > > >> r=4;

> > > >> number=5;

> > > >> radius=1.4;

> > > >>

> > > >> path = [for(i=[0:2:359]) (r+ofs*sin(number*i))*[cos(i),sin(i)]];

> > > >> path_sweep(circle(r=radius), path, closed=true);

> > > >> cube(8);

> > > >>

> > > >>

> > > >> I've also noticed that the RC doesn't always print blank lines before

> > > >> starting a new computation, which can make it hard to read the output.

> > > >>

> > > >>

> > > >>

> > > >>

> > > >> --

> > > >> Sent from: http://forum.openscad.org/

> > > >>

> > > >> _______________________________________________

> > > >> OpenSCAD mailing list

> > > >>

> > >

> > > > Discuss@.openscad

> > >

> > > >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

> > > >

> > > >

> > > > --

> > > > This email has been checked for viruses by AVG.

> > > > https://www.avg.com

> > > >

> > > >

> > > > _______________________________________________

> > > > OpenSCAD mailing list

> > >

> > > > Discuss@.openscad

> > >

> > > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

> > >

> > >

> > >

> > >

> > >

> > > --

> > > Sent from: http://forum.openscad.org/

> > >

> > > _______________________________________________

> > > OpenSCAD mailing list

> > > [hidden email]

> > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

> >

> >

> > --

> > This email has been checked for viruses by AVG.

> > https://www.avg.com


Virus-free. www.avg.com

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
OpenSCAD Admin - email* me if you need anything, or if I've done something stupid...
* on the Forum, click on my MichaelAtOz label, there is a link to email me.

Unless specifically shown otherwise above, my contribution is in the Public Domain;
to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.
Reply | Threaded
Open this post in threaded view
|

Re: 2020.12-RC2 bogus model does not give CGAL error

thehans
Yep with Lazy union, multiple top level objects can be exported.  Whether they are disjoint or not, it's up to the user (or slicer, as it may be) to deal with.

Honestly, I'm not sure how well various slicers handle overlapping objects, ie if they properly union the results themselves, or could possibly generate overlapping toolpaths which "double extrude", or force each object to be arranged separately on the build plate.

By the way, the lines from your console output are a dead giveaway that lazy union is enabled:
   Top level object is a list of objects:
   Objects:    2

That "list of objects" is only possible with lazy union.


On Fri, Dec 11, 2020 at 9:58 PM MichaelAtOz <[hidden email]> wrote:

> What happens with lazy union if you don't union the top level items?

 

It does not do CSG so all top level objects are fully present.

 

i.e Cut in half to see internals.

 

 

With a union() the cube would be empty, and cube bits would not be inside the sweep'ed part.

 

BTW, the sweep has self-intersections.

 

 

 

 

 

 

> -----Original Message-----

> From: Adrian Mariano [mailto:[hidden email]]

> Sent: Sat, 12 Dec 2020 14:47

> To: MichaelAtOz

> Subject: Re: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error

>

> STL attached.

>

> It seems like a big gotcha for lazy union if forgetting to wrap your

> top level in union() results in a bad STL output without a warning.

>

> On Sat, Dec 12, 2020 at 02:39:46PM +1100, MichaelAtOz wrote:

> > (not posted to mailing-list)

> >

> > Adrian,

> >

> > Send me the STL if you want me to have a look at it.

> >

> > Michael

> >

> > > -----Original Message-----

> > > From: Discuss [mailto:[hidden email]] On Behalf Of adrianv

> > > Sent: Sat, 12 Dec 2020 14:25

> > > To: [hidden email]

> > > Subject: Re: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error

> > >

> > > I didn't even think of possible lazy union here.  I know that lazy union is

> > > enabled for my RC---I previously tested this.  And yes, I did turn it on in

> > > a snapshot, so that seems to explain why.

> > >

> > > I wrapped with a union() and then I get a CGAL error as expected.

> > >

> > > What happens with lazy union if you don't union the top level items?  I took

> > > my bad (?) file (without the top level union) and saved an STL and my slicer

> > > seemed happy.  (But I don't have the various mesh analysis tools everybody

> > > uses to figure out just how bad the STL might be.  Maybe PrusaSlicer is

> > > really good at repairing/interpreting bad inputs.)

> > >

> > >

> > > MichaelAtOz wrote

> > > > Windows 7, I get CGAL errors on both 2019.05 & RC2.

> > > >

> > > > I get different console output.

> > > > On 2019.05, similar to Adrian's, but with the CGAL error after 'Rendering

> > > > Polygon Mesh using

> > > > CGAL...'.

> > > >

> > > > RC2 is truncated:

> > > >

> > > > Parsing design (AST generation)...

> > > > Compiling design (CSG Tree generation)...

> > > > Rendering Polygon Mesh using CGAL...

> > > > ERROR: CGAL error in CGALUtils::applyUnion3D: CGAL ERROR: assertion

> > > > violation! Expr:

> > > > G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1) File:

> > > > /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_overlayer.h

> > > > Line: 303, location

> > > > unknown

> > > > UI-WARNING: No top level geometry to render location unknown

> > > >

> > > > i.e no cache stats or time.

> > > >

> > > > Adrian, see https://github.com/openscad/openscad/issues/3517

> > > > Did you use a snapshot to test Lazy-Union?

> > > >

> > > > Wrap the path_sweep & cube in a union.

> > > >

> > > >> -----Original Message-----

> > > >> From: Discuss [mailto:

> > >

> > > > discuss-bounces@.openscad

> > >

> > > > ] On Behalf Of adrianv

> > > >> Sent: Sat, 12 Dec 2020 12:00

> > > >> To:

> > >

> > > > discuss@.openscad

> > >

> > > >> Subject: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error

> > > >>

> > > >> I wrote the code below to help a user on another thread, but I noticed a

> > > >> weird thing.  With the parameters below, the sweep gives a bad polyhedron

> > > >> with self-intersections.  And yet, with the RC I do not get a CGAL error,

> > > >> at

> > > >> least under Linux.   With 2019.05 I do get a CGAL error, but under the

> > > >> RC:

> > > >>

> > > >> Parsing design (AST generation)...

> > > >> Compiling design (CSG Tree generation)...

> > > >> Rendering Polygon Mesh using CGAL...

> > > >> Geometries in cache: 7

> > > >> Geometry cache size in bytes: 1662680

> > > >> CGAL Polyhedrons in cache: 0

> > > >> CGAL cache size in bytes: 0

> > > >> Total rendering time: 0:00:00.582

> > > >>    Top level object is a list of objects:

> > > >>    Objects:    2

> > > >> Rendering finished.

> > > >>

> > > >>

> > > >> include&lt;BOSL2/std.scad&gt;

> > > >> include&lt;BOSL2/skin.scad&gt;

> > > >>

> > > >> $fn=16;

> > > >> ofs = 1;

> > > >> r=4;

> > > >> number=5;

> > > >> radius=1.4;

> > > >>

> > > >> path = [for(i=[0:2:359]) (r+ofs*sin(number*i))*[cos(i),sin(i)]];

> > > >> path_sweep(circle(r=radius), path, closed=true);

> > > >> cube(8);

> > > >>

> > > >>

> > > >> I've also noticed that the RC doesn't always print blank lines before

> > > >> starting a new computation, which can make it hard to read the output.

> > > >>

> > > >>

> > > >>

> > > >>

> > > >> --

> > > >> Sent from: http://forum.openscad.org/

> > > >>

> > > >> _______________________________________________

> > > >> OpenSCAD mailing list

> > > >>

> > >

> > > > Discuss@.openscad

> > >

> > > >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

> > > >

> > > >

> > > > --

> > > > This email has been checked for viruses by AVG.

> > > > https://www.avg.com

> > > >

> > > >

> > > > _______________________________________________

> > > > OpenSCAD mailing list

> > >

> > > > Discuss@.openscad

> > >

> > > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

> > >

> > >

> > >

> > >

> > >

> > > --

> > > Sent from: http://forum.openscad.org/

> > >

> > > _______________________________________________

> > > OpenSCAD mailing list

> > > [hidden email]

> > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

> >

> >

> > --

> > This email has been checked for viruses by AVG.

> > https://www.avg.com


Virus-free. www.avg.com
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: 2020.12-RC2 bogus model does not give CGAL error

nophead
> Honestly, I'm not sure how well various slicers handle overlapping objects

Skeinforge XORs them so you end up with unexpected voids where they overlap.

I don't think OpenSCAD should export STLs with overlapping volumes.

On Sat, 12 Dec 2020 at 04:22, Hans L <[hidden email]> wrote:
Yep with Lazy union, multiple top level objects can be exported.  Whether they are disjoint or not, it's up to the user (or slicer, as it may be) to deal with.

Honestly, I'm not sure how well various slicers handle overlapping objects, ie if they properly union the results themselves, or could possibly generate overlapping toolpaths which "double extrude", or force each object to be arranged separately on the build plate.

By the way, the lines from your console output are a dead giveaway that lazy union is enabled:
   Top level object is a list of objects:
   Objects:    2

That "list of objects" is only possible with lazy union.


On Fri, Dec 11, 2020 at 9:58 PM MichaelAtOz <[hidden email]> wrote:

> What happens with lazy union if you don't union the top level items?

 

It does not do CSG so all top level objects are fully present.

 

i.e Cut in half to see internals.

 

 

With a union() the cube would be empty, and cube bits would not be inside the sweep'ed part.

 

BTW, the sweep has self-intersections.

 

 

 

 

 

 

> -----Original Message-----

> From: Adrian Mariano [mailto:[hidden email]]

> Sent: Sat, 12 Dec 2020 14:47

> To: MichaelAtOz

> Subject: Re: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error

>

> STL attached.

>

> It seems like a big gotcha for lazy union if forgetting to wrap your

> top level in union() results in a bad STL output without a warning.

>

> On Sat, Dec 12, 2020 at 02:39:46PM +1100, MichaelAtOz wrote:

> > (not posted to mailing-list)

> >

> > Adrian,

> >

> > Send me the STL if you want me to have a look at it.

> >

> > Michael

> >

> > > -----Original Message-----

> > > From: Discuss [mailto:[hidden email]] On Behalf Of adrianv

> > > Sent: Sat, 12 Dec 2020 14:25

> > > To: [hidden email]

> > > Subject: Re: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error

> > >

> > > I didn't even think of possible lazy union here.  I know that lazy union is

> > > enabled for my RC---I previously tested this.  And yes, I did turn it on in

> > > a snapshot, so that seems to explain why.

> > >

> > > I wrapped with a union() and then I get a CGAL error as expected.

> > >

> > > What happens with lazy union if you don't union the top level items?  I took

> > > my bad (?) file (without the top level union) and saved an STL and my slicer

> > > seemed happy.  (But I don't have the various mesh analysis tools everybody

> > > uses to figure out just how bad the STL might be.  Maybe PrusaSlicer is

> > > really good at repairing/interpreting bad inputs.)

> > >

> > >

> > > MichaelAtOz wrote

> > > > Windows 7, I get CGAL errors on both 2019.05 & RC2.

> > > >

> > > > I get different console output.

> > > > On 2019.05, similar to Adrian's, but with the CGAL error after 'Rendering

> > > > Polygon Mesh using

> > > > CGAL...'.

> > > >

> > > > RC2 is truncated:

> > > >

> > > > Parsing design (AST generation)...

> > > > Compiling design (CSG Tree generation)...

> > > > Rendering Polygon Mesh using CGAL...

> > > > ERROR: CGAL error in CGALUtils::applyUnion3D: CGAL ERROR: assertion

> > > > violation! Expr:

> > > > G.mark(v1,0)==G.mark(v2,0)&& G.mark(v1,1)==G.mark(v2,1) File:

> > > > /mxe/usr/x86_64-w64-mingw32.static.posix/include/CGAL/Nef_S2/SM_overlayer.h

> > > > Line: 303, location

> > > > unknown

> > > > UI-WARNING: No top level geometry to render location unknown

> > > >

> > > > i.e no cache stats or time.

> > > >

> > > > Adrian, see https://github.com/openscad/openscad/issues/3517

> > > > Did you use a snapshot to test Lazy-Union?

> > > >

> > > > Wrap the path_sweep & cube in a union.

> > > >

> > > >> -----Original Message-----

> > > >> From: Discuss [mailto:

> > >

> > > > discuss-bounces@.openscad

> > >

> > > > ] On Behalf Of adrianv

> > > >> Sent: Sat, 12 Dec 2020 12:00

> > > >> To:

> > >

> > > > discuss@.openscad

> > >

> > > >> Subject: [OpenSCAD] 2020.12-RC2 bogus model does not give CGAL error

> > > >>

> > > >> I wrote the code below to help a user on another thread, but I noticed a

> > > >> weird thing.  With the parameters below, the sweep gives a bad polyhedron

> > > >> with self-intersections.  And yet, with the RC I do not get a CGAL error,

> > > >> at

> > > >> least under Linux.   With 2019.05 I do get a CGAL error, but under the

> > > >> RC:

> > > >>

> > > >> Parsing design (AST generation)...

> > > >> Compiling design (CSG Tree generation)...

> > > >> Rendering Polygon Mesh using CGAL...

> > > >> Geometries in cache: 7

> > > >> Geometry cache size in bytes: 1662680

> > > >> CGAL Polyhedrons in cache: 0

> > > >> CGAL cache size in bytes: 0

> > > >> Total rendering time: 0:00:00.582

> > > >>    Top level object is a list of objects:

> > > >>    Objects:    2

> > > >> Rendering finished.

> > > >>

> > > >>

> > > >> include&lt;BOSL2/std.scad&gt;

> > > >> include&lt;BOSL2/skin.scad&gt;

> > > >>

> > > >> $fn=16;

> > > >> ofs = 1;

> > > >> r=4;

> > > >> number=5;

> > > >> radius=1.4;

> > > >>

> > > >> path = [for(i=[0:2:359]) (r+ofs*sin(number*i))*[cos(i),sin(i)]];

> > > >> path_sweep(circle(r=radius), path, closed=true);

> > > >> cube(8);

> > > >>

> > > >>

> > > >> I've also noticed that the RC doesn't always print blank lines before

> > > >> starting a new computation, which can make it hard to read the output.

> > > >>

> > > >>

> > > >>

> > > >>

> > > >> --

> > > >> Sent from: http://forum.openscad.org/

> > > >>

> > > >> _______________________________________________

> > > >> OpenSCAD mailing list

> > > >>

> > >

> > > > Discuss@.openscad

> > >

> > > >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

> > > >

> > > >

> > > > --

> > > > This email has been checked for viruses by AVG.

> > > > https://www.avg.com

> > > >

> > > >

> > > > _______________________________________________

> > > > OpenSCAD mailing list

> > >

> > > > Discuss@.openscad

> > >

> > > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

> > >

> > >

> > >

> > >

> > >

> > > --

> > > Sent from: http://forum.openscad.org/

> > >

> > > _______________________________________________

> > > OpenSCAD mailing list

> > > [hidden email]

> > > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

> >

> >

> > --

> > This email has been checked for viruses by AVG.

> > https://www.avg.com


Virus-free. www.avg.com
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: 2020.12-RC2 bogus model does not give CGAL error

cacb
On 2020-12-12 10:12, nop head wrote:
> I don't think OpenSCAD should export STLs with overlapping volumes.

Indeed, there is no concept of "volume" in STL files, so it is the same
as exporting a self-intersecting "non-manifold in need of repair" to use
OpenSCAD terminology. STL files contain a "soup" of triangles, nothing
else. The only meaningful way to properly export overlapping volumes to
STL would be to export each volume to a separate STL file.
Alternatively, use another export format with the ability to store
multiple volumes independent from each other.

Since OpenSCAD prefers to import STL files, a test of validity of an STL
export would be whether it could be imported again by OpenSCAD, i.e. the
typical round-trip test. I suppose it would always fail for "STLs with
overlapping volumes".

Carsten Arholm

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: 2020.12-RC2 bogus model does not give CGAL error

JordanBrown
In reply to this post by nophead
On 12/12/2020 1:12 AM, nop head wrote:
I don't think OpenSCAD should export STLs with overlapping volumes.

Concur.

I haven't really been following the "lazy union" feature.  I'd gotten the impression that it was a performance optimization.  If that's true, the end result needs to be the same as before the optimization - suggesting a final union of the top-level objects.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: 2020.12-RC2 bogus model does not give CGAL error

adrianv
No, lazy union is more than a performance optimization.  It leads to a major
language change where unions don't occur unless you request them.  So for
example, you would be able to run a for() and access each iteration of the
for() as a child instead of having it automatically unioned.  

At the moment I'm not sure exactly when the unions happen.  I know
difference() produces different results with lazy union, but user defined
modules still get the implied union.   So for example, if you do

difference() for(x=[1,2,3]) thing(x);

then without lazy union difference has one child and you get the union of
thing(1), thing(2) and thing(3) as the result.  With lazy union, difference
has 3 children and you get thing(1) with thing(2) and thing(3) subtracted.  


JordanBrown wrote

> On 12/12/2020 1:12 AM, nop head wrote:
>> I don't think OpenSCAD should export STLs with overlapping volumes.
>
> Concur.
>
> I haven't really been following the "lazy union" feature.  I'd gotten
> the impression that it was a performance optimization.  If that's true,
> the end result needs to be the same as before the optimization -
> suggesting a final union of the top-level objects.
>
>
> _______________________________________________
> OpenSCAD mailing list

> Discuss@.openscad

> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org





--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: 2020.12-RC2 bogus model does not give CGAL error

JordanBrown
On 12/12/2020 9:04 AM, adrianv wrote:
No, lazy union is more than a performance optimization.  It leads to a major
language change where unions don't occur unless you request them.  So for
example, you would be able to run a for() and access each iteration of the
for() as a child instead of having it automatically unioned.  

As Emily Litella would say, "Oh, that's very different.  Never mind".

(But I have to wonder how it interacts with $children.)


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: 2020.12-RC2 bogus model does not give CGAL error

thehans
Before the whole discussion gets too carried away regarding lazy union, I want to point out that the feature it's still incomplete and experimental, and NOT intended to be enabled (nor enableable) in the RC.

There was a bug where experimental feature settings from snapshots could be picked up by non-experimental builds, but it should be fixed in latest master (I think just not in RC2, but should be the next RC revision):  https://github.com/openscad/openscad/issues/3517


On Sat, Dec 12, 2020 at 11:11 AM Jordan Brown <[hidden email]> wrote:
On 12/12/2020 9:04 AM, adrianv wrote:
No, lazy union is more than a performance optimization.  It leads to a major
language change where unions don't occur unless you request them.  So for
example, you would be able to run a for() and access each iteration of the
for() as a child instead of having it automatically unioned.  

As Emily Litella would say, "Oh, that's very different.  Never mind".

(But I have to wonder how it interacts with $children.)

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org