Get Planes of BoundingBox

Get Planes of BoundingBox

mizrachi_amir2
Advocate Advocate
242 Views
1 Reply
Message 1 of 2

Get Planes of BoundingBox

mizrachi_amir2
Advocate
Advocate

Hello,

 

I am trying to get all planes of a BoundingBox. Given any element in my model, I need to have a list of planes of its boundingbox.

I was trying to follow this post but still didn't manage to reach my desired solution. 

 

Any hint would be appreciated.

 

Thank you!

0 Likes
243 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

That is trivial, since the bounding box is axis aligned. You just need to grab the min and max points and calculate the six planes using the three cardinal directions. You could use the CreateByNormalAndOrigin method to determine them like this:

  

  

  planeMinX = Plance.CreateByNormalAndOrigin( bb.Min, -XYZ.X )
  planeMinY = Plance.CreateByNormalAndOrigin( bb.Min, -XYZ.Y )
  planeMinZ = Plance.CreateByNormalAndOrigin( bb.Min, -XYZ.Z )
  planeMaxX = Plance.CreateByNormalAndOrigin( bb.Max, +XYZ.X )
  planeMaxY = Plance.CreateByNormalAndOrigin( bb.Max, +XYZ.Y )
  planeMaxZ = Plance.CreateByNormalAndOrigin( bb.Max, +XYZ.Z )

   

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes