py3dtiles.tileset.content.b3dm module#
- class py3dtiles.tileset.content.b3dm.B3dm(header: B3dmHeader, body: B3dmBody)[source]#
Bases:
TileContent
- static from_gltf(gltf: pygltflib.GLTF2, batch_table: BatchTable | None = None, feature_table: B3dmFeatureTable | None = None) B3dm [source]#
Wrap a pygltflib.GLTF2 instance into a b3dm. This gives the most control on the scene creation, as pygltflib.GLTF2 instance are as near as possible to the gltf specification.
- static from_meshes(meshes: list[GltfMesh], batch_table: BatchTable | None = None, feature_table: B3dmFeatureTable | None = None, transform: npt.NDArray[np.float32] | None = None) B3dm [source]#
Create a b3dm from GltfMesh instances. This allows for finer control than from_numpy_arrays by allowing several meshes in one b3dm.
- static from_numpy_arrays(points: npt.NDArray[np.float32], triangles: npt.NDArray[np.uint8] | None = None, batch_table: BatchTable | None = None, feature_table: B3dmFeatureTable | None = None, normal: npt.NDArray[np.float32] | None = None, uvs: npt.NDArray[np.float32] | None = None, batchids: npt.NDArray[np.uint32] | None = None, transform: npt.NDArray[np.float32] | None = None, texture_uri: str | None = None, material: pygltflib.Material | None = None) B3dm [source]#
Creates a B3DM body from numpy arrays.
- Parameters:
points – array of vertex positions, must have a (n, 3) shape.
triangles – array of triangle indices, must have a (n, 3) shape.
batch_table – a batch table.
feature_table – a feature table.
normals – array of vertex normals, must have a (n, 3) shape.
uvs – array of texture coordinates, must have a (n, 2) shape.
batchids – array of batch table IDs, must have a (n) shape.
texture_uri – the URI of the texture image if the primitive is textured.
material – a glTF material. If not set, a default material is created.