scene

Module Contents

Classes

Functions

compute_global_node_transform(scene, node_idx)

Compute the global transform associated with a node.

mesh_to_simple_scene(mesh)

Converts a single mesh into a simple scene with a single identity instance of the input mesh.

meshes_to_simple_scene(meshes)

Converts a list of meshes into a simple scene with a single identity instance of each input mesh.

simple_scene_to_mesh(scene[, normalize_normals, ...])

Converts a scene into a concatenated mesh with all the transforms applied.

class scene.Animation
property extensions: Extensions
Return type:

Extensions

property name: str
Return type:

str

__repr__()

Return repr(self).

Return type:

str

class scene.AnimationList
class scene.AnimationList(arg)
class scene.AnimationList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) Animation
__getitem__(arg: slice, /) AnimationList
__iter__()
Return type:

collections.abc.Iterator[Animation]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: Animation, /) None
__setitem__(arg0: slice, arg1: AnimationList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (Animation)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (AnimationList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

Animation

class scene.BufferList
class scene.BufferList(arg)
class scene.BufferList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__contains__(arg: int, /) bool
__contains__(arg: object, /) bool
__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__eq__(arg, /)

Return self==value.

Parameters:

arg (object)

Return type:

bool

__getitem__(arg: int, /) int
__getitem__(arg: slice, /) BufferList
__iter__()
Return type:

collections.abc.Iterator[int]

__len__()
Return type:

int

__ne__(arg, /)

Return self!=value.

Parameters:

arg (object)

Return type:

bool

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: int, /) None
__setitem__(arg0: slice, arg1: BufferList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (int)

Return type:

None

clear()

Remove all items from list.

Return type:

None

count(arg, /)

Return number of occurrences of arg.

Parameters:

arg (int)

Return type:

int

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (BufferList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
  • arg0 (int)

  • arg1 (int)

Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

int

remove(arg, /)

Remove first occurrence of arg.

Parameters:

arg (int)

Return type:

None

class scene.Camera

Camera

class Type(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Orthographic = 1
Perspective = 0
property aspect_ratio: float
Return type:

float

property extensions: Extensions
Return type:

Extensions

property far_plane: float
Return type:

float

property get_vertical_fov: float
Return type:

float

property horizontal_fov: float
Return type:

float

property look_at: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]

property name: str
Return type:

str

property near_plane: float
Return type:

float

property orthographic_width: float
Return type:

float

property position: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]

property set_horizontal_fov_from_vertical_fov: None
Parameters:

arg (float)

Return type:

None

property type: Camera
Return type:

Camera

property up: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]

__repr__()

Return repr(self).

Return type:

str

class scene.CameraList
class scene.CameraList(arg)
class scene.CameraList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) Camera
__getitem__(arg: slice, /) CameraList
__iter__()
Return type:

collections.abc.Iterator[Camera]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: Camera, /) None
__setitem__(arg0: slice, arg1: CameraList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (Camera)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (CameraList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

Camera

class scene.ElementIdList
class scene.ElementIdList(arg)
class scene.ElementIdList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__contains__(arg: int, /) bool
__contains__(arg: object, /) bool
__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__eq__(arg, /)

Return self==value.

Parameters:

arg (object)

Return type:

bool

__getitem__(arg: int, /) int
__getitem__(arg: slice, /) ElementIdList
__iter__()
Return type:

collections.abc.Iterator[int]

__len__()
Return type:

int

__ne__(arg, /)

Return self!=value.

Parameters:

arg (object)

Return type:

bool

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: int, /) None
__setitem__(arg0: slice, arg1: ElementIdList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (int)

Return type:

None

clear()

Remove all items from list.

Return type:

None

count(arg, /)

Return number of occurrences of arg.

Parameters:

arg (int)

Return type:

int

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (ElementIdList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
  • arg0 (int)

  • arg1 (int)

Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

int

remove(arg, /)

Remove first occurrence of arg.

Parameters:

arg (int)

Return type:

None

class scene.Extensions
property data: ValueUnorderedMap
Return type:

ValueUnorderedMap

property empty: bool
Return type:

bool

property size: int
Return type:

int

class scene.FacetAllocationStrategy(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

EvenSplit = 0
RelativeToMeshArea = 1
RelativeToNumFacets = 2
Synchronized = 3
class scene.Image
property extensions: Extensions

Additional data associated with the image

Return type:

Extensions

property image: ImageBuffer

Image buffer

Return type:

ImageBuffer

property name: str

Name of the image object

Return type:

str

property uri: pathlib.Path

URI of the image file

Return type:

pathlib.Path

__repr__()

Return repr(self).

Return type:

str

class scene.ImageBuffer
property data: object

Raw image data.

Return type:

object

property dtype: type | None

The element data type of the image buffer.

Return type:

type | None

property height: int

Image height

Return type:

int

property num_channels: int

Number of channels in each pixel

Return type:

int

property width: int

Image width

Return type:

int

class scene.ImageList
class scene.ImageList(arg)
class scene.ImageList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) Image
__getitem__(arg: slice, /) ImageList
__iter__()
Return type:

collections.abc.Iterator[Image]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: Image, /) None
__setitem__(arg0: slice, arg1: ImageList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (Image)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (ImageList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
  • arg0 (int)

  • arg1 (Image)

Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

Image

class scene.Light

Light

class Type(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Ambient = 4
Area = 5
Directional = 1
Point = 2
Spot = 3
Undefined = 0
property angle_inner_cone: float
Return type:

float

property angle_outer_cone: float
Return type:

float

property attenuation_constant: float
Return type:

float

property attenuation_cubic: float
Return type:

float

property attenuation_linear: float
Return type:

float

property attenuation_quadratic: float
Return type:

float

property color_ambient: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]

property color_diffuse: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]

property color_specular: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]

property direction: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]

property extensions: Extensions
Return type:

Extensions

property intensity: float
Return type:

float

property name: str
Return type:

str

property position: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]

property range: float
Return type:

float

property size: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=2, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=2, order=’C’)]

property type: Light
Return type:

Light

property up: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]

__repr__()

Return repr(self).

Return type:

str

class scene.LightList
class scene.LightList(arg)
class scene.LightList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) Light
__getitem__(arg: slice, /) LightList
__iter__()
Return type:

collections.abc.Iterator[Light]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: Light, /) None
__setitem__(arg0: slice, arg1: LightList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (Light)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (LightList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
  • arg0 (int)

  • arg1 (Light)

Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

Light

class scene.Material
class AlphaMode(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Blend = 2
Mask = 1
Opaque = 0
property alpha_cutoff: float
Return type:

float

property alpha_mode: Material
Return type:

Material

property base_color_texture: TextureInfo
Return type:

TextureInfo

property base_color_value: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=4, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=4, order=’C’)]

property double_sided: bool
Return type:

bool

property emissive_texture: TextureInfo
Return type:

TextureInfo

property emissive_value: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=3, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=3, order=’C’)]

property extensions: Extensions
Return type:

Extensions

property metallic_roughness_texture: TextureInfo
Return type:

TextureInfo

property metallic_value: float
Return type:

float

property name: str
Return type:

str

property normal_scale: float
Return type:

float

property normal_texture: TextureInfo
Return type:

TextureInfo

property occlusion_strength: float
Return type:

float

property occlusion_texture: TextureInfo
Return type:

TextureInfo

property roughness_value: float
Return type:

float

__repr__()

Return repr(self).

Return type:

str

class scene.MaterialList
class scene.MaterialList(arg)
class scene.MaterialList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) Material
__getitem__(arg: slice, /) MaterialList
__iter__()
Return type:

collections.abc.Iterator[Material]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: Material, /) None
__setitem__(arg0: slice, arg1: MaterialList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (Material)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (MaterialList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

Material

class scene.MeshInstance3D

A single mesh instance in a scene

property mesh_index: int
Return type:

int

property transform: Annotated[numpy.typing.ArrayLike, dict(dtype='float64', order='C', device='cpu')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float64’, order=’C’, device=’cpu’)]

class scene.Node
property cameras: ElementIdList
Return type:

ElementIdList

property children: ElementIdList
Return type:

ElementIdList

property extensions: Extensions
Return type:

Extensions

property lights: ElementIdList
Return type:

ElementIdList

property meshes: SceneMeshInstanceList
Return type:

SceneMeshInstanceList

property name: str
Return type:

str

property parent: int
Return type:

int

property transform: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=4, 4, order='F')]

The affine transform associated with this node

Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=(4, 4), order=’F’)]

__repr__()

Return repr(self).

Return type:

str

class scene.NodeList
class scene.NodeList(arg)
class scene.NodeList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) Node
__getitem__(arg: slice, /) NodeList
__iter__()
Return type:

collections.abc.Iterator[Node]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: Node, /) None
__setitem__(arg0: slice, arg1: NodeList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (Node)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (NodeList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
  • arg0 (int)

  • arg1 (Node)

Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

Node

class scene.RemeshingOptions
property facet_allocation_strategy: FacetAllocationStrategy
Return type:

FacetAllocationStrategy

property min_facets: int
Return type:

int

class scene.Scene

A 3D scene

property animations: AnimationList
Return type:

AnimationList

property cameras: CameraList
Return type:

CameraList

property extensions: Extensions
Return type:

Extensions

property images: ImageList
Return type:

ImageList

property lights: LightList
Return type:

LightList

property materials: MaterialList
Return type:

MaterialList

property meshes: SurfaceMeshList
Return type:

SurfaceMeshList

property name: str
Return type:

str

property nodes: NodeList
Return type:

NodeList

property root_nodes: ElementIdList
Return type:

ElementIdList

property skeletons: SkeletonList
Return type:

SkeletonList

property textures: TextureList
Return type:

TextureList

__repr__()

Return repr(self).

Return type:

str

add(element)

Add an element to the scene.

Parameters:

element (Node | lagrange.core.SurfaceMesh | Image | Texture | Material | Light | Camera | Skeleton | Animation) – The element to add to the scene. E.g. node, mesh, image, texture, material, light, camera, skeleton, or animation.

Returns:

The id of the added element.

Return type:

int

add_child(parent_id, child_id)

Add a child node to a parent node.

Parameters:
  • parent_id (int) – The parent node id.

  • child_id (int) – The child node id.

Returns:

The id of the added child node.

Return type:

None

class scene.SceneMeshInstance

Mesh and material index of a node

property materials: ElementIdList
Return type:

ElementIdList

property mesh: int
Return type:

int

class scene.SceneMeshInstanceList
class scene.SceneMeshInstanceList(arg)
class scene.SceneMeshInstanceList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) SceneMeshInstance
__getitem__(arg: slice, /) SceneMeshInstanceList
__iter__()
Return type:

collections.abc.Iterator[SceneMeshInstance]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: SceneMeshInstance, /) None
__setitem__(arg0: slice, arg1: SceneMeshInstanceList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (SceneMeshInstance)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (SceneMeshInstanceList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

SceneMeshInstance

class scene.SimpleScene3D

Simple scene container for instanced meshes

property num_meshes: int

Number of meshes in the scene

Return type:

int

property total_num_instances: int

Total number of instances for all meshes in the scene

Return type:

int

add_instance(instance)
Parameters:

instance (MeshInstance3D)

Return type:

int

add_mesh(mesh)
Parameters:

mesh (lagrange.core.SurfaceMesh)

Return type:

int

get_instance(mesh_index, instance_index)
Parameters:
  • mesh_index (int)

  • instance_index (int)

Return type:

MeshInstance3D

get_mesh(mesh_index)
Parameters:

mesh_index (int)

Return type:

lagrange.core.SurfaceMesh

num_instances(mesh_index)
Parameters:

mesh_index (int)

Return type:

int

ref_mesh(mesh_index)
Parameters:

mesh_index (int)

Return type:

lagrange.core.SurfaceMesh

reserve_instances(mesh_index, num_instances)
Parameters:
  • mesh_index (int)

  • num_instances (int)

Return type:

None

reserve_meshes(num_meshes)
Parameters:

num_meshes (int)

Return type:

None

class scene.Skeleton
property extensions: Extensions
Return type:

Extensions

property meshes: ElementIdList
Return type:

ElementIdList

class scene.SkeletonList
class scene.SkeletonList(arg)
class scene.SkeletonList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) Skeleton
__getitem__(arg: slice, /) SkeletonList
__iter__()
Return type:

collections.abc.Iterator[Skeleton]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: Skeleton, /) None
__setitem__(arg0: slice, arg1: SkeletonList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (Skeleton)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (SkeletonList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

Skeleton

class scene.SurfaceMeshList
class scene.SurfaceMeshList(arg)
class scene.SurfaceMeshList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) lagrange.core.SurfaceMesh
__getitem__(arg: slice, /) SurfaceMeshList
__iter__()
Return type:

collections.abc.Iterator[lagrange.core.SurfaceMesh]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: lagrange.core.SurfaceMesh, /) None
__setitem__(arg0: slice, arg1: SurfaceMeshList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (lagrange.core.SurfaceMesh)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (SurfaceMeshList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
  • arg0 (int)

  • arg1 (lagrange.core.SurfaceMesh)

Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

lagrange.core.SurfaceMesh

class scene.Texture

Texture

class TextureFilter(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Linear = 9729
LinearMipmapLinear = 9987
LinearMipmapNearest = 9985
Nearest = 9728
NearestMimpapNearest = 9984
NearestMipmapLinear = 9986
Undefined = 0
class WrapMode(*args, **kwds)

Bases: enum.Enum

Create a collection of name/value pairs.

Example enumeration:

>>> class Color(Enum):
...     RED = 1
...     BLUE = 2
...     GREEN = 3

Access them by:

  • attribute access:

>>> Color.RED
<Color.RED: 1>
  • value lookup:

>>> Color(1)
<Color.RED: 1>
  • name lookup:

>>> Color['RED']
<Color.RED: 1>

Enumerations can be iterated over, and know how many members they have:

>>> len(Color)
3
>>> list(Color)
[<Color.RED: 1>, <Color.BLUE: 2>, <Color.GREEN: 3>]

Methods can be added to enumerations, and members can have their own attributes – see the documentation for details.

Clamp = 1
Decal = 2
Mirror = 3
Wrap = 0
property extensions: Extensions
Return type:

Extensions

property image: int
Return type:

int

property mag_filter: Texture
Return type:

Texture

property min_filter: Texture
Return type:

Texture

property name: str
Return type:

str

property offset: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=2, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=2, order=’C’)]

property rotation: float
Return type:

float

property scale: Annotated[numpy.typing.ArrayLike, dict(dtype='float32', shape=2, order='C')]
Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=2, order=’C’)]

property wrap_u: Texture
Return type:

Texture

property wrap_v: Texture
Return type:

Texture

__repr__()

Return repr(self).

Return type:

str

class scene.TextureInfo
property index: int
Return type:

int

property texcoord: int
Return type:

int

class scene.TextureList
class scene.TextureList(arg)
class scene.TextureList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) Texture
__getitem__(arg: slice, /) TextureList
__iter__()
Return type:

collections.abc.Iterator[Texture]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: Texture, /) None
__setitem__(arg0: slice, arg1: TextureList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (Texture)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (TextureList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

Texture

class scene.ValueList
class scene.ValueList(arg)
class scene.ValueList(arg, /)
__bool__()

Check whether the vector is nonempty

Return type:

bool

__delitem__(arg: int, /) None
__delitem__(arg: slice, /) None
__getitem__(arg: int, /) Value
__getitem__(arg: slice, /) ValueList
__iter__()
Return type:

collections.abc.Iterator[Value]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0: int, arg1: Value, /) None
__setitem__(arg0: slice, arg1: ValueList, /) None
append(arg, /)

Append arg to the end of the list.

Parameters:

arg (Value)

Return type:

None

clear()

Remove all items from list.

Return type:

None

extend(arg, /)

Extend self by appending elements from arg.

Parameters:

arg (ValueList)

Return type:

None

insert(arg0, arg1, /)

Insert object arg1 before index arg0.

Parameters:
  • arg0 (int)

  • arg1 (Value)

Return type:

None

pop(index=-1)

Remove and return item at index (default last).

Parameters:

index (int)

Return type:

Value

class scene.ValueMap
class scene.ValueMap(arg)
class scene.ValueMap(arg, /)
class ItemView
__iter__()
Return type:

collections.abc.Iterator[tuple[str, Value]]

__len__()
Return type:

int

class KeyView
__contains__(arg: str, /) bool
__contains__(arg: object, /) bool
__iter__()
Return type:

collections.abc.Iterator[str]

__len__()
Return type:

int

class ValueView
__iter__()
Return type:

collections.abc.Iterator[Value]

__len__()
Return type:

int

__bool__()

Check whether the map is nonempty

Return type:

bool

__contains__(arg: str, /) bool
__contains__(arg: object, /) bool
__delitem__(arg, /)
Parameters:

arg (str)

Return type:

None

__getitem__(arg, /)
Parameters:

arg (str)

Return type:

Value

__iter__()
Return type:

collections.abc.Iterator[str]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0, arg1, /)
Parameters:
  • arg0 (str)

  • arg1 (Value)

Return type:

None

clear()

Remove all items

Return type:

None

items()

Returns an iterable view of the map’s items.

Return type:

ValueMap

keys()

Returns an iterable view of the map’s keys.

Return type:

ValueMap

update(arg, /)

Update the map with element from arg

Parameters:

arg (ValueMap)

Return type:

None

values()

Returns an iterable view of the map’s values.

Return type:

ValueMap

class scene.ValueUnorderedMap
class scene.ValueUnorderedMap(arg)
class scene.ValueUnorderedMap(arg, /)
class ItemView
__iter__()
Return type:

collections.abc.Iterator[tuple[str, Value]]

__len__()
Return type:

int

class KeyView
__contains__(arg: str, /) bool
__contains__(arg: object, /) bool
__iter__()
Return type:

collections.abc.Iterator[str]

__len__()
Return type:

int

class ValueView
__iter__()
Return type:

collections.abc.Iterator[Value]

__len__()
Return type:

int

__bool__()

Check whether the map is nonempty

Return type:

bool

__contains__(arg: str, /) bool
__contains__(arg: object, /) bool
__delitem__(arg, /)
Parameters:

arg (str)

Return type:

None

__getitem__(arg, /)
Parameters:

arg (str)

Return type:

Value

__iter__()
Return type:

collections.abc.Iterator[str]

__len__()
Return type:

int

__repr__()

Return repr(self).

Return type:

str

__setitem__(arg0, arg1, /)
Parameters:
  • arg0 (str)

  • arg1 (Value)

Return type:

None

clear()

Remove all items

Return type:

None

items()

Returns an iterable view of the map’s items.

Return type:

ValueUnorderedMap

keys()

Returns an iterable view of the map’s keys.

Return type:

ValueUnorderedMap

update(arg, /)

Update the map with element from arg

Parameters:

arg (ValueUnorderedMap)

Return type:

None

values()

Returns an iterable view of the map’s values.

Return type:

ValueUnorderedMap

scene.compute_global_node_transform(scene, node_idx)

Compute the global transform associated with a node.

Parameters:
  • scene (Scene) – The input node.

  • node_idx (int) – The index of the taget node.

Returns:

The global transform of the target node, which is the combination of transforms from this node all the way to the root.

Return type:

Annotated[numpy.typing.ArrayLike, dict(dtype=’float32’, shape=(4, 4), order=’F’)]

scene.mesh_to_simple_scene(mesh)

Converts a single mesh into a simple scene with a single identity instance of the input mesh.

Parameters:

mesh (lagrange.core.SurfaceMesh) – Input mesh to convert.

Returns:

Simple scene containing the input mesh.

Return type:

SimpleScene3D

scene.meshes_to_simple_scene(meshes)

Converts a list of meshes into a simple scene with a single identity instance of each input mesh.

Parameters:

meshes (SurfaceMeshList) – Input meshes to convert.

Returns:

Simple scene containing the input meshes.

Return type:

SimpleScene3D

scene.simple_scene_to_mesh(scene, normalize_normals=True, normalize_tangents_bitangents=True, preserve_attributes=True)

Converts a scene into a concatenated mesh with all the transforms applied.

Parameters:
  • scene (SimpleScene3D) – Scene to convert.

  • normalize_normals (bool) – If enabled, normals are normalized after transformation.

  • normalize_tangents_bitangents (bool) – If enabled, tangents and bitangents are normalized after transformation.

  • preserve_attributes (bool) – Preserve shared attributes and map them to the output mesh.

Returns:

Concatenated mesh.

Return type:

lagrange.core.SurfaceMesh