Subject: CGAL users discussion list
List archive
- From: "Sebastien Loriot (GeometryFactory)" <>
- To: "" <>
- Subject: Re: [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?
- Date: Sat, 26 Oct 2013 16:23:11 +0200
IIRC, the mesh domain is taking a bounded sphere as parameter, so changing the radius there only changes the bounding sphere. You indeed need to modify the oracle function.
Sebastien
On Friday, October 25, 2013, msmith81 <> wrote:
> Hello,
> I am fairly new to c++ and very new to CGAL. I got the example 3D Mesh
> Generation code for the implicit sphere to compile, and am playing around
> with parameters. My problem seems so simple but I just can't figure it out.
> I am very confused on how to actually change the radius of the generated
> sphere.
>
> The example code says
>
> // Domain (Warning: Sphere_3 constructor uses squared radius !)
> Mesh_domain domain(sphere_function, K::Sphere_3(CGAL::ORIGIN, 2.));
>
> I saw the warning and assumed that 2. was the squared radius value. However,
> no matter what number is put in here, the resulting sphere will always have
> a radius of 1. I was able to force it by modifying the sphere_function,
> given as:
>
> // Function
> FT sphere_function (const Point& p)
> { return CGAL::squared_distance(p, Point(CGAL::ORIGIN))-1; }
>
> For example, if I compile the code with
>
> FT sphere_function (const Point& p)
> { return CGAL::squared_distance(p, Point(CGAL::ORIGIN))-100; }
> ...
> Mesh_domain domain(sphere_function, K::Sphere_3(CGAL::ORIGIN, 100.));
>
> I will get a sphere with radius 10, as desired. But I suspect I am not
> supposed to modify the sphere_function in this way? One problem is I don't
> know how to use a variable for the radius in the sphere_function.
>
>
>
> --
> View this message in context: http://cgal-discuss.949826.n4.nabble.com/3D-Mesh-Generation-Sphere-example-changing-radius-tp4658300.html
> Sent from the cgal-discuss mailing list archive at Nabble.com.
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>
>
- [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?, msmith81, 10/25/2013
- Re: [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?, Sebastien Loriot (GeometryFactory), 10/26/2013
- Re: [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?, msmith81, 10/28/2013
- Re: [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?, Sebastien Loriot (GeometryFactory), 10/28/2013
- Re: [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?, msmith81, 10/28/2013
- Re: [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?, Laurent Rineau (CGAL/GeometryFactory), 10/29/2013
- Re: [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?, msmith81, 10/28/2013
- Re: [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?, Sebastien Loriot (GeometryFactory), 10/28/2013
- Re: [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?, msmith81, 10/28/2013
- Re: [cgal-discuss] 3D Mesh Generation Sphere example - changing radius?, Sebastien Loriot (GeometryFactory), 10/26/2013
Archive powered by MHonArc 2.6.18.