1 unstable release
0.0.9 | Dec 18, 2023 |
---|
#759 in Images
27KB
551 lines
Puzzle Paths
This library creates SVG paths suitable for cutting out jigsaw puzzle pieces of an image.
Documentation
- See https://docs.rs/puzzle-paths for stable docs
- See https://ub-unibas.pages.switch.ch/puzzle-app/puzzle-paths/puzzle_paths for dev build docs
Acknowledgements
The library is heavily inspired by @Draradech's Jigsaw Puzzle Generator (see it here in action).
lib.rs
:
The Jigsaw Puzzle library creates SVG paths which can be used to cut out puzzle pieces from a given rectangular image. It provides three public functions:
build_jigsaw_template
returns the paths from a given number of pieces in a column and a row. This is the function you normally want to usegenerate_columns_rows_numbers
returns an ideal distribution of pieces on the x- and y-axes for a given total number of piecesround
is a util function which approximately rounds a f32 value to two decimal places