src/moveOutOfCode/Plane.js
function (p1, p2) {
    let direction = p2.minus(p1)
    let labda = (this.w - this.normal.dot(p1)) / this.normal.dot(direction)
    if (isNaN(labda)) labda = 0
    if (labda > 1) labda = 1
    if (labda < 0) labda = 0
    let result = p1.plus(direction.times(labda))
    return result
  }
function (p1, p2) {
    let direction = p2.minus(p1)
    let labda = (this.w - this.normal.dot(p1)) / this.normal.dot(direction)
    if (isNaN(labda)) labda = 0
    if (labda > 1) labda = 1
    if (labda < 0) labda = 0
    let result = p1.plus(direction.times(labda))
    return result
  }
function ( p1 , p2 ) { let direction = p2 . minus ( p1 ) let labda = ( this . w - this . normal . dot ( p1 ) ) / this . normal . dot ( direction ) if ( isNaN ( labda ) ) labda = 0 if ( labda > 1 ) labda = 1 if ( labda < 0 ) labda = 0 let result = p1 . plus ( direction . times ( labda ) ) return result }
robust splitting of a line by a plane will work even if the line is parallel to the plane CONVERTED TO V2
robust splitting of a line by a plane will work even if the line is parallel to the plane CONVERTED TO V2