Is there any interest in a template geometry library?

View: New views
6 Messages — Rating Filter:   Alert me  
< Prev | 1 - 2 | Next >

Re: Is there any interest in a template geometry library?

by Barend Gehrels :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Fernando,

Fernando Cacciola wrote:

> Hi Barend,
>
>  
>>> See:
>>>
>>> http://www.cgal.org/philosophy.html
>>>
>>>      
>> Thanks for the clarification. The library uses the epsilon for floating
>> point comparisons. Your will see it next week, but it is like this:
>>            inline bool operator==(const point& other) const {
>>                if (std::numeric_limits<T>::is_exact) return m_x ==
>> other.m_x && m_y == other.m_y;
>>                else return abs(m_x - other.m_x) <
>> std::numeric_limits<T>::epsilon() && abs(m_y - other.m_y) <
>> std::numeric_limits<T>::epsilon();
>>            }
>>
>> If this approach is not enough
>>    
> Indeed, is not enough.
>
>  
>> you can please help us to make it more
>> robust because I agree, the library should handle these issues and not
>> the user because that is not possible.
>>    
> Yes, I can help you.
> The very first thing you need to do is understand the problem and why that
> approach is insufficient.
>
> Have you read the sample discussion I posted before? that should get you
> started.
>
> http://tinyurl.com/2os9co
>  
OK, thanks for your offer. Let me first finish the preview, it will take
me too much time if I dive into this at this moment. I glanced through
the discussion and to the philosophy page of CGAL, thanks.

>>> If the library *unnecesarily* fails to produce correct results because of
>>> numerical issues then it's not 'simple' but 'simplistic'.
>>>
>>>      
>> OK, tell me next week if it is bright and simple or just simplistic, I'm
>> curious.
>>
>>    
> You are using the so-called epislon-geometry approach, so I can tell you
> now: this is simplistic ;)
>
> Feel free to contact me directly if you want, though it might be interesting
> to discuss it on the list becasue this is not a problem specific to
> geometric computing but any computing sensitive to round off.
>  
Thanks again, I surely will come back to this.
Barend Gehrels.

-------------------------------------

Barend Gehrels, Geodan Holding b.v., Amsterdam, The Netherlands, www.geodan.nl


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Re: Is there any interest in a template geometry library?

by Fernando Cacciola-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Barend,

 
> OK, thanks for your offer. Let me first finish the preview, it will take
> me too much time if I dive into this at this moment. I glanced through
> the discussion and to the philosophy page of CGAL, thanks.

No problem.
Just make sure to top-post a message so it doesn't get lost in this thread.

Best

Fernando

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Re: Is there any interest in a template geometry library?

by Martin Lütken-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The reason I have 2D, 3D, 4D vector and matrices is to support as fast as
possible 2D/3D calcutations for use in computer games graphis and physiscs
simulations where every cycle counts. I Don't think that any game-engine will
ever use generic N-vector, N-matrix types like those in UBlas....

-Martin L

On Tuesday 15 January 2008 22:46, Barend Gehrels wrote:

> Hi Martin, Fernando,
>
> Thanks for your answers.
>
> Martin, thanks for your suggestion about cpaf, I can imagine that the
> job was large. Your library is different and probably planned larger
> than the one we propose, and contains different things. We for example
> have no vector and matrix definitions nor implementations, if we need we
> would use for example boost/UBLAS. On the other hand we have polygons
> with holes and corresponding algorithms.
>
> Fernando Cacciola wrote:
>  >Hi Barend,
>  >
>  >>Hi,
>  >>
>  >>Is there any interest in a template geometry library?
>  >
>  >Depends on the details ;)
>
> Details will follow next week, I'll post a sort of preview including
> sources, some examples and some documentation. I shortly answer your
> questions below.
>
>  >>Data and algorithms are separated, so there are algorithms like:
>  >>template <typename P, typename POL>
>  >>bool point_in_polygon(const P& p, const POL& pol);
>  >
>  >What algorithm is implemented for this function?
>
> Both crossing number and winding rule are implemented, besides that, you
> can implement your own if necessary (there is a "for_each_segment"
> algorithm which walks through segments, like std::for_each). The
> crosscounting is in the library since '95 and should be considered as
> thoroughly tested, however, we used it mainly for interactively
> selecting polygons in GIS applications. Winding rule algorithms are
> generally available on the internet, in this library it is just
> implemented and comparisons (e.g. speed) have still to be done.
>
>  >How does it handle robustness issues?
>  >
>  >What are the geometric requirements on the input polygon? (i.e. must be
>  >simple? strictly simple?)
>  >What if the point is exactly *over the boundary* of the polygon?
>
> Good questions, polygons are considered as in OGC, simple, their outer
> ring and inner rings (if any) should not be (self)intersecting. We
> consider the point-in-polygon as a case of the more generic "within"
> relation between two geometries and that is defined as "TRUE if g1 is
> completely contained in g2.", for "Within(g1 Geometry, g2 Geometry)",
> see e.g. OGC's 99-049 http://www.opengeospatial.org/standards/sfs. I
> will come back on this.
>
>  >>And like this:
>  >>template <typename S1, typename S2, typename MP>
>  >>intersection_result intersection_segment(const S1& segment1, const S2&
>  >>segment2, MP& multipoint);
>  >
>  >What is a multipoint?
>
> See 99-049 above or see for example
> http://dev.mysql.com/doc/refman/5.0/en/opengis-geometry-model.html. One
> of the reasons the multi versions are there is that, for example,
> clipping a polygon might result in a multi-polygon.
>
>  >What if the segments are collinear (hence their intersection is another
>  >segment)?
>  >
>  >How does it handle robustness issues?
>
> This is handled, the intersection_result gives information about how the
> segments intersect. If the intersection is another segment a multi-point
> containing two points are delivered, plus a  "is_collinear" result.
>
> I've seen on your website that you co-develop CGAL. Don't expect
> something like CGAL here, compared to CGAL this library relatively
> basic, small and simple. However, I think it will fit in the boost
> libraries and concepts and therefore we considered proposing it.
>
> Best regards, Barend Gehrels
> Geodan Holding B.V., Amsterdam, The Netherlands
>
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Re: Is there any interest in a template geometry library?

by Frank Mori Hess-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Monday 21 January 2008 04:25, Martin Lutken wrote:
> The reason I have 2D, 3D, 4D vector and matrices is to support as fast
> as possible 2D/3D calcutations for use in computer games graphis and
> physiscs simulations where every cycle counts. I Don't think that any
> game-engine will ever use generic N-vector, N-matrix types like those in
> UBlas....

I don't see any reason having a generic interface has to impose any runtime
overhead.  In the worst case, you could make the dimension a template
parameter and provide partial specializations for whichever dimensions you
have specially optimized code for.

--
Frank



_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

attachment0 (196 bytes) Download Attachment

Re: Is there any interest in a template geometry library?

by Hervé Brönnimann-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Phil:  You might also want to check my MS student's implementation  
(feel free to finish/polish/improve on it!)

http://photon.poly.edu/~hbr/publi/ilya-thesis/index.html

He's implemented (static and dynamic) kd-trees, in 2D but the paper  
(http://photon.poly.edu/~hbr/publi/inplace-ch3d.html) gives all the  
details needed for higher-dimensional and related algorithms.
--
Hervé Brönnimann
hervebronnimann@...


On Jan 15, 2008, at 5:08 PM, Phil Endecott wrote:
> There certainly is.  My particular interest is in efficient containers
> for points (and perhaps lines) with iterators over 2D ranges; have you
> done anything like that?
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Re: Is there any interest in a template geometry library?

by Barend Gehrels :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Interesting.

To all geometry-interested people:
The preview of our Geometry Library was scheduled and announced for this
week but will be next Tuesday, as we're finishing preliminary
documentation and samples.

Barend



Hervé Brönnimann wrote:

> Phil:  You might also want to check my MS student's implementation  
> (feel free to finish/polish/improve on it!)
>
> http://photon.poly.edu/~hbr/publi/ilya-thesis/index.html
>
> He's implemented (static and dynamic) kd-trees, in 2D but the paper  
> (http://photon.poly.edu/~hbr/publi/inplace-ch3d.html) gives all the  
> details needed for higher-dimensional and related algorithms.
> --
> Hervé Brönnimann
> hervebronnimann@...
>
>
> On Jan 15, 2008, at 5:08 PM, Phil Endecott wrote:
>  
>> There certainly is.  My particular interest is in efficient containers
>> for points (and perhaps lines) with iterators over 2D ranges; have you
>> done anything like that?
>>    
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>
>  

--
-------------------------------------
Barend Gehrels, Geodan Holding b.v., Amsterdam, The Netherlands, www.geodan.nl


_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
< Prev | 1 - 2 | Next >