Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] How to get Contour of the intersection plane and polyhedron

Subject: CGAL users discussion list

List archive

[cgal-discuss] How to get Contour of the intersection plane and polyhedron


Chronological Thread 
  • From: 马良 <>
  • To:
  • Subject: [cgal-discuss] How to get Contour of the intersection plane and polyhedron
  • Date: Fri, 13 Jul 2012 09:29:59 +0800

Hi
    I read a STL-file (a kind of file using in RapidPrototyping, a triangle in STL is composed of 3-Point and normal). And I create a Polyhedron like a following.
    Polyhedron P;
    P.make_triangle(V1,V2,V3);
    P.make_triangle(V4,V5,V6);
    ....
    //Then, I create AABB tree, as follows:
    Facet_tree tree(P.facets_begin(),P.facets_end());
 
    //Next, I create a plane and caculate intersections between plane and polyhedron
    Vector nor(0,0,1);
    Point pnt(0,0,0.5);
    Plane plane(pnt,nor);
 
    tree.all_intersections(plane,std::back_inserter(Intersetions));   
 
    //Here, I get intersetions (Points: (X,Y,Z))
    for( it = Intersetions.begin();it !=Intersections.end();it++)
{
    if(CGAL::assign(segment,object) m_segment.push_back(segment);
}
    // But, I get a lot of segments. And Here I want get contours (a contour is composed of segments in order).
    My question is How to constitute contours using segments. Whether or not I must sort those segments by myself? Here is a algorithm in CGAL?
 
Thanks!

--
马良  Mr.MaLiang
State Key Laboratory of Solidification Processing
Northwestern Polytechnical University
Xi'an 710072, Shanxi
P. R. China
Tel/Fax:+86(29)88460520
Mobile:+86(0)15829297776
Email:
QQ number:394646034




Archive powered by MHonArc 2.6.18.

Top of Page