Skip to content

BezierPath.interpolate: define behavior for structurally mismatched inputs #9

Description

@ronaldmannak

BezierPath.interpolate(_:_:_:) (PR #2) assumes its inputs were restructured by aligned(with:). For mismatched inputs it currently interpolates over the min subpath/curve counts and drops the excess for 0 < t < 1 (documented), which means unaligned callers would see geometry vanish mid-morph and pop back at t >= 1.

Options:

  1. Keep the contract but make it harder to misuse: make interpolate internal and expose only a morph(from:to:t:) that always aligns (possibly with the precomputed-alignment fast path the timeline uses).
  2. Auto-align lazily inside interpolate when counts mismatch (cost: hidden work in a hot path).
  3. Append the excess from the longer path unchanged (partial fidelity, still a pop at the boundary).

The only current caller (ManimScene, PR #4) always pre-aligns at build time, so nothing user-facing is affected today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions