3D selection issue

In the example below, the selection of shapes in 3d-view shows some decision problems, which shape to select, when moving the mouse.

pload ALL
vinit
restore s1.brep s1
restore s2.brep s2
vdisplay s1 s2
vsetdispmode 1
vsetcolor s1 RED
vfit

There is a screenshot in the attachement showing the mouse hovering on the yellow shape while the red shape got selected.

I've tested it with OCCT 7.3 and 7.4, both showing same issue.

In addition, the visualization suffers from some z-fighting, but the areas of the selection issue do not match with the areas of the z-fighting (which was my initial assumption).

Any ideas how to solve the selection issue?

Kirill Gavrilov's picture

> In addition, the visualization suffers from some z-fighting, but the areas of the selection issue do not match with the areas of the z-fighting (which was my initial assumption).

The selection mechanism is different from visualization, but also suffers from too close triangles - because of necessity to handle some corner cases with some precision.
If such objects are unavoidable, solving mismatched picking will require improving selection logic in OCCT.

But if question is how to handle ambiguity in general while picking overlapped objects - use buttons '<', '>' to iterate through all objects under mouse cursor.