-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Line
and LineSegment
#261
Comments
I'm leaning toward not changing things, but it is an interesting question. I agree that more mathematically correct usage would be "line" for the infinite case and "line segment" for the bounded case. Actually if we're being really mathematically correct, it's a directed line segment, as the orientation is significant. The other body of precedent includes SVG, which uses the word "line" for the same concept as in kurbo. I'm not sure whether kurbo needs a type for the infinite line. It's not a proper shape (as it's not bounded), but I can see it maybe being useful for intersections. |
I think sometimes it is useful to draw an infinite line. The way to draw it would be to clip it to whatever bounds the viewport was using. |
I think the way to go naming-wise would be |
The
Line
struct in kurbo is a straight line between 2 points. This is commonly called aLineSegment
in other libraries (e.g.lyon
), while theLine
struct represents an infinite line.Because
kurbo
doesn't have the concept of alyon_geom::Line
, it perhaps doesn't matter that there is this mismatch, but I just want to highlight it. Perhaps if something likelyon_geom::Line
was added to kurbo in the future, it could be calledInfiniteLine
? Such a structure could be drawn (just draw the part of it that intersects with the viewport), and you could implementShape
for it (with somef64::INFINITY
s).Again I don't think it's worth or desirable to change the name for
kurbo::Line
, but I thought it was worth thinking about this mismatch.The text was updated successfully, but these errors were encountered: