For all issues regarding the Forums use, please, refer to the Forum Rules.

Our Solutions

Need professional assistance?
Consider our:

Support Offerings

 

Need to speed up your development?
Have a look at our:

Samples & Tools

 

Need some functionality extending standard OCCT capabilities?
Check out our:

Adv. Components

Related pages

Bounding box not updating

Heiko Irrgang's picture
Forums: 

Hi get the bounding box of a shape by:

BoundingBox ret;
Bnd_Box box;
BRepBndLib::Add(myShape, box);
box.Get(ret.minX, ret.minY, ret.minZ, ret.maxX, ret.maxY, ret.maxZ);
return ret;

Which works, but as soon as i move the shape

gp_Vec vec(moveX, moveY, moveZ);
gp_Trsf transform;
transform.SetTranslation(vec);
gp_Trsf myTrsfX = myShape.Location().Transformation();
myTrsfX *= transform;
BRepBuilderAPI_Transform moveTransform(myShape, transform);
myShape = moveTransform.Shape();

 

When i then call the bounding box function again, i get the same bounding box coordinates, while the representation seems to actually be on the correct position.

Any ideas?

Daniel Neander's picture

Hello,

Have you confirmed that the transformation you are applying is actually working?

gp_Pnt shapeTranslation = myShape->Transformation().TranslationPart();

Heiko Irrgang's picture

Sorry, code example actually works, i accidently (because of a lot of try an error attempts) was calculating a shapes bounding box by combining the bounding boxes of the shapes sub-edges, which seem to get not the correct result. If i actually calculate the bounding box of the shape, like above, it seems to work.

Contact us

Attention: DO NOT use this form for all kind of request for the removal of your personal data. Please follow this link for such cases.