Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Next version
steps stop the job instead of masking the real error (#994)
* Fixed the changelog check, which had been failing on checkout since the Node 20
deprecation, by dropping the alpine:3.14 container (#994)
* Made the overlap_check ray direction independent of the compiler, which had
been picking a different direction under GCC than under Clang (#996)


v3.2.4
Expand Down
10 changes: 9 additions & 1 deletion src/overlap_check/overlap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,15 @@ ErrorCode check_instance_for_overlaps(std::shared_ptr<Interface> MBI,
int num_locations = all_verts.size() + pnts_per_edge * all_edges.size();
int num_checked = 1;

CartVect dir(rand(), rand(), rand());
// The order in which function arguments are evaluated is unspecified, so
// calling rand() three times inside the constructor picks a different
// direction depending on the compiler: GCC evaluates right to left, Clang
// left to right. Evaluate the calls in a defined order instead, so that the
// same geometry gives the same answer whichever compiler was used.
const double dir_x = rand();
const double dir_y = rand();
const double dir_z = rand();
CartVect dir(dir_x, dir_y, dir_z);
dir.normalize();

ProgressBar prog_bar;
Expand Down
Loading