mirror of
https://github.com/revarbat/BOSL2.git
synced 2025-08-12 02:24:11 +02:00
Address regression error
This commit is contained in:
@@ -439,6 +439,7 @@ function line_from_points(points, check_collinear=false, eps=EPSILON) =
|
|||||||
len(points) == 2
|
len(points) == 2
|
||||||
? points
|
? points
|
||||||
: let(
|
: let(
|
||||||
|
twod = is_path(points,2),
|
||||||
covmix = _covariance_evec_eval(path3d(points), 0), // pass 0 to use largest eigenvalue
|
covmix = _covariance_evec_eval(path3d(points), 0), // pass 0 to use largest eigenvalue
|
||||||
pm = covmix[0], // point mean
|
pm = covmix[0], // point mean
|
||||||
evec = unit(covmix[1]), // normalized eigenvector corresponding to largest eigenvalue
|
evec = unit(covmix[1]), // normalized eigenvector corresponding to largest eigenvalue
|
||||||
@@ -446,7 +447,7 @@ function line_from_points(points, check_collinear=false, eps=EPSILON) =
|
|||||||
line = [pm-evec*maxext, pm+evec*maxext]
|
line = [pm-evec*maxext, pm+evec*maxext]
|
||||||
)
|
)
|
||||||
check_collinear && _line_greatest_distance(points,line)>eps ? undef :
|
check_collinear && _line_greatest_distance(points,line)>eps ? undef :
|
||||||
line ;
|
twod ? path2d(line) : line ;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user