Class PAPathParametric

java.lang.Object
net.paulhertz.pixelaudio.curves.PAPathParametric

public final class PAPathParametric extends Object
PAPathParametric Parametric view of a polyline path (e.g., polygonized Bezier). u ∈ [0,1] → (x(u), y(u)) For now, u is interpreted over the *index* of the point list: - u = 0 → first point - u = 1 → last point - intermediate u → linear interpolation between neighboring points This preserves any "bunching" of points in high-curvature regions produced by the polygonization.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
     
    private final List<processing.core.PVector>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PAPathParametric(List<processing.core.PVector> points)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
     
    private static processing.core.PVector
    lerp(processing.core.PVector a, processing.core.PVector b, float u)
     
    processing.core.PVector
    sample(float u)
    Sample the path at parameter u ∈ [0,1], returning an interpolated point.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • points

      private final List<processing.core.PVector> points
    • count

      private final int count
  • Constructor Details

    • PAPathParametric

      public PAPathParametric(List<processing.core.PVector> points)
      Parameters:
      points - ordered points along the path (e.g., from getEventPoints) must contain at least 2 points.
  • Method Details

    • getPointCount

      public int getPointCount()
    • sample

      public processing.core.PVector sample(float u)
      Sample the path at parameter u ∈ [0,1], returning an interpolated point. u is clamped to [0,1].
    • lerp

      private static processing.core.PVector lerp(processing.core.PVector a, processing.core.PVector b, float u)