From 34a5f89184072d85be8bc9778f06e2c78b379a0d Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Fri, 3 Feb 2012 03:19:56 +0100 Subject: [PATCH 1/2] Gracefully handle errors converting a Nef polyhedron to a polyset. Fixes #77 --- src/PolySetCGALEvaluator.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/PolySetCGALEvaluator.cc b/src/PolySetCGALEvaluator.cc index c3f4774b..22567f21 100644 --- a/src/PolySetCGALEvaluator.cc +++ b/src/PolySetCGALEvaluator.cc @@ -90,6 +90,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node) } PolySet *ps3 = sum.convertToPolyset(); + if (!ps3) return NULL; Grid2d conversion_grid(GRID_COARSE); for (size_t i = 0; i < ps3->polygons.size(); i++) { for (size_t j = 0; j < ps3->polygons[i].size(); j++) { @@ -121,6 +122,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const ProjectionNode &node) } PolySet *ps3 = sum.convertToPolyset(); + if (!ps3) return NULL; CGAL_Nef_polyhedron np; for (size_t i = 0; i < ps3->polygons.size(); i++) { @@ -385,7 +387,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const CgaladvNode &node) PolySet *ps = NULL; if (!N.empty()) { ps = N.convertToPolyset(); - ps->convexity = node.convexity; + if (ps) ps->convexity = node.convexity; } return ps; @@ -401,7 +403,7 @@ PolySet *PolySetCGALEvaluator::evaluatePolySet(const RenderNode &node) } else { ps = N.convertToPolyset(); - ps->convexity = node.convexity; + if (ps) ps->convexity = node.convexity; } } return ps; From 3072518e83a89c62cfe9ad0286b34a617cdf84c0 Mon Sep 17 00:00:00 2001 From: Marius Kintel Date: Fri, 3 Feb 2012 03:29:08 +0100 Subject: [PATCH 2/2] Updated to gmp-5.0.3 - now works on Mac OS X Lion. Also exit script on any error --- scripts/macosx-build-dependencies.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/macosx-build-dependencies.sh b/scripts/macosx-build-dependencies.sh index 3940b06d..68b82006 100755 --- a/scripts/macosx-build-dependencies.sh +++ b/scripts/macosx-build-dependencies.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/sh -e # # This script builds all library dependencies of OpenSCAD for Mac OS X. # The libraries will be build in 32- and 64-bit mode and backwards compatible with @@ -201,7 +201,7 @@ build_opencsg() echo "Using basedir:" $BASEDIR mkdir -p $SRCDIR $DEPLOYDIR -build_gmp 5.0.2 +build_gmp 5.0.3 build_mpfr 3.1.0 build_boost 1.47.0 # NB! For CGAL, also update the actual download URL in the function