ShapeWarp modifies a shape
and produces a new shape
where the control
points have been shifted by an amount
.
We also provide a seed
value for pseudo-randomness
Warping shapes is straight forward with PathWarp
Rectangle()
.warp(amount: 10, seed: 45678)
Before | After |
---|---|
![]() |
![]() |
We've written an extension
extension Shape {
func warp(amount: CGFloat, seed: UInt64, include: PointType = .all) -> some Shape {}
}
I've spent time getting this package to a point where the shapes themselves animate nicely
between different settings.
This has been done by implementing VectorArithmetic
on a custom AnimatablePathElement
type
Doc website here: https://nthstate.github.io/ShapeWarp/documentation/shapewarp/
Building the docs
swift build
PACKAGE_NAME=ShapeWarp
REPOSITORY_NAME=ShapeWarp
OUTPUT_PATH=./docs
swift package --allow-writing-to-directory $OUTPUT_PATH \
generate-documentation --target $PACKAGE_NAME \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path $REPOSITORY_NAME \
--output-path $OUTPUT_PATH