Jigwin piece template

From Just Solve the File Format Problem
(Difference between revisions)
Jump to: navigation, search
m (The format: add filename for completness)
(The format: clarify max vertex limit)
 
(2 intermediate revisions by one user not shown)
Line 9: Line 9:
  
 
The "fun piece" feature was added in version 6 (2005), which comes with 22 pre-made Jigwin piece templates and explains the format in its help file. To be recognized by the program, a template file must have the <code>asc</code> extension and be placed in the Pieces/ subfolder.
 
The "fun piece" feature was added in version 6 (2005), which comes with 22 pre-made Jigwin piece templates and explains the format in its help file. To be recognized by the program, a template file must have the <code>asc</code> extension and be placed in the Pieces/ subfolder.
 +
 +
The pre-made files all start with the line <code>Jigwin piece template version 1.0</code>, hence the title of this article. The name "Jigwin" refers to the Jigsaws Galore executable, <code>jigwin.exe</code>.
  
 
== The format ==
 
== The format ==
Line 25: Line 27:
 
4, 0.0, 1.0
 
4, 0.0, 1.0
 
</pre>
 
</pre>
The format is pretty self-explanatory. Some notes:
+
The format is pretty self-explanatory. Some notes: (Checked as of Jigsaws Galore version 6)
* After the initial metadata, each row contains a point id number (integer), and x, y coordinates (floats or integers). Coordinates can be positive or negative, and given to any scale or precision; the program automatically resizes the piece to match the other jigsaw pieces.
+
* The initial metadata section must contain a line starting with <code>Corners:</code>. This line specifies the ids of the four vertices which are the corners of the piece, in the order: top-left, top-right, bottom-right, bottom-left.
* The <code>Corners:</code> line specifies the ids of the four points which are the corners of the piece, in the order: top-left, top-right, bottom-right, bottom-left.
+
* The <code>Title:</code> and <code>Author:</code> lines are optional. They specify the title and author name that will be displayed by Jigsaws Galore in the fun piece settings dialog.
 +
* Any other lines in the metadata section are ignored.
 +
* After the initial metadata, each row contains a vertex id number (integer), and x, y coordinates (floats or integers). Coordinates can be positive or negative, and given to any scale or precision; the program automatically resizes the piece to match the other jigsaw pieces. There can be of course more than four vertices listed (it's unknown if there's any specific limit to their number).
 +
* The vertices must be listed in increasing order, starting from 1, without repetitions or gaps in id numbers. This section of the file cannot contain any lines other than vertex definitions. The final line can end with a newline character, but this is not required.
 
* The piece templates bundled with the program sometimes have additional numbers after the coordinates, e.g. <code>1,0.330000,9.210000,0.000000,1</code>. However, the help file clarifies that those extra numbers are ignored. (Perhaps they're the leftovers of some cut feature.)
 
* The piece templates bundled with the program sometimes have additional numbers after the coordinates, e.g. <code>1,0.330000,9.210000,0.000000,1</code>. However, the help file clarifies that those extra numbers are ignored. (Perhaps they're the leftovers of some cut feature.)

Latest revision as of 00:46, 19 September 2025

File Format
Name Jigwin piece template
Ontology
Extension(s) .asc
Released 2005

The Jigwin piece template is a file format used by the Jigsaws Galore program. It defines the shape of a "fun piece": a fancifully-shaped puzzle piece which can appear in jigsaw puzzles alongside normal-shaped pieces.

The "fun piece" feature was added in version 6 (2005), which comes with 22 pre-made Jigwin piece templates and explains the format in its help file. To be recognized by the program, a template file must have the asc extension and be placed in the Pieces/ subfolder.

The pre-made files all start with the line Jigwin piece template version 1.0, hence the title of this article. The name "Jigwin" refers to the Jigsaws Galore executable, jigwin.exe.

[edit] The format

Jigwin piece template files are plaintext lists of vertex coordinates.

An example Jigwin piece template (square.asc, one of the default ones bundled with version 6) looks as follows:

Jigwin piece template version 1.0
Title: Square
Author: David P. Gray
Corners: 1,2,3,4
1, 0.0, 0.0
2, 1.0, 0.0
3, 1.0, 1.0
4, 0.0, 1.0

The format is pretty self-explanatory. Some notes: (Checked as of Jigsaws Galore version 6)

  • The initial metadata section must contain a line starting with Corners:. This line specifies the ids of the four vertices which are the corners of the piece, in the order: top-left, top-right, bottom-right, bottom-left.
  • The Title: and Author: lines are optional. They specify the title and author name that will be displayed by Jigsaws Galore in the fun piece settings dialog.
  • Any other lines in the metadata section are ignored.
  • After the initial metadata, each row contains a vertex id number (integer), and x, y coordinates (floats or integers). Coordinates can be positive or negative, and given to any scale or precision; the program automatically resizes the piece to match the other jigsaw pieces. There can be of course more than four vertices listed (it's unknown if there's any specific limit to their number).
  • The vertices must be listed in increasing order, starting from 1, without repetitions or gaps in id numbers. This section of the file cannot contain any lines other than vertex definitions. The final line can end with a newline character, but this is not required.
  • The piece templates bundled with the program sometimes have additional numbers after the coordinates, e.g. 1,0.330000,9.210000,0.000000,1. However, the help file clarifies that those extra numbers are ignored. (Perhaps they're the leftovers of some cut feature.)
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox