is_line_line_colinear
See original GitHub issueFeature Request
As a COMPAS user, I want compas.geometry.queries to have a function for lines co-linear check and so that we can all use it.
Details
Describe the solution you’d like I would like the following (or something similar) to happen:
line1 = Line([0, 0, 0], [1, 1, 1])
line2 = Line([2, 2, 2], [3, 3,3])
assert is_line_line_colinear(line1, line2) == true
"Another Direction should work too"
line3 = Line([-2,- 2, -2], [3, 3,3])
assert is_line_line_colinear(line1, line3) == true
Describe alternatives you’ve considered Currently there is a function to check if 3 points in colinear. https://github.com/compas-dev/compas/blob/16f3f6ef3b49a6a2191f41feb5da79d7bdac3f5c/src/compas/geometry/queries.py#L117
There is also feature to do intersection between 2 lines.
https://github.com/compas-dev/compas/blob/16f3f6ef3b49a6a2191f41feb5da79d7bdac3f5c/src/compas/geometry/queries.py#L792
But not a simple 2 lines colinear check, or did I miss something? Would be useful to have this feature.
similarly, is_line_line_overlap(l1, l2, epsilon)
might also be useful
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (6 by maintainers)
Top GitHub Comments
anyhow, since with this thread the colinear function is basically implemented, how about we go through the proper channels, which means you write a PR and i approve it 😃
Hi Tom, I haven’t got any experience creating a Pull Request. But I can give it a try. Please let me know if I do anything wrong.