Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Always a degenerate plane, why ???

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Always a degenerate plane, why ???


Chronological Thread 
  • From: Andreas Fabri <>
  • To:
  • Subject: Re: [cgal-discuss] Always a degenerate plane, why ???
  • Date: Mon, 19 Oct 2009 18:22:18 +0200


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




Archive powered by MHonArc 2.6.16.

Top of Page