Crate puzzle_paths

Source
Expand description

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 use
  • generate_columns_rows_numbers returns an ideal distribution of pieces on the x- and y-axes for a given total number of pieces
  • round is a util function which approximately rounds a f32 value to two decimal places

Structs§

JigsawTemplate
Provides all information on how to cut out the jigsaw puzzle pieces from an image

Functions§

build_jigsaw_template
Returns information on how to cut jigsaw puzzle pieces from an image of a given width and height and the number of pieces in a row and a column as an optional the tab size, a “jitter” factor and a initial seed value.
generate_columns_rows_numbers
Returns the visually most appealing numbers of pieces in one column and one row based on a given number of pieces
round
Rounds a given rational number to two decimal places