generative geometry algorithms library idea

Hi all, I've been doing some work for the past few weeks on a generative/generic 2D geometry library (leaving open the possibility for 3D in the future). The idea is for all the algorithms to be generative taking coordinate, point, segment, polyline/gon types as template parameters (or deducing where presented as nested typedefs) and specialized traits types for accessing type traits and methods ( things like access_traits<point_type>::get_x( point ) .). So far the library has allowed me to work with the same algorithms in native floating type and exact types like gmp's mpq_class. It's just a first rough draft of ideas, and I would really like some input from the community to see if I'm on the right track for something that boost would be interested in having. I'll post a copy of the lib in the vault. It's header only (with a small testbed with trivial testing and a visual studio 2008 solution/project). I hope there should not be too many issues compiling these tests/headers under other platforms. I'll put it in the vault as generative_geometry_algorithms.zip link: http://www.boostpro.com/vault/index.php?action=downloadfile&filename=generative_geometry_algorithms.zip&directory=Math%20-%20Geometry& Thanks for any constructive input. With regards, Brandon Kohn

Brandon Kohn wrote:
Hi all,
I've been doing some work for the past few weeks on a generative/generic 2D geometry library (leaving open the possibility for 3D in the future). The idea is for all the algorithms to be generative taking coordinate, point, segment, polyline/gon types as template parameters (or deducing where presented as nested typedefs) and specialized traits types for accessing type traits and methods ( things like access_traits<point_type>::get_x( point ) .). So far the library has allowed me to work with the same algorithms in native floating type and exact types like gmp's mpq_class. It's just a first rough draft of ideas, and I would really like some input from the community to see if I'm on the right track for something that boost would be interested in having. I'll post a copy of the lib in the va ult. It's header only (with a small testbed with trivial testing and a visual studio 2008 solution/project). I hope there should not be too many issues compiling these tests/headers under ot her platforms.
I'll put it in the vault as generative_geometry_algorithms.zip
link:
Thanks for any constructive input.
Apologies I haven't looked at your library yet but is it likely that the algorithms will be usable with eigen2* data types? Eigen2 seems to be the best open source small vector/matrix library right now for performance. At least that I can find. * http://eigen.tuxfamily.org/ Thanks, -- Michael Marcin

-------------------------------------------------- From: "Michael Marcin" <mike.marcin@gmail.com> Sent: Tuesday, September 23, 2008 1:37 PM Newsgroups: gmane.comp.lib.boost.devel To: <boost@lists.boost.org> Subject: Re: generative geometry algorithms library idea
Brandon Kohn wrote:
Hi all,
I've been doing some work for the past few weeks on a generative/generic 2D geometry library (leaving open the possibility for 3D in the future). The idea is for all the algorithms to be generative taking coordinate, point, segment, polyline/gon types as template parameters (or deducing where presented as nested typedefs) and specialized traits types for accessing type traits and methods ( things like access_traits<point_type>::get_x( point ) .). So far the library has allowed me to work with the same algorithms in native floating type and exact types like gmp's mpq_class. It's just a first rough draft of ideas, and I would really like some input from the community to see if I'm on the right track for something that boost would be interested in having. I'll post a copy of the lib in the va ult. It's header only (with a small testbed with trivial testing and a visual studio 2008 solution/project). I hope there should not be too many issues compiling these tests/headers under ot her platforms.
I'll put it in the vault as generative_geometry_algorithms.zip
Thanks for any constructive input.
Apologies I haven't looked at your library yet but is it likely that the algorithms will be usable with eigen2* data types? Eigen2 seems to be the best open source small vector/matrix library right now for performance. At least that I can find.
Thanks,
-- Michael Marcin
HI Michael, I wouldn't see any reason why it wouldn't. The basic rationale for representation of primitives is that their numeric traits, dimension etc are embedded in a point_traits<> specialization. Access functions are specified in a separate traits specialization. There are a couple of ways you can use the code: (apologies if the format doesn't come out right... this is my first time posting code) For example, say you have a vector type for your point: (eigen seems to use: VectorXf ) BOOST_DEFINE_USER_POINT_TRAITS( VectorXf, float, 2 );//note the 2 is dimension. template <> struct cartesian_access_traits< VectorXf > { typedef VectorXf point_type; typedef boost::numeric::geometry::point_traits< VectorXf
::coordinate_type coordinate_type; typedef boost::numeric::geometry::point_traits< VectorXf>::dimension_type dimension_type;
static inline coordinate_type get_x( const point_type& p ) { return p[0]; } static inline coordinate_type get_y( const point_type& p ) { return p[1]; } //Note, the template requirement here is due to some experimentation I'm doing on how to deal with different dimensions and the //construct member functions specification both 2 and higher dimensions. //I wanted to make use the enable_if/disable_if based on the point_traits<>::dimension_type and to do that, you have to be in a template member function //(at least in visual studio) template <typename Point> static inline point_type construct( const coordinate_type& x, const coordinate_type& y ) { point_type p(dimenstion_type::value); p[0] = x; p[1] = y; return p; } }; BOOST_DEFINE_SEGMENT_TRAITS( VectorXf, segment< VectorXf > ); BOOST_DEFINE_SEGMENT_ACCESS_TRAITS( segment< VectorXf > ); Here is a specialization I did for the GMP rational type using the point template provided with my code: typedef point<mpq_class, 2> point_rational_2d; BOOST_DEFINE_POINT_TRAITS( point_rational_2d ); BOOST_DEFINE_CARTESIAN_ACCESS_TRAITS( point_rational_2d ); BOOST_DEFINE_SEGMENT_TRAITS( point_rational_2d, segment< point_rational_2d
); BOOST_DEFINE_SEGMENT_ACCESS_TRAITS( segment< point_rational_2d > );
You can then use the points as-is in the algorithms: For example: BOOST_AUTO_TEST_CASE( TestIntersections ) { using namespace boost::numeric::geometry; typedef cartesian_access_traits< VectorFx > point_access; VectorFx p1 = point_access::construct< VectorFx >( 0., 0. ); //I agree... it's annoying to have the point type specified here as a template parameter. VectorFx p2 = point_access::construct< VectorFx >( 1., 1. ); VectorFx p3 = point_access::construct< VectorFx >( 1., 0. ); VectorFx p4 = point_access::construct< VectorFx >( 0., 1. ); segment< VectorFx > seg1( p1, p2 ); segment< VectorFx > seg2( p3, p4 ); VectorFx xPoints[2]; intersection_type iType = intersect( seg1, seg2, xPoints, fraction_tolerance_comparison_policy<float>(1e-5) ); std::cout << iType << " at point: " << point_access::get_x( Points[0] ) << ", " << point_access::get_y( xPoints[0] ) << std::endl; } This is still very much a work in progress, but please do have a look and see what you think. I'd like to hear suggestions about the design or how I might improve things. Cheers, Brandon

-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Brandon Kohn Sent: 22 September 2008 21:29 To: boost@lists.boost.org Subject: [boost] generative geometry algorithms library idea
I've been doing some work for the past few weeks on a generative/generic 2D geometry library (leaving open the possibility for 3D in the future). The idea is for all the algorithms to be generative taking coordinate, point, segment, polyline/gon types as template parameters (or deducing where presented as nested typedefs) and specialized traits types for accessing type traits and methods ( things like access_traits<point_type>::get_x( point ) .).
So far the library has allowed me to work with the same algorithms in native floating type and exact types like gmp's mpq_class. It's just a first rough draft of ideas, and I would really like some input from the community to see if I'm on the right track for something that boost would be interested in having.
This all looks interesting stuff of course. And the use of templates is adventurous. I trust it does not mean that the need for both compile and runtime speed won't lead some to reject the library outright. I presume one could also use it with other arbitrary (but inexact) precision libraries? Past discussions on geometry have not produced a consensus on design/spec :-(( So you may prefer to ignore that and simply present your version. There is the little matter of some documentation ;-) Paul PS I see you have neatly 're-solved' the floating point comparison problems, and present them in a more generally useful form that in Boost.Test. I find the function names a step too long, but I feel that they would be most useful as a independent module. --- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com

Hi Brandon, Interesting to see another geometry library appearing into the Boost list. It definitely shows the need of such a library in the Boost community. I don't know if you followed the list this year. In January and in March I posted two previews of a geometry library, based on similar concepts as the library you posted: generic, based on templates, header only, defines points, lines and polygons (which might have holes, this is probably a difference) and has operations on these. It also has 2D/3D possibilities. Based on these previews there has been much discussion on the list, especially about the underlying concepts and how explicit they were made in the library code. Bruno Lalande, Boost-contributor and active member of the Boost community, joined and together we worked on the concepts of the library, making them more explicit. We planned to republish it in June but, as often, this was delayed somewhat. However, we're still enthousiastic and hope to publish a new preview within a month. You might consider to look at our work to see if it is worth to merge with us, if it is valuable for you as a source of inspiration or if it is worth to join us. It's actually open source already and still intended to be submitted as a Boost library. Also, note that there is a Google Summer of Code project mentored by Boost which is based on this library. Best regards, Barend Gehrels, Geodan, Amsterdam, the Netherlands Bruno Lalande, France Brandon Kohn wrote:
Hi all,
I've been doing some work for the past few weeks on a generative/generic 2D geometry library (leaving open the possibility for 3D in the future). The idea is for all the algorithms to be generative taking coordinate, point, segment, polyline/gon types as template parameters (or deducing where presented as nested typedefs) and specialized traits types for accessing type traits and methods ( things like access_traits<point_type>::get_x( point ) .). So far the library has allowed me to work with the same algorithms in native floating type and exact types like gmp's mpq_class. It's just a first rough draft of ideas, and I would really like some input from the community to see if I'm on the right track for something that boost would be interested in having. I'll post a copy of the lib in the vault. It's header only (with a small testbed with trivial testing and a visual studio 2008 solution/project). I hope there should not be too many issues compiling these tests/headers under ot her platforms.
I'll put it in the vault as generative_geometry_algorithms.zip
link:
Thanks for any constructive input.
With regards,
Brandon Kohn _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

-------------------------------------------------- From: "Barend Gehrels" <barend@geodan.nl> Sent: Friday, September 26, 2008 3:56 PM To: <boost@lists.boost.org> Subject: Re: [boost] generative geometry algorithms library idea
Hi Brandon,
Hi Barend,
Interesting to see another geometry library appearing into the Boost list. It definitely shows the need of such a library in the Boost community.
I don't know if you followed the list this year. In January and in March I posted two previews of a geometry library, based on similar concepts as the library you posted: generic, based on templates, header only, defines points, lines and polygons (which might have holes, this is probably a difference) and has operations on these. It also has 2D/3D possibilities.
I actually haven't followed the list for a few years :-). I did do a browse of your library before I started, but I found that it didn't do exactly what I was looking to do. I have been working on a legacy geometry library for many year which has some algorithms which are proprietary, but is sorely lacking of others which are not generally available under free license for the commercial domain. This means that I need to retain the use of the legacy primitives, but also that I would like to develop some of the new sorely needed algorithms (boolean ops, doubly connected edge lists) and at the same time be able to develop new primitives which can use exact precision types in these same newly developed algorithms. My only choice was to develop all my algorithms to a defined set of traits for the concepts of points, segments and point sequences. So the algorithms in my library are actually built to work with any primitives for which traits for point, segment, and point sequence (polylines,polygons) have been specialized. All the algorithms are implemented to access underlying coordinate values and to construct the points, segments, and point sequences using static methods specialized in the traits classes. I think this is perhaps significantly different to what your library does (although I didn't see any higher level algorithms like the bentley-ottmann sweep line, trapezoidal decomposition, binary search partition trees, and boolean operations so maybe you have done similar since last posting to the vault.) Could you post a current version so I have some basis for proper comparison? Also, there are some other issues with respect to using custom number types which may not use math function like std::sqrt or the trig functions which may require specialization of math_function traits for the coordinate type. I had to do this in order to use mpq_class (rational exact type in GMP) so that I could get distances between two points :-). (In the end its going to require defining a generic Taylor series expansion for all the trig + sqrt functions that support number types as template parameters.) The same goes for constants. How is PI defined for mpq_class etc? Something users should explicitly control depending on their precision requirements. How does your library deal with number comparisons for floating types and precision issues?
Based on these previews there has been much discussion on the list, especially about the underlying concepts and how explicit they were made in the library code.
Bruno Lalande, Boost-contributor and active member of the Boost community, joined and together we worked on the concepts of the library, making them more explicit. We planned to republish it in June but, as often, this was delayed somewhat. However, we're still enthousiastic and hope to publish a new preview within a month.
You might consider to look at our work to see if it is worth to merge with us, if it is valuable for you as a source of inspiration or if it is worth to join us. It's actually open source already and still intended to be submitted as a Boost library. Also, note that there is a Google Summer of Code project mentored by Boost which is based on this library.
From looking at the library in the vault, I seem to have implemented all the algorithms you have so far + have more functionality in my library ;-). Plus I need to support legacy primitives in my algorithms as I said before which doesn't seem possible with your library. Please send your latest so I can make a more fair appraisal. :D
Very respectfully, Brandon
Best regards, Barend Gehrels, Geodan, Amsterdam, the Netherlands Bruno Lalande, France
Brandon Kohn wrote:
Hi all,
I've been doing some work for the past few weeks on a generative/generic 2D geometry library (leaving open the possibility for 3D in the future). The idea is for all the algorithms to be generative taking coordinate, point, segment, polyline/gon types as template parameters (or deducing where presented as nested typedefs) and specialized traits types for accessing type traits and methods ( things like access_traits<point_type>::get_x( point ) .). So far the library has allowed me to work with the same algorithms in native floating type and exact types like gmp's mpq_class. It's just a first rough draft of ideas, and I would really like some input from the community to see if I'm on the right track for something that boost would be interested in having. I'll post a copy of the lib in the vault. It's header only (with a small testbed with trivial testing and a visual studio 2008 solution/project). I hope there should not be too many issues compiling these tests/headers under ot her platforms.
I'll put it in the vault as generative_geometry_algorithms.zip
Thanks for any constructive input.
With regards,
Brandon Kohn _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Hi Brandon,
Hi Barend,
Hi Brandon and Barend, If two is company, is three a community? I suggested to Brandon off list that we ought to merge. I also conceded that the algorithms he provides are a better starting point than mine in terms of what a boost geometry library ought to provide. The primary thing preventing us from working together and sharing algorithms is the lack of an agreed upon standard for abstracting geometry data types from the algorithms that work on them. We all agree that it should be done, we even largely agree on how in a general sense. If we could pick one specific syntax and pattern, or combine ideas to arrive at one we all agree on, then we could port our algorithms and their interfaces into that form. Ideally, we should be able to compare our algorithms side by side in the same library to chose which one becomes the one that is published as the boost algorithm. Barend has a line intersection algorithm. I have boolean operations on manhattan, 45-degree and now arbitrary angle polgyons. Replacing my line intersection algorithm with the one coming from Barend or Brandon's library might speed up my boolean operations. My scanline that does boolean operations is generic and provides several other algorithms such as connectivity extraction and property merge operations, but may not be as fast as Brandon's for simple Booleans. Ideally, I'd like to find out the answers to these questions with a minimum of effort. I think the algorithms themselves are less important than their interfaces, and as Brandon said, the whole meat of the problem is how to parameterize the coordinate data type in a way that actually works for complex numerical data types and is still usable. Brandon pointed out:
Also, there are some other issues with respect to using custom number types which may not use math function like std::sqrt or the trig functions which may require specialization of math_function traits for the coordinate type. I had to do this in order to use mpq_class (rational exact type in GMP) so that I could get distances between two points :-). (In the end its going >to require defining a generic Taylor series expansion for all the trig + sqrt functions that support number types as template parameters.)
These issues clearly need to be sorted out. I just integrated mpz_class into my integer geometry oriented algorithms because I need upwards of 90 bits of integer precision to store intermediate values of complex algebraic expressions. I had to wrap it to provide the casting operator to integer so that I could parameterize the high precision data type in my code without directly depending on GPL'd gmp header files. For me the problem of how to bridge the conceptual gap between floating point and integer geometry is an open question. Even multi-precision rational data type geometry does not really satisfy my needs because a robust linescan in rational coordinates may lead to new intersections and many degeneracies being introduced when snapping back to integer coordinates at the output. I don't need an epsilon or comparison policy argument to deal with integer coordinates, so I don't have these in my library. Clearly, I should need it if comparing Euclidean distances, and I could benefit from incorporating it. I'd like to see a boost library that works well with floating point, rational/lazy-exact and integer coordinates of geometry that I can contribute to/use. This could mean that the line segment intersection algorithm requires a snapping policy in addition to a comparison policy. It might even mean separate integer and floating point implementations of some algorithms where convolving the complexities of the one with those of the other is simply not worth the trouble. I think we should focus on how we can get from where we are today--talking about my geometry library, your geometry library and his geometry library-- to the point where we need to be; talking about the boost geometry library and the community of developers who are contributing to it. Luke

Hi, I'm glad to see that everyone agrees to try to see what are the merging/collaboration possibilities between all the different libraries currently being developed. Indeed I think it would be a good thing as each library have its strengths and weaknesses, this being principally due to the fact that we all have different priorities. But for a geometry library meant to be widely used, everything is a priority. So having several people each bringing his own part would surely be more productive. As Luke said, the problems are not really about algorithms but about how genericity will be handle. Once this is defined, adding algorithms only raises implementation issues for which consensuses should be easily found. A lot of things have changed since the second preview of Barend's library. Especially for the data types adaptation techniques, we have first implemented a traits approach, then a more fine-grained approach with separate metafunctions. We will try to release a preview as soon as possible to discuss those choices and see what are the points of agreement and disagreement between us. Regards Bruno

-------------------------------------------------- From: "Paul A Bristow" <pbristow@hetp.u-net.com> Sent: Thursday, September 25, 2008 12:06 PM Newsgroups: gmane.comp.lib.boost.devel To: <boost@lists.boost.org> Subject: Re: generative geometry algorithms library idea
-----Original Message----- From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Brandon Kohn Sent: 22 September 2008 21:29 To: boost@lists.boost.org Subject: [boost] generative geometry algorithms library idea
Hi Paul, Thank you for having a look and providing useful feedback.
I've been doing some work for the past few weeks on a generative/generic 2D geometry library (leaving open the possibility for 3D in the future). The idea is for all the algorithms to be generative taking coordinate, point, segment, polyline/gon types as template parameters (or deducing where presented as nested typedefs) and specialized traits types for accessing type traits and methods ( things like access_traits<point_type>::get_x( point ) .).
So far the library has allowed me to work with the same algorithms in native floating type and exact types like gmp's mpq_class. It's just a first rough draft of ideas, and I would really like some input from the community to see if I'm on the right track for something that boost would be interested in having.
This all looks interesting stuff of course.
And the use of templates is adventurous. I trust it does not mean that the need for both compile and runtime speed won't lead some to reject the library outright.
I wouldn't really expect this to be much of an issue. I have been using variants of this stuff is a fairly large sized projects. The templates have an insignificant impact on compile times in my experience.
I presume one could also use it with other arbitrary (but inexact) precision libraries?
Yes, that is the goal. It remains to be proven of course as the interfaces get hammered into shape.
Past discussions on geometry have not produced a consensus on design/spec :-((
I've noticed this. I waited for awhile (vacation) to respond to this email to see if there was anymore feedback. There seems not to be a very vocal geometry user base in the boost dev lists. The only people who have responded to my request for feedback seem to be other geometry library writers, and from those responses, I didn't really get the sense that they had really investigated what my library tries to do (I.e. all talk about merging with their works with little feedback about the substance of my library.) The notion of a concept driven traits based interface is a bit different than simply having users define their points in terms of a boost::point type. Same for the segments and polygons/lines. With my library I'm really trying to define an interface where any user defined geometry type can be used and the traits specialized on their type provide the necessary mechanisms for interaction with the algorithms in the library. I do define a point, and segment type (and point sequences based on std::vector of those defined point types) for the native coordinate types, but it isn't intended that these types are forced onto the users. The concrete primitive types I define really are for convenience only (or for internal usage in some instances). I have continued working on my library, refining some of the interface definitions and algorithms. I've added polygonal boolean operations based on binary search partition trees in 2D and a doubly_connected_edge_list class based on boost::graph (similar to a planar graph except with directed edges). I've also added code for the Bentley-Ottmann sweep to differentiate between floating point and integral coordinates (specialized via a coordinate_traits< C > class) so the sweep line segment comparison functor will use boost::rational< IntegerCoordinate > to do the sweepline segment intersection comparisons when the points use integer coordinates (this is necessary to avoid slope truncation and correct intersect y value interpolation.) I will be doing some more testing and then will put the latest version up on the vault. So still plodding away, and hoping for more feedback.
So you may prefer to ignore that and simply present your version.
There is the little matter of some documentation ;-)
I'm still trying to finalize some design issues and would like to complete that before writing documentation. Soon hopefully!
Paul
PS I see you have neatly 're-solved' the floating point comparison problems, and present them in a more generally useful form that in Boost.Test. I find the function names a step too long, but I feel that they would be most useful as a independent module.
Thanks again Paul. I also agree with your assessment that the number comparison functors for floating point should be put into a stand-alone number comparison library under numeric. These are issues that arise all the time in developing fuzzy number comparison algorithms and precision tolerance mechanisms. The names I chose are a bit long in the tooth, but I prefer long explanatory names (which in practice are declared infrequently) to short names which obscure meaning. I would of course be open to hearing any reasonable suggestions as alternates. Cheers Paul, Brandon
--- Paul A Bristow Prizet Farmhouse, Kendal, Cumbria UK LA8 8AB +44 1539561830 & SMS, Mobile +44 7714 330204 & SMS pbristow@hetp.u-net.com
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

The only people who have responded to my request for feedback seem to be other geometry library writers, and from those responses, I didn't really get the sense that
Brandon wrote: they
had really investigated what my library tries to do (I.e. all talk about merging with their works with little feedback about the substance of my
library.)
The notion of a concept driven traits based interface is a bit different than simply having users define their points in terms of a boost::point type. Same for the segments and polygons/lines. With my library I'm really trying to define an interface where any user defined geometry type can be used and the traits specialized on their type provide the necessary mechanisms for interaction with the algorithms in the
Brandon, I'm confused that you seem to be disappointed by the response you have gotten. I skimmed the code and noticed several things I like about your code. It was neat, had good comments, followed Hungarian notation (actually I don't like Hungarian notation itself, but I like that you have a disciplined and professional style), implemented valuable algorithms that I am interested in, and used template techniques so similar to my own that they even have some of the same names: point_type, coordinate_type, coordinate_traits, etc. I emailed you off list immediately, asking questions to help me investigate further into your code, to inform you of the lay of the land in boost wrt. Barend's library and to suggest we work together. After you didn't reply, I went back to my own work and didn't bother to read your code further. If you can't be bothered to talk to me, why should I review your code or offer feedback? I guess we are both disappointed. Whatever expectation you had when you submitted your library to the vault, I'm sorry that it wasn't met, but you could have set that expectation more realistically by looking at the list archive from the last several rounds of geometry discussion. One tip, post code snippets to the list. Don't expect people to dig through your vault submission to find out what you are doing. Very few will. Package your design for the list in a concise email with examples and explain it. You will get the feedback you wanted that way. If you really want to talk to people on the boost list who are interested in geometry other than Barend and myself, I can send you a list of their email addresses (or you can look them up in the list archive) and you can ask them directly to take a look at your library. It is possible they weren't subscribed at the time or overlooked your submission in the volume of unread boost email that can easily pile up in an inbox. library. Please read the list archive, this is not a new idea around here. Depending on when you had the idea you may have thought of it first, but this is what we've already been discussing wrt. geometry type systems. I'm optimistic that Barend's new interfaces will look like what you describe and we can start moving toward a consensus. I also welcome the fact that you are advocating for the same type of interface as I am, because it makes it more likely that an eventual boost geometry library will work the way you and I appear to agree that it should.
I'm still trying to finalize some design issues and would like to complete that before writing documentation. Soon hopefully!
Please share these design issues with us. Perhaps the boost community can help. Respectfully, Luke

Hi Brandon, I wouldn't have said better than Luke.What you are trying to do is what we are all trying to do. Even though consensus is very difficult to reach in that domain as Paul pointed out, it is wrong to say that nothing has emerged from all the discussions that have occurred. The fact that a C++ geometry library is definitely not all about providing a point class, but proposing a set of algorithms generically adaptable to any kind of point, is one of those consensuses. Another one is that point coordinates selection should be made at compile-time (get<0>(p), not get(0, p)), and be dimension-agnostic (get<0>, not get_x). Barend's library wasn't made that way initially. It is now, even if there remain some ways to acquire even more genericity. Points are now handled generically (even a C-style array can be a point), linestrings are now pairs of iterators, etc... And everything has been made dimension-agnostic. If I took a while to look at your library, it's obviously not for lack of interest, but for lack of time. I finally glanced through it, it sounds well written, well designed and clean to me. And like Luke said, very similar to what we already have in terms of design, which is very encouraging indeed. To the extent that at some places of your files, I couldn't say directly if I'm browsing your library or Barend's one :-) Everything is about coordinate_type, point_traits, access_traits and stuff like that, which is absolutely normal. So we shouldn't have troubles working together. We are still working on cleaning everything and preparing the next preview of Barend's library, it should come very soon. Regards Bruno
participants (6)
-
Barend Gehrels
-
Brandon Kohn
-
Bruno Lalande
-
Michael Marcin
-
Paul A Bristow
-
Simonson, Lucanus J