class Terrain(dtcc.Object)[source]

Represents a terrain object in a city.

Public members

to_proto() Object[source]

Return a protobuf representation of the Terrain.

from_proto(pb: Object | bytes)[source]

Initialize Terrain from a protobuf representation.

__str__()[source]

Return str(self).

Terrain(id: str = <factory>, attributes: dict = <factory>, ...)

Initialize self. See help(type(self)) for accurate signature.

__repr__()

Return repr(self).

__eq__(other)

Return self==value.

property num_children

Return number of child objects.

property lod0

Return LOD0 geometry.

property lod1

Return LOD0 geometry.

property lod2

Return LOD0 geometry.

property lod3

Return LOD0 geometry.

property mesh

Return LOD0 geometry.

property volume_mesh

Return LOD0 geometry.

property point_cloud

Return POINT_CLOUD geometry.

property raster

Return RASTER geometry.

property bounds

Return BOUNDS geometry.

add_child(child)[source]

Add child object.

add_children(children)[source]

Adds a list of children objects.

add_geometry(geometry: Geometry, geometry_type: GeometryType | str)[source]

Add geometry to object.

add_field(field, geometry_type)[source]

Add a field to a geometry of the object.

get_children(child_type)[source]
set_child_attributues(child_type, attribute, values)[source]
get_child_attributes(child_type, attribute, default=None)[source]
flatten_geometry(geom_type: GeometryType)[source]

Returns a single geometry of the specified type, merging all the geometries of the children.

calculate_bounds(lod=None)[source]

Calculate the bounding box of the object.

defined_geometries()[source]

Return a list of the types of geometries defined on this object.

defined_attributes()[source]

Return a list of the attributes defined on this object.

view()

View a generic object in 3D with a GLFW window.

id : str
attributes : dict
children : dict
geometry : dict
to_json() str

Return a JSON representation of the object.

copy(**kwargs)

Return a copy of the object.

classmethod add_methods(module, name=None)

Adds methods from a module or function to the class.

classmethod print_methods(verbose=False)

Print the methods that have been added to the class.