Issue with mustBeFullyContained = true in beginConvexPolyhedronSelection API

Hello TechSoft3D,

I’ve encountered an issue while using the beginConvexPolyhedronSelection API. I created a bounding region by selecting a node. To find nodes inside bounding box and overlapping with the bounding box I used ‘beginConvexPolyhedronSelection’ API. However, when I set config.mustBeFullyContained = true, the node used to create the bounding region is not being returned as included or inside bounding box.

As shown in the screenshot shared below, the node appears to be slightly touching the bounding box. Despite that, it’s not being included in the selection when the mustBeFullyContained flag is set to true.

Interestingly, when I set config.mustBeFullyContained = false, the node is included in bounding box.

Ideally, even with mustBeFullyContained = true, I would expect the node to be lies entirely within the bounding region.

Could you please clarify if this is the expected behavior, or if there might be a precision issue or configuration setting that needs adjustment?

Hello @cad-developer,

The results you are getting are very likely due to precision “errors.” Our recommendation here is to implement an epsilon variable for the bounding box dimension (so an infinitesimally larger bounding box).

Thanks,
Tino

Wouldn’t it be technically incorrect to add an external variable in this context? Since we also need to identify nodes overlapping a bounding box, using an external variable could result in inaccurate node IDs.

I would agree that on a purely technical vantage point, the extra buffer should not be needed. That said, part of the bounding box boundary is co-planar with that of the model. In this particular situation, having such a buffer makes more sense.

In the context of collision detection, buffer zones are typically implemented to provide for hard and soft clashes. More information on this can be found in a previous forum post on this very topic.

Can you provide the value of infinitesimally small value of epsilon? How small it should be?

Well, the rule of thumb for epsilon 1e-6 but there is no one-size-fits-all answer. Our recommendation is test on the types of models you will typically load to gain empirical data.