Linear Spline
Curve class useful to describe any kind of curves
LinearSpline
Bases: LinearEntity
Curve class
Source code in otary/geometry/discrete/linear/linear_spline.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
centroid
property
Returns the center point that is within the linear spline. This means that this points necessarily belongs to the linear spline.
This can be useful when the centroid is not a good representation of what is needed as 'center'.
Returns:
Name | Type | Description |
---|---|---|
NDArray |
NDArray
|
point of shape (1, 2) |
curvature
property
Get the curvature of the linear spline as-if it had a well-defined curvature, meaning as-if it were a continuous curve.
Returns:
Name | Type | Description |
---|---|---|
float |
float
|
curvature value |
midpoint
property
Returns the center point that is within the linear spline. This means that this points necessarily belongs to the linear spline.
This can be useful when the centroid is not a good representation of what is needed as 'center'.
Returns:
Name | Type | Description |
---|---|---|
NDArray |
NDArray
|
point of shape (1, 2) |
find_interpolated_point(pct_dist)
Return a point along the curve at a relative distance pct_dist ∈ [0, 1]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pct_dist
|
float
|
Value in [0, 1], 0 returns start, 1 returns end. Any value in [0, 1] returns a point between start and end that is pct_dist along the path. |
required |
Returns:
Name | Type | Description |
---|---|---|
NDArray |
NDArray
|
Interpolated point [x, y] |
Source code in otary/geometry/discrete/linear/linear_spline.py
find_interpolated_point_and_prev_ix(pct_dist)
Return a point along the curve at a relative distance pct_dist ∈ [0, 1]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pct_dist
|
float
|
Value in [0, 1], 0 returns start, 1 returns end. Any value in [0, 1] returns a point between start and end that is pct_dist along the path. |
required |
Returns:
Type | Description |
---|---|
tuple[NDArray, int]
|
tuple[NDArray, int]: Interpolated point [x, y] and previous index in path. |