Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

**First time visiting? Here are some places to start:**

- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

# Get Transforms/Orientations for a Box

Jonathan_Hutchinson
Member Posts:

**54**PRO
Hi there,

I'm wondering if I can produce a catch all solution that, given several box like extrusions, would be able to produce a list containing location (with respect to O), rotation and size but from the box centre. Essentially, data to go backwards to a world axis aligned box whose centre is at the origin.

Let's assume firstly that everything I'm generating is going to be a box-like.

So, there are quite a few things at play there. My initial feeling is drawn towards that evFaceTangentPlaneAtEdge will enable me to sort of get a co-ordinate system, albeit on a corner, or that by sampling any random point on a corner thus making an axis system, and taking the three lengths (in the correct order) to use as the size, I can get the rotation matrix and then translate it home, if an XY plane was created and its origin moved to the sampled point. And then translate by half of each unit, but in the correct direction! Which would probably be negative.

Maybe there's a shortcut in there somewhere by using the bounding box and it's max/min corner to sample the most suitable point.

Given that there are technically multiple solutions to this, let's assume the minimum rotation possible.

I'm wondering if I can produce a catch all solution that, given several box like extrusions, would be able to produce a list containing location (with respect to O), rotation and size but from the box centre. Essentially, data to go backwards to a world axis aligned box whose centre is at the origin.

Let's assume firstly that everything I'm generating is going to be a box-like.

So, there are quite a few things at play there. My initial feeling is drawn towards that evFaceTangentPlaneAtEdge will enable me to sort of get a co-ordinate system, albeit on a corner, or that by sampling any random point on a corner thus making an axis system, and taking the three lengths (in the correct order) to use as the size, I can get the rotation matrix and then translate it home, if an XY plane was created and its origin moved to the sampled point. And then translate by half of each unit, but in the correct direction! Which would probably be negative.

Maybe there's a shortcut in there somewhere by using the bounding box and it's max/min corner to sample the most suitable point.

Given that there are technically multiple solutions to this, let's assume the minimum rotation possible.

0