Bounding box on a freeform

Bounding box on a freeform

DavidTruyens
Advocate Advocate
836 Views
7 Replies
Message 1 of 8

Bounding box on a freeform

DavidTruyens
Advocate
Advocate

Hi,

 

I'm working on a program and I need the boundingbox values. That sounds easy, but on a freeform that doesn't seems to be easy?

 

Here's my code:

boundingboxXmin = _Doc.ComponentDefinition.WorkPlanes.AddByPlaneAndOffset(_Doc.ComponentDefinition.WorkPlanes.Item(1), baseBody.RangeBox.MinPoint.X)
boundingboxXmax = _Doc.ComponentDefinition.WorkPlanes.AddByPlaneAndOffset(_Doc.ComponentDefinition.WorkPlanes.Item(1), baseBody.RangeBox.MaxPoint.X)
boundingboxYmin = _Doc.ComponentDefinition.WorkPlanes.AddByPlaneAndOffset(_Doc.ComponentDefinition.WorkPlanes.Item(2), baseBody.RangeBox.MinPoint.Y)
boundingboxYmax = _Doc.ComponentDefinition.WorkPlanes.AddByPlaneAndOffset(_Doc.ComponentDefinition.WorkPlanes.Item(2), baseBody.RangeBox.MaxPoint.Y)
...

 And I get this result:

freeformboundingbox.PNG 

 

Any idea why Y max doesn't match?

 

Regards,

David



David Truyens
Technical Specialist
Twitter | LinkedIn | IDCM | GitHub

0 Likes
837 Views
7 Replies
Replies (7)
Message 2 of 8

wayne.brill
Collaborator
Collaborator

Hi David,

 

I am able to recreate this behavior. I asked a colleague in Inventor Engineering about this. Here is an excerpt of their reply:

 

>> >>

The only thing guaranteed about a bounding box is that the object will be inside the box. There is no guarantee about how tight the box will be to the object. This example actually looks very good.

<< <<

 

If you believe Inventor Engineering needs to consider improving the return values of the Bounding Box on a freeform please post the issue on the Inventor Idea station:

http://forums.autodesk.com/t5/inventor-ideastation/idb-p/v1232/tab/most-recent

 

 

Thanks,

Wayne



Wayne Brill
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 8

DavidTruyens
Advocate
Advocate

Hi Wayne,

 

Thanks, I've posted it here: http://forums.autodesk.com/t5/inventor-ideastation/tight-xyz-boundingbox/idi-p/6006514



David Truyens
Technical Specialist
Twitter | LinkedIn | IDCM | GitHub

0 Likes
Message 4 of 8

Jef_E
Collaborator
Collaborator

Hi,

 

How do you get the bounding box values from a non-freeform part if I may ask? I made a application that creates nozzle connections on a cylinder. The only problem is getting the correct pipe length when its eccentric and under a angle into the cylinder. The bounding box would make this overrule this problem for me.

 

 



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 5 of 8

DavidTruyens
Advocate
Advocate

Hi @Jef_E,

 

Beware that the standard bounding box returns values in a XYZ orientation. So if you pipe is under an angle it's hard to get a correct distance. It might be possible to reorient it if you know the angle of the pipe. Maybe with transient geometry (something you don't see in Inventor but it's used in the background).

 

To get the bounding box values it's a default ilogic functionality, or using Inventor API, there it's called a range box (see code above).



David Truyens
Technical Specialist
Twitter | LinkedIn | IDCM | GitHub

0 Likes
Message 6 of 8

Jef_E
Collaborator
Collaborator

Yes, I was looking into the programming help and saw that it's X-Y-Z orientated. this is indeed a complication. I don't have expierience using TransientGeometry.. I looked around a bit but I don't see the solution there..

 



Please kudo if this post was helpfull
Please accept as solution if your problem was solved

Inventor 2014 SP2
0 Likes
Message 7 of 8

DavidTruyens
Advocate
Advocate

Hi @Jef_E

 

Maybe it's a good idea to start a separate thread on that? That'll make it easier for other people to reuse. In the meanwhile I'll keep it in my mind if a solution pops up.



David Truyens
Technical Specialist
Twitter | LinkedIn | IDCM | GitHub

0 Likes
Message 8 of 8

adam.nagy
Autodesk Support
Autodesk Support

This could be useful:

http://adndevblog.typepad.com/manufacturing/2016/02/rangebox-of-components.html



Adam Nagy
Autodesk Platform Services
0 Likes