Subject: CGAL users discussion list
List archive
- From: rusmus <>
- To:
- Subject: [cgal-discuss] Coordinates in Mesh_3
- Date: Wed, 20 Oct 2010 11:12:21 -0700 (PDT)
Hello all,
I am new to CGAL, and I have a question regarding coordinates in
Mesh_complex_3_in_triangulation_3, using an implicit domain.
Using the following code, I am able to mesh a sphere (I know that this goes
well, because the medit output looks right), iterate over the cells in the
mesh, and print the coordinates of the circumcenter of each cell. My problem
is with the interpretation of the coordinates. They are all between 0 and 1,
which would be OK if I could find some documentation that explained why, but
no such luck. I assume that they are somehow normalized, but how? and is
there a way of getting non-normalized coordinates?
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Mesh_triangulation_3.h>
#include <CGAL/Mesh_complex_3_in_triangulation_3.h>
#include <CGAL/Mesh_criteria_3.h>
#include <CGAL/Implicit_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point;
typedef Kernel::Vector_3 Vector;
typedef FT (Function)(const Point&);
typedef CGAL::Implicit_mesh_domain_3<Function, Kernel> Domain;
typedef CGAL::Mesh_triangulation_3<Domain>::type Triangulation;
typedef CGAL::Mesh_complex_3_in_triangulation_3<Triangulation> C3t3;
typedef CGAL::Mesh_criteria_3<Triangulation> Criteria;
using namespace CGAL::parameters;
FT sphere_function(const Point& p)
{
return CGAL::squared_distance(p, Point(CGAL::ORIGIN)) -1;
}
Domain domain(sphere_function, Kernel::Sphere_3(CGAL::ORIGIN, 10.));
Criteria criteria(facet_angle=30, facet_size=0.1, facet_distance=0.025,
cell_radius_edge=2, cell_size=0.1);
C3t3 c3t3;
int main(int argc, char* argv[])
{
c3t3 = CGAL::make_mesh_3<C3t3>(domain, criteria);
for(C3t3::Cell_iterator it = c3t3.cells_begin();
!it.is_end();
it++)
{
C3t3::Cell_handle c = it;
Point p = c->circumcenter();
std::cout << p << std::endl;
}
}
I hope you can help me.
Thank you in advance
Rasmus Bach Nielsen
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Coordinates-in-Mesh-3-tp3004351p3004351.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Coordinates in Mesh_3, rusmus, 10/20/2010
- Re: [cgal-discuss] Coordinates in Mesh_3, Sebastien Loriot (GeometryFactory), 10/21/2010
- Re: [cgal-discuss] Coordinates in Mesh_3, Rasmus Bach Nielsen, 10/21/2010
- Re: [cgal-discuss] Coordinates in Mesh_3, Sebastien Loriot (GeometryFactory), 10/21/2010
Archive powered by MHonArc 2.6.16.