Skip to content

Box-Segment intersection in 3D #810

Open
@cserteGT3

Description

@cserteGT3

I have a box, and a segment, that clearly doesn't intersect, but intersects returns true:

julia> testbox = Box(Point3(-130, -18.78, 46.25), Point3(-110.75, -5.05, 60.0))
Box{3,Float64}
├─ min: Point(-130.0, -18.78, 46.25)
└─ max: Point(-110.75, -5.05, 60.0)

julia> testline = Segment(Point(-70,-50,0), Point(-130, 0, 50))
Segment{3,Float64}
├─ Point(-70.0, -50.0, 0.0)
└─ Point(-130.0, 0.0, 50.0)

julia> intersects(testbox, testline)
true

Using Ray returns false, as expected:

julia> testbox = Box(Point3(-130, -18.78, 46.25), Point3(-110.75, -5.05, 60.0))
Box{3,Float64}
├─ min: Point(-130.0, -18.78, 46.25)
└─ max: Point(-110.75, -5.05, 60.0)

julia> testray = Ray(Point(-70,-50,0), Point(-130, 0, 50)-Point(-70,-50,0))
Ray{3,Float64}
├─ p: Point(-70.0, -50.0, 0.0)
└─ v: Vec(-60.0, 50.0, 50.0)

julia> intersects(testbox, testray)
false

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions