py3dtiles.tilers.b3dm.wkb_utils module

class py3dtiles.tilers.b3dm.wkb_utils.TriangleSoup[source]

Bases: object

compute_normals() ndarray[Any, dtype[float32]][source]

Compute vertex normals and returns them as a numpy array.

static from_wkb_multipolygon(wkb: bytes, associated_data: list[bytes] | None = None) TriangleSoup[source]
Parameters:
  • wkb – Well-Known Binary binary string describing a multipolygon

  • associated_data – array of multipolygons containing data attached to the wkb parameter multipolygon. Must be the same size as wkb.

get_bbox() list[ndarray[Any, dtype[float32]]][source]

Returns the bbox in this format: [[minX, minY, minZ],[maxX, maxY, maxZ]]

get_data(index: int) ndarray[Any, dtype[float32]][source]
get_data_array(index: int) bytes[source]

Returns a binary array of vertex data

get_normal_array() bytes[source]

Returns a binary array of vertex normals

get_position_array() bytes[source]

Returns a binary array of vertex positions

property triangle_indices: ndarray[Any, dtype[uint8]]

Express the triangles as triplets of vertex indices.

property vertices: ndarray[Any, dtype[float32]]

Extract the unique vertices that compose the triangle set.

py3dtiles.tilers.b3dm.wkb_utils.face_attribute_to_array(triangles: list[ndarray[Any, dtype[float32]]]) list[ndarray[Any, dtype[float32]]][source]
py3dtiles.tilers.b3dm.wkb_utils.parse(wkb: bytes) list[list[list[ndarray[Any, dtype[float32]]]]][source]
py3dtiles.tilers.b3dm.wkb_utils.triangulate(polygon: list[list[ndarray[Any, dtype[float32]]]], additional_polygons: list[list[list[ndarray[Any, dtype[float32]]]]] | None = None) list[list[ndarray[Any, dtype[float32]]]][source]

Triangulates 3D polygons

py3dtiles.tilers.b3dm.wkb_utils.unflatten(array: list[list[ndarray[Any, dtype[float32]]]], lengths: list[int], index: int) ndarray[Any, dtype[float32]][source]
py3dtiles.tilers.b3dm.wkb_utils.vertex_attribute_to_array(triangles: list[ndarray[Any, dtype[float32]]]) list[ndarray[Any, dtype[float32]]][source]