Void

May 18, 2022 ยท View on GitHub

from tdw.proc_gen.arrangements.void import Void

An empty space along a wall.

Class Variables

VariableTypeDescriptionValue
DEFAULT_CELL_SIZEfloatThe default span used for arranging objects next to each other.0.6096
ENCLOSED_BYDict[str, List[str]]A dictionary of categories that can be enclosed by other categories. Key = A category. Value = A list of categories of models that can enclosed by the key category.loads(Path(resource_filename(__name__, "data/enclosed_by.json")).read_text())
INSIDE_OFDict[str, List[str]]A dictionary of categories that can be inside of other categories. Key = A category. Value = A list of categories of models that can inside of the key category.loads(Path(resource_filename(__name__, "data/inside_of.json")).read_text())
MODEL_CATEGORIESDict[str, List[str]]A dictionary of all of the models that may be used for procedural generation. Key = The category. Value = A list of model names. Note that this category overlaps with, but is not the same as, model_record.wcategory; see: Arrangement.get_categories_and_wcategories().loads(Path(resource_filename(__name__, "data/models.json")).read_text())
ON_TOP_OFDict[str, List[str]]A dictionary of categories that can be on top of other categories. Key = A category. Value = A list of categories of models that can be on top of the key category.loads(Path(resource_filename(__name__, "data/on_top_of.json")).read_text())

Fields

  • send_commands If True, send commands when self.get_commands() is called. If False, self.get_commands() will return an empty list.

  • root_object_id The ID of the root object.

  • object_ids A list of all of the object IDs in this arrangement.

  • root_object_id The ID of the root object.

  • object_ids A list of all of the object IDs in this arrangement.

  • object_ids A list of all of the object IDs in this arrangement.


Functions

__init__

Void(corner, wall, distance, region)

Void(corner, wall, distance, region, length=ArrangementAlongWall.DEFAULT_CELL_SIZE)

ParameterTypeDefaultDescription
cornerOrdinalDirectionThe origin OrdinalDirection of this wall. This is used to derive the direction.
wallCardinalDirectionThe wall as a CardinalDirection that the root object is next to.
distancefloatThe distance in meters from the corner along the derived direction.
regionInteriorRegionThe InteriorRegion that the object is in.
lengthfloatArrangementAlongWall.DEFAULT_CELL_SIZEThe length of the void.

get_categories_and_wcategories

Arrangement.get_categories_and_wcategories()

(Static)

Returns: A dictionary of the categories of every model that can be used by Arrangement and their corresponding wcategory and wnid. Key = The model name. Value = A dictionary with the following keys: "category" (the ProcGenObjects category), "wcategory" (the value of record.wcategory), and "wnid" (the value of record.wnid).

get_commands

self.get_commands()

Returns: A list of commands that will generate the arrangement.

get_length

self.get_length()

Returns: The lateral extent of the object.