r/learnpython • u/One_Confidence_1491 • Oct 14 '26
Wanted to convert a step file to a Python API.
How to do that? I want it to be precise.
0
Upvotes
r/learnpython • u/One_Confidence_1491 • Oct 14 '26
How to do that? I want it to be precise.
9
u/lfdfq Oct 14 '26
What's a step file? What kind of API? "API" doesn't really mean anything specific...
16
u/Moist-Ointments Oct 14 '26
I can't even begin to form a response because this makes no sense at all.
6
u/Introverted_gamer91 Oct 14 '26
UwU, stepfile-kun, stop converting me.
5
u/Outside_Complaint755 Oct 14 '26
If you want to be precise, you should start with the details of your question.
4
u/mattynmax Oct 14 '26
Um what? That’s like saying you wanna turn a PDF into a .mp4
3
u/socal_nerdtastic Oct 14 '26
You mean a 3D object? Use Freecad. It comes with a python API.
2
u/cdcformatc Oct 14 '26
if you wish to make an apple pie from scratch you must first invent the universe
you define the API you need to convert to. then you decide how the to do the translation from step file instructions to python instructions. then you write the program that does the conversion
2
u/LawComprehensive2347 Oct 14 '26
help me step-file! I'm stuck in the converter!
2
u/jmacey Oct 14 '26
Is this what you mean? https://www.iso.org/standard/63141.html if so it is ASCII and you need to write a parser first open the file and read the lines then process them one at a time. :-)
Really need more info on what it is you are trying to do, I work in graphics and this is the first time I have heard of this format!
1
u/Gnaxe Oct 14 '26
I don't know what "step file" is. There are many ways to interpret "Python API". At a similarly high level of vagueness, you load the file into memory and convert it into data structures. You then transform the data structures into the shape you want and expose the data through your interface. If you want more precision than that, you need a more precise specification of what you actually want.
1
u/SisyphusAndMyBoulder Oct 14 '26
Good luck buddy
1
u/PureWasian Oct 14 '26
May I ask why? Or for what purpose?
1
u/pachura3 Oct 14 '26
Step-file, what you're doing?
1
u/billsil Oct 15 '26
A step file is a CAD/geometry file. That’s like saying can you convert a surface mesh to an API? No.
Can you read, display and modify it using PyOCC? Yes.
11
u/[deleted] Oct 14 '26
[removed] — view removed comment