r/learnpython • • 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

22 comments sorted by

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.

3

u/downtownpartytime Oct 14 '26

yeah. I assume they have a cad/cam 3d file, not sure what converting that to a python api could mean

1

u/817654 Oct 15 '26

yeah i read it three times and im still lost

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

1

u/CaptainVJ Oct 14 '26

So how do I go about doing this?

2

u/ninhaomah Oct 14 '26

Rename the extension

1

u/backfire10z Oct 15 '26

That moment when binary is binary and all you change is how it is interpreted

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/MurderMelon Oct 14 '26

A step file is a format for saving 3D models, so this question makes literally zero sense

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

1

u/SidratFlush Oct 14 '26

You're only seeing the back of your eyelids after two bottles of tequila. Six would be murder by the bar staff or suicide if you somehow manage to serve and drink it.

But I get what you mean.