Subject: CGAL users discussion list
List archive
- From: Sylvain Pion <>
- To:
- Cc:
- Subject: Re: [cgal-discuss] Problem in 3D Triangulation
- Date: Tue, 15 Jul 2008 11:20:37 +0200
- Organization: INRIA
Sylvain Pion a écrit :
Yang Liu a écrit :
Dear all,
Recently I am using CGAL to compute 3D triangulation.
For some input data, the 3D triangulation does not work.
My simple test code is attached at the end of this email.
I am using Microsoft Visual Studio 2008 and CGAL-3.3.1.
The CGAL library is recompiled under VS2008.
My program always reports "Microsoft C++ exception: CGAL::Uncertain_conversion_exception at memory location ..." in debug mode.
This issue has already been raised on the list. Please have a look at
the archive for details. I have also added it to the FAQ:
http://www.cgal.org/FAQ.html#uncertain_exception .
Maybe there is a way to tell the debugger to ignore it.
Further investigation showed that there is actually an issue in CGAL 3.3.1.
Please use the replacement file attached for
include/CGAL/number_utils_classes.h .
This should reduce/eliminate many uses of those internal exceptions.
As a bonus, it may give a speedup for some degenerate data sets.
--
Sylvain Pion
INRIA Sophia-Antipolis
Geometrica Project-Team
CGAL, http://cgal.org/
// Copyright (c) 1997 Utrecht University (The Netherlands),
// ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany),
// INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
// (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz
(Austria),
// and Tel-Aviv University (Israel). All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with CGAL.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the
software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL:
svn+ssh://scm.gforge.inria.fr/svn/cgal/trunk/Algebraic_foundations/include/CGAL/number_utils_classes.h
$
// $Id: number_utils_classes.h 44021 2008-07-08 07:03:41Z hemmer $
//
//
// Author(s) : Michael Hoffmann
<>
// : Michael Hemmer
<>
// to be included by number_utils.h
#ifndef CGAL_NUMBER_UTILS_CLASSES_H
#define CGAL_NUMBER_UTILS_CLASSES_H 1
#include <CGAL/number_type_basic.h>
#include <algorithm>
#include <utility>
CGAL_BEGIN_NAMESPACE
/* Defines functors:
- Is_zero
- Is_one
- Is_negative
- Is_positive
- Sgn
- Abs
- Compare
- Square
- Sqrt
- Div
- Gcd
- To_double
- To_interval
*/
template < class NT >
struct Is_negative : Real_embeddable_traits<NT>::Is_negative {};
template < class NT >
struct Is_positive : Real_embeddable_traits<NT>::Is_positive {};
template < class NT >
struct Abs : Real_embeddable_traits<NT>::Abs{};
template < class NT >
struct To_double : Real_embeddable_traits<NT>::To_double{};
template < class NT >
struct To_interval : Real_embeddable_traits<NT>::To_interval{};
// Sign would result in a name clash with enum.h
template < class NT >
struct Sgn : Real_embeddable_traits<NT>::Sign {};
template < class NT >
struct Square : Algebraic_structure_traits<NT>::Square{};
template < class NT >
struct Sqrt : Algebraic_structure_traits<NT>::Sqrt {};
template < class NT >
struct Div : Algebraic_structure_traits<NT>::Div{};
template < class NT >
struct Gcd : Algebraic_structure_traits<NT>::Gcd{};
template < class NT >
struct Is_one : Algebraic_structure_traits<NT>::Is_one {};
// This is due to the fact that Is_zero may be provided by
// Algebraic_structure_traits as well as Real_embeddable_traits
// Of course it is not possible to derive from both since this
// would cause an ambiguity.
namespace CGALi{
template <class AST_Is_zero, class RET_Is_zero>
struct Is_zero_base : AST_Is_zero {} ;
template <class RET_Is_zero>
struct Is_zero_base <CGAL::Null_functor, RET_Is_zero >: RET_Is_zero {} ;
} // namespace CGALi
template < class NT >
struct Is_zero :
CGALi::Is_zero_base
<typename Algebraic_structure_traits<NT>::Is_zero,
typename Real_embeddable_traits<NT>::Is_zero>{};
// This is due to the fact that CGAL::Compare is used for other
// non-realembeddable types as well.
// In this case we try to provide a default implementation
namespace CGALi {
template <class NT, class Compare> struct Compare_base: public Compare {};
template <class NT> struct Compare_base<NT,Null_functor>
:public Binary_function< NT, NT, Comparison_result > {
Comparison_result operator()( const NT& x, const NT& y) const
{
if (x < y) return SMALLER;
if (x > y) return LARGER;
CGAL_postcondition(x == y);
return EQUAL;
}
};
} // namespace CGALi
template < class NT >
struct Compare
:public CGALi::Compare_base
<NT,typename Real_embeddable_traits<NT>::Compare>{};
CGAL_END_NAMESPACE
#endif // CGAL_NUMBER_UTILS_CLASSES_H
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature
- Re: [cgal-discuss] Problem in 3D Triangulation, Sylvain Pion, 07/15/2008
Archive powered by MHonArc 2.6.16.