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:
JigsawGenerator::generate
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
Re-exports§
Structs§
- Edge
Contour Generator - Provides the means to generate
IndentedEdge
s - Indentation
Segment - A segment of an indented puzzle piece edge. A segment is described by a cubic Bézier curve, which includes a starting point, an end point and two control points. Three segments make up a piece’s edge.
- Indented
Edge - An indented puzzle piece edge. An edge is decribe via three distinct cubic Bézier curves (the “segments”)
- Jigsaw
Generator - A jigsaw pieces generator
- Jigsaw
Piece - Jigsaw
Template - Puzzle
Id - Straight
Edge - A puzzle piece edge which is at the same time a part of the puzzle’s border and therefore forms a straight line
Enums§
- Edge
- A border of a puzzle piece. Can be either an
StraightEdge
(no adjacent other piece) or anIndentedEdge
- Game
Mode - Side
Functions§
- 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