Skip to content

Commit 7267e60

Browse files
committed
Fragments -> Issue #89
1 parent b2bd7c0 commit 7267e60

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

src/cpp/test/web-ifc-test.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,10 @@ int main()
486486
// std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/bc-78.ifc");
487487
// std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/83.ifc");
488488
// std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/1506.ifc");
489-
std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/TAR_E1A_LA_RVT_0001.ifc");
489+
// std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/TAR_E1A_LA_RVT_0001.ifc");
490+
491+
// std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/1604.ifc");
492+
std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/fragments_89.ifc");
490493

491494
struct LoaderSettings
492495
{
@@ -532,7 +535,11 @@ int main()
532535

533536
start = ms();
534537

535-
SpecificLoadTest(loader, geometryLoader, 543139); //
538+
// SpecificLoadTest(loader, geometryLoader, 2099); //1604
539+
540+
SpecificLoadTest(loader, geometryLoader, 164); //1604
541+
542+
// SpecificLoadTest(loader, geometryLoader, 543139); //
536543
// SpecificLoadTest(loader, geometryLoader, 350038); //
537544
// SpecificLoadTest(loader, geometryLoader, 252); // 1506
538545
// SpecificLoadTest(loader, geometryLoader, 407); // 1450

src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2011,7 +2011,8 @@ namespace webifc::geometry
20112011
auto pts = ReadIfcCartesianPointList3D(ptsRef);
20122012
for (auto &pt : sg.indexs)
20132013
{
2014-
curve.Add(pts[pt - 1]);
2014+
// Fragments -> Issue #89 -> requires not to skip overlapped points, this is why "removeCoincident" is set to false
2015+
curve.Add(pts[pt - 1], false);
20152016
}
20162017
}
20172018
if (sg.type == "IFCARCINDEX")
@@ -2020,7 +2021,8 @@ namespace webifc::geometry
20202021
IfcCurve arc = Build3DArc3Pt(pts[sg.indexs[0] - 1], pts[sg.indexs[1] - 1], pts[sg.indexs[2] - 1], _circleSegments, EPS_MINISCULE);
20212022
for (auto &pt : arc.points)
20222023
{
2023-
curve.Add(pt);
2024+
// Fragments -> Issue #89 -> requires not to skip overlapped points, this is why "removeCoincident" is set to false
2025+
curve.Add(pt, false);
20242026
}
20252027
curve.arcSegments.push_back(curve.points.size() - 1 - arc.points.size());
20262028
curve.arcSegments.push_back(curve.points.size() - 1);
@@ -3088,8 +3090,9 @@ namespace webifc::geometry
30883090
_loader.MoveToArgumentOffset(expressID, 0);
30893091
profile.type = _loader.GetStringArgument();
30903092
_loader.MoveToArgumentOffset(expressID, 2);
3093+
uint32_t curveID = _loader.GetRefArgument();
30913094
// ISSUE 765 requires dimension 3, not sure how to solve it without a stopgap
3092-
profile.curve = GetCurve(_loader.GetRefArgument(), 2);
3095+
profile.curve = GetCurve(curveID, 2);
30933096
profile.isConvex = IsCurveConvex(profile.curve);
30943097

30953098
return profile;

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77

88
namespace bimGeometry
99
{
10-
11-
void Curve::Add(glm::dvec3 pt)
10+
// Fragments -> Issue #89 -> requires "removeCoincident" switch
11+
void Curve::Add(glm::dvec3 pt, bool removeCoincident)
1212
{
13-
if (points.empty())
13+
14+
if (points.empty() || !removeCoincident)
1415
points.push_back(pt);
1516
else if (!equals(pt, points.back(), EPS_TINY_CURVE))
1617
points.push_back(pt);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace bimGeometry {
1111

1212
void Invert();
1313
bool IsCCW() const;
14-
void Add(glm::dvec3 pt);
14+
void Add(glm::dvec3 pt, bool removeCoincident = true);
1515
void Add(glm::dvec2 pt);
1616
};
1717
}

0 commit comments

Comments
 (0)