Skip to content

Conversation

@sina1988
Copy link

Summary

Adds helper functions for uneven line segmentation without changing existing behaviour.

Changes

  • Adds segmented_line_from_fractions(point1, point2, fractions) for manual split locations using fractions in (0, 1).
  • Adds segmented_line_from_lengths(point1, point2, weights) using normalised positive weights (not geometric distances).
  • Exports the new helpers via geometry/__init__.py.

Notes

  • Endpoints are always included.
  • Existing segmented_line and segmented_path are unchanged.

Example

# Fractions: 3 internal splits -> 4 segments -> 5 points
pts = segmented_line_from_fractions(p1, p2, [0.2, 0.55, 0.9])

# Weights: 5 segments -> 6 points (weights are normalised)
pts = segmented_line_from_lengths(p1, p2, [1, 2, 1, 3, 2])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant