Subject: CGAL users discussion list
List archive
Re: [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron
Chronological Thread
- From: Stephane Tayeb <>
- To:
- Subject: Re: [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron
- Date: Thu, 20 May 2010 17:12:09 +0200
Benjamin Bouscasse wrote:
OK, it compiles well now!
Thanks for the tip, so it means that the C3T3::iterator runs only on finite
cells?
Because for a similar application in 2D I have to add an
"if(fit->is_in_domain())" to select only the faces inside the meshed domain.
So I thought that "cit->is_in_complex()" was the 3D equivalent.
Thanks for the fast response,
Ben
Yes, C3T3::Cell_iterator iterates over cells of the triangulation which belongs to the c3t3 (i.e. which verify c3t3.is_in_complex(c)).
If you iterate over the cell of the triangulation, using C3T3::Triangulation::Cell_iterator, then you will have to check whether the cell is in complex or not. In the 2D case, you were maybe iterating on triangulation facets ?
Stéphane.
2010/5/20 Stephane Tayeb
<>
N2a wrote:
Hello,Hi,
I would like to create a 3D mesh from a polyhedral domain, like in the
example mesh_polyhedral_domain.cpp
After I want make a cycle on each cell in order to transform each cell in
a
tetrahedron. The tetrahedron class would be used to calculate geometrical
properties of the cells.
from :
http://www.cgal.org/Manual/3.2/doc_html/cgal_manual/Kernel_23_ref/Class_Tetrahedron_3.html
CGAL::Tetrahedron_3<K> is constructed by
Tetrahedron_3<Kernel> t ( Point_3<Kernel> p0,
Point_3<Kernel> p1,
Point_3<Kernel> p2,
Point_3<Kernel> p3);
introduces a tetrahedron t with vertices p0, p1, p2 and p3.
So I modify the mesh_polyhedral_domain.cpp example with :
-----------------------------------------------------------------------------------
#include <CGAL/Tetrahedron_3.h>
// Tetrahedron
typedef CGAL::Tetrahedron_3<K> Tetrahedron_3;
typedef K::Point_3 Point_3;
int main()
{
// Here create c3t3...
Point_3 p0,p1,p2,p3;
int mesh_cells_counter =0 ;
for(C3t3::Cell_iterator cit=c3t3.cells_begin(); cit != c3t3.cells_end();
++cit) {
if(c3t3.is_in_complex(cit)) {
++mesh_cells_counter;
p0=(cit->vertex(0)->point());
p1=(cit->vertex(1)->point());
p2=(cit->vertex(2)->point());
p3=(cit->vertex(3)->point());
std::cout << (cit->vertex(1)->point()) <<
std::endl;
Tetrahedron_3 tetra (p0,p1,p2,p3);
}
}
// std::cout << "Number of cells: " << mesh_cells_counter << std::endl;
return 0;
}
-----------------------------------------------------------------------------------------------------------------------
But the compilation failed and return BOOST::STATIC_ASSERTION_FAILURE and
I
really don't understand the problem.
In file included from /usr/include/CGAL/user_classes.h:48,
from /usr/include/CGAL/squared_distance_2_1.h:30,
from
/usr/include/CGAL/Circle_2_Circle_2_intersection.h:30,
from /usr/include/CGAL/intersection_2_3.h:29,
from /usr/include/CGAL/intersection_2.h:31,
from /usr/include/CGAL/intersections.h:29,
from /usr/include/CGAL/AABB_intersections.h:20,
from
/home/ben/CGAL/CGAL-3.6/examples/BenWork/mesh_polyhedral_domain_ben.cpp:1:
/usr/include/CGAL/Tetrahedron_3.h: In instantiation of
‘CGAL::Tetrahedron_3<K>’:
/home/ben/CGAL/CGAL-3.6/examples/BenWork/mesh_polyhedral_domain_ben.cpp:90:
instantiated from here
/usr/include/CGAL/Tetrahedron_3.h:42: error: invalid application of
‘sizeof’
to incomplete type ‘boost::STATIC_ASSERTION_FAILURE<false>’ make[2]: ***
[CMakeFiles/mesh_polyhedral_domain_ben.dir/mesh_polyhedral_domain_ben.o]
Errore 1
make[1]: *** [CMakeFiles/mesh_polyhedral_domain_ben.dir/all] Errore 2
Thanks,
Benjamin
Could you please try the following typedefs instead of yours (I don't know
if you want to use those or K::Tetrahedron_3 and K::Point_3 --
Tr::Geom_traits::Point_3 is actually a Weighted_point) ?
typedef Tr::Geom_traits::Tetrahedron_3 Tetrahedron_3;
typedef Tr::Geom_traits::Point_3 Point_3;
And I would also like to provide you a tip :)
the following code is equivalent to yours.
-----------
int mesh_cells_counter =0 ;
for(C3t3::Cell_iterator cit=c3t3.cells_begin(); cit != c3t3.cells_end();
++cit)
{
// cit is in c3t3 by definition
++mesh_cells_counter;
Tetrahedron_3 t = c3t3.triangulation().tetrahedron(cit);
}
assert (mesh_cells_counter == c3t3.number_of_cells());
-----------
Best,
Stéphane.
--
Stephane Tayeb
Software engineer - INRIA Sophia Antipolis
Geometrica Project-Team
--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
--
Stephane Tayeb
Software engineer - INRIA Sophia Antipolis
Geometrica Project-Team
- [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron, N2a, 05/20/2010
- Re: [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron, Stephane Tayeb, 05/20/2010
- Re: [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron, Benjamin Bouscasse, 05/20/2010
- Re: [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron, Stephane Tayeb, 05/20/2010
- Re: [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron, Benjamin Bouscasse, 05/20/2010
- Re: [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron, Laurent Rineau (GeometryFactory), 05/20/2010
- Re: [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron, Stephane Tayeb, 05/20/2010
- Re: [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron, Benjamin Bouscasse, 05/20/2010
- Re: [cgal-discuss] Boost:: STATIC_ASSERTION_FAILURE when instantiated tetrahedron, Stephane Tayeb, 05/20/2010
Archive powered by MHonArc 2.6.16.