v0.1.51

searches the current version of every section · esc to close

26.05.05 Block Placement

Block-placement snaps the placement of artifacts onto a block grid. Block-placement is not compatible with cell-placement.

The block-placement makes use of the volume of the artifact, as defined in 26.05.02-Artifact-Volume.

26.05.05.01 Requirements of the Block-placement

The artifact itself, i.e., the Artifact object, that participates in the block-placement MUST have volume, as defined in 26.05.02-Artifact-Volume.

26.05.05.02 Alter the Artifact Level Block-placement

The Layout Mode module introduces a new member in ArtifactProperties to adjust the behavior of the block-placement. The new member in ArtifactProperties is defined as

interface ArtifactProperties {
	snapping: boolean // OPTIONAL
	// ...
}

where snapping is OPTIONAL and its value MUST be of type boolean. When not specified, the implementation MUST use the default value true if no other module alters the default value. When working with the Category module, the default value MUST follow the default value defined for each category.

An artifact with snapping set to false will not participate in the block-placement.

26.05.05.03 The Input and Result of the Block-placement Snapping

The block-placement snapping takes an input layout from Form and produces a resulting layout in which each element in the layout list, if it participates in the snapping, follows the block-placement.

For artifact ii, its original placement can be written as (xi,yi,zi)(x_i', y_i', z_i') before performing the block-placement snapping, where ii indexes artifacts in the input layout that participate in the block-placement snapping. The resulting placement can be written as (xi,yi,zi)(x_i, y_i, z_i) after performing the block-placement snapping.

For artifact ii, its original rotation can be written as the Euler angle (αi,βi,γi)(\alpha_i', \beta_i', \gamma_i') before performing the block-placement snapping, where ii indexes artifacts in the input layout that participate in the block-placement snapping. The resulting rotation can be written as (αi,βi,γi)(\alpha_i, \beta_i, \gamma_i) after performing the block-placement snapping.

26.05.05.04 Snap the Rotation

Block-placement allows artifacts to have only rotations of 0, 90, 180, or 270 degrees. This means all values of all members of the resulting rotation MUST be in the set {k90°kZ}\{k\, 90 \degree\mid k\in\mathbb{Z}\}.

26.05.05.05 Snap the Position

The scene is divided into cells of size 11 by 11 by 11. The cells are placed so that the origin of the scene is the center of a cell. Therefore,

  • the center of a cell belongs to the set {(a,b,c)a,b,cZ}\{(a, b, c)\mid a, b, c \in \mathbb{Z}\}, known as the cell lattice,
  • the corners (vertices) of the cells belong to the set {(a,b,c)a,b,cZ+12}\{(a, b, c)\mid a, b, c \in \mathbb{Z} + \tfrac{1}{2}\}, where Z+12\mathbb{Z} + \tfrac{1}{2} denotes all half-integers, known as the vertex lattice.

A valid placement of an Embedding MUST have the corners of its rotated rounded volume, as defined in 26.05.05-Block-Placement#26.05.05.06 Rounding Rule, coincide exactly with points in the vertex lattice.

Moreover, the above rules mean:

  • If volume.length is an odd integer, then the coordinate in the length direction must lie in Z\mathbb{Z}.
  • If volume.length is an even integer, then the coordinate in the length direction must lie in Z+12\mathbb{Z} + \tfrac{1}{2}.
  • The same rule applies to volume.width and volume.height. Note that a 90 or 270 degrees rotation swaps between length, width, and height in the scene coordinates.

26.05.05.06 Rounding Rule

When performing block-placement snapping, an Embedding MUST be rounded to respect the block-placement as follows in the following order

  1. Each member of rotation for the Embedding MUST be rounded to the nearest value defined in 26.05.05-Block-Placement#26.05.05.04 Snap the Rotation. If a value is exactly between two legal values, it MUST be rounded up to the larger value.
  2. Each element of the Artifact’s volume, for the purposes of block-placement, MUST be rounded up (ceiling) to an integer. The volume after being rounded up is called the rounded volume.
  3. Each element of the Embedding’s position MUST be rounded to the nearest value defined in 26.05.05-Block-Placement#26.05.05.05 Snap the Position. If it is exactly between two legal values, it MUST round to the larger value.

To respect the block-placement, it is usually easier in an implementation to round the rotation and volume first, then round the position.

26.05.05.07 Block-placement in Flat Layout Mode

In flat layout mode, artifacts are placed on a plane. The plane is divided into cells of size 11 by 11. The cells are placed so that the origin of the scene is the center of a cell. Therefore,

  • the center of a cell belongs to the set {(a,b)a,bZ}\{(a, b)\mid a, b \in \mathbb{Z}\}, known as the cell lattice,
  • the corners (vertices) of the cells belong to the set {(a,b)a,bZ+12}\{(a, b)\mid a, b \in \mathbb{Z} + \tfrac{1}{2}\}, where Z+12\mathbb{Z} + \tfrac{1}{2} denotes all half-integers, known as the vertex lattice.

A valid placement of an Embedding MUST have the corners of its rotated rounded volume, as defined in 26.05.05-Block-Placement#26.05.05.06 Rounding Rule, coincide exactly with points in the vertex lattice. The rotated volume in the zz direction of the artifact is ignored and is effectively overridden to zero. It is RECOMMENDED that all rotations are around the zz axis, i.e., the volume.height is consistently ignored. The rotation snapping works as specified in 26.05.05-Block-Placement#26.05.05.04 Snap the Rotation.

Revision history

  1. v0.1.51update wording: flat layout mode ignores the z directional rotated volumeviewdiff
  2. v0.1.43now rotation use degreeviewdiff
  3. v0.1.38add block placementview