Subject: CGAL users discussion list
List archive
- From: Max Harris <>
- To:
- Subject: Re: [cgal-discuss] Offset Plane
- Date: Fri, 27 May 2011 17:49:01 -0500
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:mime-version:content-type:subject:date:in-reply-to:to :references:message-id:x-mailer; b=swBND8at72sDKLRiYuR3QaDmct4ncyRHI/r3AgU+1YVvvMbrQcZc/mQ+j7J3gwNybc N0MgzPMRrqKQB5Gn6LL9E0N+BVyrcwYWaQdpcI2hTmFD2GJIYCjz9LR7y9yOgzCoXDWH o1T363aqrHHcp34HyLX2GCxaijgGFSnhTnnv4=
OK, your suggestion worked for that case, but I want to write a function that finds the correct Halfedge_handle for a given cutting plane. What follows is my attempt, which doesn't work. What's wrong with it? Halfedge_handle FindUsableHandle(Polyhedron P, Plane pl) { Halfedge_iterator hi; for (hi = P.halfedges_begin(); hi != P.halfedges_end(); hi++) { CGAL::Oriented_side test = pl.oriented_side(hi->vertex()->point()); if (test == CGAL::ON_POSITIVE_SIDE) { cout << "point on positive side" << endl; } else if (test == CGAL::ON_NEGATIVE_SIDE) { cout << "point on negative side" << endl; return hi; } else { cout << "point over line" << endl; } } return hi; } Polyhedron result; Halfedge_handle he = make_cube_3(result); CGAL::polyhedron_cut_plane_3(result, he->opposite()->next(), pl3); // works CGAL::polyhedron_cut_plane_3(result, FindUsableHandle(P, pl3), pl3); // does not work. see output below output: Facet number: 0 Plane: -0 -1 -0 -0 Normal: -0 -1 -0 Scaled normal: -0 0.1 -0 Transformed plane: -0 -1 -0 0.1 point on positive side point on positive side point on positive side point on positive side point on positive side point on positive side point on negative side terminate called after throwing an instance of 'CGAL::Postcondition_exception' what(): CGAL ERROR: postcondition violation! Expr: D.is_valid(false,3) File: /usr/local/include/CGAL/halfedgeDS_cut_component.h Line: 126 (gdb) On May 27, 2011, at 2:29 AM, Sebastien Loriot (GeometryFactory) wrote:
|
- [cgal-discuss] Offset Plane, harris . max, 05/25/2011
- Re: [cgal-discuss] Offset Plane, Marc Glisse, 05/25/2011
- Re: [cgal-discuss] Offset Plane, Max Harris, 05/26/2011
- Re: [cgal-discuss] Offset Plane, Sebastien Loriot (GeometryFactory), 05/27/2011
- Re: [cgal-discuss] Offset Plane, Max Harris, 05/28/2011
- Re: [cgal-discuss] Offset Plane, Sebastien Loriot (GeometryFactory), 05/30/2011
- Re: [cgal-discuss] Offset Plane, Max Harris, 05/28/2011
- Re: [cgal-discuss] Offset Plane, Sebastien Loriot (GeometryFactory), 05/27/2011
- Re: [cgal-discuss] Offset Plane, Max Harris, 05/26/2011
- Re: [cgal-discuss] Offset Plane, Marc Glisse, 05/25/2011
Archive powered by MHonArc 2.6.16.