question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

vtkPlane's intersectWithLine() function return is mathematically confusing

See original GitHub issue

the function is given a line defined by two points, but does not specify that the intersection HAS to happen between those two points for the result to return intersect:true.

A line defined by two points extends BEYOND those two points, and can still intersect, but if the intersection is outside of the defined points, you get a return with intersect:false but still get the coordinates of the intersection.

I think the function & corresponding return is misleading.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
finetjulcommented, Aug 27, 2019

Maybe intersectWithLine(p0,p1) could be renamed intersectWithSegment(p0, p1) and documented as behaving like VTK(C++) intersectWithLine and add new intersectWithLine as such:

function intersectWithLine(p0, p1) {
  res = vtkPlane.intersectWithSegment(p0, p1);
  return Object.assign(res, {intersect: res.intersect || res.t < Number.MAX_VALUE });
0reactions
jourdaincommented, Aug 27, 2019

🎉 This issue has been resolved in version 11.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

vtkPlane Class Reference - VTK
Return the distance of a point x to a plane defined by n(x-p0) = 0. The normal n[3] must be magnitude=1. ◇ IntersectWithLine()...
Read more >
Plane | vtk.js - Kitware, Inc.
Method used to decorate a given object (publicAPI+model) with vtkPlane characteristics. Argument, Type, Required, Description. publicAPI, Yes ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found