Skip to content

Line3.isparallel()/__or__ still scale-dependent, like the distance() bug fixed in #224 #231

Description

@petercorke

#224 fixed Line3.distance() so it no longer depends on the magnitude of the Plucker direction vectors (w), only their direction — it was giving wrong results whenever a line's Plucker coordinates were rescaled by a factor other than 1, and crashing outright on parallel lines.

isparallel() (and hence __or__, ^/isintersecting, and commonperp(), all of which call it) has the same shape of bug: it tests norm(cross(l1.w, l2.w)) < tol * eps using the raw, non-unit direction vectors, rather than unit directions. Two lines with the same true angular separation can cross or miss the parallel threshold depending purely on how their Plucker coordinates happen to be scaled.

closest_to_line() wasn't checked for the same issue — worth a separate look.

Not urgent (no crash, unlike the distance() case), but the same class of bug and probably the same fix shape: normalize to unit vectors before the tolerance comparison.

Cross-ref: #224

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions