File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
src/cpp/web-ifc/geometry/operations/boolean-utils Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 24
24
#include " is-inside-mesh.h"
25
25
#include " is-inside-boundary.h"
26
26
27
+ #define GLM_ENABLE_EXPERIMENTAL
28
+ #include < glm/gtx/norm.hpp>
29
+
27
30
using Vec2 = glm::dvec2;
28
31
using Vec3 = glm::dvec3;
29
32
@@ -1579,17 +1582,16 @@ namespace fuzzybools
1579
1582
1580
1583
inline std::vector<double > ComputeInitialIntersections (Plane &p, SharedPosition &sp, const Line &lineA)
1581
1584
{
1582
- double size = 1.0E+04 ; // TODO: this is bad
1585
+ double size = 1.0E+08 ; // TODO: this is bad
1583
1586
1584
1587
for (auto &point : sp.points )
1585
1588
{
1586
- double d = glm::distance (lineA.origin , point.location3D );
1587
- if (size < d)
1588
- {
1589
- size = d;
1590
- }
1589
+ const auto d2 = glm::distance2 (lineA.origin , point.location3D );
1590
+ size = std::max (size, d2);
1591
1591
}
1592
1592
1593
+ size = std::sqrt (size);
1594
+
1593
1595
auto Astart = lineA.origin + lineA.direction * (size * 2 );
1594
1596
auto Aend = lineA.origin - lineA.direction * (size * 2 );
1595
1597
You can’t perform that action at this time.
0 commit comments