Subject: CGAL users discussion list
List archive
- From: "Sebastian Marino" <>
- To:
- Subject: Re: [cgal-discuss] Need to write facets created from Implicit surface meshing
- Date: Mon, 1 Dec 2008 11:23:41 -0800
Laurent, thank you for your comments.
On Mon, Dec 1, 2008 at 2:21 AM, Laurent Rineau
<>
wrote:
> On Monday 01 December 2008 05:42:39 Sebastian Marino wrote:
>> I was only playing around with this, however, I use the following
>> block of code to extract the facets from such a triangulation:
>>
>> std::map<Vertex_handle, unsigned int> vh_to_index_map;
>> unsigned int index( 0 ); for(
>> CGAL::Complex_2_in_triangulation_3<Tr>::Vertex_iterator iter(
>> c2t3.vertices_begin() ); iter != c2t3.vertices_end(); iter++ )
>> {
>> const Vertex_handle vh( static_cast<Vertex_handle>( iter ) );
>
> No need for the static_cast: it is done automatically. Actually, there is no
> need for that variable "vh" at all.
>
>> const Vertex v( *vh );
>
> No need for "v".
>
>> const Point p( v.point() );
>
> You can use "iter->point()", instead of "v.point()".
>
>> const double x( p.x() );
>> const double y( p.y() );
>> const double z( p.z() );
>> _vertices.push_back( Imath::V3d( x, y, z ) );
>> vh_to_index_map[vh] = index++;
>
> Idem: you can use "vh_to_index_map[iter]", because the type of "iter" is
> castable to "Vertex_handle" (there is a cast operator defined in the
> iterator
> type).
>
> --
> Laurent Rineau, PhD
> Engineer at GeometryFactory
> http://www.geometryfactory.com/
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>
--
Sebastian Marino
Chief Software Architect
Makani Power, Inc., Alameda, Ca.
www.makanipower.com
510.387.8077
han
- Re: [cgal-discuss] Need to write facets created from Implicit surface meshing, Sebastian Marino, 12/01/2008
- Re: [cgal-discuss] Need to write facets created from Implicit surface meshing, Laurent Rineau, 12/01/2008
- Re: [cgal-discuss] Need to write facets created from Implicit surface meshing, Sebastian Marino, 12/01/2008
- Re: [cgal-discuss] Need to write facets created from Implicit surface meshing, Laurent Rineau, 12/01/2008
Archive powered by MHonArc 2.6.16.