Oriented bounding box

Oriented bounding box

rolandas_vegis
Advocate Advocate
640 Views
4 Replies
Message 1 of 5

Oriented bounding box

rolandas_vegis
Advocate
Advocate

Hello,

 

The BRepBody.orientedMinimumBoundingBox Property has been in Preview for 10months now.

When using this method of getting a orientedMinimumBoundingBox ir works wrong sometimes:

 

		const auto physicalProperties = body->getPhysicalProperties(HighCalculationAccuracy);
		JCAD_ASSERT_FUSION_RESULT(physicalProperties);
		Ptr<Vector3D> xAxis;
		Ptr<Vector3D> yAxis;
		Ptr<Vector3D> zAxis;
		JCAD_ASSERT_FUSION_RESULT(physicalProperties->getPrincipalAxes(xAxis, yAxis, zAxis));

		return Application::get()->measureManager()->getOrientedBoundingBox(body, xAxis, yAxis);

 

 

 

But the property on BrepBody works correctly.

 

Is it safe to release the BRepBody.orientedMinimumBoundingBox to users now?

0 Likes
Accepted solutions (1)
641 Views
4 Replies
Replies (4)
Message 2 of 5

BrianEkins
Mentor
Mentor

I'm sure this is an oversight, and the BRepBody.orientedMinimumBoundingBox property is OK to use.

 

Do you have an example model where the MeasureManager.getOrientedBoundingBox fails? I tried it with a random model, and it worked OK, so it must be a case-specific issue.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 3 of 5

rolandas_vegis
Advocate
Advocate

Thanks, great that we can use it.

Yes, we issue is case specific.

Link to model: https://a360.co/3YK6yX3

Also an image showing for which component the box is wrong. MeasureManager.getOrientedBoundingBox returns sligthly rotated box, while BRepBody.orientedMinimumBoundingBox returns the correct box for this component.

rolandas_vegis_0-1731566441561.png

 

0 Likes
Message 4 of 5

BrianEkins
Mentor
Mentor
Accepted solution

The MeasureManager.getOrientedBoundingBox and BRepBody.orientedMinimumBoundingBox differ in what they do and what you would use them for. The BRepBody orientedMinimumBoundingBox method doesn't require any input and calculates a tight-fitting bounding box for the body. The resulting box can be in any orientation to give the best fitting box.

 

The getOrientedBoundingBox of MeasureManager calculates a bounding box using the orientation you specify. It doesn't try to find the best fit. I get the same result as the minimum bounding box when I call this using the X and Y axes as the orientation. I don't know what directions you're using for the getOrientedBoundingBox.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 5 of 5

rolandas_vegis
Advocate
Advocate

Thanks for explaining the difference, I was using it wrong then.

0 Likes