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 RoadNetwork(dtcc.Object)[source]
class RoadType(enum.Enum)[source]

Enumeration representing different road types.

class Landuse(dtcc.Object)[source]
class LanduseClasses(enum.Enum)[source]

An enumeration.

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 LineString(dtcc.Geometry)[source]
class MultiLineString(dtcc.Geometry)[source]
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: str | list[str], ...) 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, path)

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

load_cityjson(path: str | dict) City

Load a CityJSON file into a City object.

load_roadnetwork(path, id_field='id', ...) RoadNetwork
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, ...) 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, ...)

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)