Subject: CGAL users discussion list
List archive
- From: Bart Janssens <>
- To:
- Subject: Re: [cgal-discuss] Inconsistent results in 3D booleans on Nef
- Date: Sun, 1 Feb 2009 22:20:18 +0100
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; b=FffEIA4oNWIbHzJ73he+8K61SADDlL7iGm2ajBGW7o4HUo/bCJKO+IUm9GxiPgtXM+ ka7Cji81Qi+Ogi6HyRwDbimKQ//sdibQsWRlRLW2SXe5O1vIhfPWO38UooRq4PFBHpa4 ajW1rOwTaziuVb4cc3Y3Jo3u1hhVKpu7cJ6LU=
On Sat, Jan 31, 2009 at 12:58 AM, Peter Hachenberger
<>
wrote:
> you can patch Nef_3 in the following way to get
> rid of the inconsistencies:
> Halfedge:
> bool is_twin() const
> { return twin_->source()->point() < center_vertex_->point(); }
Hi Peter,
Thanks for the help! Attached is the patch after implementing your
suggestions. The only deviation is in Halfedge: it seems that twin_
can be null, so I added an extra check.
Cheers,
--
Bart
diff -urp CGAL-3.4/include/CGAL/Nef_3/binop_intersection_tests.h CGAL-3.4-patched/include/CGAL/Nef_3/binop_intersection_tests.h --- CGAL-3.4/include/CGAL/Nef_3/binop_intersection_tests.h 2008-12-19 14:50:49.000000000 +0100 +++ CGAL-3.4-patched/include/CGAL/Nef_3/binop_intersection_tests.h 2009-01-31 14:59:50.000000000 +0100 @@ -24,6 +24,7 @@ #include <vector> #include <iostream> #include <CGAL/Timer.h> +#include <CGAL/Random.h> CGAL_BEGIN_NAMESPACE @@ -136,6 +137,7 @@ struct binop_intersection_test_segment_t SNC_structure& sncp, SNC_structure& snc1i) { + CGAL::Random dummy(12345); Halfedge_iterator e0, e1; Halffacet_iterator f0, f1; std::vector<Nef_box> a, b; diff -urp CGAL-3.4/include/CGAL/Nef_3/Halfedge.h CGAL-3.4-patched/include/CGAL/Nef_3/Halfedge.h --- CGAL-3.4/include/CGAL/Nef_3/Halfedge.h 2008-12-19 14:50:49.000000000 +0100 +++ CGAL-3.4-patched/include/CGAL/Nef_3/Halfedge.h 2009-02-01 22:10:20.000000000 +0100 @@ -133,7 +133,7 @@ class Halfedge_base return os.str(); } - bool is_twin() const { return (&*twin_ < this); } + bool is_twin() const { return twin_ == NULL || twin_->source()->point() < center_vertex_->point(); } bool is_valid( bool verb = false, int level = 0) const { diff -urp CGAL-3.4/include/CGAL/Nef_3/Halffacet.h CGAL-3.4-patched/include/CGAL/Nef_3/Halffacet.h --- CGAL-3.4/include/CGAL/Nef_3/Halffacet.h 2008-12-19 14:50:49.000000000 +0100 +++ CGAL-3.4-patched/include/CGAL/Nef_3/Halffacet.h 2009-01-31 14:57:13.000000000 +0100 @@ -110,7 +110,7 @@ class Halffacet_base { Halffacet_cycle_const_iterator facet_cycles_end() const { return boundary_entry_objects_.end(); } - bool is_twin() const { return (&*twin_ < this); } + bool is_twin() const { return (CGAL::ORIGIN + twin_->plane().orthogonal_vector()) < (CGAL::ORIGIN + supporting_plane_.orthogonal_vector()); } bool is_valid( bool verb = false, int level = 0) const { diff -urp CGAL-3.4/include/CGAL/Nef_3/SHalfedge.h CGAL-3.4-patched/include/CGAL/Nef_3/SHalfedge.h --- CGAL-3.4/include/CGAL/Nef_3/SHalfedge.h 2008-12-19 14:50:49.000000000 +0100 +++ CGAL-3.4-patched/include/CGAL/Nef_3/SHalfedge.h 2009-01-31 14:57:46.000000000 +0100 @@ -202,7 +202,7 @@ class SHalfedge_base { return os.str(); } - bool is_twin() const { return (&*twin_ < this); } + bool is_twin() const { return (CGAL::ORIGIN + twin_->circle().orthogonal_vector()) < (CGAL::ORIGIN + circle_.orthogonal_vector()); } bool is_valid( bool verb = false, int level = 0) const { diff -urp CGAL-3.4/include/CGAL/Nef_3/SHalfloop.h CGAL-3.4-patched/include/CGAL/Nef_3/SHalfloop.h --- CGAL-3.4/include/CGAL/Nef_3/SHalfloop.h 2008-12-19 14:50:49.000000000 +0100 +++ CGAL-3.4-patched/include/CGAL/Nef_3/SHalfloop.h 2009-01-31 14:58:04.000000000 +0100 @@ -102,7 +102,7 @@ class SHalfloop_base { return os.str(); } - bool is_twin() const { return (&*twin_ < this); } + bool is_twin() const { return (CGAL::ORIGIN + twin_->circle().orthogonal_vector()) < (CGAL::ORIGIN + circle_.orthogonal_vector()); } bool is_valid( bool verb = false, int level = 0) const {
- Re: [cgal-discuss] Inconsistent results in 3D booleans on Nef, Bart Janssens, 02/01/2009
Archive powered by MHonArc 2.6.16.