Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Coordinates in Mesh_3

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Coordinates in Mesh_3


Chronological Thread 
  • From: Rasmus Bach Nielsen <>
  • To:
  • Subject: Re: [cgal-discuss] Coordinates in Mesh_3
  • Date: Thu, 21 Oct 2010 20:37:49 +0200

You are of coures right. I was fiddling with the radius of the bounding sphere, instead of the radius of the sphere to mesh... Thank you for helping me see the obvious :-)

Regards
Rasmus


On 21-10-2010 09:00, Sebastien Loriot (GeometryFactory) wrote:
rusmus wrote:
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,

as explained in the documentation,
http://www.cgal.org/Manual/latest/doc_html/cgal_manual/Mesh_3_ref/Class_Implicit_mesh_domain_3.html#Cross_link_anchor_1473
this is the function which indicates the signed distance from a point to the surface. In you case you indicated that the sphere as radius 1.
Don't forget to increase the square radius of the bounding sphere.

S.

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





Archive powered by MHonArc 2.6.16.

Top of Page