build/modelscript.umd.js
function(obj) {
                if (obj.normal || (obj.start && obj.end)) { return obj.intersectionWith(this); }
                if (!this.intersects(obj)) { return null; }
                var P = this.anchor.elements, X = this.direction.elements,
                    Q = obj.anchor.elements, Y = obj.direction.elements;
                var X1 = X[0], X2 = X[1], X3 = X[2], Y1 = Y[0], Y2 = Y[1], Y3 = Y[2];
                var PsubQ1 = P[0] - Q[0], PsubQ2 = P[1] - Q[1], PsubQ3 = P[2] - Q[2];
                var XdotQsubP = - X1*PsubQ1 - X2*PsubQ2 - X3*PsubQ3;
                var YdotPsubQ = Y1*PsubQ1 + Y2*PsubQ2 + Y3*PsubQ3;
                var XdotX = X1*X1 + X2*X2 + X3*X3;
                var YdotY = Y1*Y1 + Y2*Y2 + Y3*Y3;
                var XdotY = X1*Y1 + X2*Y2 + X3*Y3;
                var k = (XdotQsubP * YdotY / XdotX + XdotY * YdotPsubQ) / (YdotY - XdotY * XdotY);
                return vector.create([P[0] + k*X1, P[1] + k*X2, P[2] + k*X3]);
              }
function(obj) {
                if (obj.normal || (obj.start && obj.end)) { return obj.intersectionWith(this); }
                if (!this.intersects(obj)) { return null; }
                var P = this.anchor.elements, X = this.direction.elements,
                    Q = obj.anchor.elements, Y = obj.direction.elements;
                var X1 = X[0], X2 = X[1], X3 = X[2], Y1 = Y[0], Y2 = Y[1], Y3 = Y[2];
                var PsubQ1 = P[0] - Q[0], PsubQ2 = P[1] - Q[1], PsubQ3 = P[2] - Q[2];
                var XdotQsubP = - X1*PsubQ1 - X2*PsubQ2 - X3*PsubQ3;
                var YdotPsubQ = Y1*PsubQ1 + Y2*PsubQ2 + Y3*PsubQ3;
                var XdotX = X1*X1 + X2*X2 + X3*X3;
                var YdotY = Y1*Y1 + Y2*Y2 + Y3*Y3;
                var XdotY = X1*Y1 + X2*Y2 + X3*Y3;
                var k = (XdotQsubP * YdotY / XdotX + XdotY * YdotPsubQ) / (YdotY - XdotY * XdotY);
                return vector.create([P[0] + k*X1, P[1] + k*X2, P[2] + k*X3]);
              }
function ( obj ) { if ( obj . normal || ( obj . start && obj . end ) ) { return obj . intersectionWith ( this ) ; } if ( ! this . intersects ( obj ) ) { return null ; } var P = this . anchor . elements , X = this . direction . elements , Q = obj . anchor . elements , Y = obj . direction . elements ; var X1 = X [ 0 ] , X2 = X [ 1 ] , X3 = X [ 2 ] , Y1 = Y [ 0 ] , Y2 = Y [ 1 ] , Y3 = Y [ 2 ] ; var PsubQ1 = P [ 0 ] - Q [ 0 ] , PsubQ2 = P [ 1 ] - Q [ 1 ] , PsubQ3 = P [ 2 ] - Q [ 2 ] ; var XdotQsubP = - X1 * PsubQ1 - X2 * PsubQ2 - X3 * PsubQ3 ; var YdotPsubQ = Y1 * PsubQ1 + Y2 * PsubQ2 + Y3 * PsubQ3 ; var XdotX = X1 * X1 + X2 * X2 + X3 * X3 ; var YdotY = Y1 * Y1 + Y2 * Y2 + Y3 * Y3 ; var XdotY = X1 * Y1 + X2 * Y2 + X3 * Y3 ; var k = ( XdotQsubP * YdotY / XdotX + XdotY * YdotPsubQ ) / ( YdotY - XdotY * XdotY ) ; return vector . create ( [ P [ 0 ] + k * X1 , P [ 1 ] + k * X2 , P [ 2 ] + k * X3 ] ) ; }
Returns the unique intersection point with the argument, if one exists
Returns the unique intersection point with the argument if one exists