diff --git a/Object-Model.md b/Object-Model.md index 47045f4..a417135 100644 --- a/Object-Model.md +++ b/Object-Model.md @@ -17,13 +17,29 @@ Both `grid` and `pack` objects include data representing voronoi diagrams and th * `grid.spacing`: `number` - spacing between points before jirrering * `grid.cellsY`: `number` - number of cells in column * `grid.cellsX`: `number` - number of cells in row -* `grid.points`: `number[][]` - initial coordinates `[x, y]` based on jittered square grid. Numbers are rounded to 2 decimals +* `grid.points`: `number[][]` - initial coordinates `[x, y]` based on jittered square grid. Numbers rounded to 2 decimals +* `grid.boundary`: `number[][]` - coordinates or out-of-canvas points used to cut the diagram approximately by canvas edges. Integers * `grid.cells`: `{}` - cells data object, including voronoi data: * * `grid.cells.i`: `number[]` - cell indexes `Uint16Array` or `Uint32Array` (depending on cells number) * * `grid.cells.c`: `number[][]` - indexes of cells adjacent to each cell (neighboring cells) * * `grid.cells.v`: `number[][]` - indexes of vertices of each cell +* * `grid.cells.b`: `number[]` - indicator whether the cell borders the map edge, 1 if `true`, 0 if `false`. Integers, not Boolean * `grid.vertices`: `{}` - vertices data object, contains only voronoi data: * * `grid.vertices.p`: `number[][]` - vertices coordinates `[x, y]`, integers * * `grid.vertices.c`: `number[][]` - indexes of cells adjacent to each vertex, each vertex has 3 adjacent cells -* * `grid.vertices.v`: `number[][]` - indexes of vertices adjacent to each vertex. Most vertices have 3 neighboring vertices, bordering vertices has only 2, while the third is still added to the data as `-1` \ No newline at end of file +* * `grid.vertices.v`: `number[][]` - indexes of vertices adjacent to each vertex. Most vertices have 3 neighboring vertices, bordering vertices has only 2, while the third is still added to the data as `-1` + +### Pack object +* `pack.cells`: `{}` - cells data object, including voronoi data: +* * `pack.cells.i`: `number[]` - cell indexes `Uint16Array` or `Uint32Array` (depending on cells number) +* * `pack.cells.p`: `number[][]` - cells coordinates `[x, y]` after repacking. Numbers rounded to 2 decimals +* * `pack.cells.c`: `number[][]` - indexes of cells adjacent to each cell (neighboring cells) +* * `pack.cells.v`: `number[][]` - indexes of vertices of each cell +* * `pack.cells.b`: `number[]` - indicator whether the cell borders the map edge, 1 if `true`, 0 if `false`. Integers, not Boolean +* * `pack.cells.g`: `number[]` - indexes of a source cell in `grid`. `Uint16Array` or `Uint32Array`. The only way to find correct `grid` cell parent for `pack` cells + +* `pack.vertices`: `{}` - vertices data object, contains only voronoi data: +* * `pack.vertices.p`: `number[][]` - vertices coordinates `[x, y]`, integers +* * `pack.vertices.c`: `number[][]` - indexes of cells adjacent to each vertex, each vertex has 3 adjacent cells +* * `pack.vertices.v`: `number[][]` - indexes of vertices adjacent to each vertex. Most vertices have 3 neighboring vertices, bordering vertices has only 2, while the third is still added to the data as `-1` \ No newline at end of file