Skip to content

Main #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 109 commits into from
Jun 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
109 commits
Select commit Hold shift + click to select a range
e9e3ba0
Extrude with holes
QuimMoya Apr 29, 2025
2819a14
CircularSweep to bimGeometry
QuimMoya May 2, 2025
309a458
Merge remote-tracking branch 'origin/main' into bimGeometry
QuimMoya May 2, 2025
8593c83
build(deps-dev): bump three and @types/three
dependabot[bot] May 2, 2025
fe3edb7
Sectioned surface
QuimMoya May 2, 2025
9aec0bc
build(deps-dev): bump @babel/plugin-syntax-jsx from 7.25.9 to 7.27.1
dependabot[bot] May 5, 2025
23cbf9b
build(deps-dev): bump @babel/helper-validator-identifier
dependabot[bot] May 5, 2025
0ccbd03
build(deps-dev): bump electron-to-chromium from 1.5.148 to 1.5.152
dependabot[bot] May 13, 2025
2d6896d
Merge remote-tracking branch 'origin/main' into bimGeometry
QuimMoya May 13, 2025
6ca3be0
Merge pull request #1419 from ThatOpen/dependabot/npm_and_yarn/electr…
beachtom May 14, 2025
6e0f12c
Merge pull request #1415 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom May 14, 2025
6e48b1e
Merge pull request #1413 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom May 14, 2025
45712c3
build(deps-dev): bump @types/stats.js from 0.17.3 to 0.17.4
dependabot[bot] May 15, 2025
f0ac0e1
build(deps-dev): bump @babel/types from 7.27.0 to 7.27.1
dependabot[bot] May 15, 2025
3d82569
build(deps-dev): bump electron-to-chromium from 1.5.152 to 1.5.153
dependabot[bot] May 15, 2025
6ca05c8
Multi Threading
beachtom May 15, 2025
e505dce
Merge pull request #1424 from ThatOpen/dependabot/npm_and_yarn/electr…
beachtom May 15, 2025
2f44981
Merge pull request #1423 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom May 15, 2025
c5a1cdc
Merge pull request #1422 from ThatOpen/dependabot/npm_and_yarn/types/…
beachtom May 15, 2025
36349ce
Merge branch 'main' into Multithreading
beachtom May 15, 2025
bf828e7
build(deps-dev): bump three and @types/three
dependabot[bot] May 15, 2025
ab0ba35
Merge branch 'dependabot/npm_and_yarn/multi-3692938182' of https://gi…
beachtom May 15, 2025
eb48c0e
Merge pull request #1425 from ThatOpen/Multithreading
beachtom May 15, 2025
c7a2f12
Updates
beachtom May 15, 2025
1b078ea
build(deps-dev): bump @babel/core from 7.26.10 to 7.27.1
dependabot[bot] May 15, 2025
45b34ca
Merge branch 'main' into dependabot/npm_and_yarn/multi-3692938182
beachtom May 15, 2025
26a4ee4
Merge pull request #1408 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom May 15, 2025
ed1fc4f
Merge branch 'main' into dependabot/npm_and_yarn/multi-3692938182
beachtom May 15, 2025
5432dcc
Merge pull request #1406 from ThatOpen/dependabot/npm_and_yarn/multi-…
beachtom May 15, 2025
ff11a45
build(deps-dev): bump @babel/template from 7.27.0 to 7.27.2
dependabot[bot] May 16, 2025
4260261
build(deps-dev): bump @shikijs/themes from 3.3.0 to 3.4.2
dependabot[bot] May 16, 2025
694afe1
build(deps-dev): bump caniuse-lite from 1.0.30001716 to 1.0.30001718
dependabot[bot] May 16, 2025
c5a63a1
build(deps-dev): bump @shikijs/langs from 3.3.0 to 3.4.2
dependabot[bot] May 16, 2025
d7bb899
Further
beachtom May 16, 2025
c2e5d5a
Merge pull request #1430 from ThatOpen/dependabot/npm_and_yarn/shikij…
beachtom May 16, 2025
f3da5e8
Merge pull request #1428 from ThatOpen/dependabot/npm_and_yarn/canius…
beachtom May 16, 2025
a5e12f6
Merge pull request #1427 from ThatOpen/dependabot/npm_and_yarn/shikij…
beachtom May 16, 2025
092c69a
Merge pull request #1426 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom May 16, 2025
b845f54
build(deps-dev): bump @gerrit0/mini-shiki from 3.3.0 to 3.4.2
dependabot[bot] May 16, 2025
c5828d8
Merge pull request #1431 from ThatOpen/Further-MutliThreading
beachtom May 16, 2025
1876c75
Merge pull request #1429 from ThatOpen/dependabot/npm_and_yarn/gerrit…
beachtom May 16, 2025
2eb4400
build(deps-dev): bump electron-to-chromium from 1.5.153 to 1.5.155
dependabot[bot] May 19, 2025
179abba
build(deps-dev): bump @babel/plugin-syntax-typescript
dependabot[bot] May 19, 2025
44fdd71
build(deps-dev): bump @types/node from 22.15.3 to 22.15.19
dependabot[bot] May 19, 2025
bce4009
build(deps-dev): bump yaml from 2.7.1 to 2.8.0
dependabot[bot] May 19, 2025
4d79309
build(deps-dev): bump @babel/parser from 7.27.0 to 7.27.2
dependabot[bot] May 19, 2025
de1feae
Merge pull request #1432 from ThatOpen/dependabot/npm_and_yarn/electr…
beachtom May 19, 2025
667234e
Merge pull request #1433 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom May 19, 2025
bcd0cdb
Merge pull request #1434 from ThatOpen/dependabot/npm_and_yarn/types/…
beachtom May 19, 2025
f5387d2
Merge pull request #1435 from ThatOpen/dependabot/npm_and_yarn/yaml-2…
beachtom May 19, 2025
1f9d24b
Merge pull request #1436 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom May 19, 2025
b2c5be3
build(deps-dev): bump dedent from 1.5.3 to 1.6.0
dependabot[bot] May 20, 2025
1181c73
build(deps-dev): bump typedoc from 0.28.3 to 0.28.4
dependabot[bot] May 20, 2025
e567c6c
build(deps-dev): bump @babel/code-frame from 7.26.2 to 7.27.1
dependabot[bot] May 20, 2025
0339ccd
Fix bug
QuimMoya May 21, 2025
39f5884
Update Regressio
beachtom May 22, 2025
cdace5a
build(deps-dev): bump esbuild from 0.25.3 to 0.25.4
dependabot[bot] May 22, 2025
51206c9
Merge pull request #1440 from ThatOpen/dependabot/npm_and_yarn/esbuil…
beachtom May 22, 2025
9436031
Merge pull request #1439 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom May 22, 2025
3840718
Merge pull request #1438 from ThatOpen/dependabot/npm_and_yarn/typedo…
beachtom May 22, 2025
78c601e
Merge pull request #1437 from ThatOpen/dependabot/npm_and_yarn/dedent…
beachtom May 22, 2025
1bbba2e
build(deps-dev): bump ts-jest from 29.3.2 to 29.3.4
dependabot[bot] May 23, 2025
f5bcf32
build(deps-dev): bump jackspeak from 4.1.0 to 4.1.1
dependabot[bot] May 23, 2025
07f7dd6
build(deps-dev): bump @babel/plugin-syntax-import-attributes
dependabot[bot] May 23, 2025
897524b
In ReadLenghtMeasure(): add type "IFCLENGTHMEASURE"
ifcapps May 23, 2025
adabd52
add return value in case of unexpected type
ifcapps May 23, 2025
1c1e0ef
Cap holes triangulation
QuimMoya Jun 2, 2025
611cbff
build(deps-dev): bump electron-to-chromium from 1.5.155 to 1.5.165
dependabot[bot] Jun 5, 2025
71d3969
build(deps-dev): bump @types/node from 22.15.19 to 22.15.30
dependabot[bot] Jun 6, 2025
d7cf021
Merge pull request #1443 from ThatOpen/dependabot/npm_and_yarn/ts-jes…
beachtom Jun 9, 2025
9bda9e4
Merge pull request #1445 from ThatOpen/dependabot/npm_and_yarn/jacksp…
beachtom Jun 9, 2025
b64ea45
Merge pull request #1446 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom Jun 9, 2025
4ce6802
Merge pull request #1461 from ThatOpen/dependabot/npm_and_yarn/electr…
beachtom Jun 9, 2025
b886e1e
Merge pull request #1463 from ThatOpen/dependabot/npm_and_yarn/types/…
beachtom Jun 9, 2025
3b0686b
Merge pull request #1447 from Creoox/add-type-in-ReadLengthMeasure
beachtom Jun 9, 2025
4bcdcda
build(deps-dev): bump @babel/traverse from 7.27.1 to 7.27.4
dependabot[bot] Jun 10, 2025
5503e43
build(deps-dev): bump esbuild from 0.25.4 to 0.25.5
dependabot[bot] Jun 10, 2025
1060609
build(deps-dev): bump @shikijs/themes from 3.4.2 to 3.6.0
dependabot[bot] Jun 10, 2025
81194b3
build(deps-dev): bump @shikijs/engine-oniguruma from 3.4.2 to 3.6.0
dependabot[bot] Jun 10, 2025
15140ab
Merge pull request #1465 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom Jun 10, 2025
350740a
Merge pull request #1466 from ThatOpen/dependabot/npm_and_yarn/esbuil…
beachtom Jun 10, 2025
4942f55
Merge pull request #1468 from ThatOpen/dependabot/npm_and_yarn/shikij…
beachtom Jun 10, 2025
36cf68f
Merge pull request #1469 from ThatOpen/dependabot/npm_and_yarn/shikij…
beachtom Jun 10, 2025
94416db
build(deps-dev): bump acorn from 8.14.1 to 8.15.0
dependabot[bot] Jun 11, 2025
6b2f7b6
build(deps-dev): bump @babel/helper-module-transforms
dependabot[bot] Jun 11, 2025
6a5d109
build(deps-dev): bump caniuse-lite from 1.0.30001718 to 1.0.30001723
dependabot[bot] Jun 16, 2025
4b99a98
Boolean functions to bimGeometry
QuimMoya Jun 17, 2025
2b49774
Update settings.json
QuimMoya Jun 17, 2025
9395016
Update
beachtom Jun 18, 2025
5d13228
build(deps-dev): bump typedoc from 0.28.4 to 0.28.5
dependabot[bot] Jun 18, 2025
d9ded8f
Merge pull request #1476 from ThatOpen/dependabot/npm_and_yarn/canius…
beachtom Jun 18, 2025
ed4ea91
Merge pull request #1473 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom Jun 18, 2025
aa9ecd8
Merge pull request #1472 from ThatOpen/dependabot/npm_and_yarn/acorn-…
beachtom Jun 18, 2025
e186104
Merge pull request #1470 from ThatOpen/dependabot/npm_and_yarn/typedo…
beachtom Jun 18, 2025
e340901
build(deps-dev): bump ts-jest from 29.3.4 to 29.4.0
dependabot[bot] Jun 19, 2025
66b998d
build(deps-dev): bump brace-expansion from 1.1.11 to 1.1.12
dependabot[bot] Jun 19, 2025
b537485
build(deps-dev): bump @babel/helpers from 7.27.1 to 7.27.6
dependabot[bot] Jun 19, 2025
bb6e088
build(deps-dev): bump @webgpu/types from 0.1.60 to 0.1.61
dependabot[bot] Jun 19, 2025
aabcce2
build(deps-dev): bump @shikijs/langs from 3.4.2 to 3.6.0
dependabot[bot] Jun 19, 2025
eaa95e8
Merge pull request #1481 from ThatOpen/dependabot/npm_and_yarn/shikij…
beachtom Jun 19, 2025
eae8cfe
Merge pull request #1480 from ThatOpen/dependabot/npm_and_yarn/webgpu…
beachtom Jun 19, 2025
533560d
Merge pull request #1479 from ThatOpen/dependabot/npm_and_yarn/babel/…
beachtom Jun 19, 2025
1f2c135
Merge pull request #1478 from ThatOpen/dependabot/npm_and_yarn/brace-…
beachtom Jun 19, 2025
fb26f96
Merge pull request #1477 from ThatOpen/dependabot/npm_and_yarn/ts-jes…
beachtom Jun 19, 2025
10b6019
Added profiles to bimGeometry
QuimMoya Jun 19, 2025
77d1d0c
Merge branch 'bimGeometry'
QuimMoya Jun 19, 2025
a2a89cb
Update eps.h
QuimMoya Jun 19, 2025
289309c
Add new profile types
QuimMoya Jun 19, 2025
ab7f4c3
Merge branch 'develop' into main
ifcapps Jun 20, 2025
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
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@
"__verbose_abort": "cpp",
"coroutine": "cpp",
"expected": "cpp",
"source_location": "cpp"
"source_location": "cpp",
"booleanutils": "cpp"
},
"cmake.configureOnOpen": true,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
Expand Down
593 changes: 302 additions & 291 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
],
"devDependencies": {
"@types/jest": "^29.5.14",
"@types/three": "^0.175.0",
"@types/three": "^0.176.0",
"adm-zip": "^0.5.10",
"cpy-cli": "^5.0.0",
"esbuild": "^0.25.0",
Expand All @@ -75,7 +75,7 @@
"make-dir-cli": "^4.0.0",
"monaco-editor": "^0.52.0",
"rimraf": "^6.0.0",
"three": "^0.175.0",
"three": "^0.176.0",
"ts-jest": "^29.3.2",
"ts-node": "^10.9.2",
"typedoc": "^0.28.3",
Expand Down
4 changes: 2 additions & 2 deletions src/cpp/test/io_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ namespace webifc::io

for (uint32_t i = 0; i < geom.numFaces; i++)
{
webifc::geometry::Face f = geom.GetFace(i);
bimGeometry::Face f = geom.GetFace(i);
obj << "f " << (f.i0 + 1 + offset) << "// " << (f.i1 + 1 + offset) << "// " << (f.i2 + 1 + offset) << "//\n";
}

Expand Down Expand Up @@ -231,7 +231,7 @@ namespace webifc::io

for (uint32_t i = 0; i < geom.numFaces; i++)
{
webifc::geometry::Face f = geom.GetFace(i);
bimGeometry::Face f = geom.GetFace(i);
obj << "f " << (f.i0 + 1 + offset) << "// " << (f.i1 + 1 + offset) << "// " << (f.i2 + 1 + offset) << "//\n";
}

Expand Down
6 changes: 3 additions & 3 deletions src/cpp/test/web-ifc-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ int main()
// std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/15.ifc");
// std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/F_MA_160_ALT3.ifc");
// std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/1256.ifc");
std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/15.ifc");
std::string content = ReadFile("C:/Users/qmoya/Desktop/MODELS/1092_A.ifc");

struct LoaderSettings
{
Expand Down Expand Up @@ -501,8 +501,8 @@ int main()

start = ms();

SpecificLoadTest(loader, geometryLoader, 211736);
// auto meshes = LoadAllTest(loader, geometryLoader, -1);
// SpecificLoadTest(loader, geometryLoader, 3994);
auto meshes = LoadAllTest(loader, geometryLoader, -1);
// auto rebars = GetAllRebars(loader, geometryLoader);
// std::cout << GetLine(loader, 225) << std::endl;
// auto alignments = GetAlignments(loader, geometryLoader);
Expand Down
46 changes: 43 additions & 3 deletions src/cpp/wasm/web-ifc-wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,16 @@
#include "../version.h"
#include "../web-ifc/geometry/operations/bim-geometry/extrusion.h"
#include "../web-ifc/geometry/operations/bim-geometry/sweep.h"
#include "../web-ifc/geometry/operations/bim-geometry/circularSweep.h"
#include "../web-ifc/geometry/operations/bim-geometry/revolution.h"
#include "../web-ifc/geometry/operations/bim-geometry/cylindricalRevolution.h"
#include "../web-ifc/geometry/operations/bim-geometry/parabola.h"
#include "../web-ifc/geometry/operations/bim-geometry/clothoid.h"
#include "../web-ifc/geometry/operations/bim-geometry/arc.h"
#include "../web-ifc/geometry/operations/bim-geometry/alignment.h"
#include "../web-ifc/geometry/operations/bim-geometry/utils.h"
#include "../web-ifc/geometry/operations/bim-geometry/boolean.h"
#include "../web-ifc/geometry/operations/bim-geometry/Profile.h"

namespace webifc::parsing {
void p21encode(std::string_view input, std::ostringstream &output);
Expand Down Expand Up @@ -800,6 +803,12 @@ bimGeometry::Sweep CreateSweep()
return bimGeometry::Sweep();
}

bimGeometry::CircularSweep CreateCircularSweep()
{
return bimGeometry::CircularSweep();
}


bimGeometry::Revolve CreateRevolution()
{
return bimGeometry::Revolve();
Expand Down Expand Up @@ -830,6 +839,15 @@ bimGeometry::Alignment CreateAlignment()
return bimGeometry::Alignment();
}

bimGeometry::Boolean CreateBoolean()
{
return bimGeometry::Boolean();
}

bimGeometry::Profile CreateProfile()
{
return bimGeometry::Profile();
}

EMSCRIPTEN_BINDINGS(my_module) {

Expand All @@ -842,8 +860,6 @@ EMSCRIPTEN_BINDINGS(my_module) {
.function("GetSweptDiskSolid", &webifc::geometry::IfcGeometry::GetSweptDiskSolid)
;



emscripten::value_object<glm::dvec4>("dvec4")
.field("x", &glm::dvec4::x)
.field("y", &glm::dvec4::y)
Expand Down Expand Up @@ -962,19 +978,26 @@ EMSCRIPTEN_BINDINGS(my_module) {
.function("GetBuffers", &bimGeometry::AABB::GetBuffers)
.function("SetValues", &bimGeometry::AABB::SetValues)
;


emscripten::class_<bimGeometry::Extrusion>("Extrusion")
.constructor<>()
.function("GetBuffers", &bimGeometry::Extrusion::GetBuffers)
.function("SetValues", &bimGeometry::Extrusion::SetValues)
.function("SetHoles", &bimGeometry::Extrusion::SetHoles)
.function("ClearHoles", &bimGeometry::Extrusion::ClearHoles)
;

emscripten::class_<bimGeometry::Sweep>("Sweep")
.constructor<>()
.function("GetBuffers", &bimGeometry::Sweep::GetBuffers)
.function("SetValues", &bimGeometry::Sweep::SetValues)
;

emscripten::class_<bimGeometry::CircularSweep>("CircularSweep")
.constructor<>()
.function("GetBuffers", &bimGeometry::CircularSweep::GetBuffers)
.function("SetValues", &bimGeometry::CircularSweep::SetValues)
;

emscripten::class_<bimGeometry::Revolve>("Revolution")
.constructor<>()
Expand Down Expand Up @@ -1011,16 +1034,33 @@ EMSCRIPTEN_BINDINGS(my_module) {
.function("GetBuffers", &bimGeometry::Alignment::GetBuffers)
.function("SetValues", &bimGeometry::Alignment::SetValues)
;

emscripten::class_<bimGeometry::Boolean>("BooleanOperator")
.constructor<>()
.function("GetBuffers", &bimGeometry::Boolean::GetBuffers)
.function("SetValues", &bimGeometry::Boolean::SetValues)
.function("SetSecond", &bimGeometry::Boolean::SetSecond)
.function("clear", &bimGeometry::Boolean::clear)
;

emscripten::class_<bimGeometry::Profile>("Profile")
.constructor<>()
.function("GetBuffers", &bimGeometry::Profile::GetBuffers)
.function("SetValues", &bimGeometry::Profile::SetValues)
;

emscripten::function("CreateAABB", &CreateAABB);
emscripten::function("CreateExtrusion", &CreateExtrusion);
emscripten::function("CreateSweep", &CreateSweep);
emscripten::function("CreateCircularSweep", &CreateCircularSweep);
emscripten::function("CreateRevolution", &CreateRevolution);
emscripten::function("CreateCylindricalRevolution", &CreateCylindricalRevolution);
emscripten::function("CreateParabola", &CreateParabola);
emscripten::function("CreateClothoid", &CreateClothoid);
emscripten::function("CreateArc", &CreateArc);
emscripten::function("CreateAlignment", &CreateAlignment);
emscripten::function("CreateBooleanOperator", &CreateBoolean);
emscripten::function("CreateProfile", &CreateProfile);
emscripten::function("LoadAllGeometry", &LoadAllGeometry);
emscripten::function("GetAllCrossSections", &GetAllCrossSections);
emscripten::function("GetAllAlignments", &GetAllAlignments);
Expand Down
24 changes: 18 additions & 6 deletions src/cpp/web-ifc/geometry/IfcGeometryLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2995,16 +2995,16 @@ IfcProfile IfcGeometryLoader::GetProfile(uint32_t expressID) const
IfcCurve IfcGeometryLoader::GetLocalCurve(uint32_t expressID) const
{
spdlog::debug("[GetLocalCurve({})]",expressID);
for (uint32_t i = 0; i < LocalcurvesIndices.size(); i++)
for (uint32_t i = 0; i < _localcurvesIndices.size(); i++)
{
if (LocalcurvesIndices[i] == expressID)
if (_localcurvesIndices[i] == expressID)
{
return LocalCurvesList[i];
return _localCurvesList[i];
}
}
IfcCurve curve = GetCurve(expressID, 3, false);
LocalcurvesIndices.push_back(expressID);
LocalCurvesList.push_back(curve);
_localcurvesIndices.push_back(expressID);
_localCurvesList.push_back(curve);
return curve;
}

Expand Down Expand Up @@ -3638,8 +3638,9 @@ IfcProfile IfcGeometryLoader::GetProfile(uint32_t expressID) const
_loader.GetTokenType();
return _loader.GetDoubleArgument();
}
spdlog::warn("[ReadLengthMeasure()] Unrecognised type {}", LengthMeasureLabel);
spdlog::warn("[ReadLenghtMeasure()] Unrecognised type {}", LengthMeasureLabel);
}
return 0.0;
}

std::vector<IfcSegmentIndexSelect> IfcGeometryLoader::ReadCurveIndices() const
Expand Down Expand Up @@ -3685,4 +3686,15 @@ IfcProfile IfcGeometryLoader::GetProfile(uint32_t expressID) const
return result;
}

IfcGeometryLoader* IfcGeometryLoader::Clone(const webifc::parsing::IfcLoader &newLoader) const {
IfcGeometryLoader * newGeomLoader = new IfcGeometryLoader(newLoader, _schemaManager, _relVoids, _relNests, _relAggregates, _styledItems, _relMaterials, _materialDefinitions, _linearScalingFactor, _squaredScalingFactor, _cubicScalingFactor, _angularScalingFactor, _angleUnits, _circleSegments, _localCurvesList, _localcurvesIndices, _expressIDToPlacement);
return newGeomLoader;
}


IfcGeometryLoader::IfcGeometryLoader(const webifc::parsing::IfcLoader &loader, const webifc::schema::IfcSchemaManager &schemaManager, const std::unordered_map<uint32_t, std::vector<uint32_t>> &relVoids, const std::unordered_map<uint32_t, std::vector<uint32_t>> &relNests, const std::unordered_map<uint32_t, std::vector<uint32_t>> &relAggregates, const std::unordered_map<uint32_t, std::vector<std::pair<uint32_t, uint32_t>>> &styledItems, const std::unordered_map<uint32_t, std::vector<std::pair<uint32_t, uint32_t>>> &relMaterials, const std::unordered_map<uint32_t, std::vector<std::pair<uint32_t, uint32_t>>> &materialDefinitions, double linearScalingFactor, double squaredScalingFactor, double cubicScalingFactor, double angularScalingFactor, std::string angleUnits, uint16_t circleSegments, std::vector<IfcCurve> &localCurvesList, std::vector<uint32_t> &localcurvesIndices, std::unordered_map<uint32_t, glm::dmat4> expressIDToPlacement)
: _loader(loader),_schemaManager(schemaManager),_relVoids(relVoids),_relNests(relNests),_relAggregates(relAggregates),_styledItems(styledItems),_relMaterials(relMaterials), _materialDefinitions(materialDefinitions), _linearScalingFactor(linearScalingFactor), _squaredScalingFactor(squaredScalingFactor), _cubicScalingFactor(cubicScalingFactor), _angularScalingFactor(angularScalingFactor), _angleUnits(angleUnits), _circleSegments(circleSegments),_localCurvesList(localCurvesList), _localcurvesIndices(localcurvesIndices), _expressIDToPlacement(expressIDToPlacement)
{}


}
6 changes: 4 additions & 2 deletions src/cpp/web-ifc/geometry/IfcGeometryLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ namespace webifc::geometry
double GetLinearScalingFactor() const;
std::string GetAngleUnits() const;
void Clear() const;
IfcGeometryLoader* Clone(const webifc::parsing::IfcLoader &loader) const;
private:
IfcGeometryLoader(const webifc::parsing::IfcLoader &loader, const webifc::schema::IfcSchemaManager &schemaManager, const std::unordered_map<uint32_t, std::vector<uint32_t>> &relVoids, const std::unordered_map<uint32_t, std::vector<uint32_t>> &relNests, const std::unordered_map<uint32_t, std::vector<uint32_t>> &relAggregates, const std::unordered_map<uint32_t, std::vector<std::pair<uint32_t, uint32_t>>> &styledItems, const std::unordered_map<uint32_t, std::vector<std::pair<uint32_t, uint32_t>>> &relMaterials, const std::unordered_map<uint32_t, std::vector<std::pair<uint32_t, uint32_t>>> &materialDefinitions, double linearScalingFactor, double squaredScalingFactor, double cubicScalingFactor, double angularScalingFactor, std::string angleUnits, uint16_t circleSegments, std::vector<IfcCurve> &localCurvesList, std::vector<uint32_t> &localcurvesIndices, std::unordered_map<uint32_t, glm::dmat4> expressIDToPlacement);
IfcCurve GetAlignmentCurve(uint32_t expressID, uint32_t parentExpressID = -1) const;
IfcProfile GetProfileByLine(uint32_t expressID) const;
glm::dvec3 GetVertexPoint(uint32_t expressID) const;
Expand All @@ -79,8 +81,8 @@ namespace webifc::geometry
double _angularScalingFactor = 1;
std::string _angleUnits;
uint16_t _circleSegments;
mutable std::vector<IfcCurve> LocalCurvesList;
mutable std::vector<uint32_t> LocalcurvesIndices;
mutable std::vector<IfcCurve> _localCurvesList;
mutable std::vector<uint32_t> _localcurvesIndices;
std::unordered_map<uint32_t, std::vector<uint32_t>> PopulateRelVoidsMap();
std::unordered_map<uint32_t, std::vector<uint32_t>> PopulateRelNestsMap();
std::unordered_map<uint32_t, std::vector<uint32_t>> PopulateRelAggregatesMap();
Expand Down
12 changes: 11 additions & 1 deletion src/cpp/web-ifc/geometry/IfcGeometryProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1650,7 +1650,7 @@ namespace webifc::geometry

IfcGeometry IfcGeometryProcessor::BoolProcess(const std::vector<IfcGeometry> &firstGeoms, std::vector<IfcGeometry> &secondGeoms, std::string op)
{
return boolEngine.BoolProcess(firstGeoms, secondGeoms, op);
return _boolEngine.BoolProcess(firstGeoms, secondGeoms, op);
}

std::vector<uint32_t> IfcGeometryProcessor::Read2DArrayOfThreeIndices()
Expand Down Expand Up @@ -1990,4 +1990,14 @@ namespace webifc::geometry
return convertToWebIfc(fuzzybools::Subtract(firstEngGeom, secondEngGeom));
}

IfcGeometryProcessor * IfcGeometryProcessor::Clone(const webifc::parsing::IfcLoader &newLoader) const {
IfcGeometryProcessor *newProcessor = new IfcGeometryProcessor(_settings,_expressIDToGeometry,*_geometryLoader.Clone(newLoader),_transformation, newLoader, _boolEngine, _schemaManager, _isCoordinated, _expressIdCyl, _expressIdRect, _coordinationMatrix, _predefinedCylinder, _predefinedCube);
return newProcessor;
}

IfcGeometryProcessor::IfcGeometryProcessor(const IfcGeometrySettings &settings,std::unordered_map<uint32_t, IfcGeometry> expressIDToGeometry,const IfcGeometryLoader &geometryLoader,glm::dmat4 transformation, const parsing::IfcLoader &loader, booleanManager boolEngine, const schema::IfcSchemaManager &schemaManager, bool isCoordinated, uint32_t expressIdCyl, uint32_t expressIdRect, glm::dmat4 coordinationMatrix, IfcGeometry predefinedCylinder, IfcGeometry predefinedCube)
: _settings(settings), _expressIDToGeometry(expressIDToGeometry), _geometryLoader(geometryLoader), _transformation(transformation), _loader(loader), _boolEngine(boolEngine), _schemaManager(schemaManager), _isCoordinated(isCoordinated), _expressIdCyl(expressIdCyl), _expressIdRect(expressIdRect), _coordinationMatrix(coordinationMatrix), _predefinedCylinder(predefinedCylinder), _predefinedCube(predefinedCube)
{}


}
19 changes: 11 additions & 8 deletions src/cpp/web-ifc/geometry/IfcGeometryProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ namespace webifc::geometry
std::array<double, 16> GetFlatCoordinationMatrix() const;
glm::dmat4 GetCoordinationMatrix() const;
void Clear();
IfcGeometrySettings _settings;

protected:
IfcGeometryProcessor * Clone(const webifc::parsing::IfcLoader &loader) const;

private:
IfcGeometryProcessor(const IfcGeometrySettings &settings,std::unordered_map<uint32_t, IfcGeometry> expressIDToGeometry,const IfcGeometryLoader &geometryLoader,glm::dmat4 transformation, const parsing::IfcLoader &loader, booleanManager boolEngine, const schema::IfcSchemaManager &schemaManager, bool isCoordinated, uint32_t expressIdCyl, uint32_t expressIdRect, glm::dmat4 coordinationMatrix, IfcGeometry predefinedCylinder, IfcGeometry predefinedCube);
IfcGeometrySettings _settings;

std::optional<glm::dvec4> GetStyleItemFromExpressId(uint32_t expressID);
void AddFaceToGeometry(uint32_t expressID, IfcGeometry &geometry);
IfcGeometry GetBrep(uint32_t expressID);
Expand All @@ -65,16 +68,16 @@ namespace webifc::geometry
const IfcGeometryLoader _geometryLoader;
glm::dmat4 _transformation = glm::dmat4(1.0);
const parsing::IfcLoader &_loader;
booleanManager boolEngine;
booleanManager _boolEngine;
const schema::IfcSchemaManager &_schemaManager;
bool _isCoordinated = false;
uint32_t expressIdCyl = 0;
uint32_t expressIdRect = 0;
uint32_t _expressIdCyl = 0;
uint32_t _expressIdRect = 0;
glm::dmat4 _coordinationMatrix = glm::dmat4(1.0);
void AddComposedMeshToFlatMesh(IfcFlatMesh &flatMesh, const IfcComposedMesh &composedMesh, const glm::dmat4 &parentMatrix = glm::dmat4(1), const glm::dvec4 &color = glm::dvec4(1, 1, 1, 1), bool hasColor = false);
std::vector<uint32_t> Read2DArrayOfThreeIndices();
void ReadIndexedPolygonalFace(uint32_t expressID, std::vector<IfcBound3D> &bounds, const std::vector<glm::dvec3> &points);
IfcGeometry predefinedCylinder;
IfcGeometry predefinedCube;
IfcGeometry _predefinedCylinder;
IfcGeometry _predefinedCube;
};
}
61 changes: 61 additions & 0 deletions src/cpp/web-ifc/geometry/operations/bim-geometry/boolean.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#include <vector>
#include <algorithm>
#include <glm/glm.hpp>
#include "boolean.h"
#include "epsilons.h"
#include "geometry.h"
#include "utils.h"
#include "booleanUtils.h"

using Vec = glm::dvec3;

namespace bimGeometry {

Buffers Boolean::GetBuffers()
{
Buffers buffers;

Geometry geom = BoolProcess(geometry, seconds, op);

for (int r = 0; r < geom.numFaces; r++)
{
bimGeometry::Face f = geom.GetFace(r);
buffers.AddTri(geom.GetPoint(f.i0), geom.GetPoint(f.i1), geom.GetPoint(f.i2));
}

return buffers;
}

void Boolean::SetValues(std::vector<double> triangles_, std::string op_) {
op = op_;
geometry = Geometry();
for (size_t i = 0; i + 8 < triangles_.size(); i += 9) {
geometry.AddFace(
glm::dvec3(triangles_[i], triangles_[i + 1], triangles_[i + 2]),
glm::dvec3(triangles_[i + 3], triangles_[i + 4], triangles_[i + 5]),
glm::dvec3(triangles_[i + 6], triangles_[i + 7], triangles_[i + 8])
);
}
geometry.buildPlanes();
}

void Boolean::SetSecond(std::vector<double> triangles_) {
Geometry newGeometry = Geometry();
for (size_t i = 0; i + 8 < triangles_.size(); i += 9) {
newGeometry.AddFace(
glm::dvec3(triangles_[i], triangles_[i + 1], triangles_[i + 2]),
glm::dvec3(triangles_[i + 3], triangles_[i + 4], triangles_[i + 5]),
glm::dvec3(triangles_[i + 6], triangles_[i + 7], triangles_[i + 8])
);
}
newGeometry.buildPlanes();
seconds.push_back(newGeometry);
}

void Boolean::clear()
{
geometry = Geometry();
seconds.clear();
op = "";
}
}
Loading
Loading