tpaviot / pythonocc-core

Python package for 3D geometry CAD/BIM/CAM
GNU Lesser General Public License v3.0
1.39k stars 380 forks source link

How to get correct translation and rotation of part in step file #1364

Open leoghizoni opened 3 months ago

leoghizoni commented 3 months ago

I'm trying to implement a function to retrieve the translation and rotation of the parts in an assembly step file. I found the function read_step_file_with_names_colors(filename) inside DataExchange.py with the locations commented, and implemented in my code. When I get the numbers, they match perfectly with the parameters shown in a CAD program e.g. FreeCAD. However, the positions are exactly the same for different parts, both in FreeCAD data and in my output, which I know not to be true, as they are shown in FreeCAD in different locations. I've read something in the internet about the vertices of a part actually being in the correct positions, but I have no idea how to implement that. Is there a way to actually getting the correct position of a part in the "world" of the assembly? Thanks in advance.