Skip to content

Commit ae23c31

Browse files
committed
Fixed bug with footprintoffset if model had very high z value
1 parent 6d73c7e commit ae23c31

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

inc/cjCreator.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
#include <nlohmann/json.hpp>
99

1010
#include <chrono>
11+
#include <mutex>
1112

1213
#include <Bnd_Box.hxx>
1314
#include <BOPAlgo_Splitter.hxx>
@@ -755,6 +756,12 @@ void CJGeoCreator::makeFootprint(DataManager* h)
755756
// set up floorlvl
756757
double floorlvl = settingsCollection.footprintElevation();
757758
std::cout << CommunicationStringEnum::getString(CommunicationStringID::infoCoasreFootFiltering) << floorlvl << std::endl;
759+
// local user choses z offset
760+
double storeyBuffer = settingsCollection.horizontalSectionOffset();
761+
gp_Trsf translation;
762+
translation.SetTranslation(gp_Vec(0, 0, -storeyBuffer));
763+
floorlvl = floorlvl + storeyBuffer + h->getObjectTranslation().TranslationPart().Z();
764+
758765
// check if storey elev falls within bbox
759766
if (h->getLllPoint().Z() > floorlvl || h->getUrrPoint().Z() < floorlvl)
760767
{
@@ -765,15 +772,10 @@ void CJGeoCreator::makeFootprint(DataManager* h)
765772
std::cout << CommunicationStringEnum::getString(CommunicationStringID::infoCoasreFootFiltering) << floorlvl << std::endl;
766773
}
767774

768-
// local user choses z offset
769-
double storeyBuffer = settingsCollection.horizontalSectionOffset();
770-
gp_Trsf translation;
771-
translation.SetTranslation(gp_Vec(0, 0, -storeyBuffer));
772-
773775
try
774776
{
775777
std::vector<TopoDS_Face> footprintList;
776-
makeFloorSection(footprintList, h, floorlvl + storeyBuffer + h->getObjectTranslation().TranslationPart().Z());
778+
makeFloorSection(footprintList, h, floorlvl);
777779
for (TopoDS_Face& footprintItem : footprintList) { footprintItem.Move(translation); }
778780

779781
for (BuildingSurfaceCollection& buildingSurfaceData : buildingSurfaceDataList_)

inc/helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#define USE_IFC4x3
1+
#define USE_IFC2x3
22

33
#ifdef USE_IFC2x3
44
#define IfcSchema Ifc2x3

0 commit comments

Comments
 (0)