line-segment

Line Segment container for fast Ray intersection? (2D)

I have a ray, I need to find the closest line segment that it hits. I think it's possible to do this in O(log n) time if I sort the line segments first, but I can't remember how to sort them... I think some sort of tree would work best, but how do I sort them by both start and end point? I would also like fast insertions into this data s...

Algorithm to Find Overlapping Line Segments

n4------------------n3--------------------n2--n1 | | | | | | | P1 | | | | | | | n6--n5 | | | | n11--n10 | n17 ...

Merging multiple line segments

Hi, My program uses PyOpenGL (so it's Python) with psyco. I have around 21,000 line segments which I need to render in each frame of my render (unless the user zooms in, in which case line segments are culled and not sent to the card at all). This is currently taking around 1.5 seconds each frame to complete. That's just not good enoug...

Very general question about the implementation of vectors, vertices, edges, rays, lines & line segments.

This is just a LARGE generalized question regarding rays (and/or line segments or edges etc) and their place in a software rendered 3d engine that is/not performing raytracing operations. I'm learning the basics and I'm the first to admit that I don't know much about this stuff so please be kind. :) OK, I wondered why a parametrized lin...

calculate intersection between two segments in a symmetric way

When using the usual formulas to calculate intersection between two 2D segments, ie here, if you round the result to an integer, you get non-symmetric results. That is, sometimes, due to rounding errors, I get that intersection(A,B)!=intersection(B,A). The best solution is to keep working with floats, and compare the results up to a c...