Karana.Scene

Contents

Karana.Scene#

Classes and modules related to Scenes.

Submodules#

Attributes#

Classes#

AbstractStaticGeometry

Interface for static geometry types

Alignment

Members:

AssimpImporter

AbstractImport implementation using the third-party ASSIMP library

BoxGeometry

Concrete box geometry class

CapsuleGeometry

Geometry class for a cylinder capped with hemispheres

CollisionInfo

CollisionScene

Scene with added collision-specific interface

CollisionSceneNode

CollisionScenePart

Color

Color class

ConeGeometry

Concrete cone geometry class

Contact

CylinderGeometry

Concrete cylinder geometry class

DistanceInfo

GraphicalScene

Scene with an added graphics-specific interface

GraphicalSceneCamera

GraphicalSceneNode

GraphicalScenePart

GrayscaleTexture

Texture specialization for grayscale values

ImportResult

OrthographicProjection

Info for an orthographic camera projection

PerspectiveProjection

Info for a perspective camera projection

PhongMaterial

A standard Phong material

PhongMaterialInfo

Parameter struct for a PhongMaterial

PhysicalMaterial

A standard PBR material

PhysicalMaterialInfo

Parameter struct for a PhysicalMaterial

RoundFrustumGeometry

Concrete round frustum geometry class

Scene

Base container for a hierarchy of geometries

SceneNode

Base for objects with a transform i n the scene hierarchy

ScenePart

Class for objects with geometry and material in the scene

ScenePartSpec

SphereGeometry

Concrete sphere geometry class

StaticMeshGeometry

Concrete triangular mesh geometry class

TextParameters

Style parameters for text

Texture

Class for a texture image

ProxyScene

A Scene implementation acting as a proxy to any number of registered

ProxySceneNode

ProxyScenePart

WebScene

GraphicalScene implementation for web-based graphics

WebSceneNode

WebScenePart

CoalScene

CollisionScene implementation using the COAL library

CoalSceneNode

CoalScenePart

Functions#

defaultGeometry(...)

defaultMaterial(→ PhysicalMaterial | PhongMaterial)

Package Contents#

class Karana.Scene.AbstractStaticGeometry#

Bases: Karana.Core.Base

Interface for static geometry types

See Scene layer for more discussion on the scene layer.

aabb() Karana.Math.AABB#

Compute the axis-aligned bounding box (AABB) :returns: The AABB

class Karana.Scene.Alignment(value: SupportsInt)#

Members:

LEFT

CENTER

RIGHT

CENTER: ClassVar[Alignment]#
LEFT: ClassVar[Alignment]#
RIGHT: ClassVar[Alignment]#
__members__: ClassVar[dict[str, Alignment]]#
__eq__(other: Any) bool#
__getstate__() int#
__hash__() int#
__index__() int#
__int__() int#
__ne__(other: Any) bool#
__repr__() str#
__setstate__(state: SupportsInt) None#
__str__() str#
property name: str#
property value: int#
class Karana.Scene.AssimpImporter#

AbstractImport implementation using the third-party ASSIMP library

See Scene layer for more discussion on the scene layer.

importFrom(filename: os.PathLike | str | bytes) ImportResult#
class Karana.Scene.BoxGeometry(width: SupportsFloat, height: SupportsFloat, depth: SupportsFloat)#

Bases: AbstractStaticGeometry

Concrete box geometry class

See Scene layer for more discussion on the scene layer.

static to_json(o: BoxGeometry) dict[str, Any]#

Class method used to represent BoxGeometry in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a BoxGeometry from json file data.

classmethod from_yaml(loader, node) Self#

Construct a BoxGeometry from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent BoxGeometry in a yaml file.

__getstate__() Annotated[numpy.typing.NDArray[numpy.float32], [3, 1]]#
__setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [3, 1]]) None#
property depth: float#

side length in the z direction

property height: float#

side length in the y direction

property width: float#

side length in the x direction

class Karana.Scene.CapsuleGeometry(radius: SupportsFloat, height: SupportsFloat)#

Bases: AbstractStaticGeometry

Geometry class for a cylinder capped with hemispheres

See Scene layer for more discussion on the scene layer.

static to_json(o: CapsuleGeometry) dict[str, Any]#

Class method used to represent CapsuleGeometry in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a CapsuleGeometry from json file data.

classmethod from_yaml(loader, node) Self#

Construct a CapsuleGeometry from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent CapsuleGeometry in a yaml file.

__getstate__() Annotated[numpy.typing.NDArray[numpy.float32], [2, 1]]#
__setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [2, 1]]) None#
property height: float#

height of the capsule’s middle section

property radius: float#

radius of the capsule

class Karana.Scene.CollisionInfo#
static singleton() CollisionInfo#
__bool__() bool#
hasContact() bool#
property contacts: list[Contact]#
property part1: int#
property part2: int#
class Karana.Scene.CollisionScene#

Bases: Scene

Scene with added collision-specific interface

See Scene layer for more discussion on the scene layer.

broadphase(callback: collections.abc.Callable[[CollisionScenePart, CollisionScenePart], None]) None#
Do a coarse sweep over the scene check for potential

collisions.

Parameters:

callback

  • Function called for each potential collision

cachedCollisions() list[CollisionInfo]#

Get a list of collisions from the last sweep :returns: The cached collisions

lookupPart(id: SupportsInt) CollisionScenePart#

Fetch a part by its id :returns: The part

sweep(callback: collections.abc.Callable[[CollisionInfo], None], filter: collections.abc.Callable[[CollisionScenePart, CollisionScenePart], bool] = None) None#

Do a sweep over the scene checking for collisions :param callback:

  • Function called for each collision

Parameters:

filter

  • Filter function called for each potential collision pair

class Karana.Scene.CollisionSceneNode#

Bases: SceneNode

class Karana.Scene.CollisionScenePart#

Bases: ScenePart, CollisionSceneNode

collide(other: CollisionScenePart) CollisionInfo#
collide(other: CollisionScenePart, result: CollisionInfo) CollisionInfo
distance(other: CollisionScenePart) DistanceInfo#
distance(other: CollisionScenePart, result: DistanceInfo) DistanceInfo
class Karana.Scene.Color(other: Color)#

Color class

See Scene layer for more discussion on the scene layer.

ALICEBLUE: ClassVar[Color]#
ANTIQUEWHITE: ClassVar[Color]#
AQUA: ClassVar[Color]#
AQUAMARINE: ClassVar[Color]#
AZURE: ClassVar[Color]#
BEIGE: ClassVar[Color]#
BISQUE: ClassVar[Color]#
BLACK: ClassVar[Color]#
BLANCHEDALMOND: ClassVar[Color]#
BLUE: ClassVar[Color]#
BLUEVIOLET: ClassVar[Color]#
BROWN: ClassVar[Color]#
BURLYWOOD: ClassVar[Color]#
CADETBLUE: ClassVar[Color]#
CHARTREUSE: ClassVar[Color]#
CHOCOLATE: ClassVar[Color]#
CORAL: ClassVar[Color]#
CORNFLOWERBLUE: ClassVar[Color]#
CORNSILK: ClassVar[Color]#
CRIMSON: ClassVar[Color]#
CYAN: ClassVar[Color]#
DARKBLUE: ClassVar[Color]#
DARKCYAN: ClassVar[Color]#
DARKGOLDENROD: ClassVar[Color]#
DARKGRAY: ClassVar[Color]#
DARKGREEN: ClassVar[Color]#
DARKGREY: ClassVar[Color]#
DARKKHAKI: ClassVar[Color]#
DARKMAGENTA: ClassVar[Color]#
DARKOLIVEGREEN: ClassVar[Color]#
DARKORANGE: ClassVar[Color]#
DARKORCHID: ClassVar[Color]#
DARKRED: ClassVar[Color]#
DARKSALMON: ClassVar[Color]#
DARKSEAGREEN: ClassVar[Color]#
DARKSLATEBLUE: ClassVar[Color]#
DARKSLATEGRAY: ClassVar[Color]#
DARKSLATEGREY: ClassVar[Color]#
DARKTURQUOISE: ClassVar[Color]#
DARKVIOLET: ClassVar[Color]#
DEEPPINK: ClassVar[Color]#
DEEPSKYBLUE: ClassVar[Color]#
DIMGRAY: ClassVar[Color]#
DIMGREY: ClassVar[Color]#
DODGERBLUE: ClassVar[Color]#
FIREBRICK: ClassVar[Color]#
FLORALWHITE: ClassVar[Color]#
FORESTGREEN: ClassVar[Color]#
FUCHSIA: ClassVar[Color]#
GAINSBORO: ClassVar[Color]#
GHOSTWHITE: ClassVar[Color]#
GOLD: ClassVar[Color]#
GOLDENROD: ClassVar[Color]#
GRAY: ClassVar[Color]#
GREEN: ClassVar[Color]#
GREENYELLOW: ClassVar[Color]#
GREY: ClassVar[Color]#
HONEYDEW: ClassVar[Color]#
HOTPINK: ClassVar[Color]#
INDIANRED: ClassVar[Color]#
INDIGO: ClassVar[Color]#
IVORY: ClassVar[Color]#
KHAKI: ClassVar[Color]#
LAVENDER: ClassVar[Color]#
LAVENDERBLUSH: ClassVar[Color]#
LAWNGREEN: ClassVar[Color]#
LEMONCHIFFON: ClassVar[Color]#
LIGHTBLUE: ClassVar[Color]#
LIGHTCORAL: ClassVar[Color]#
LIGHTCYAN: ClassVar[Color]#
LIGHTGOLDENRODYELLOW: ClassVar[Color]#
LIGHTGRAY: ClassVar[Color]#
LIGHTGREEN: ClassVar[Color]#
LIGHTGREY: ClassVar[Color]#
LIGHTPINK: ClassVar[Color]#
LIGHTSALMON: ClassVar[Color]#
LIGHTSEAGREEN: ClassVar[Color]#
LIGHTSKYBLUE: ClassVar[Color]#
LIGHTSLATEGRAY: ClassVar[Color]#
LIGHTSLATEGREY: ClassVar[Color]#
LIGHTSTEELBLUE: ClassVar[Color]#
LIGHTYELLOW: ClassVar[Color]#
LIME: ClassVar[Color]#
LIMEGREEN: ClassVar[Color]#
LINEN: ClassVar[Color]#
MAGENTA: ClassVar[Color]#
MAROON: ClassVar[Color]#
MEDIUMAQUAMARINE: ClassVar[Color]#
MEDIUMBLUE: ClassVar[Color]#
MEDIUMORCHID: ClassVar[Color]#
MEDIUMPURPLE: ClassVar[Color]#
MEDIUMSEAGREEN: ClassVar[Color]#
MEDIUMSLATEBLUE: ClassVar[Color]#
MEDIUMSPRINGGREEN: ClassVar[Color]#
MEDIUMTURQUOISE: ClassVar[Color]#
MEDIUMVIOLETRED: ClassVar[Color]#
MIDNIGHTBLUE: ClassVar[Color]#
MINTCREAM: ClassVar[Color]#
MISTYROSE: ClassVar[Color]#
MOCCASIN: ClassVar[Color]#
NAVAJOWHITE: ClassVar[Color]#
NAVY: ClassVar[Color]#
OLDLACE: ClassVar[Color]#
OLIVE: ClassVar[Color]#
OLIVEDRAB: ClassVar[Color]#
ORANGE: ClassVar[Color]#
ORANGERED: ClassVar[Color]#
ORCHID: ClassVar[Color]#
PALEGOLDENROD: ClassVar[Color]#
PALEGREEN: ClassVar[Color]#
PALETURQUOISE: ClassVar[Color]#
PALEVIOLETRED: ClassVar[Color]#
PAPAYAWHIP: ClassVar[Color]#
PEACHPUFF: ClassVar[Color]#
PERU: ClassVar[Color]#
PINK: ClassVar[Color]#
PLUM: ClassVar[Color]#
POWDERBLUE: ClassVar[Color]#
PURPLE: ClassVar[Color]#
REBECCAPURPLE: ClassVar[Color]#
RED: ClassVar[Color]#
ROSYBROWN: ClassVar[Color]#
ROYALBLUE: ClassVar[Color]#
SADDLEBROWN: ClassVar[Color]#
SALMON: ClassVar[Color]#
SANDYBROWN: ClassVar[Color]#
SEAGREEN: ClassVar[Color]#
SEASHELL: ClassVar[Color]#
SIENNA: ClassVar[Color]#
SILVER: ClassVar[Color]#
SKYBLUE: ClassVar[Color]#
SLATEBLUE: ClassVar[Color]#
SLATEGRAY: ClassVar[Color]#
SLATEGREY: ClassVar[Color]#
SNOW: ClassVar[Color]#
SPRINGGREEN: ClassVar[Color]#
STEELBLUE: ClassVar[Color]#
TAN: ClassVar[Color]#
TEAL: ClassVar[Color]#
THISTLE: ClassVar[Color]#
TOMATO: ClassVar[Color]#
TURQUOISE: ClassVar[Color]#
VIOLET: ClassVar[Color]#
WHEAT: ClassVar[Color]#
WHITE: ClassVar[Color]#
WHITESMOKE: ClassVar[Color]#
YELLOW: ClassVar[Color]#
YELLOWGREEN: ClassVar[Color]#
static fromHex(hex_str: str, alpha: SupportsFloat = 1.0) Color#

Create a color from a hex string and opacity

The hex_str input is parsed to extract red, green, and blue components. For example, “ff0000” and “f00” are pure red.

Parameters:
  • hex_str – a 3 or 6 length hex string

  • alpha – the opacity factor between 0 and 1

Returns:

the created Color

static fromRGB(r: SupportsFloat, g: SupportsFloat, b: SupportsFloat) Color#

Create an opaque color from rgb components

Parameters:
  • r – the red component between 0 and 1

  • g – the green component between 0 and 1

  • b – the blue component between 0 and 1

Returns:

the created Color

static fromRGBA(r: SupportsFloat, g: SupportsFloat, b: SupportsFloat, alpha: SupportsFloat) Color#

Create a color from rgb components and opacity

Parameters:
  • r – the red component between 0 and 1

  • g – the green component between 0 and 1

  • b – the blue component between 0 and 1

  • alpha – the opacity factor between 0 and 1

Returns:

the created Color

static to_json(o: Color) dict[str, Any]#

Class method used to represent Color in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a Color from json file data.

classmethod from_yaml(loader, node) Self#

Construct a Color from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent Color in a yaml file.

__assign__(other: Color) Color#

Copy assignment operator :param other: the Color to copy

Returns:

this Color

__getstate__() Annotated[numpy.typing.NDArray[numpy.float32], [4, 1]]#
__repr__() str#
__setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [4, 1]]) None#
alpha() float#

Get the alpha (opacity) value :returns: The alpha value

b() float#

Get the blue component :returns: The blue component

g() float#

Get the green component :returns: The green component

r() float#

Get the red component :returns: The red component

class Karana.Scene.ConeGeometry(radius: SupportsFloat, height: SupportsFloat)#

Bases: AbstractStaticGeometry

Concrete cone geometry class

See Scene layer for more discussion on the scene layer.

static to_json(o: ConeGeometry) dict[str, Any]#

Class method used to represent ConeGeometry in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a ConeGeometry from json file data.

classmethod from_yaml(loader, node) Self#

Construct a ConeGeometry from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent ConeGeometry in a yaml file.

__getstate__() Annotated[numpy.typing.NDArray[numpy.float32], [2, 1]]#
__setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [2, 1]]) None#
property height: float#

height of the cone

property radius: float#

radius of the cone

class Karana.Scene.Contact#
property normal: Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]#
property penetration: float#
property witness1: Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]#
property witness2: Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]#
class Karana.Scene.CylinderGeometry(radius: SupportsFloat, height: SupportsFloat)#

Bases: AbstractStaticGeometry

Concrete cylinder geometry class

See Scene layer for more discussion on the scene layer.

static to_json(o: CylinderGeometry) dict[str, Any]#

Class method used to represent CylinderGeometry in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a CylinderGeometry from json file data.

classmethod from_yaml(loader, node) Self#

Construct a CylinderGeometry from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent CylinderGeometry in a yaml file.

__getstate__() Annotated[numpy.typing.NDArray[numpy.float32], [2, 1]]#
__setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [2, 1]]) None#
property height: float#

height of the cylinder

property radius: float#

radius of the cylinder

class Karana.Scene.DistanceInfo#
static singleton() DistanceInfo#
property distance: float#
property nearest1: Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]#
property nearest2: Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]#
class Karana.Scene.GraphicalScene#

Bases: Scene

Scene with an added graphics-specific interface

See Scene layer for more discussion on the scene layer.

addOverlayText(arg0: str, arg1: SupportsFloat, arg2: SupportsFloat, arg3: TextParameters) int#
addOverlayText(message: str, x: SupportsFloat, y: SupportsFloat, align: Alignment = Alignment.LEFT, size: SupportsFloat = 0.05000000074505806, color: Color = ...) int

Add text in screen space :param message:

  • The content of the overlay text

Parameters:
  • x

    • The horizontal position of the text between 0 and 1

  • y

    • The vertical position of the text between 0 and 1

  • parameters

    • Addition text parameters

Returns:

Unique id to later update the text instance

defaultCamera() GraphicalSceneCamera#

Get the automatically created default camera :returns: The default camera

removeOverlayText(arg0: SupportsInt) None#

Add text in screen space :param message:

  • The content of the overlay text

Parameters:
  • x

    • The horizontal position of the text between 0 and 1

  • y

    • The vertical position of the text between 0 and 1

  • parameters

    • Addition text parameters

Returns:

Unique id to later update the text instance

renderToFile(arg0: os.PathLike | str | bytes) None#

Render the scene to a file :param filepath:

  • filename to render to

setOverlayText(arg0: SupportsInt, arg1: str) None#

Add text in screen space :param message:

  • The content of the overlay text

Parameters:
  • x

    • The horizontal position of the text between 0 and 1

  • y

    • The vertical position of the text between 0 and 1

  • parameters

    • Addition text parameters

Returns:

Unique id to later update the text instance

class Karana.Scene.GraphicalSceneCamera#

Bases: GraphicalSceneNode

getMask() int#

Get the bitmask for which layers should be visible. :returns: The layers bitmask

getProjection() PerspectiveProjection | OrthographicProjection#

Get the camera projection parameters :returns: The camera projection parameters

pointCameraAt(offset: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]], target: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]], up: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) None#

Set the pose of the camera. :param offset: The position of the camera. :param target: The position the camera will point at. :param up: The up vector of the camera.

setMask(mask: SupportsInt) None#

Set the bitmask for which layers should be visible. :param mask:

  • The layers bitmask

setProjection(projection: PerspectiveProjection | OrthographicProjection) None#

Set the camera projection parameters :param proj: The camera projection parameters

class Karana.Scene.GraphicalSceneNode#

Bases: SceneNode

removeTrail() None#

Remove a trail previously created by calling trail

showAxes(size: SupportsFloat = 1.0) None#

Show axes to visualize the node’s position and orientation :param size:

  • Lengths of the axes (zero to remove the axes)

trail(reference: GraphicalSceneNode = None, color: Color = ...) None#

Display a trail tracking the node’s motion over time. :param relative_to:

  • Another node to draw the trail relative to.

Parameters:

color

  • The color of the Trail.

class Karana.Scene.GraphicalScenePart#

Bases: ScenePart, GraphicalSceneNode

class Karana.Scene.GrayscaleTexture#

Bases: Texture

Texture specialization for grayscale values

See Scene layer for more discussion on the scene layer.

static lookupOrCreateTexture(filename: os.PathLike | str | bytes) GrayscaleTexture#
Create a texture from a file name. This caches the texture

so that future versions created with the same file name just return a pointer to the same texture.

Parameters:

filename – The name of the file.

Returns:

A ks_ptr to the GrayscaleTexture.

static to_json(o: GrayscaleTexture) dict[str, Any]#

Class method used to represent GrayscaleTexture in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a GrayscaleTexture from json file data.

classmethod from_yaml(loader, node) Self#

Construct a GrayscaleTexture from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent GrayscaleTexture in a yaml file.

__getstate__() tuple#
__setstate__(arg0: tuple) None#
class Karana.Scene.ImportResult#
property geometries: list[BoxGeometry | CapsuleGeometry | ConeGeometry | CylinderGeometry | RoundFrustumGeometry | SphereGeometry | StaticMeshGeometry | AbstractStaticGeometry]#
property materials: list[PhysicalMaterial | PhongMaterial]#
property parts: list[ScenePartSpec]#
Karana.Scene.LAYER_ALL: int = 4294967295#
Karana.Scene.LAYER_COLLISION: int = 134217728#
Karana.Scene.LAYER_CUSTOM0: int = 1#
Karana.Scene.LAYER_CUSTOM1: int = 2#
Karana.Scene.LAYER_CUSTOM10: int = 1024#
Karana.Scene.LAYER_CUSTOM11: int = 2048#
Karana.Scene.LAYER_CUSTOM12: int = 4096#
Karana.Scene.LAYER_CUSTOM13: int = 8192#
Karana.Scene.LAYER_CUSTOM14: int = 16384#
Karana.Scene.LAYER_CUSTOM15: int = 32768#
Karana.Scene.LAYER_CUSTOM16: int = 65536#
Karana.Scene.LAYER_CUSTOM17: int = 131072#
Karana.Scene.LAYER_CUSTOM18: int = 262144#
Karana.Scene.LAYER_CUSTOM19: int = 524288#
Karana.Scene.LAYER_CUSTOM2: int = 4#
Karana.Scene.LAYER_CUSTOM20: int = 1048576#
Karana.Scene.LAYER_CUSTOM21: int = 2097152#
Karana.Scene.LAYER_CUSTOM22: int = 4194304#
Karana.Scene.LAYER_CUSTOM23: int = 8388608#
Karana.Scene.LAYER_CUSTOM3: int = 8#
Karana.Scene.LAYER_CUSTOM4: int = 16#
Karana.Scene.LAYER_CUSTOM5: int = 32#
Karana.Scene.LAYER_CUSTOM6: int = 64#
Karana.Scene.LAYER_CUSTOM7: int = 128#
Karana.Scene.LAYER_CUSTOM8: int = 256#
Karana.Scene.LAYER_CUSTOM9: int = 512#
Karana.Scene.LAYER_GRAPHICS: int = 117440512#
Karana.Scene.LAYER_NONE: int = 0#
Karana.Scene.LAYER_ORNAMENTAL: int = 33554432#
Karana.Scene.LAYER_PHYSICAL: int = 150994944#
Karana.Scene.LAYER_PHYSICAL_GRAPHICS: int = 16777216#
Karana.Scene.LAYER_RESERVED0: int = 16777216#
Karana.Scene.LAYER_RESERVED1: int = 33554432#
Karana.Scene.LAYER_RESERVED2: int = 67108864#
Karana.Scene.LAYER_RESERVED3: int = 134217728#
Karana.Scene.LAYER_RESERVED4: int = 268435456#
Karana.Scene.LAYER_RESERVED5: int = 536870912#
Karana.Scene.LAYER_RESERVED6: int = 1073741824#
Karana.Scene.LAYER_RESERVED7: int = 2147483648#
Karana.Scene.LAYER_STICK_FIGURE: int = 67108864#
class Karana.Scene.OrthographicProjection#

Info for an orthographic camera projection

property far: float#

distance to far clipping plane

property height: float#

distance between top and bottom viewing planes

property near: float#

distance to near clipping plane

class Karana.Scene.PerspectiveProjection#

Info for a perspective camera projection

property far: float#

distance to far clipping plane

property fov: float#

vertical field of view in degrees

property near: float#

distance to near clipping plane

class Karana.Scene.PhongMaterial(mat: PhongMaterialInfo)#

Bases: Karana.Core.Base

A standard Phong material

See Scene layer for more discussion on the scene layer.

static create(mat: PhongMaterialInfo) PhongMaterial#

Create a PhongMaterial :param mat: the parameter struct

Returns:

The created PhongMaterial

static to_json(o: PhongMaterial) dict[str, Any]#

Class method used to represent PhongMaterial in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a PhongMaterial from json file data.

classmethod from_yaml(loader, node) Self#

Construct a PhongMaterial from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent PhongMaterial in a yaml file.

__getstate__() PhongMaterialInfo#
__setstate__(arg0: PhongMaterialInfo) None#
property info: PhongMaterialInfo#

Parameters for the materials

class Karana.Scene.PhongMaterialInfo#

Parameter struct for a PhongMaterial

static to_json(o: PhongMaterialInfo) dict[str, Any]#

Class method used to represent PhongMaterialInfo in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a PhongMaterialInfo from json file data.

classmethod from_yaml(loader, node) Self#

Construct a PhongMaterialInfo from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent PhongMaterialInfo in a yaml file.

__getstate__() tuple#
__setstate__(arg0: tuple) None#
property ambient_color: Color#

constant ambient color

property ambient_color_map: Texture#

ambient color map

property color: Color#

constant diffuse color

property color_map: Texture#

diffuse color map

property emissive_color: Color#

constant emissive color

property emissive_color_map: Texture#

emissive color map

property specular_color: Color#

constant specular color

property specular_color_map: Texture#

specular color map

class Karana.Scene.PhysicalMaterial(mat: PhysicalMaterialInfo)#

Bases: Karana.Core.Base

A standard PBR material

See Scene layer for more discussion on the scene layer.

static create(mat: PhysicalMaterialInfo) PhysicalMaterial#

Create a PhysicalMaterial :param mat: the parameter struct

Returns:

The created PhysicalMaterial

static to_json(o: PhysicalMaterial) dict[str, Any]#

Class method used to represent PhysicalMaterial in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a PhysicalMaterial from json file data.

classmethod from_yaml(loader, node) Self#

Construct a PhysicalMaterial from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent PhysicalMaterial in a yaml file.

__getstate__() PhysicalMaterialInfo#
__setstate__(arg0: PhysicalMaterialInfo) None#
property info: PhysicalMaterialInfo#

Parameters for the materials

class Karana.Scene.PhysicalMaterialInfo#

Parameter struct for a PhysicalMaterial

static to_json(o: PhysicalMaterialInfo) dict[str, Any]#

Class method used to represent PhysicalMaterialInfo in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a PhysicalMaterialInfo from json file data.

classmethod from_yaml(loader, node) Self#

Construct a PhysicalMaterialInfo from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent PhysicalMaterialInfo in a yaml file.

__getstate__() tuple#
__setstate__(arg0: tuple) None#
property color: Color#

constant base color

property color_map: Texture#

base color map

property metalness: float#

how metal-like the material is, between 0 and 1

property metalness_map: GrayscaleTexture#

grayscale metalness map

property normal_map: Texture#

normal map (assumes tangent space)

property roughness: float#

how rough the material is, between 0 and 1

property roughness_map: GrayscaleTexture#

grayscale roughness map

class Karana.Scene.RoundFrustumGeometry(bottom_radius: SupportsFloat, top_radius: SupportsFloat, height: SupportsFloat)#

Bases: AbstractStaticGeometry

Concrete round frustum geometry class

See Scene layer for more discussion on the scene layer.

static to_json(o: RoundFrustumGeometry) dict[str, Any]#

Class method used to represent RoundFrustumGeometry in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a RoundFrustumGeometry from json file data.

classmethod from_yaml(loader, node) Self#

Construct a RoundFrustumGeometry from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent RoundFrustumGeometry in a yaml file.

__getstate__() Annotated[numpy.typing.NDArray[numpy.float32], [3, 1]]#
__setstate__(arg0: Annotated[numpy.typing.ArrayLike, numpy.float32, [3, 1]]) None#
property bottom_radius: float#

radius of the bottom face

property height: float#

height of the frustum

property top_radius: float#

radius of the top face

class Karana.Scene.Scene#

Bases: Karana.Core.Base

Base container for a hierarchy of geometries

See Scene layer for more discussion on the scene layer.

getManager() Scene#

Get the Scene managing this one :returns: The managing scene or nullptr

setManager(manager: Scene) None#

Assign a managing scene :param manager: The scene managing this one (nullable)

class Karana.Scene.SceneNode#

Bases: Karana.Core.Base

Base for objects with a transform i n the scene hierarchy

See Scene layer for more discussion on the scene layer.

attachTo(parent: SceneNode, maintain_world_transform: bool = False) None#

Attach to a parent node :param parent:

  • The parent node

Parameters:

maintain_world_transform

  • If true, update the node’s relative

transform so that its overall world transform doesn’t change after attaching it to the parent

detach(maintain_world_transform: bool = False) None#

Detach the node from its parent :param maintain_world_transform:

  • If true, update the node’s relative

transform so that its overall world transform doesn’t change after detaching

getManager() SceneNode#

Get a SceneNode managing this one :returns: The managing scene node or nullptr

getScale() float#

Get uniform scale of the node relative to its parent :returns: The relative uniform scale

getTranslation() Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]#

Get position of the node relative to its parent :returns: The relative translation

getUnitQuaternion() Karana.Math.UnitQuaternion#

Get rotation of the node relative to its parent :returns: The relative rotation as a unit quaternion

getVisible() bool#

Get whether the object is visible :returns: The visibility flag

getWorldScale() float#

Get uniform scale of the node relative to the scene’s root :returns: The uniform scale

getWorldTransform() Karana.Math.SimTran#

Get similarity transform of the node relative to the scene’s root :returns: The similarity transform

getWorldTranslation() Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]#

Get translation of the node relative to the scene’s root :returns: The translation

getWorldUnitQuaternion() Karana.Math.UnitQuaternion#

Get rotation of the node relative to the scene’s root :returns: The rotation as a unit quaternion

setManager(manager: SceneNode) None#

Assign a managing scene node :param manager: The scene node managing this one (nullable)

setScale(scale: SupportsFloat) None#

Set uniform of the node relative to its parent :param scale:

  • The relative uniform scale

setTranslation(translation: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) None#

Set position of the node relative to its parent :param translation:

  • The relative translation

setUnitQuaternion(quaternion: Karana.Math.UnitQuaternion) None#

Set rotation of the node relative to its parent :param quaternion:

  • The relative rotation as a unit quaternion

setVisible(visible: bool) None#

Set whether the object is visible :param visible:

  • The visibility flag

class Karana.Scene.ScenePart#

Bases: SceneNode

Class for objects with geometry and material in the scene

See Scene layer for more discussion on the scene layer.

getGeometry() BoxGeometry | CapsuleGeometry | ConeGeometry | CylinderGeometry | RoundFrustumGeometry | SphereGeometry | StaticMeshGeometry | AbstractStaticGeometry#

Get the part’s geometry

Returns:

The part’s geometry

getIntrinsicScale() Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]#

Get the part’s intrinsic scale.

The intrinsic scale can be non-uniform but does not apply to attached nodes.

Returns:

The part’s intrinsic scale.

getLayers() int#

Get which layers the part belongs to.

Returns:

Bitmask for which layers the part belongs to.

getMaterial() PhysicalMaterial | PhongMaterial#

Get the part’s material

Returns:

The part’s material

setIntrinsicScale(arg0: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) None#

Set the part’s intrinsic scale.

The intrinsic scale can be non-uniform but does not apply to attached nodes.

Parameters:

scale

  • The part’s intrinsic scale.

setMaterial(arg0: PhysicalMaterial | PhongMaterial) None#

Set the part’s material

Parameters:

material

  • The part’s new material.

class Karana.Scene.ScenePartSpec#
geometry: BoxGeometry | CapsuleGeometry | ConeGeometry | CylinderGeometry | RoundFrustumGeometry | SphereGeometry | StaticMeshGeometry | AbstractStaticGeometry#
material: PhysicalMaterial | PhongMaterial#
name: str#
transform: Karana.Math.HomTran#
property layers: int#
property scale: Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]#
class Karana.Scene.SphereGeometry(radius: SupportsFloat)#

Bases: AbstractStaticGeometry

Concrete sphere geometry class

See Scene layer for more discussion on the scene layer.

static to_json(o: SphereGeometry) dict[str, Any]#

Class method used to represent SphereGeometry in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a SphereGeometry from json file data.

classmethod from_yaml(loader, node) Self#

Construct a SphereGeometry from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent SphereGeometry in a yaml file.

__getstate__() float#
__setstate__(arg0: SupportsFloat) None#
property radius: float#

radius of the sphere

class Karana.Scene.StaticMeshGeometry(positions: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, 3]], faces: Annotated[numpy.typing.ArrayLike, numpy.int32, [m, 3]], normals: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, 3]], surface_map_coords: Annotated[numpy.typing.ArrayLike, numpy.float32, [m, 2]])#

Bases: AbstractStaticGeometry

Concrete triangular mesh geometry class

See Scene layer for more discussion on the scene layer.

static to_json(o: StaticMeshGeometry) dict[str, Any]#

Class method used to represent StaticMeshGeometry in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a StaticMeshGeometry from json file data.

classmethod from_yaml(loader, node) Self#

Construct a StaticMeshGeometry from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent StaticMeshGeometry in a yaml file.

__getstate__() tuple#
__setstate__(arg0: tuple) None#
property faces: Annotated[numpy.typing.NDArray[numpy.int32], [m, 3]]#

triangles consisting of three vertex indices

property filename: str#

If this mesh comes from a file, this is the filename.

property normals: Annotated[numpy.typing.NDArray[numpy.float32], [m, 3]]#

vertex normals

property positions: Annotated[numpy.typing.NDArray[numpy.float32], [m, 3]]#

vertex positions

property surface_map_coords: Annotated[numpy.typing.NDArray[numpy.float32], [m, 2]]#

vertex uv (texture) coordinates

class Karana.Scene.TextParameters#

Style parameters for text

property align: Alignment#

Controls text alignment/justification

property color: Color#

Color of the text

property size: float#

Text size as a portion of the screen’s full vertical space

class Karana.Scene.Texture#

Bases: Karana.Core.Base

Class for a texture image

See Scene layer for more discussion on the scene layer.

static create(name: str, data: Annotated[numpy.typing.ArrayLike, numpy.int8]) Texture#

Create a Texture instance. :param name: The Texture’s name. :param data: The data for the texture.

Returns:

A ks_ptr to the Texture.

static lookupOrCreateTexture(filename: os.PathLike | str | bytes) Texture#
Create a texture from a file name. This caches the texture

so that future versions created with the same file name just return a pointer to the same texture.

Parameters:

filename – The name of the file.

Returns:

A ks_ptr to the Texture.

static to_json(o: Texture) dict[str, Any]#

Class method used to represent Texture in a json file.

classmethod from_json(d: dict[str, Any]) Self#

Construct a Texture from json file data.

classmethod from_yaml(loader, node) Self#

Construct a Texture from yaml file data.

classmethod to_yaml(representer, node)#

Class method used to represent Texture in a yaml file.

__getstate__() tuple#
__setstate__(arg0: tuple) None#
getData() numpy.ndarray#

Get the texture data associated with the Texture. :returns: The texture data associated with the Texture.

setData(data: Annotated[numpy.typing.ArrayLike, numpy.int8]) None#

Set the texture data associated with the Texture. :param data: The data to set the Texture data to.

writeToFile(filename: os.PathLike | str | bytes) None#

Write the texture to a file. :param filename: The name of the file to write to.

Karana.Scene.defaultGeometry() BoxGeometry | CapsuleGeometry | ConeGeometry | CylinderGeometry | RoundFrustumGeometry | SphereGeometry | StaticMeshGeometry | AbstractStaticGeometry#
Karana.Scene.defaultMaterial() PhysicalMaterial | PhongMaterial#
class Karana.Scene.ProxyScene(name: str, root_frame: Karana.Frame.Frame)#

Bases: Karana.Scene.Scene

A Scene implementation acting as a proxy to any number of registered ‘client’ Scenes.

See Scene layer for more discussion on the scene layer.

update_callbacks: Karana.Core._KCore_pybind11_Py._VoidCallbackRegistry#
static create(name: str, root_frame: Karana.Frame.Frame) ProxyScene#

Create a ProxyScene :param name:

  • Name of the ProxyScene.

Parameters:

root_frame

  • Default Frame to attach nodes to.

Returns:

The created ProxyScene

clientScenes() list[Karana.Scene.Scene]#

Get a list of all registered client Scenes

Returns:

The list of client Scenes

collision() Karana.Scene.CollisionScene#

Get a registered CollisionScene

If there is more than one only the first one found is returned.

Returns:

A CollisionScene or nullptr

getNodesAttachedToFrame(arg0: Karana.Frame.Frame) list[ProxySceneNode]#

Retrieve all ProxySceneNodes attached to the provided frame. :param frame:

  • The frame to retrieve nodes from.

Returns:

  • A vector of ProxySceneNodes attached to the provided frame.

graphics() Karana.Scene.GraphicalScene#

Get a registered GraphicalScene

If there is more than one only the first one found is returned.

Returns:

A GraphicalScene or nullptr

lookupProxyFromImpl(impl: Karana.Scene.SceneNode) ProxySceneNode#

Lookup the ProxySceneNode managing the given implementation :param impl:

  • The SceneNode in a client Scene

Returns:

The corresponding ProxySceneNode

registerClientScene(scene: Karana.Scene.Scene, origin_frame: Karana.Frame.Frame, layers: SupportsInt = 4294967295) None#

Register a client Scene to be managed :param scene:

  • The client Scene

Parameters:
  • origin_frame

    • The Frame to center the client’s origin at

  • layers

    • Bitmask for objects to implement

showAxes(frame: Karana.Frame.Frame, size: SupportsFloat = 1.0) None#

Show the axes for a Frame

Parameters:
  • frm – the Frame to show axes for

  • size – the size of the axes

unregisterClientScene(arg0: Karana.Scene.Scene) None#

Unregister a client Scene to no longer be managed :param scene:

  • The client Scene.

update() None#
update(arg0: Karana.Scene.Scene) None

Update all Frame-attached nodes’ transforms for all clients

viewAroundFrame(frame: Karana.Frame.Frame, offset: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]], at_offset: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]] = ..., up: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]] = ...) None#

Position the default camera relative to a Frame

Parameters:
  • frm – the Frame to view around

  • offset – camera position relative to the Frame

  • at_offset – camera target relative to the Frame

  • up – camera up vector

class Karana.Scene.ProxySceneNode(name: str, scene: ProxyScene)#

Bases: Karana.Scene.SceneNode

attachTo(parent: Karana.Scene.SceneNode, maintain_world_transform: bool = False) None#
attachTo(parent: Karana.Frame.Frame, maintain_world_transform: bool = False) None

Attach the node to a Frame :param parent:

  • The Frame to attach to

Parameters:

maintain_world_transform

  • If true, update the node’s relative

transform so that its overall world transform doesn’t change after attaching it to the parent

collision() Karana.Scene.CollisionSceneNode#
collision(arg0: Karana.Scene.Scene) Karana.Scene.CollisionSceneNode

Get a collision implementation If there is more than one collision implementation only the first one found is returned.

Returns:

A collision implementation or nullptr

create(name: Karana.Frame.Frame) ProxyScene#

Create a ProxyScene node. :param name:

  • The name of the ProxySceneNode.

Parameters:

scene

  • The ProxyScene to add the node to.

Returns:

The created ProxySceneNode

detach(maintain_world_transform: bool = False) None#
graphics() Karana.Scene.GraphicalSceneNode#
graphics(arg0: Karana.Scene.Scene) Karana.Scene.GraphicalSceneNode

Get a graphical implementation If there is more than one graphical implementation only the first one found is returned.

Returns:

A graphical implementation or nullptr

of(scene: Karana.Scene.Scene) Karana.Scene.SceneNode#

Get the implementation for a given client :param scene:

  • The client scene

Returns:

The implementation of this node for the client

setScale(arg0: SupportsFloat) None#
setTranslation(arg0: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) None#
setUnitQuaternion(arg0: Karana.Math.UnitQuaternion) None#
class Karana.Scene.ProxyScenePart(name: str, scene: ProxyScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944)#
class Karana.Scene.ProxyScenePart(name: str, scene: ProxyScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt = 150994944)

Bases: Karana.Scene.ScenePart, ProxySceneNode

static create(name: str, scene: ProxyScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944) ProxyScenePart#
static create(name: str, scene: ProxyScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt = 150994944) ProxyScenePart

Create a ProxyScenePart.

Parameters:
  • name

    • Name of the ProxyScenePart.

  • geometry

    • Geometry of the ProxyScenePart.

  • scene

    • The ProxyScene to add the ProxyScenePart to.

  • material

    • Material for the ProxyScenePart.

  • layers

    • Layers to use for the ProxyScenePart.

Returns:

The new ProxyScene part.

static fromScenePartSpec(scene: ProxyScene, spec: Karana.Scene.ScenePartSpec) ProxyScenePart#

Create a ProxyScenePart from a ScenePartSpec.

Parameters:
  • scene

    • The ProxyScene to add the ProxyScenePart to.

  • spec – The spec to use to create the ProxyScenePart.

Returns:

The new ProxyScene part.

collision() Karana.Scene.CollisionScenePart#
collision(arg0: Karana.Scene.Scene) Karana.Scene.CollisionScenePart

Get a collision implementation If there is more than one collision implementation only the first one found is returned.

Returns:

A collision implementation or nullptr

graphics() Karana.Scene.GraphicalScenePart#
graphics(arg0: Karana.Scene.Scene) Karana.Scene.GraphicalScenePart

Get a graphical implementation If there is more than one graphical implementation only the first one found is returned.

Returns:

A graphical implementation or nullptr

of(scene: Karana.Scene.Scene) Karana.Scene.ScenePart#

Get the implementation for a given client :param scene:

  • The client scene

Returns:

The implementation of this node for the client

setIntrinsicScale(arg0: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) None#
class Karana.Scene.WebScene(name: str, server: Karana.WebUI.Server)#

Bases: Karana.Scene.GraphicalScene

GraphicalScene implementation for web-based graphics

See Scene layer for more discussion on the scene layer.

static create(name: str, server: Karana.WebUI.Server) WebScene#

Create a WebScene :param name:

  • Name for the WebScene

Parameters:

server

  • Server to communicate with frontends

Returns:

The created WebScene

defaultCamera() Karana.Scene.GraphicalSceneCamera#

Get the default camera :returns: The camera

renderToFile(filepath: os.PathLike | str | bytes) None#
server() Karana.WebUI.Server#

Get the server used by WebScene :returns: The server used to communicate with frontends

class Karana.Scene.WebSceneNode(name: str, scene: WebScene)#

Bases: Karana.Scene.GraphicalSceneNode

static create(name: str, scene: WebScene) WebSceneNode#

Create a WebSceneNode. :param name:

  • Name of the node.

Parameters:

scene

  • The WebScene to add the node to.

Returns:

The created WebSceneNode.

class Karana.Scene.WebScenePart(name: str, scene: WebScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944)#
class Karana.Scene.WebScenePart(name: str, scene: WebScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt = 150994944)

Bases: Karana.Scene.GraphicalScenePart, WebSceneNode

static create(name: str, scene: WebScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944) WebScenePart#
static create(name: str, scene: WebScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt = 150994944) WebScenePart

Create a WebScenePart.

Parameters:
  • name

    • Name of the WebScenePart.

  • scene

    • The GraphicalScene to add the WebScenePart to.

  • geometry

    • Geometry of the WebScenePart.

  • material

    • Material for the WebScenePart.

  • layers

    • Layers to use for the WebScenePart.

Returns:

The new WebScene part.

getIntrinsicScale() Annotated[numpy.typing.NDArray[numpy.float64], [3, 1]]#
setIntrinsicScale(arg0: Annotated[numpy.typing.ArrayLike, numpy.float64, [3, 1]]) None#
class Karana.Scene.CoalScene(name: str)#

Bases: Karana.Scene.CollisionScene

CollisionScene implementation using the COAL library

See Scene layer for more discussion on the scene layer.

static create(name: str) CoalScene#

Create a CoalScene :param name:

  • Name for the CoalScene

Returns:

The created CoalScene

class Karana.Scene.CoalSceneNode(name: str, scene: CoalScene)#

Bases: Karana.Scene.CollisionSceneNode

static create(name: str, scene: CoalScene) CoalSceneNode#

Create a CoalSceneNode. :param name:

  • The name of the CoalSceneNode.

Parameters:

scene

  • The CoalScene to add the node to.

Returns:

The created CoalSceneNode.

class Karana.Scene.CoalScenePart(name: str, scene: CoalScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944)#
class Karana.Scene.CoalScenePart(name: str, scene: CoalScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt = 150994944)

Bases: CoalSceneNode, Karana.Scene.CollisionScenePart

static create(name: str, scene: CoalScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944) CoalScenePart#
static create(name: str, scene: CoalScene, geometry: Karana.Scene.BoxGeometry | Karana.Scene.CapsuleGeometry | Karana.Scene.ConeGeometry | Karana.Scene.CylinderGeometry | Karana.Scene.RoundFrustumGeometry | Karana.Scene.SphereGeometry | Karana.Scene.StaticMeshGeometry | Karana.Scene.AbstractStaticGeometry, layers: SupportsInt = 150994944) CoalScenePart

Create a CoalScenePart. :param name:

  • Name of the CoalScenePart.

Parameters:
  • scene

    • The GraphicalScene to add the CoalScenePart to.

  • geometry

    • Geometry of the CoalScenePart.

  • material

    • Material for the CoalScenePart.

  • layers

    • Layers to use for the CoalScenePart.

Returns:

The new CoalScene part.