GMS:Classify Material Zones

From XMS Wiki
Revision as of 16:04, 30 September 2019 by Jcreer (talk | contribs) (→‎Classify algorithm)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
The Classify Material Zones dialog

The Classify Material Zones dialogs allows assigning materials to a grid or mesh. The dialog is reached by right-clicking on a grid or mesh then selecting the Classify Material Zones command.

Select background object

The background object defines the source of the materials to be assigned to the grid or mesh. The source of the materials can be solids or a different grid or mesh.

Classify algorithm

Two options are available to assign materials to the grid or mesh: Centroid and Predominant material. When the Centroid method is used, the centroid of the grid cell or mesh element is calculated. Then the location of the calculated centroid is found in the background object (grid, mesh, or solid) and the material at that location in the background object is assigned to the grid cell or mesh element. If the calculated centroid is outside of the background object then the material of the grid cell or mesh element is not changed.

When the Predominant material method is used to assign materials to a grid from a solid the following process occurs. A vertical ray from the center of the cell is intersected with the solids. The top and bottom of the grid cell is then compared with intersected solids to determine the length of each solid within the cell. Then all of the "solid lengths" with the same material id are combined. The material id with the greatest length in the cell is assigned to the cell. If more than one material has the same length in the cell then the material with the lowest id is assigned to the cell.

Material set name

The Material set name is used to specify the name of the new material set as it appears in the Project Explorer.