ClipperMinkowski

clipper.ClipperMinkowski (Class)

Minkowski Sum and Difference operations.

Minkowski Sum: For each point P in path, the pattern is translated by P. The union of all these translated patterns forms the Minkowski sum.

Minkowski Difference: Similar to sum, but subtracts pattern points from path points.

Static Members

isPositive(path: Path64): Bool

Returns true if the polygon has a positive (counter-clockwise) winding.

Name Type
path Path64
Returns
Bool

reversePath(path: Path64): Path64

Returns a reversed copy of the path.

Name Type
path Path64
Returns
Path64

sum(pattern: Path64, path: Path64, isClosed: Bool): Paths64

Computes the Minkowski Sum of pattern and path.

Name Type Description
pattern Path64 The pattern polygon to add
path Path64 The path polygon
isClosed Bool Whether the path is closed
Returns Description
Paths64 The union of all translated patterns

diff(pattern: Path64, path: Path64, isClosed: Bool): Paths64

Computes the Minkowski Difference of pattern and path.

Name Type Description
pattern Path64 The pattern polygon to subtract
path Path64 The path polygon
isClosed Bool Whether the path is closed
Returns Description
Paths64 The union of all translated patterns

sumD(pattern: PathD, path: PathD, isClosed: Bool, ?decimalPlaces: Int = 2): PathsD

Computes the Minkowski Sum for floating-point paths.

Name Type Default Description
pattern PathD The pattern polygon to add
path PathD The path polygon
isClosed Bool Whether the path is closed
decimalPlaces Int 2 Decimal precision for scaling (default 2)
Returns Description
PathsD The union of all translated patterns

diffD(pattern: PathD, path: PathD, isClosed: Bool, ?decimalPlaces: Int = 2): PathsD

Computes the Minkowski Difference for floating-point paths.

Name Type Default Description
pattern PathD The pattern polygon to subtract
path PathD The path polygon
isClosed Bool Whether the path is closed
decimalPlaces Int 2 Decimal precision for scaling (default 2)
Returns Description
PathsD The union of all translated patterns

Private Members

minkowskiInternal(pattern: Path64, path: Path64, isSum: Bool, isClosed: Bool): Paths64

Internal implementation of Minkowski operation. Creates quads from adjacent pattern/path point pairs.

Name Type
pattern Path64
path Path64
isSum Bool
isClosed Bool
Returns
Paths64

scalePath64(path: PathD, scale: Float): Path64

Scales a PathD to Path64 by multiplying coordinates by scale.

Name Type
path PathD
scale Float
Returns
Path64

scalePathsD(paths: Paths64, scale: Float): PathsD

Scales Paths64 to PathsD by multiplying coordinates by scale.

Name Type
paths Paths64
scale Float
Returns
PathsD

union(paths: Paths64): Paths64

Performs a union operation on the given paths.

Name Type
paths Paths64
Returns
Paths64

Metadata

Name Parameters
:hxGen -