What's new

Script Release: STL Import

First, thanks for taking the time to build this script. I have been looking for a way to translate STL to STP and have not had great luck.

Fair warning that I don't know what I am doing here.
I tried running the script STL Import3.py but I get this error:

C:\Users\mike_\Downloads>python .\STL_Import3.py
Traceback (most recent call last):
File "C:\Users\mike_\Downloads\STL_Import3.py", line 1, in <module>
from System.Diagnostics import Process # for running another process
ModuleNotFoundError: No module named 'System'

Any help is appreciated.
Thanks
 
First, thanks for taking the time to build this script. I have been looking for a way to translate STL to STP and have not had great luck.

Fair warning that I don't know what I am doing here.
I tried running the script STL Import3.py but I get this error:

C:\Users\mike_\Downloads>python .\STL_Import3.py
Traceback (most recent call last):
File "C:\Users\mike_\Downloads\STL_Import3.py", line 1, in <module>
from System.Diagnostics import Process # for running another process
ModuleNotFoundError: No module named 'System'

Any help is appreciated.
Thanks
How are you running the script? Directly in AlibreScript or some other method? What Alibre version? What OS?
 
Hi - I ran the script the other day (from AlibreScript) to convert a .stl file, and it worked great. But I try it with another file (attached - see the stl file inside the zip), and I get the message "0 triangles found". And yet I can open it in FreeCAD and it shows up fine (but FreeCAD won't save it as a a STEP file..). Any thoughts?
 

Attachments

I've been trying to convert an .stl to .stp for about an hour this morning with no luck whatsoever. About a hundred online "converters" have failed.

I just came across your script, and it works perfectly.

Thanks Nate! This script is fantastic! Excellent work!
Hi Ken, is it possible for you to post this STL-file? I've developed a STL-converter (among other functions) and want to test some impossible files.
 
Converting tri-meshes into STEP format is more successfully with planar/flat face geometry. That model won't convert properly or at all without cleaning up the mesh. I attached a quadmeshered STEP file.

1747933885464.png
 

Attachments

Thanks so much - I saw the bad triangles in the first STEP file, and then I ran the conversion on the fixed .stl and now I have a part I can move forward with. Appreciate the help.

Out of curiosity, what tool did you use to open the stl file and make the corrections?

Chris
 
Dynamo first and the conversion loaded into Alibre just fine. The STEP doesn't work in my STEP tools. I suspect the surface joining is the cause. Alibre's import stitch to surface does a better job. Then I used Rhino 9 which is what I posted. The image with the quadremesh was made with AnalysisSitus, it has cleanup tools for STEP.
 
The file is in the zip file.
Thanks. I tested my little app and it worked!

1. Open STL
2. Save STEP
3. Open in Alibre Design
4. Cut and mirror (error on one side)
5. Save as SAT and open again (can reduce errors).

In the picture the model has been refined to make the surfaces smoother.


1747945174137.png
 
Last edited:
Thanks. I tested my little app and it worked!

1. Open STL
2. Save STEP
3. Open in Alibre Design
4. Cut and mirror (error on one side)
5. Save as SAT and open again (can reduce errors).

In the picture the model has been refined to make the surfaces smoother.


View attachment 44597
Is that your app? Looks like Python Tkinter/TCL GUI. Or is your app a CLI and that's for viewing or both?
 
Is that your app? Looks like Python Tkinter/TCL GUI. Or is your app a CLI and that's for viewing or both?
It's a small app I developed based on Tkinter and Opencascade. I test it to Open STL, Repair/Modify, Save STEP. There are also simple rendering functionality, 3D print analyze (not top notch yet) and a simple wind tunnel.

This was a project I went into when I was brainstorming about including AI in a CAD-software. Unfortunately I have not done that yet, not sure what to do or how to do it... Hopefully Alibre will figure that out later on :)

I was experimenting with the Alibre BOM (sometimes a PITA to work with) making my own version with more options but ended up doing this instead. More fun.
 
It's a small app I developed based on Tkinter and Opencascade. I test it to Open STL, Repair/Modify, Save STEP. There are also simple rendering functionality, 3D print analyze (not top notch yet) and a simple wind tunnel.

This was a project I went into when I was brainstorming about including AI in a CAD-software. Unfortunately I have not done that yet, not sure what to do or how to do it... Hopefully Alibre will figure that out later on :)

I was experimenting with the Alibre BOM (sometimes a PITA to work with) making my own version with more options but ended up doing this instead. More fun.
Thanks for sharing!
AI in a CAD-software
I think my position has shifted.
 
Back
Top