mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 17:31:45 +00:00
Include cgal patch for nary union
This commit is contained in:
+17
-1
@@ -673,7 +673,23 @@ if "cgal" in targets:
|
||||
if BUILD_CFG != "Debug":
|
||||
# CGAL only supports Debug and Release for CMAKE_BUILD_TYPE
|
||||
BUILD_CFG = "Release"
|
||||
build_dependency(name="cgal-{CGAL_VERSION}".format(**locals()), mode="cmake", build_tool_args=["-DGMP_LIBRARIES=%s/install/gmp-%s/lib/libgmp.a" % (DEPS_DIR, GMP_VERSION), "-DGMP_INCLUDE_DIR=%s/install/gmp-%s/include" % (DEPS_DIR, GMP_VERSION), "-DMPFR_LIBRARIES=%s/install/mpfr-%s/lib/libmpfr.a" % (DEPS_DIR, MPFR_VERSION), "-DMPFR_INCLUDE_DIR=%s/install/mpfr-%s/include" % (DEPS_DIR, MPFR_VERSION), "-DBoost_INCLUDE_DIR=%s/install/boost-%s" % (DEPS_DIR, BOOST_VERSION), "-DCMAKE_INSTALL_PREFIX=%s/install/cgal-%s/" % (DEPS_DIR, CGAL_VERSION), "-DBUILD_SHARED_LIBS=Off"], download_url="https://github.com/CGAL/cgal.git", download_name="cgal", download_tool=download_tool_git, revision="releases/CGAL-{CGAL_VERSION}".format(**locals()))
|
||||
build_dependency(
|
||||
name="cgal-{CGAL_VERSION}".format(**locals()),
|
||||
mode="cmake",
|
||||
patch="./patches/cgal/cgal_4768.patch",
|
||||
build_tool_args=[
|
||||
"-DGMP_LIBRARIES=%s/install/gmp-%s/lib/libgmp.a" % (DEPS_DIR, GMP_VERSION),
|
||||
"-DGMP_INCLUDE_DIR=%s/install/gmp-%s/include" % (DEPS_DIR, GMP_VERSION),
|
||||
"-DMPFR_LIBRARIES=%s/install/mpfr-%s/lib/libmpfr.a" % (DEPS_DIR, MPFR_VERSION),
|
||||
"-DMPFR_INCLUDE_DIR=%s/install/mpfr-%s/include" % (DEPS_DIR, MPFR_VERSION),
|
||||
"-DBoost_INCLUDE_DIR=%s/install/boost-%s" % (DEPS_DIR, BOOST_VERSION),
|
||||
"-DCMAKE_INSTALL_PREFIX=%s/install/cgal-%s/" % (DEPS_DIR, CGAL_VERSION),
|
||||
"-DBUILD_SHARED_LIBS=Off"],
|
||||
download_url="https://github.com/CGAL/cgal.git",
|
||||
download_name="cgal",
|
||||
download_tool=download_tool_git,
|
||||
revision="releases/CGAL-{CGAL_VERSION}".format(**locals())
|
||||
)
|
||||
BUILD_CFG = OLD_BUILD_CFG
|
||||
|
||||
if "voxel" in targets:
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From a86712d1aae9a1a6d2004db3fc8fcdac6ef6b782 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Krijnen <t.krijnen@gmail.com>
|
||||
Date: Sun, 7 Jun 2020 15:25:18 +0200
|
||||
Subject: [PATCH] Don't segfault on empty Nef_nary_x
|
||||
|
||||
---
|
||||
Nef_3/include/CGAL/Nef_nary_intersection_3.h | 3 ++-
|
||||
Nef_3/include/CGAL/Nef_nary_union_3.h | 3 ++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Nef_3/include/CGAL/Nef_nary_intersection_3.h b/Nef_3/include/CGAL/Nef_nary_intersection_3.h
|
||||
index 70fc5791fae..5178705dc2f 100644
|
||||
--- a/Nef_3/include/CGAL/Nef_nary_intersection_3.h
|
||||
+++ b/Nef_3/include/CGAL/Nef_nary_intersection_3.h
|
||||
@@ -52,7 +52,8 @@ class Nef_nary_intersection_3 {
|
||||
}
|
||||
|
||||
Polyhedron get_intersection() {
|
||||
-
|
||||
+ if (queue.empty())
|
||||
+ return empty;
|
||||
while(queue.size() > 1)
|
||||
intersect();
|
||||
inserted = 0;
|
||||
diff --git a/Nef_3/include/CGAL/Nef_nary_union_3.h b/Nef_3/include/CGAL/Nef_nary_union_3.h
|
||||
index ecbbae2db59..c8663bb911b 100644
|
||||
--- a/Nef_3/include/CGAL/Nef_nary_union_3.h
|
||||
+++ b/Nef_3/include/CGAL/Nef_nary_union_3.h
|
||||
@@ -52,7 +52,8 @@ class Nef_nary_union_3 {
|
||||
}
|
||||
|
||||
Polyhedron get_union() {
|
||||
-
|
||||
+ if (queue.empty())
|
||||
+ return empty;
|
||||
while(queue.size() > 1)
|
||||
unite();
|
||||
inserted = 0;
|
||||
@@ -447,6 +447,7 @@ IF NOT %ERRORLEVEL%==0 GOTO :Error
|
||||
cd "%DEPENDENCY_DIR%"
|
||||
git reset --hard
|
||||
git apply "%~dp0patches\cgal_no_zlib.patch"
|
||||
git apply "%~dp0patches\cgal_4768.patch"
|
||||
call :RunCMake -DCMAKE_INSTALL_PREFIX="%INSTALL_DIR%\cgal" ^
|
||||
-DBOOST_ROOT="%DEPS_DIR%\boost_%BOOST_VER%" ^
|
||||
-DGMP_INCLUDE_DIR="%INSTALL_DIR%\mpir" ^
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
From a86712d1aae9a1a6d2004db3fc8fcdac6ef6b782 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Krijnen <t.krijnen@gmail.com>
|
||||
Date: Sun, 7 Jun 2020 15:25:18 +0200
|
||||
Subject: [PATCH] Don't segfault on empty Nef_nary_x
|
||||
|
||||
---
|
||||
Nef_3/include/CGAL/Nef_nary_intersection_3.h | 3 ++-
|
||||
Nef_3/include/CGAL/Nef_nary_union_3.h | 3 ++-
|
||||
2 files changed, 4 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Nef_3/include/CGAL/Nef_nary_intersection_3.h b/Nef_3/include/CGAL/Nef_nary_intersection_3.h
|
||||
index 70fc5791fae..5178705dc2f 100644
|
||||
--- a/Nef_3/include/CGAL/Nef_nary_intersection_3.h
|
||||
+++ b/Nef_3/include/CGAL/Nef_nary_intersection_3.h
|
||||
@@ -52,7 +52,8 @@ class Nef_nary_intersection_3 {
|
||||
}
|
||||
|
||||
Polyhedron get_intersection() {
|
||||
-
|
||||
+ if (queue.empty())
|
||||
+ return empty;
|
||||
while(queue.size() > 1)
|
||||
intersect();
|
||||
inserted = 0;
|
||||
diff --git a/Nef_3/include/CGAL/Nef_nary_union_3.h b/Nef_3/include/CGAL/Nef_nary_union_3.h
|
||||
index ecbbae2db59..c8663bb911b 100644
|
||||
--- a/Nef_3/include/CGAL/Nef_nary_union_3.h
|
||||
+++ b/Nef_3/include/CGAL/Nef_nary_union_3.h
|
||||
@@ -52,7 +52,8 @@ class Nef_nary_union_3 {
|
||||
}
|
||||
|
||||
Polyhedron get_union() {
|
||||
-
|
||||
+ if (queue.empty())
|
||||
+ return empty;
|
||||
while(queue.size() > 1)
|
||||
unite();
|
||||
inserted = 0;
|
||||
Reference in New Issue
Block a user