Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Creating a surface mesh segment as the ROI in Surface mesh deformation

Subject: CGAL users discussion list

List archive

[cgal-discuss] Creating a surface mesh segment as the ROI in Surface mesh deformation


Chronological Thread 
  • From: Sukhraj Singh <>
  • To:
  • Subject: [cgal-discuss] Creating a surface mesh segment as the ROI in Surface mesh deformation
  • Date: Fri, 2 Sep 2016 22:54:13 +0530
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:1ti2vRbC6o0wR78GFULoVWj/LSx+4OfEezUN459isYplN5qZpcq+bnLW6fgltlLVR4KTs6sC0LuP9f27EjVYsd7B6ClEK80UEUddyI0/pE8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0IufrymUrDbg8n/7e2u4ZqbO1wO32vkJ+4pZ0zu/U2R7pBQ2to6bP5pi1PgmThhQ6xu32RmJFaezV7Xx/yb29pdyRlWoO8r7MVaUK/3LOwSRL1cCyk6YShuvJW4/UqLcQza7XQVViAakwFDHhPexBD8RJb49CXg5cRn3yzPBtD1Tao9W3yZ7qFkSFe8kyYBOD5/63zUitZ5jopUpRugo1p0xIuCM9LdD+Z3Yq6IJYBSfmFGRMsEDyE=

Hello,

I am trying to create a particular segment (which is the output of surface mesh segmentation) as ROI in Surface Mesh Deformation.

I implemented following code, which is crashing( psb comment below)

==========================================================
void set_all_vertices_as_roi()
  {
    vertex_iterator vb, ve;
    for(boost::tie(vb, ve) = vertices(*polyhedron()); vb != ve; ++vb)
    {
      insert_roi_vertex(*vb);
    }
  }


//Implement it likewise all mesh vertices as roi

  void set_segment_vertices_as_roi(Polyhedron mesh)
  {
    std::size_t number_of_clusters;
    double smoothing_lambda ;

    // create a property-map for segment-ids
    typedef std::map<Polyhedron::Facet_const_handle, std::size_t> Facet_int_map;
    Facet_int_map internal_segment_map;
    boost::associative_property_map<Facet_int_map> segment_property_map(internal_segment_map);

//Run the sdf segmentation algo
    int nb_segments = SegmentPolyhedron(segment_property_map,number_of_clusters, smoothing_lambda ,mesh);

    std::vector <Polyhedron> PolySegments;
    PolySegments.resize(nb_segments);

//Get the segement of the mesh
    GetSegments(mesh,segment_property_map,nb_segments,PolySegments,0);
 
    vertex_iterator vb, ve;
   
//Make zeroth segment as ROI
    for(boost::tie(vb, ve) = vertices(PolySegments[0]); vb != ve; ++vb)
    {
      //std::cout << __LINE__ << std::endl;
        insert_roi_vertex(*vb); // GIVES CRASH
    }

   

  }


===============================================================================

Perhaps it is because of size of deform_mesh, which was  equal to complete non-segmented mesh size. ?

There is k-ring selection as well, which is used when picked by mouse.

Can someone suggest me some other way maybe, so that I could make the mesh segment as ROI


Thanks to provide input.


--
Sukhraj Singh
 



Archive powered by MHonArc 2.6.18.

Top of Page