Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Setting Sphere Radius

Subject: CGAL users discussion list

List archive

[cgal-discuss] Setting Sphere Radius


Chronological Thread 
  • From: Omer Ozturk <>
  • To:
  • Subject: [cgal-discuss] Setting Sphere Radius
  • Date: Thu, 20 Nov 2014 03:29:34 -0800 (PST)

Hello everyone,

I'm trying to add several spheres with different radius. In the code, I'm
passing different radius values but it has no effect to the sphere. They all
have the same size. What I'm doing wrong? Please help me.

Thanks. My Code;


FT sphere_function (Point_3 p) {
const FT x2=p.x()*p.x(), y2=p.y()*p.y(), z2=p.z()*p.z();
return x2+y2+z2-1;
}

void MainWindow::AddSphere(){


Tr tr; // 3D-Delaunay triangulation
C2t3 c2t3 (tr); // 2D-complex in 3D-Delaunay triangulation
// defining the surface

double radius = 1.0; //This is where I set the different radius values

Surface_3 surface(sphere_function, // pointer to function
Sphere_3(CGAL::ORIGIN, radius)); // bounding sphere


//Set criteria by given radius.
CGAL::Surface_mesh_default_criteria_3 Tr
criteria(radius*5.0,radius/4.0,radius/4.0);


Polyhedron *sphere = new Polyhedron;

CGAL::make_surface_mesh(c2t3, surface, criteria,
CGAL::Non_manifold_tag());

CGAL::Complex_2_in_triangulation_3_polyhedron_builder C2t3, Polyhedron
builder(c2t3);
sphere->delegate(builder);

Scene_item* item = new Scene_polyhedron_item(sphere);

scene->addItem(item);
}



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Setting-Sphere-Radius-tp4660143.html
Sent from the cgal-discuss mailing list archive at Nabble.com.


  • [cgal-discuss] Setting Sphere Radius, Omer Ozturk, 11/20/2014

Archive powered by MHonArc 2.6.18.

Top of Page