Skip to content

Commit

Permalink
improve geometry processing
Browse files Browse the repository at this point in the history
  • Loading branch information
ifcquery committed May 29, 2023
1 parent 036786f commit fa8e9b1
Show file tree
Hide file tree
Showing 1,809 changed files with 28,517 additions and 25,996 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,7 @@ examples/CreateIfcWallAndWriteFile/x64/
examples/LoadFileWithGeometryExampleConsole/dump_mesh_debug.txt
IfcPlusPlus-*
IfcPlusPlus/src/ifcpp/geometry/Carve - Copy/
IfcPlusPlus/src/ifcpp-
IfcPlusPlus/src/ifcpp--
IfcPlusPlus/src/ifcpp---/
IfcPlusPlus/src/ifcpp----/
9 changes: 4 additions & 5 deletions IfcPlusPlus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ set(IFCPP_SOURCE_FILES
src/ifcpp/reader/ReaderUtil.cpp
src/ifcpp/writer/WriterSTEP.cpp
src/ifcpp/writer/WriterUtil.cpp
src/ifcpp/geometry/MeshOps.cpp
src/ifcpp/geometry/GeometryInputData.cpp
src/external/manifold/src/boolean3.cpp
src/external/manifold/src/boolean_result.cpp
src/external/manifold/src/collider/src/collider.cpp
Expand Down Expand Up @@ -82,14 +84,11 @@ set(IFCPP_SOURCE_FILES
src/external/Carve/src/lib/timing.cpp
src/external/Carve/src/lib/triangle_intersection.cpp
src/external/Carve/src/lib/triangulator.cpp
src/external/Carve/src/common/geometry.cpp
src/external/Carve/src/common/geometry.cpp
src/external/zip-master/zip.c
)

if (MSVC)
set(IFCPP_SOURCE_FILES
src/external/XUnzip.cpp # do not add src/external/XUnzip.cpp on unix platforms
${IFCPP_SOURCE_FILES})
#set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj ")
set_source_files_properties(src/ifcpp/IFC4X3/EntityFactory.cpp PROPERTIES COMPILE_FLAGS /bigobj)
set_source_files_properties(src/ifcpp/IFC4X3/TypeFactory.cpp PROPERTIES COMPILE_FLAGS /bigobj)
endif()
Expand Down
7 changes: 4 additions & 3 deletions IfcPlusPlus/IfcPlusPlus.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<PropertyGroup Label="Globals">
<ProjectGuid>{9700AD93-4F6B-484A-BA34-FC4C97E5C645}</ProjectGuid>
<RootNamespace>IfcPlusPlus</RootNamespace>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
Expand Down Expand Up @@ -341,7 +341,9 @@
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\external\XUnzip.cpp" />
<ClCompile Include="src\external\zip-master\zip.c" />
<ClCompile Include="src\ifcpp\geometry\GeometryInputData.cpp" />
<ClCompile Include="src\ifcpp\geometry\MeshOps.cpp" />
<ClCompile Include="src\ifcpp\IFC4X3\EntityFactory.cpp">
<AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">/bigobj %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
Expand Down Expand Up @@ -402,7 +404,6 @@
<ClCompile Include="src\external\Carve\src\lib\triangulator.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="src\external\XUnzip.h" />
<ClInclude Include="src\ifcpp\geometry\AppearanceData.h" />
<ClInclude Include="src\ifcpp\geometry\ConverterOSG.h" />
<ClInclude Include="src\ifcpp\geometry\CSG_Adapter.h" />
Expand Down
15 changes: 9 additions & 6 deletions IfcPlusPlus/IfcPlusPlus.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,6 @@
<ClInclude Include="src\ifcpp\reader\AbstractReader.h">
<Filter>Headerdateien</Filter>
</ClInclude>
<ClInclude Include="src\external\XUnzip.h">
<Filter>Headerdateien</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\ifcpp\model\UnitConverter.cpp">
Expand All @@ -179,9 +176,6 @@
<ClCompile Include="src\ifcpp\writer\WriterUtil.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="src\external\XUnzip.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="src\ifcpp\model\BuildingGuid.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
Expand Down Expand Up @@ -323,5 +317,14 @@
<ClCompile Include="src\external\Carve\src\lib\triangulator.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="src\external\zip-master\zip.c">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="src\ifcpp\geometry\MeshOps.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
<ClCompile Include="src\ifcpp\geometry\GeometryInputData.cpp">
<Filter>Quelldateien</Filter>
</ClCompile>
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions IfcPlusPlus/src/external/Carve/src/include/carve/geom3d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ namespace carve {
}
}

double lengthOfNormalVector = n.length();
if( lengthOfNormalVector < CARVE_EPSILON * 0.001 )
double length2OfNormalVector = n.length2();
if( length2OfNormalVector < CARVE_EPSILON * CARVE_EPSILON * 0.000001 )
{
n.x = 1.0;
n.y = 0.0;
Expand Down Expand Up @@ -160,7 +160,7 @@ namespace carve {
}

#if defined(_DEBUG)
if( numPointsNotInPlane > 0 && lengthOfNormalVector > 0.2 )
if( numPointsNotInPlane > 0 && length2OfNormalVector > 0.2 * 0.2)
{
std::stringstream strs_out;
strs_out << "Polyline{\nvertices{" << std::endl;
Expand Down
Loading

0 comments on commit fa8e9b1

Please sign in to comment.