Skip to content

set logic for known surfaces automatically

Severin Diederichs requested to merge set_logic_for_known_surfaces into surface_model

This MR proposes to set the logic of known surfaces automatically when evaluating boolean solids.

When a surface of a boolean solid is entered or exited, the boolean logic is evaluated by pushing the point some small distance (1e-6 in double precision). However, for highly tangential rays at cylindrical surfaces (e.g., tubes), the push by 1e-6 resulted in a difference of the normal by < 1e-9, so an exiting ray could still be considered as "inside" and therefore the point rejected, causing disagreement between the surface and solid model.

With this PR, the is_inside for the entering and exiting surfaces is set to true and false, respectively, when evaluating the boolean logic, preventing these tangential rays to cause numerical problems (that could lead to the code crashing).

Note that these highly tangential rays are quite rare and one typically needs 10s of millions of rays to have this issue to occur.

Merge request reports