Rotate and move model in text STEP file ISO-10303-21

450 views Asked by At

I have N .step files that i want to merge into one. I saw that i can open .step file as text.

If i copy the text in the DATA section of the second file in the DATA section of the first file i can make a file with both of my models, but there is a way to rotate and move the second model on the X Y Z axis?

1

There are 1 answers

0
remi On BEST ANSWER

I assume the STEP files you are talking about are using the schemas AP203, AP214 or AP242 This can be seen in the STEP file header in a line such as:

FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }'));

This will not be a complete answer for how to rotate and move, but hopefully point you in the right direction.

Identifiers

When you copy the content of one file directly into another, you need to be careful. Each instance in the files have identifier that are referenced by other instances. The identifiers looks like #1, #102, #1003 etc. If the files have similar identifiers there will be clashes, and you will have unexpected results.

Maybe your application that export these files can set an offset to these identifiers, or you can edit them manually or via a script.

Coordinate systems

Assuming you managed to merge the files into one file. To move them around, you should look for the AXIS2_PLACEMENT_3D instances in your file.

These reference a CARTESIAN_POINT and two DIRECTION instances. They define the position, x-direction and z-direction of a coordinates system.

There will most likely be many AXIS2_PLACEMENT_3D in your file, depending on how complex the model is. These are referenced by SHAPE_REPRESENTATION. To really get an understanding of how these different instances are part of an assembly where multiple parts are connected and use different coordinate systems, you need to look into this document https://www.cax-if.org/documents/pdmug_release4_3.pdf.