Subject: CGAL users discussion list
List archive
- From: MrVH <>
- To:
- Subject: [cgal-discuss] Screen easely Cells, Facets, Edges, AlphaShape3D Weighted
- Date: Wed, 9 Feb 2011 03:06:41 -0800 (PST)
Hello everyone,
I didn't find the possibility to use AlphaShape3D Weighted in Python CGAL,
so I'm using CGAL C++ now but C++ is really not my language :(
I found the example, but I didn't found an easy way (understandable for not
C++ native speaker) to print the result:
// empty list
std::list<Weighted_point> lwp;
...
while (getline(file, line)){
/* Get coordinates*/
string type(line.substr(0,4));
string xstr(line.substr(30,8));
string ystr(line.substr(38,8));
string zstr(line.substr(46,8));
float x = atof(xstr.c_str());
float y = atof(ystr.c_str());
float z = atof(zstr.c_str());
// I fill up my vector
lwp.push_back(Weighted_point(Bare_point( x, y, z), 1.80)); // just
example,
change 1.8 by the weight of each point
}
//build alpha_shape in GENERAL mode and set alpha=0
Alpha_shape_3 as(lwp.begin(), lwp.end(), 0, Alpha_shape_3::GENERAL);
//explore the 0-shape - It is dual to the boundary of the union.
std::list<Cell_handle> cells;
std::list<Facet> facets;
std::list<Edge> edges;
as.get_alpha_shape_cells(std::back_inserter(cells),
Alpha_shape_3::INTERIOR);
as.get_alpha_shape_facets(std::back_inserter(facets),
Alpha_shape_3::REGULAR);
as.get_alpha_shape_facets(std::back_inserter(facets),
Alpha_shape_3::SINGULAR);
as.get_alpha_shape_edges(std::back_inserter(edges),
Alpha_shape_3::SINGULAR);
std::cout << " The 0-shape has : " << std::endl;
std::cout << cells.size() << " interior tetrahedra" << std::endl;
std::cout << facets.size() << " boundary facets" << std::endl;
std::cout << edges.size() << " singular edges" << std::endl;
Ok here I've got my number of cells, facets and edges
But how to have that explicitly
I would like to see
Cell 1: 1 2 3 4
Cell 2: 20 31 5 35
...
Facet 1: 7 4 8
Facet 2: 9 5 8
...
Edge 1: 65 35
Edge 2: 76 45
...
...
(If I understand Cell is the tetrahedron no destroy by alphashape, Facet is
triangle residue of a tetrahedron destroy by alphashape and edge is only
rest of a tetrahedron after alphashape which destroy almost all of the
tetrahedron associate)
Thank you very much for your help, and sorry if it is too noob (it is I'm
sure !)
MrVH
/*
// std::ifstream iFileT("output",std::ios::in);
//iFileT >> as;
std::cout << "TOTO" << std::endl;
std::list<Facet>::iterator facetIterator;
for (facetIterator = facets.begin(); facetIterator != facets.end();
++facetIterator) {
sdt::cout << faceIterator << endl;
}
*/
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Screen-easely-Cells-Facets-Edges-AlphaShape3D-Weighted-tp3297041p3297041.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, MrVH, 02/09/2011
- Re: [cgal-discuss] Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, Sebastien Loriot (GeometryFactory), 02/09/2011
- [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, MrVH, 02/09/2011
- Re: [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, Sebastien Loriot (GeometryFactory), 02/09/2011
- [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, MrVH, 02/10/2011
- [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, MrVH, 02/10/2011
- Re: [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, Sebastien Loriot (GeometryFactory), 02/10/2011
- [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, MrVH, 02/10/2011
- [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, MrVH, 02/10/2011
- [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, MrVH, 02/11/2011
- Re: [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, Sebastien Loriot (GeometryFactory), 02/11/2011
- Re: [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, Sebastien Loriot (GeometryFactory), 02/10/2011
- [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, MrVH, 02/10/2011
- [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, MrVH, 02/10/2011
- Re: [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, Sebastien Loriot (GeometryFactory), 02/09/2011
- [cgal-discuss] Re: Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, MrVH, 02/09/2011
- Re: [cgal-discuss] Screen easely Cells, Facets, Edges, AlphaShape3D Weighted, Sebastien Loriot (GeometryFactory), 02/09/2011
Archive powered by MHonArc 2.6.16.