Subject: CGAL users discussion list
List archive
- From: Priyank Jain <>
- To:
- Subject: Re: [cgal-discuss] Always a degenerate plane, why ???
- Date: Mon, 19 Oct 2009 12:26:57 -0400
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=x4snWfPJky8iRW4A4eFBEp0pxAblpaJfRsQx7nbZeCDz1PFkU9IamV4KWd2b3hMyP+ SA3RJWfC/EmfQ6XG9pPhziLUa+l/XQ0r2g7wfc+gf880y08jod8WzSjk6nCSY+sv12VD Zx8xL2c7TXmwy3IGMdQwBapNgOg0Z+iKfsRC4=
Hi Andreas,
I understand that, but I thought when I make the polyhedron, the plane is generated and stored within.
So, when I do this:
Polyhedron model;
Point_3 p( 1.0, 0.0, 0.0);
Point_3 q( 0.0, 1.0, 0.0);
Point_3 r( 0.0, 0.0, 0.0);
model.make_triangle(p, q, r);
Wouldn't the plane (formed due to the triangle) be generated / initialiazed automatically ?
Thanks
/Priyank
Andreas Fabri wrote:
Hi Priyank,
You have to initialize the plane yourself. The Polyhedron only provides the storage.
andreas
Priyank Jain wrote:
I am always getting a degenerate plane, when I try to find out the plane from the given half-edge in Polyhedron data structure. Any guesses why ???
for(Halfedge_iterator hedge_it = model.halfedges_begin() ; hedge_it !=
model.halfedges_end(); hedge_it++)
{
// proceed for boundary edges
if( hedge_it->is_border() == false) // boundary(hedge_it)
continue;
// find x_proj by:
// "projecting_distance" perpendicular to "hedge_it" from the midpoint
of hedge_it
// in the plane of the model at hedge_it
// Finding the midpoint: midPt
Point_3& point1 = hedge_it->vertex()->point();
Point_3& point2 = hedge_it->opposite()->vertex()->point();
Point_3& midPt = midpoint(point1, point2);
Plane& plane = hedge_it->opposite()->face()->plane(); //opposite
half-edge since this gives the plane of the model at that edge
Vector3& direction = plane.orthogonal_vector();
//debugging purposes
Point_3 pt = plane.point();
bool waste = false;
waste = plane.is_degenerate();
//Vertex_3 x_proj = hedge_it.project(midpoint, projecting_distance);
Point_3& x_proj = midPt + (direction * projecting_distance);
}
waste (degenerate plane) always becomes true, why ? I tried different values
of
vertices, but still..
Polyhedron model is made up of:
Point_3 p( 1.0, 0.0, 0.0);
Point_3 q( 0.0, 1.0, 0.0);
Point_3 r( 0.0, 0.0, 0.0);
model.make_triangle(p, q, r);
Can someone please help me with this?
Thanks
- [cgal-discuss] Always a degenerate plane, why ???, Priyank Jain, 10/19/2009
- Re: [cgal-discuss] Always a degenerate plane, why ???, Andreas Fabri, 10/19/2009
- Re: [cgal-discuss] Always a degenerate plane, why ???, Priyank Jain, 10/19/2009
- Re: [cgal-discuss] Always a degenerate plane, why ???, Andreas Fabri, 10/19/2009
Archive powered by MHonArc 2.6.16.