searches the current version of every section · esc to close

Viewing this section as of v0.1.47 (tagged 2026-04-18). Go to current →

26.05.04 Cell Placement

Cell-placement constrains the placement of artifacts onto a grid for easy placement for general users. Cell-placement is not compatible with block-placement.

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

26.05.04.01 Requirements of the Cell-placement

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

26.05.04.02 Alter the Artifact Level Cell-placement

The Layout Mode module introduces a new member in ArtifactProperties to adjust the behavior of the cell-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 cell-placement.

26.05.04.03 The Input and Result of the Cell-placement Snapping

The cell-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 cell-placement.

For artifact ii, its original placement can be written as (xi,yi,zi)(x_i', y_i', z_i') before performing the cell-placement snapping, where ii indexes artifacts in the input layout that participate in the cell-placement snapping. The resulting placement can be written as (xi,yi,zi)(x_i, y_i, z_i) after performing the cell-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 cell-placement snapping, where ii indexes artifacts in the input layout that participate in the cell-placement snapping. The resulting rotation can be written as (αi,βi,γi)(\alpha_i, \beta_i, \gamma_i) after performing the cell-placement snapping.

The cell-placement snapping alters the ground plane coordinate of the artifact and the rotation. The height is left unchanged.

26.05.04.04 Snap the Rotation

The cell placement allows only zz-axis rotation. The input xx and yy-axis rotations will be mapped to 0 during the snapping. To focus only on the relevant data in the cell-placement, in the following sections, rotation refers to the zz-axis rotation, as rotation around any other axis is mapped to zero. The snapped zz-axis rotation together with zero rotation on the other axes is the resulting rotation for each Embedding.

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

26.05.04.05 Snap the Position

The cell placement constrains the position horizontally, i.e., the ground plane coordinate (x,y)(x, y), and the height zz is left unchanged. In the following section, it should be understood that the snapping is performed on the ground plane coordinate.

The ground plane is divided into cells of size 12\frac{1}{2} by 12\frac{1}{2}. The cells are placed so that the origin of the ground plane coincides with the corner points of nearby cells. Therefore,

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

A valid placement of an Embedding MUST have the corners of its rounded volume’s footprint, as defined in 26.05.04-Cell-Placement#26.05.04.06 Rounding Rule, coincide exactly with points in the vertex lattice.

Moreover, the above rules mean:

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

26.05.04.06 Rounding Rule

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

  1. The rotation of the Embedding MUST be rounded to the nearest value defined in 26.05.04-Cell-Placement#26.05.04.04 Snap the Rotation. If it is exactly between two legal values, it MUST round to the larger value.
  2. Each element of the Artifact’s volume, for the purposes of cell-placement and stacking logic, MUST be rounded up (ceiling) to the next integer or half-integer, i.e., an element in 12Z\tfrac{1}{2}\mathbb{Z}. The volume after being rounded up is called the rounded volume. The footprint calculated using the rounded volume is therefore its rounded volume’s footprint.
  3. Each element of the Embedding’s position MUST be rounded to the nearest value defined in 26.05.04-Cell-Placement#26.05.04.05 Snap the Position. If it is exactly between two legal values, it MUST round to the larger value.