News:

When replying to a specific statement be sure to quote the previous post.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

STL generation flawed, no good solutions right now, looking for suggestions

Started by jgmick, March 10, 2023, 05:36:49 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

jgmick

I have been struggling with the export of 3D objects as STL files.  The target is a 3D printer.  There are a number of warts in the export.  I have tried to restrict my part shape generation to avoid those warts, but it has been a mixed bag.  I just stumbled on yet another wart so I tried a different approach.

I exported the parts as STP, then went looking for STP to STL converters.  I found several on-line that offer conversion, but after trying 3 different packages I struck out.  All 3 converters threw up on the STP files, claiming that they were corrupt for some reason.  No details in the form of the corruption, they just wouldn't convert to STL.

At this point I am starting to dive into stuff I know little about, so I am open to suggestions.  Are there other file formats for "save as" that will have better odds of converting to STL?  Other alternatives?  I really need to address this as the STL files produce strange results if I just ignore the errors and forge ahead and try to print anyway.  In some cases the printer interface S/W just refuses to proceed.  I am then left with trying to hack the original part to eliminate the offending features or re-design the part shape to solve the problem.  Tedious, time consuming, and only marginally successful.

Wise counsel needed.

Andy H

I don't know if you can share a TC file example, of a faulty stl export (in TCW format) or not.  If not,  can you post at least an image of what you are trying to achieve. 

Most of the (thousands) of parts I've printed are pretty simple, so I don't know about really complex parts from TC, but on the odd occasion I had a problem, I just send the stl through Meshlab (free). Sometimes I just needed to re-save the stl in Meshlab, without even needing to run any of the repair tools.

curious - what is S/W.

jgmick

I did later what I should have done before posting, I went back to the printer S/W front end (Repetier-Host) and looked to see what other file formats it could accept.  It showed that 3DS was an acceptable input format, so I tried an export from TC in that format.  That appears to have worked (haven't printed that part yet but the printer S/W liked it.)  At least temporarily that has solved the problem.  If that is fully successful long term then the problem is fixed. (Time will tell, I thought I had whipped this one before.)

I dived into this a couple of years ago when this first showed up and did an analysis of the STL file.  You can save an STL as ASCII so you can actually examine the output in detail.  The flaw in TC STL export is that it does not always follow what the STL folks call the "right hand rule" to define the triangles that make up the STL file.  The result is that on a complex part you may be looking at a specific triangle from the inside out (looking at the back side of that triangle) instead of "outside in".  That is what trips up the Repetier S/W.  It highlights those surfaces in red.  Trying to print with those in the package is pot luck.  You never know what you are going to get.  It also checks to see that the part is manifold which is "watertight" (No gaps in the triangles touching each other).  I have not seen that problem, only the "inside out" flaw.

For now, I think that I got well using the 3DS format for export.

I think I'll take a look at Meshlab.  That might be an interesting tool to have around (particularly if it is free).  I'm kind of curious to see if it will clean up one of my problem STL files.

Andy H

As well as Meshlab.  Don't forget about Windows 3D builder. (its in the Windows accessories section via the start menu).  when an stl is opened in it, it will display a box if it finds problems with the file, and an option to allow it to try and repair it.   Note - this is 3d builder, not the 3d viewer.

Been about 10 years since I use Repetier and my memory won't stretch that far. So I cannot remember if I had problems with TC stl's back then.

Jeff_in_90620

Quote from: jgmick on March 10, 2023, 05:36:49 AMAt this point I am starting to dive into stuff I know little about, so I am open to suggestions. 

With no information on the shape or overall complexity of your design, one can only provide general guidance.

For instance, if your object has curved surfaces and areas that have been subtracted, you could reduce your chances of errors in STL exports by increasing the resolution (and the resulting file size).  The easiest way to do this in Platinum is to create as an ACIS Solid and make sure that Faceter Quality is set to 100 (the default is 50).  If that doesn't fix the problem, you could activate Expert Faceter Parameters and set Normal Tolerance to something smaller than 15° (the smaller the number, the larger your STL files will be, but the curves will be smoother).

If you are using Professional or Deluxe, then there are no ACIS Solid models in your drawing.  You will have to improve the quality in a different manner.  Select your object, invoke Properties (<Ctrl> F is the easiest way) and select the TC Surface Options tab at the left of the popup.  Increase the Number of approximation lines value (the maximum is 90).  Personally, I have not noticed a difference when activating the Smooth option.


Jeff
Jeff

TC 2026 Pro Platinum plus 2015->2024 (most with LightWorks & RedSDK) & V21
System: AMD Ryzen 9 7950X, MSI Mag X670E Tomahawk WiFi, 64GB RAM @ 4.80GHz, ARC A770 w/16GB, 3 x Samsung NVMe 990 (1TB), Windows 11 Pro (64-bit)

murray dickinson

The approximation lines smoothing algorithm only applies to primitives and surfaces in creation and refers to their initial, declared parameters, before they're edited or Booleaned.  It's not a post-applied subdivision.  Bear in mind that a couple of .stl's criteria, two facets only can share an edge, three only to a vertex, are irrelevant to geometry, they're for format convenience for 3DS' original SLA stereolithography machines.  Interestingly (to me, anyway!) they also defined a slicing format, .slc, which you can get from an .stl in Netfabb.  It's just a polyline section at defined layer heights, and Netfabb will animate them like CT scans if you're interested, but it would probably work as a basic slicer format, if infill were treated as a hatch pattern, say.  It could work from any format of model, even surfaces, if it just recognised the concave side of the profile, as TC's section tool closes an open profile to apply a hatch, or just to apply a thickness, or pen width, to the explicit skin.

jgmick

Just to tidy up and finish up, some more info.
I am running TC Platinum 2019 64 bit.

Attached are 2 files, the TC source and a screenshot from my printer front end showing what it considers to be errors in the STL file.  All of these reported errors go away if I export as 3DS.

Of note on the screenshot, anything shown in pink is an error in the STL file that indicates an "inside-out triangle in the STL.  Anything in blue is correct according to the printer S/W.  The printer S/W did report that the part is manifold.

I know from trying to slice this that the resulting printer code does not correctly reproduce any of the holes thru the part.  Note that these errors are highly variable from part to part in the presence of STL problems, it is just what happened this time.

Don Cheke

Quote from: jgmick on March 13, 2023, 01:27:25 PMJust to tidy up and finish up, some more info.
I am running TC Platinum 2019 64 bit.

Attached are 2 files, the TC source and a screenshot from my printer front end showing what it considers to be errors in the STL file.  All of these reported errors go away if I export as 3DS.

Of note on the screenshot, anything shown in pink is an error in the STL file that indicates an "inside-out triangle in the STL.  Anything in blue is correct according to the printer S/W.  The printer S/W did report that the part is manifold.

I know from trying to slice this that the resulting printer code does not correctly reproduce any of the holes thru the part.  Note that these errors are highly variable from part to part in the presence of STL problems, it is just what happened this time.

I don't see any issues with your parts on my MakerBot.
Don Cheke
My Blog: One Man's Meanderings

Andy H

Like Don.  I didn't find any problem.

I saved from TC as stl. opened in 3Dbuilder, Meshlab, and NetFabb, + two different slicers.

All was OK EXCEPT. Netfabb didn't like both parts as a single stl.  So I resaved both parts separately, and they both opened in NetFabb without problem and didn't report any faults.   

jgmick

VERY interesting.  I need to have another chat with the printer front end S/W folks.

I usually split the parts into separate files also.  I left them in a single file here simply because I built the part that way.  Nothing changes when I go to the printer S/W with the 2 separate parts, it still shows the same issues. 

Is there any way you can give me the stl file you exported?  I would like to run your copy thru my printer S/W.
Just the lower part would be sufficient.  The fact that it gets well when I export it as 3ds solved the problem for me, so this is simple curiosity on my part.

Don Cheke

Here it is.

I exported to stl from TurboCAD in ASCII format, which is what my printer prefers.
Don Cheke
My Blog: One Man's Meanderings

jgmick

I opened it in my printer front end S/W (it seems to handle ASCII fine) and it shows exactly the same errors as what I had gotten when I exported as a .stl locally.

I'm wondering if there is a difference if you open it to view it or open it to slice it up for the printer.
Hard to say. Still interesting but I think I am kind of done with science on this one.  I got a solution for me to be able to move forward, that is good enough for now.

Thank you for your time.