JuliaGeometry/Meshes.jl

`Ngon`-`Segment` intersection in 2D

Open

#646 aperta il 5 dic 2023

Vedi su GitHub
 (4 commenti) (0 reazioni) (0 assegnatari)Julia (98 fork)auto 404
featurehelp wanted

Metriche repository

Star
 (460 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

julia> r = Rope(Point(1, 0), Point(1, 1), Point(2, 1));

julia> q = Quadrangle(Point(0,0), Point(0, 1), Point(1, 1), Point(1, 0));

julia> intersection(q, r)
ERROR: StackOverflowError:
Stacktrace:
 [1] intersection(f::Function, g₁::Quadrangle{2, Float64}, g₂::Rope{2, Float64, Vector{Point2}})
   @ Meshes ~/.julia/packages/Meshes/w8yhV/src/intersections.jl:100
 [2] intersection(f::Function, g₁::Rope{2, Float64, Vector{Point2}}, g₂::Quadrangle{2, Float64})
   @ Meshes ~/.julia/packages/Meshes/w8yhV/src/intersections.jl:100

julia> b = Box(Point(0,0), Point(1,1));

julia> intersection(b, r)
ERROR: StackOverflowError:
Stacktrace:
 [1] intersection(f::Function, g₁::Box{2, Float64}, g₂::Rope{2, Float64, Vector{Point2}})
   @ Meshes ~/.julia/packages/Meshes/w8yhV/src/intersections.jl:100
 [2] intersection(f::Function, g₁::Rope{2, Float64, Vector{Point2}}, g₂::Box{2, Float64})
   @ Meshes ~/.julia/packages/Meshes/w8yhV/src/intersections.jl:100

Related to #644. In my application, I would like to use a Rope to represent a "path", and I would like to find intersections between that path and a number of geometries. At the moment, those are segments, ngons (probably only rectangles), and other ropes.

I guess the stackoverlow is a red herring for any missing method: https://github.com/JuliaGeometry/Meshes.jl/issues/246

Guida contributor