Closed swsnider closed 7 years ago
With the program
translate([0,0,1.5]) scale(10) difference(){
cube(size=3, center=true);
rotate(a=90, v=[1,0,0]) cylinder(r=1, h=3.5, center=true, $fn=20);
}
openscad generates a mesh that looks like this
so this seems to be a diversion from that behavior as well.
It would be a nice rosey world if all software packages interacted together and create perfectly formatted files. I still haven't found a 3D design tool that creates perfectly formatted STL files, and therefore always "clean" all STL files, especially before slicing for 3D printers.
FYI, I ran the "incorrect" STL file through Netfabb (https://netfabb.azurewebsites.net). I think that you would be surprised at the results.
I don't think that OpenJSCAD should create perfect STL files, as the internals are quite different. Something that can be "read" as STL is sufficient. My favorite application for reading various formats is Meshlab.
This is different than not being 'perfectly formatted'. If you read my bug above, you'll note that the output STL describes a different shape than the user instructed it to create. This is a bug, not an issue of formatting. It's great (truly!) that people have created STL fixup tools, but that doesn't mean this isn't a bug.
So, just to be clear. You are saying that the STL file is NOT "well-formed", i.e. the output is not following the rules of STL. And that OpenJSCAD.org is not formatting the output correctly. i.e. there are triangles that do not share two vertexes with neighboring triangles. There's a related issue about STL as well, #9 . Can you take a look at that as well? FYI, the STL file output is created as part of the CSG.js library, which as all export functions defined in format.js.
What I'm saying is that the STL file describes a shape with slits along two of the cube's faces. This could also be viewed as a problem where there exist triangles that do not share two vertices with neighboring triangles.
This is not a normals issue, although that may also be wrong with this file. This is purely a bug report about an incorrect shape being output.
Pull request #107 contains some changes to CSG.js and openjscad.js. I ran some tests and all issues with T-junctions were resolved after making those changes.
If you need this fixed then please make the changes manually.
This issue was moved to jscad/io#16
When I export STL from the program (using the openjscad.org site)
I get an mesh that looks like this:
Note that the face with the hole has a bunch of triangles that do not share two vertexes with each neighboring triangle, in violation of the page at http://www.ennex.com/~fabbers/StL.asp, which is the most authoritative page I can find on the STL format.
If I use tinkercad.com to create the equivalent object, I get a mesh that looks like
which correctly ensures that each neighboring triangle shares two vertexes.
Normally, I'd consider this a nit-pick, but my slicer I'm developing is choking on the input that violates the STL format because I'm using an optimization that's only possible with well-formed files.