Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Plane equations and cartesian<double> kernel

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Plane equations and cartesian<double> kernel


Chronological Thread 
  • From: "Jens K. Becker" <>
  • To:
  • Subject: Re: [cgal-discuss] Plane equations and cartesian<double> kernel
  • Date: Thu, 2 Oct 2008 11:43:12 +0200

if I use this:

Plane(f1->halfedge()->vertex()->point(),f1->halfedge()->next()->vertex()->point(),f1->halfedge()->prev()->vertex()->point())==Plane(f2->halfedge()->vertex()->point(),f2->halfedge()->next()->vertex()->point(),f2->halfedge()->prev()->vertex()->point())

to check if two facets are in the same plane, it crashes with

CGAL error: precondition violation!
Expr: circulator_size(h->vertex_begin()) >= size_type(3)
while trying to remove a halfedge

(because the facets are not coplanar).

If I use f1->plane()==f2->plane(), it does not crash but does not find any
coplanar facets. Using typedef
CGAL::Exact_predicates_inexact_constructions_kernel K; for both cases.

I also changed the code to test first if they are adjacent and then if they are
coplanar, the problem remains...

Something with the plane equations does not work (for me). Does anybody have any
other ideas how to check if two facets are coplanar (without using the build-in
plane-equation?)?

Thanks for your help,

Jens Becker
--
Dr. J.K. Becker
University of Tuebingen - Institute for Geoscience
Sigwartst. 10 - 72076 Tuebingen (Germany)
Tel.: ++49 7071 29 73139 Fax: +49 7071 5059
web: http://www.jkbecker.de


Quoting Camille Wormser
<>:

I had a code (see below) that
does that and it worked nicely using a homogeneous kernel with Gmpz. Now I have
changed the kernel to be Cartesian<double> and the function does not work
anymore.

I did not read your code in detail, but you say

I tried different Kernels types (including
Exact_predicates_inexact_constructions_kernel) but the problem remains.

Then it probably means that you are performing some constructions.

I see that you test first "f1->plane()==f2->plane()", and then "f2- >halfedge()->next()->opposite()->facet()==f1".

So the supporting planes are constructed before being compared. You can avoid this construction by first testing that the two faces are adjacent, and then checking whether the four vertices are coplanar or not.

This may solve your problem, if you use Exact_predicates_inexact_constructions_kernel again.
--
Camille

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss







Archive powered by MHonArc 2.6.16.

Top of Page