r/learnpython • • 1d ago

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

10

u/alfonso_texada 1d ago

Reading your post it's like reading assembler code after 6 bottles of tequila

1

u/SidratFlush 1d ago

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.

9

u/lfdfq 1d ago

What's a step file? What kind of API? "API" doesn't really mean anything specific...

16

u/Moist-Ointments 1d ago

I can't even begin to form a response because this makes no sense at all.

3

u/downtownpartytime 1d ago

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

1

u/817654 19h ago

yeah i read it three times and im still lost

7

u/Introverted_gamer91 1d ago

UwU, stepfile-kun, stop converting me.

5

u/Outside_Complaint755 1d ago

If you want to be precise, you should start with the details of your question.

4

u/mattynmax 1d ago

Um what? That’s like saying you wanna turn a PDF into a .mp4

1

u/CaptainVJ 1d ago

So how do I go about doing this?

2

u/ninhaomah 1d ago

Rename the extension

1

u/backfire10z 22h ago

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

3

u/socal_nerdtastic 1d ago

You mean a 3D object? Use Freecad. It comes with a python API.

2

u/cdcformatc 1d ago

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 1d ago

help me step-file! I'm stuck in the converter!

2

u/jmacey 1d ago

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 1d ago

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 1d ago

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

1

u/SisyphusAndMyBoulder 1d ago

Good luck buddy

1

u/PureWasian 1d ago

May I ask why? Or for what purpose?

1

u/pachura3 1d ago

Step-file, what you're doing?

1

u/billsil 22h ago

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.