discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

STL compile warning for simplest rotate_extrude() combo

N
neri-engineering
Mon, Nov 7, 2022 12:35 AM

Using OpenSCAD 2021.01 on Ubuntu 22.10.

I have a very nice workflow in my projects, and part of that workflow involves compiling parts to STL format on the command-line. E.g. a UNIX script that would look like this (much simplified for purposes of this discussion):

#!/bin/sh
openscad -o "extrude.stl"
"extrude.scad"

I then have the file "extrude.scad" which looks like so:

pt00=[5,3];
pt01=[7,6];
pt02=[6,7];
pt03=[9,5];
rotate_extrude(convexity=1,
$fn=23) {
polygon(points=[pt00,pt01,pt02]);
}
rotate_extrude(convexity=1,
$fn=23) {
polygon(points=[pt00,pt03,pt01]);
}
I noticed that when combining rotate_extrude() in such a manner (as above) I consistently get STL compile warnings of this nature:

Geometries in cache: 4
Geometry cache size in bytes: 20432
CGAL Polyhedrons in cache: 1
CGAL cache size in bytes: 283680
Total rendering time: 0:00:00.261
Top level object is a 3D object:
Simple: no
Vertices: 92
Halfedges: 622
Edges: 311
Halffacets: 444
Facets: 222
Volumes: 13
WARNING: Object may not be a valid 2-manifold and may need repair!EXPORT-WARNING: Exported object may not be a valid 2-manifold and may need repair

Just wondering. I strive to get rid of all warnings. I feel better that way. I have more of a guarantee that my STL files will play nice with other apps. For example I can union() the two polygon() objects and pass the union through rotate_extrude(). That will solve the issue. But in the general case I am relying on different objects being joined together, and I would like them to compile to STL w/o warnings. If I define polyhedron() myself, bypassing rotate_extrude() altogether, then the compile warning goes away as well. It seems that rotate_extrude() does not play nice with combinations and compiling to STL. Any thoughts? I can work around these issues but it's much work to keep working around it. I thought there would be a simple solution, but after searching there seems to be no simple solution, if I insist on no compile warnings. Sorry if I missed something obvious.

Sent with Proton Mail secure email.

Using OpenSCAD 2021.01 on Ubuntu 22.10. I have a very nice workflow in my projects, and part of that workflow involves compiling parts to STL format on the command-line. E.g. a UNIX script that would look like this (much simplified for purposes of this discussion): #!/bin/sh openscad -o "extrude.stl" \ "extrude.scad" I then have the file "extrude.scad" which looks like so: pt00=[5,3]; pt01=[7,6]; pt02=[6,7]; pt03=[9,5]; rotate_extrude(convexity=1, $fn=23) { polygon(points=[pt00,pt01,pt02]); } rotate_extrude(convexity=1, $fn=23) { polygon(points=[pt00,pt03,pt01]); } I noticed that when combining rotate_extrude() in such a manner (as above) I consistently get STL compile warnings of this nature: Geometries in cache: 4 Geometry cache size in bytes: 20432 CGAL Polyhedrons in cache: 1 CGAL cache size in bytes: 283680 Total rendering time: 0:00:00.261 Top level object is a 3D object: Simple: no Vertices: 92 Halfedges: 622 Edges: 311 Halffacets: 444 Facets: 222 Volumes: 13 WARNING: Object may not be a valid 2-manifold and may need repair!EXPORT-WARNING: Exported object may not be a valid 2-manifold and may need repair Just wondering. I strive to get rid of all warnings. I feel better that way. I have more of a guarantee that my STL files will play nice with other apps. For example I can union() the two polygon() objects and pass the union through rotate_extrude(). That will solve the issue. But in the general case I am relying on different objects being joined together, and I would like them to compile to STL w/o warnings. If I define polyhedron() myself, bypassing rotate_extrude() altogether, then the compile warning goes away as well. It seems that rotate_extrude() does not play nice with combinations and compiling to STL. Any thoughts? I can work around these issues but it's much work to keep working around it. I thought there would be a simple solution, but after searching there seems to be no simple solution, if I insist on no compile warnings. Sorry if I missed something obvious. Sent with [Proton Mail](https://proton.me/) secure email.
MM
Michael Marx
Mon, Nov 7, 2022 12:52 AM

a. convexity=1 is wrong for this, but that is just a preview issue not your reported problem. (try 4, but 10 is 'good' in general)

b. You have coincident faces, that is non-manifold.

pt00=[5,3];

pt01=[7,6];

pt02=[6,7];

pt03=[9,5];

intersection() {

 union() {

       rotate_extrude(convexity=10,

                                             $fn=23) {

                 polygon(points=[pt00,pt01,pt02]);

       }

       #rotate_extrude(convexity=10,

                                             $fn=23) {

                 polygon(points=[pt00,pt03,pt01]);

       }

}

 cube(20);

}

You can see it by the z-fighting


From: neri-engineering [mailto:neri-engineering@protonmail.com]
Sent: Mon, 7 Nov 2022 11:36
To: OpenSCAD general discussion Mailing-list
Subject: [OpenSCAD] STL compile warning for simplest rotate_extrude() combo

Using OpenSCAD 2021.01 on Ubuntu 22.10.

I have a very nice workflow in my projects, and part of that workflow involves compiling parts to STL format on the command-line.  E.g. a UNIX script  that would look like this (much simplified for purposes of this discussion):

#!/bin/sh

openscad -o "extrude.stl" \

     "extrude.scad"

I then have the file "extrude.scad" which looks like so:

pt00=[5,3];

pt01=[7,6];

pt02=[6,7];

pt03=[9,5];

rotate_extrude(convexity=1,

           $fn=23) {

polygon(points=[pt00,pt01,pt02]);

}

rotate_extrude(convexity=1,

           $fn=23) {

polygon(points=[pt00,pt03,pt01]);

}

I noticed that when combining rotate_extrude() in such a manner (as above) I consistently get STL compile warnings of this nature:

Geometries in cache: 4

Geometry cache size in bytes: 20432

CGAL Polyhedrons in cache: 1

CGAL cache size in bytes: 283680

Total rendering time: 0:00:00.261

Top level object is a 3D object:

Simple:        no

Vertices:      92

Halfedges:    622

Edges:        311

Halffacets:    444

Facets:        222

Volumes:        13

WARNING: Object may not be a valid 2-manifold and may need repair!

EXPORT-WARNING: Exported object may not be a valid 2-manifold and may need repair

Just wondering.  I strive to get rid of all warnings.  I feel better that way.  I have more of a guarantee that my STL files will play nice with other apps.  For example I can union() the two polygon() objects and pass the union through rotate_extrude().  That will solve the issue.  But in the general case I am relying on different objects being joined together, and I would like them to compile to STL w/o warnings.  If  I define polyhedron() myself, bypassing rotate_extrude() altogether, then the compile warning goes away as well.  It seems that rotate_extrude() does not play nice with combinations and compiling to STL.  Any thoughts?  I can work around these issues but it's much work to keep working around it.  I thought there would be a simple solution, but after searching there seems to be no simple solution, if I insist on no compile warnings.  Sorry if I missed something obvious.

Sent with Proton https://proton.me/  Mail secure email.

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

a. convexity=1 is wrong for this, but that is just a preview issue not your reported problem. (try 4, but 10 is 'good' in general) b. You have coincident faces, that is non-manifold. pt00=[5,3]; pt01=[7,6]; pt02=[6,7]; pt03=[9,5]; intersection() { union() { rotate_extrude(convexity=10, $fn=23) { polygon(points=[pt00,pt01,pt02]); } #rotate_extrude(convexity=10, $fn=23) { polygon(points=[pt00,pt03,pt01]); } } cube(20); } You can see it by the z-fighting _____ From: neri-engineering [mailto:neri-engineering@protonmail.com] Sent: Mon, 7 Nov 2022 11:36 To: OpenSCAD general discussion Mailing-list Subject: [OpenSCAD] STL compile warning for simplest rotate_extrude() combo Using OpenSCAD 2021.01 on Ubuntu 22.10. I have a very nice workflow in my projects, and part of that workflow involves compiling parts to STL format on the command-line. E.g. a UNIX script that would look like this (much simplified for purposes of this discussion): #!/bin/sh openscad -o "extrude.stl" \ "extrude.scad" I then have the file "extrude.scad" which looks like so: pt00=[5,3]; pt01=[7,6]; pt02=[6,7]; pt03=[9,5]; rotate_extrude(convexity=1, $fn=23) { polygon(points=[pt00,pt01,pt02]); } rotate_extrude(convexity=1, $fn=23) { polygon(points=[pt00,pt03,pt01]); } I noticed that when combining rotate_extrude() in such a manner (as above) I consistently get STL compile warnings of this nature: Geometries in cache: 4 Geometry cache size in bytes: 20432 CGAL Polyhedrons in cache: 1 CGAL cache size in bytes: 283680 Total rendering time: 0:00:00.261 Top level object is a 3D object: Simple: no Vertices: 92 Halfedges: 622 Edges: 311 Halffacets: 444 Facets: 222 Volumes: 13 WARNING: Object may not be a valid 2-manifold and may need repair! EXPORT-WARNING: Exported object may not be a valid 2-manifold and may need repair Just wondering. I strive to get rid of all warnings. I feel better that way. I have more of a guarantee that my STL files will play nice with other apps. For example I can union() the two polygon() objects and pass the union through rotate_extrude(). That will solve the issue. But in the general case I am relying on different objects being joined together, and I would like them to compile to STL w/o warnings. If I define polyhedron() myself, bypassing rotate_extrude() altogether, then the compile warning goes away as well. It seems that rotate_extrude() does not play nice with combinations and compiling to STL. Any thoughts? I can work around these issues but it's much work to keep working around it. I thought there would be a simple solution, but after searching there seems to be no simple solution, if I insist on no compile warnings. Sorry if I missed something obvious. Sent with Proton <https://proton.me/> Mail secure email. -- This email has been checked for viruses by AVG antivirus software. www.avg.com
JB
Jordan Brown
Mon, Nov 7, 2022 1:32 AM

I duplicated this with $fn=3, which makes the figure significantly simpler.

I spent a few minutes looking at the resulting STL, and I don't
immediately see anything catastrophically wrong, but I didn't run any
automated analysis on it.

Normally this error means that you have a coincident edge that is not
associated with a coincident face.

One thing that is ... interesting ... is that the resulting figure has
28 faces.

I don't understand how it can have a number of faces that isn't a
multiple of three.  The smallest reasonable number is, I think, 12.  But
it looks like we triangulate it, which would mean 24.  How we get
another four faces is a mystery to me.

Unless somebody else who is more of an STL wizard than I am figures it
out first, I'll see if I can take a further stab at analyzing the
edges.  But that's not something I can do "by hand".

I duplicated this with $fn=3, which makes the figure significantly simpler. I spent a few minutes looking at the resulting STL, and I don't immediately see anything catastrophically wrong, but I didn't run any automated analysis on it. Normally this error means that you have a coincident edge that is not associated with a coincident face. One thing that is ... interesting ... is that the resulting figure has 28 faces. I don't understand how it can have a number of faces that isn't a multiple of three.  The smallest reasonable number is, I think, 12.  But it looks like we triangulate it, which would mean 24.  How we get another *four* faces is a mystery to me. Unless somebody else who is more of an STL wizard than I am figures it out first, I'll see if I can take a further stab at analyzing the edges.  But that's not something I can do "by hand".