Function splineToSvgDrawAttribute

  • Converts a spline to a string that can be used as the d attribute of an SVG path, for a visual display of the spline.

    Example

    <svg>
    <path d={splineToSvgDrawAttribute(spline)} stroke="purple" fill="none" />
    </svg>

    Returns

    the SVG path for the spline.

    Parameters

    • spline: {
          points: (({ type: SplinePointType.CubicBezier; controlPoint: { x: number; y: number; }; endPoint: { x: number; y: number; }; }) | ({ type: SplinePointType.QuadraticBezier; endPoint: { x: number; y: number; }; }))[];
          start: { type: SplinePointType.StartPoint; point: { x: number; y: number; }; };
      }

      the spline to convert.

      • points: (({ type: SplinePointType.CubicBezier; controlPoint: { x: number; y: number; }; endPoint: { x: number; y: number; }; }) | ({ type: SplinePointType.QuadraticBezier; endPoint: { x: number; y: number; }; }))[]
      • start: { type: SplinePointType.StartPoint; point: { x: number; y: number; }; }

    Returns string

Generated using TypeDoc