Skip to content

Commit 0fb4e10

Browse files
authored
Merge pull request #8 from ThatOpen/main
sync with upstream
2 parents 68ca995 + b7325a5 commit 0fb4e10

File tree

4 files changed

+28
-22
lines changed

4 files changed

+28
-22
lines changed

src/cpp/web-ifc/geometry/operations/bim-geometry/profile.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ namespace bimGeometry
5252
{
5353
profile = bimGeometry::GetUShapedCurve(width, depth, thickness, flangeThickness, filletRadius, radius, slope, _placement);
5454
}
55+
if(pType == 6)
56+
{
57+
profile = bimGeometry::GetRectangleCurve(width, depth, _placement);
58+
}
59+
if(pType == 7)
60+
{
61+
profile = bimGeometry::GetTrapeziumCurve(width, thickness, depth, flangeThickness, _placement);
62+
}
5563

5664

5765
for (int r = 0; r < profile.points.size(); r++)

src/cpp/web-ifc/geometry/operations/bim-geometry/utils.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1260,11 +1260,11 @@ namespace bimGeometry
12601260
double halfX = xdim / 2;
12611261
double halfY = ydim / 2;
12621262

1263-
glm::dvec2 bl = placement * glm::dvec3(-halfX, -halfY, 1);
1264-
glm::dvec2 br = placement * glm::dvec3(halfX, -halfY, 1);
1263+
glm::dvec3 bl = placement * glm::dvec3(-halfX, -halfY, 1);
1264+
glm::dvec3 br = placement * glm::dvec3(halfX, -halfY, 1);
12651265

1266-
glm::dvec2 tl = placement * glm::dvec3(-halfX, halfY, 1);
1267-
glm::dvec2 tr = placement * glm::dvec3(halfX, halfY, 1);
1266+
glm::dvec3 tl = placement * glm::dvec3(-halfX, halfY, 1);
1267+
glm::dvec3 tr = placement * glm::dvec3(halfX, halfY, 1);
12681268

12691269
Curve c;
12701270
c.Add(bl);
@@ -1524,11 +1524,11 @@ namespace bimGeometry
15241524
double halfX = bottomXDim / 2;
15251525
double halfY = yDim / 2;
15261526

1527-
glm::dvec2 bl = placement * glm::dvec3(-halfX, -halfY, 1);
1528-
glm::dvec2 br = placement * glm::dvec3(halfX, -halfY, 1);
1527+
glm::dvec3 bl = placement * glm::dvec3(-halfX, -halfY, 1);
1528+
glm::dvec3 br = placement * glm::dvec3(halfX, -halfY, 1);
15291529

1530-
glm::dvec2 tl = placement * glm::dvec3(-halfX + topXOffset, halfY, 1);
1531-
glm::dvec2 tr = placement * glm::dvec3(-halfX + topXOffset + topXDim, halfY, 1);
1530+
glm::dvec3 tl = placement * glm::dvec3(-halfX + topXOffset, halfY, 1);
1531+
glm::dvec3 tr = placement * glm::dvec3(-halfX + topXOffset + topXDim, halfY, 1);
15321532

15331533
Curve c;
15341534
c.Add(bl);

src/cpp/web-ifc/geometry/operations/boolean-utils/clip-mesh.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ namespace fuzzybools
9191
auto isInside1Loc = isInsideMesh(triCenter, n, *bvh1.ptr, bvh1, raydir);
9292
auto isInside2Loc = isInsideMesh(triCenter, n, *bvh2.ptr, bvh2, raydir);
9393

94-
Vec extraDir1 = glm::normalize(Vec(1.1, 1.4, 1.2));
95-
Vec extraDir2 = glm::normalize(Vec(-2.1, 1.4, -3.2));
94+
Vec extraDir1 = glm::normalize(raydir + Vec(0.02,0.01,0.04));
95+
Vec extraDir2 = glm::normalize(raydir + Vec(0.20,-0.1,0.40));
9696

9797
auto isInside1Loc_B = isInsideMesh(triCenter, n, *bvh1.ptr, bvh1, extraDir1);
9898
auto isInside2Loc_B = isInsideMesh(triCenter, n, *bvh2.ptr, bvh2, extraDir1);

src/cpp/web-ifc/geometry/operations/boolean-utils/is-inside-mesh.h

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
/*
66
This function was revised on 2024-03-17. Further review is needed once we have an overview
77
of the entire package.
8-
8+
99
Parameter normal is assumed to be normalised.
1010
Function computeNormal returns a normalised vector.
11-
11+
1212
The constants toleranceBoundaryPoint and toleranceParallel are defined in eps.h.
1313
*/
14-
#pragma once
14+
#pragma once
1515

1616
#include <glm/glm.hpp>
1717
#include <iostream>
@@ -37,22 +37,20 @@ namespace fuzzybools
3737
Vec normal;
3838
};
3939

40-
inline InsideResult isInsideMesh
41-
(
42-
const Vec& pt,
40+
inline InsideResult isInsideMesh(
41+
const Vec &pt,
4342
Vec normal,
44-
const Geometry& g,
45-
BVH& bvh,
43+
const Geometry &g,
44+
BVH &bvh,
4645
Vec dir = Vec(1.0, 1.1, 1.4),
47-
bool UNION = false
48-
)
46+
bool UNION = false)
4947
{
5048
int winding = 0;
51-
dir = dir + Vec(0.02,0.01,0.04); //Randomly changing the normal to create a truly random direction for raytrace
49+
dir = dir + Vec(0.02, 0.01, 0.04); // Randomly changing the normal to create a truly random direction for raytrace
5250
InsideResult result;
5351
result.loc = MeshLocation::BOUNDARY;
5452
result.normal = glm::dvec3(0);
55-
53+
5654
double dirLength = dir.length();
5755

5856
bool hasResult = bvh.IntersectRay(pt, dir, [&](uint32_t i) -> bool

0 commit comments

Comments
 (0)