svg_path/congruency

Directional congruency checks for path geometry.

Values

pub fn path(
  source source: svg_path.Path,
  target target: svg_path.Path,
  tolerance tolerance: Float,
) -> Result(transform.Matrix, Nil)

Find a translation, rotation, and uniform scale mapping one path to another path.

Path subpaths must match in order. Each subpath comparison ignores the subpath closed field, and no cycling or alternate starting segment is attempted.

pub fn points(
  source source: List(vec2.Vec2(Float)),
  target target: List(vec2.Vec2(Float)),
  tolerance tolerance: Float,
) -> Result(transform.Matrix, Nil)

Find a translation, rotation, and uniform scale mapping one ordered point list to another.

Empty lists and lists with different lengths return Error(Nil). A one-point source list uses a translation. For two or more source points, the candidate transform is built from a triple-sweep source point pair and the target points at the corresponding positions, then every mapped source point is checked against the corresponding target point.

pub fn segment(
  source source: svg_path.Segment,
  target target: svg_path.Segment,
  tolerance tolerance: Float,
) -> Result(transform.Matrix, Nil)

Find a translation, rotation, and uniform scale mapping one segment to another segment of the same constructor.

This is a directional, tolerance-based check. Ok(transform) means the returned transform maps source to target within tolerance under this module’s semantic segment comparison. Error(Nil) means no such transform was found.

pub fn subpath(
  source source: svg_path.Subpath,
  target target: svg_path.Subpath,
  tolerance tolerance: Float,
) -> Result(transform.Matrix, Nil)

Find a translation, rotation, and uniform scale mapping one subpath to another subpath.

The subpath closed field is ignored. Segment constructors must match in order; no cycling or alternate starting segment is attempted.

Search Document