Skip to content

Add method to map [0, arc length] -> [0, 1] #29

@toadative

Description

@toadative

Today, every spline method accepts either a time in [0, 1] or, if the spline is unit-speed, a fractional arc length in [0, 1]. That both options use [0, 1] is confusing. For unit-speed methods, we should provide a simple mapping from [0, arc length] -> [0, 1] so users can use (non-fractional) arc length as input.

function CatRom:RescaleArcLength(arcLength: number): number
    assert(arcLength >= 0 and arcLength <= self.length)
    return arcLength / self.length
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions