API Reference

Classes

class Object(dtcc_model.model.Model)[source]

Base class for all object classes.

class GeometryType(enum.Enum)[source]

An enumeration.

class Building(dtcc.Object)[source]

Represents a building in a city.

class BuildingPart(dtcc.Object)[source]
class City(dtcc.Object)[source]

Represents a city, the top-level container class for city models.

class CityObject(dtcc.Object)[source]

Represents a generic object in a city.

class Terrain(dtcc.Object)[source]

Represents a terrain object in a city.

class Bounds(dtcc_model.model.Model)[source]

Represents the boundaries of a rectangular region in the xy plane) with optional extension along the z-axis (depth)

class Geometry(dtcc_model.model.Model)[source]

Base class for all geometry classes.

class Grid(dtcc.Geometry)[source]

Represents a structured quadrilateral grid in 2D.

class Mesh(dtcc.Geometry)[source]

Represents an unstructured triangular mesh in 3D.

class MultiSurface(dtcc.Geometry)[source]

Represents a planar surfaces in 3D.

class PointCloud(dtcc.Geometry)[source]

Represents a set of points in 3D.

class Surface(dtcc.Geometry)[source]

Represents a planar surface in 3D.

class Transform(dtcc_model.model.Model)[source]

Represents an affine transformation to a global coordinate system.

class VolumeGrid(dtcc.Geometry)[source]

Represents a structured hexahedral grid in 3D.

class VolumeMesh(dtcc.Geometry)[source]

Represents an unstructured tetrahedral mesh in 3D.

class Field(dtcc_model.model.Model)[source]

Represents a field (scalar or vector) defined on a geometry.

class Raster(dtcc_model.model.Model)[source]

A georeferenced n-dimensional raster of values.

class Window[source]

OpenGL Rendering Window.

class Scene[source]

Scene which contains a collection of objects to be rendered.

class Shading(enum.IntEnum)[source]

An enumeration.

Free functions

init_logging(name)[source]

Initialize logging for given package

set_log_level(level)[source]

Set log level. Valid levels are:

load_mesh(path)[source]
save_mesh(mesh, path)
load_volume_mesh(path)[source]
save_volume_mesh(mesh, path)
load_pointcloud(path, points_only=False, ...) PointCloud

Load a LAS/LAZ/CSV file or a directory containing LAS/LAZ/CSV files as a PointCloud object.

save_pointcloud(pointcloud, outfile)
load_raster(path, delimiter=',') Raster

Load a raster file as a Raster object.

save_raster(raster: Raster, path)

Save a Raster object to a file.

load_city(path)
load_footprints(...) [<class 'dtcc_model.object.building.Building'>]

Load the buildings from a supported file and return a City object.

save_footprints(city, filename)

Save the buildings in a City object to a supported file.

load_cityjson(cityjson_path: str | dict) City

Load a CityJSON file into a City object.

extract_roof_points(...) List[Building][source]
compute_building_heights(buildings, ...) List[Building][source]
build_lod1_buildings(...) List[Building][source]

Build the LOD1 representation of the given buildings.

build_surface_mesh(city: City, lod, ...) Mesh[source]

Build a mesh from the surfaces of the buildings in the city.

build_terrain_mesh(...) Mesh[source]
build_terrain_raster(pc: PointCloud, cell_size, ...) Raster[source]

Rasterize a point cloud into a Raster object.

flat_terrain(height, bounds: Bounds) Terrain[source]

Create a flat terrain.

merge_building_footprints(buildings, ...) List[Building][source]
simplify_building_footprints(buildings, ...) List[Building][source]
fix_building_footprint_clearance(buildings, ...) List[Building][source]
split_footprint_walls(buildings, ...) List[Building][source]
view_pointcloud(pc: PointCloud, size: float = 0.2, data)

View a point cloud in 3D with a GLFW window.

view_city(city: City)

View a mesh in 3D with a GLFW window.

view_mesh(mesh: Mesh, data: Any | None = None)

View a mesh in 3D with a GLFW window.

view_building(building: Building)

View a mesh in 3D with a GLFW window.

view_object(obj: Object)

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

view_raster(raster: Raster)

View a raster in 3D with a GLFW window.

debug(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘DEBUG’.

info(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘INFO’.

warning(msg, *args, **kwargs)[source]

Log ‘msg % args’ with severity ‘WARNING’.

error(message)
critical(message)