Subject: CGAL users discussion list
List archive
- From: Sukhraj Singh <>
- To:
- Subject: [cgal-discuss] Finding adjacent segments from SDF Mesh Segmentation
- Date: Fri, 24 Jun 2016 20:30:39 +0530
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
- Ironport-phdr: 9a23:pChdwxFg5XSRunDDLa1omJ1GYnF86YWxBRYc798ds5kLTJ75pMSwAkXT6L1XgUPTWs2DsrQf2rKQ6/CrBjJIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TWM5DIfUi/yKRBybrysXNWD14Lvh6vtpdX6WEZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwu3cYh/V0/MFJVeD2fr8zUKdDJDUgKWE8osPx5jfZSg7a3WYfUn8fkFJzAg7K7FmuRZb3vSu8rfd+2DOTP+X5SLk1XXKp6KI9G0ygszsOKzNsqDKfscd3lq8O+B8=
Hello,
--
I am trying to create an adjacency matrix for the segments.(undirected)
I tried following code snippet, (the code isnt perfect though)
The segment_ids ,contains the ids of the segments, its populated in the Surface Mesh Segmentation Plugin.
====================================================================================
int current_segment = -1;
int prev_segment = -1;
int adjmat[10][10] = {0};
for(Polyhedron::Facet_iterator facet_it = polyhedron->facets_begin();
facet_it != polyhedron->facets_end(); ++facet_it)
{
current_segment = segment_ids[facet_it];
if(current_segment != prev_segment)
{
//std::cout << std::endl;
//std::cout << " segment: "<< prev_segment << " and " << " segment: " << current_segment;
//std::cout << " Are adjacent" << std::endl;
adjmat[current_segment][prev_segment] = 1;
prev_segment = current_segment;
}
}
===========================================================================================
The output of adjmat is
0 1 1 1 1 1 0 0 0 1
1 0 1 1 1 1 0 0 0 0
1 1 0 1 1 1 0 0 0 0
1 1 1 0 1 1 0 0 0 0
1 1 1 1 0 1 0 0 0 0
1 1 1 1 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
No. of segments were six, that's why > 6,6 elements are ale zeros
Looks like the facet iteration is not "from one facet to neighboring facet" ? I assumed, I could record that particular jump from a facet to other that leads to segment id change , and make those segments as adjacent.
Thanks to check the fallacy in my approach.
Sukhraj Singh
- [cgal-discuss] Finding adjacent segments from SDF Mesh Segmentation, Sukhraj Singh, 06/24/2016
- Re: [cgal-discuss] Finding adjacent segments from SDF Mesh Segmentation, Sebastien Loriot (GeometryFactory), 06/24/2016
- Re: [cgal-discuss] Finding adjacent segments from SDF Mesh Segmentation, Sukhraj Singh, 06/24/2016
- Re: [cgal-discuss] Finding adjacent segments from SDF Mesh Segmentation, Sebastien Loriot (GeometryFactory), 06/24/2016
Archive powered by MHonArc 2.6.18.