Skip to content

Commit fa8e9b1

Browse files
committed
improve geometry processing
1 parent 036786f commit fa8e9b1

File tree

1,809 files changed

+28517
-25996
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,809 files changed

+28517
-25996
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@ examples/CreateIfcWallAndWriteFile/x64/
4545
examples/LoadFileWithGeometryExampleConsole/dump_mesh_debug.txt
4646
IfcPlusPlus-*
4747
IfcPlusPlus/src/ifcpp/geometry/Carve - Copy/
48+
IfcPlusPlus/src/ifcpp-
4849
IfcPlusPlus/src/ifcpp--
50+
IfcPlusPlus/src/ifcpp---/
51+
IfcPlusPlus/src/ifcpp----/

IfcPlusPlus/CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ set(IFCPP_SOURCE_FILES
3838
src/ifcpp/reader/ReaderUtil.cpp
3939
src/ifcpp/writer/WriterSTEP.cpp
4040
src/ifcpp/writer/WriterUtil.cpp
41+
src/ifcpp/geometry/MeshOps.cpp
42+
src/ifcpp/geometry/GeometryInputData.cpp
4143
src/external/manifold/src/boolean3.cpp
4244
src/external/manifold/src/boolean_result.cpp
4345
src/external/manifold/src/collider/src/collider.cpp
@@ -82,14 +84,11 @@ set(IFCPP_SOURCE_FILES
8284
src/external/Carve/src/lib/timing.cpp
8385
src/external/Carve/src/lib/triangle_intersection.cpp
8486
src/external/Carve/src/lib/triangulator.cpp
85-
src/external/Carve/src/common/geometry.cpp
87+
src/external/Carve/src/common/geometry.cpp
88+
src/external/zip-master/zip.c
8689
)
8790

8891
if (MSVC)
89-
set(IFCPP_SOURCE_FILES
90-
src/external/XUnzip.cpp # do not add src/external/XUnzip.cpp on unix platforms
91-
${IFCPP_SOURCE_FILES})
92-
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj ")
9392
set_source_files_properties(src/ifcpp/IFC4X3/EntityFactory.cpp PROPERTIES COMPILE_FLAGS /bigobj)
9493
set_source_files_properties(src/ifcpp/IFC4X3/TypeFactory.cpp PROPERTIES COMPILE_FLAGS /bigobj)
9594
endif()

IfcPlusPlus/IfcPlusPlus.vcxproj

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<PropertyGroup Label="Globals">
3838
<ProjectGuid>{9700AD93-4F6B-484A-BA34-FC4C97E5C645}</ProjectGuid>
3939
<RootNamespace>IfcPlusPlus</RootNamespace>
40-
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
40+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
4141
</PropertyGroup>
4242
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
4343
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@@ -341,7 +341,9 @@
341341
</Lib>
342342
</ItemDefinitionGroup>
343343
<ItemGroup>
344-
<ClCompile Include="src\external\XUnzip.cpp" />
344+
<ClCompile Include="src\external\zip-master\zip.c" />
345+
<ClCompile Include="src\ifcpp\geometry\GeometryInputData.cpp" />
346+
<ClCompile Include="src\ifcpp\geometry\MeshOps.cpp" />
345347
<ClCompile Include="src\ifcpp\IFC4X3\EntityFactory.cpp">
346348
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
347349
</ClCompile>
@@ -402,7 +404,6 @@
402404
<ClCompile Include="src\external\Carve\src\lib\triangulator.cpp" />
403405
</ItemGroup>
404406
<ItemGroup>
405-
<ClInclude Include="src\external\XUnzip.h" />
406407
<ClInclude Include="src\ifcpp\geometry\AppearanceData.h" />
407408
<ClInclude Include="src\ifcpp\geometry\ConverterOSG.h" />
408409
<ClInclude Include="src\ifcpp\geometry\CSG_Adapter.h" />

IfcPlusPlus/IfcPlusPlus.vcxproj.filters

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,6 @@
153153
<ClInclude Include="src\ifcpp\reader\AbstractReader.h">
154154
<Filter>Headerdateien</Filter>
155155
</ClInclude>
156-
<ClInclude Include="src\external\XUnzip.h">
157-
<Filter>Headerdateien</Filter>
158-
</ClInclude>
159156
</ItemGroup>
160157
<ItemGroup>
161158
<ClCompile Include="src\ifcpp\model\UnitConverter.cpp">
@@ -179,9 +176,6 @@
179176
<ClCompile Include="src\ifcpp\writer\WriterUtil.cpp">
180177
<Filter>Quelldateien</Filter>
181178
</ClCompile>
182-
<ClCompile Include="src\external\XUnzip.cpp">
183-
<Filter>Quelldateien</Filter>
184-
</ClCompile>
185179
<ClCompile Include="src\ifcpp\model\BuildingGuid.cpp">
186180
<Filter>Quelldateien</Filter>
187181
</ClCompile>
@@ -323,5 +317,14 @@
323317
<ClCompile Include="src\external\Carve\src\lib\triangulator.cpp">
324318
<Filter>Quelldateien</Filter>
325319
</ClCompile>
320+
<ClCompile Include="src\external\zip-master\zip.c">
321+
<Filter>Quelldateien</Filter>
322+
</ClCompile>
323+
<ClCompile Include="src\ifcpp\geometry\MeshOps.cpp">
324+
<Filter>Quelldateien</Filter>
325+
</ClCompile>
326+
<ClCompile Include="src\ifcpp\geometry\GeometryInputData.cpp">
327+
<Filter>Quelldateien</Filter>
328+
</ClCompile>
326329
</ItemGroup>
327330
</Project>

IfcPlusPlus/src/external/Carve/src/include/carve/geom3d.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ namespace carve {
130130
}
131131
}
132132

133-
double lengthOfNormalVector = n.length();
134-
if( lengthOfNormalVector < CARVE_EPSILON * 0.001 )
133+
double length2OfNormalVector = n.length2();
134+
if( length2OfNormalVector < CARVE_EPSILON * CARVE_EPSILON * 0.000001 )
135135
{
136136
n.x = 1.0;
137137
n.y = 0.0;
@@ -160,7 +160,7 @@ namespace carve {
160160
}
161161

162162
#if defined(_DEBUG)
163-
if( numPointsNotInPlane > 0 && lengthOfNormalVector > 0.2 )
163+
if( numPointsNotInPlane > 0 && length2OfNormalVector > 0.2 * 0.2)
164164
{
165165
std::stringstream strs_out;
166166
strs_out << "Polyline{\nvertices{" << std::endl;

0 commit comments

Comments
 (0)