Skip to content

Commit

Permalink
🐛 Catch floating point lessthan
Browse files Browse the repository at this point in the history
  • Loading branch information
je-cook committed Sep 16, 2024
1 parent 71db30a commit bbf66f3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bluemira/codes/_freecadapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,11 @@ def wire_value_at(wire: apiWire, distance: float) -> np.ndarray:
parameter = edge.getParameterByLength(floatify(new_distance))
point = edge.valueAt(parameter)
break
else:
# This catches floating point less thans when new_length ~= distance
# for the last wire
edge = wire.OrderedEdges[-1]
point = edge.valueAt(edge.LastParameter)

Check warning on line 1046 in bluemira/codes/_freecadapi.py

View check run for this annotation

Codecov / codecov/patch

bluemira/codes/_freecadapi.py#L1045-L1046

Added lines #L1045 - L1046 were not covered by tests

return np.array(point)

Expand Down

0 comments on commit bbf66f3

Please sign in to comment.