Skip to content
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

skgeom.intersection(Ray2, Ray2) fails? #109

Open
HughBothwell opened this issue Jan 25, 2023 · 0 comments
Open

skgeom.intersection(Ray2, Ray2) fails? #109

HughBothwell opened this issue Jan 25, 2023 · 0 comments

Comments

@HughBothwell
Copy link

HughBothwell commented Jan 25, 2023

I built the wheel with pip, so I'm not sure whether this error is general to the library or something I messed up in the build. I have repeated it on three different computers with the same result.

Simple Demo

import skgeom as sg

# first ray
a = sg.Point2(0, 0)
b = sg.Point2(1, 1)
r1 = sg.Ray2(a, b-a)

# second ray
c = sg.Point2(6, 0)
d = sg.Point2(5, 1)
r2 = sg.Ray2(c, d-c)

# find intersection - should be at (3, 3)
pt = sg.intersection(r1, r2)   # !!! error here

Simple Demo Result

Jupyter QtConsole 5.4.0
Python 3.10.7 (main, Nov 24 2022, 19:45:47) [GCC 12.2.0]
Type 'copyright', 'credits' or 'license' for more information
IPython 8.8.0 -- An enhanced Interactive Python. Type '?' for help.

TypeError                                 Traceback (most recent call last)
Cell In[1], line 14
     11 r2 = sg.Ray2(c, d-c)
     13 # find intersection - should be at (3, 3)
---> 14 pt = sg.intersection(r1, r2)   # !!! error here

TypeError: intersection(): incompatible function arguments. The following argument types are supported:
    1. (arg0: skgeom._skgeom.Line2, arg1: skgeom._skgeom.Line2) -> object
    2. (arg0: skgeom._skgeom.Line2, arg1: skgeom._skgeom.Segment2) -> object
    3. (arg0: skgeom._skgeom.Segment2, arg1: skgeom._skgeom.Segment2) -> object
    4. (arg0: skgeom._skgeom.Ray2, arg1: skgeom._skgeom.Segment2) -> object
    5. (arg0: skgeom._skgeom.Line3, arg1: skgeom._skgeom.Line3) -> object
    6. (arg0: skgeom._skgeom.Line3, arg1: skgeom._skgeom.Plane3) -> object
    7. (arg0: skgeom._skgeom.Line3, arg1: skgeom._skgeom.Ray3) -> object
    8. (arg0: skgeom._skgeom.Line3, arg1: skgeom._skgeom.Segment3) -> object
    9. (arg0: skgeom._skgeom.Line3, arg1: skgeom._skgeom.Triangle3) -> object
    10. (arg0: skgeom._skgeom.Plane3, arg1: skgeom._skgeom.Plane3) -> object
    11. (arg0: skgeom._skgeom.Plane3, arg1: skgeom._skgeom.Ray3) -> object
    12. (arg0: skgeom._skgeom.Plane3, arg1: skgeom._skgeom.Segment3) -> object
    13. (arg0: skgeom._skgeom.Plane3, arg1: CGAL::Sphere_3<CGAL::Epeck>) -> object
    14. (arg0: skgeom._skgeom.Plane3, arg1: skgeom._skgeom.Triangle3) -> object
    15. (arg0: skgeom._skgeom.Ray3, arg1: skgeom._skgeom.Ray3) -> object
    16. (arg0: skgeom._skgeom.Ray3, arg1: skgeom._skgeom.Segment3) -> object
    17. (arg0: skgeom._skgeom.Ray3, arg1: skgeom._skgeom.Triangle3) -> object
    18. (arg0: skgeom._skgeom.Segment3, arg1: skgeom._skgeom.Segment3) -> object
    19. (arg0: skgeom._skgeom.Segment3, arg1: skgeom._skgeom.Triangle3) -> object
    20. (arg0: CGAL::Sphere_3<CGAL::Epeck>, arg1: CGAL::Sphere_3<CGAL::Epeck>) -> object
    21. (arg0: skgeom._skgeom.Triangle3, arg1: skgeom._skgeom.Triangle3) -> object

Invoked with: RayC2(PointC2(0, 0), PointC2(1, 1)), RayC2(PointC2(6, 0), PointC2(5, 1))

.. which I read as "I don't know how to intersect Ray2 and Ray2".
However the CGAL library does support this, per
https://doc.cgal.org/latest/Kernel_23/group__intersection__linear__grp.html#gade00253914ac774cce3d2031c07d74fe
(row 10 of the '2D Intersections' type table)

System Info

Ubuntu 22.10
Python 3.10.7
pip 22.3.1, setuptools 66.1.1
CGAL 5.5-1 (installed by: sudo apt-get install libcgal-dev)
Boost (installed by: sudo apt-get install libboost-all-dev)

Requirements fulfilled:
pybind11 2.7.1
numpy 1.23.5

scikit-geometry (installed by:

git clone https://github.com/scikit-geometry
cd ./scikit-geometry
pip3 install -e scikit-geometry -vvv --use-pep517

builds with gcc - gives 11 warnings, but nothing that looks relevant to this problem (full build output attached: scikit-geometry-build-output.txt )

I haven't yet dug into the source; I'll do that tomorrow. At this point I presume that the Ray2/Ray2 case just got skipped somehow. If so, I'll try adding it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant