|
Geometry : |
Subject: Re: [geometry] vtk output beta ready for polygon, ring and multi_polygon
From: Bruno Lalande (bruno.lalande_at_[hidden])
Date: 2013-05-16 14:08:45
Hi Tomislav,
Thanks a lot for contributing this.
Code-wise it looks good, except the way in which you output into the stream
is a bit suboptimal, a lot of strings could be joined together - e.g.
things like
"\nPOLYGONS" << " " << 1 << " "
should rather be written
"\nPOLYGONS 1 "
There's no point incurring any overhead here.
Conceptually speaking, including the polyhedron version is going to be
difficult at this point, as Boost.Geometry has no polyhedron concept yet.
You are basically inventing your own concept in the code, adapted to what
this specific algorithm expect, which is not the idea of concepts. I don't
know yet which form the polyhedron concept will take but I expect there
will actually be several of them, following the Boost.Graph concepts :
http://www.boost.org/doc/libs/1_53_0/libs/graph/doc/graph_concepts.html
We can also take some inspiration from CGAL here. Basically they have
adapted their polyhedron class to the Boost.Graph concepts, and they have
also added one additional concept that was not in Boost.Graph
(HalfedgeGraph).
www.cgal.org/Manual/latest/doc_html/cgal_manual/BGL/Chapter_main.html
The concept you seem to be following doesn't really seem to follow any of
those (but please double-check), it looks more like a polygon soup, so that
might also be a separate concept. How did you choose the way in which
you're accessing your polyhedron? Does that simply come from an actual
class you're working with?
Regards
Bruno
Geometry list run by mateusz at loskot.net