0
$\begingroup$

This argument seems to be undocumented. Does it mean that if an intersection point is not between the line's two endpoints (line_a and line_b) then it is not returned?

$\endgroup$
2
$\begingroup$

Short Answer: Yes, it does.


Long Answer:

The source code is located in this file. It calls line_point_factor_v3 which subtracts both, the end point line_b and the intersection point isect from the start point line_a, to get the relative vectors from line_a to line_b and the intersection point isect, respectively.

It then divides the dot product of these relative vectors by the squared length from line_a to line_b.

Since both relative vectors are on the same line, the result of the dot product is negative if they point in opposite directions, else the result of the dot product is the product of the lengths of these vectors.

So basically its

dist(line_a, line_b) * dist(line_a, isect) / dist(line_a, line_b)²

If clip is True it checks wether this is between 0.0 and 1.0 which means the intersection point is on the line segment from line_a to line_b

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.