Karana.Scene

Contents

Karana.Scene#

Classes and modules related to Scenes.

Submodules#

Attributes#

Classes#

AbstractStaticGeometry

@class AbstractStaticGeometry Interface for static geometry types

Alignment

Members:

AssimpImporter

@class AssimpImporter AbstractImport implementation using the third-

BoxGeometry

@class BoxGeometry Concrete box geometry class

CapsuleGeometry

@class CapsuleGeometry Geometry class for a cylinder capped with

CollisionInfo

CollisionScene

@class CollisionScene Scene with added collision-specific interface

CollisionSceneNode

CollisionScenePart

Color

@class Color Color class

ConeGeometry

@class ConeGeometry Concrete cone geometry class

Contact

CylinderGeometry

@class CylinderGeometry Concrete cylinder geometry class

DistanceInfo

GraphicalScene

@class GraphicalScene Scene with an added graphics-specific interface

GraphicalSceneCamera

GraphicalSceneNode

GraphicalScenePart

GrayscaleTexture

@class GrayscaleTexture Texture specialization for grayscale values

ImportResult

OrthographicProjection

Info for an orthographic camera projection

PerspectiveProjection

Info for a perspective camera projection

PhongMaterial

@class PhongMaterial A standard Phong material

PhongMaterialInfo

Parameter struct for a PhongMaterial

PhysicalMaterial

@class PhysicalMaterial A standard PBR material

PhysicalMaterialInfo

Parameter struct for a PhysicalMaterial

RoundFrustumGeometry

@class RoundFrustumGeometry Concrete round frustum geometry class

Scene

@class Scene Base container for a hierarchy of geometries

SceneNode

@class SceneNode Base for objects with a transform i n the scene

ScenePart

@class ScenePart Class for objects with geometry and material in the

ScenePartSpec

SphereGeometry

@class SphereGeometry Concrete sphere geometry class

StaticMeshGeometry

@class StaticMeshGeometry Concrete triangular mesh geometry class

TextParameters

Style parameters for text

Texture

@class Texture Class for a texture image

ProxyScene

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

ProxySceneNode

ProxyScenePart

WebScene

@class WebScene GraphicalScene implementation for web-based graphics

WebSceneNode

WebScenePart

CoalScene

@class CoalScene CollisionScene implementation using the COAL library

CoalSceneNode

CoalScenePart

Functions#

defaultGeometry(...)

defaultMaterial(→ PhysicalMaterial | PhongMaterial)

Package Contents#

class Karana.Scene.AbstractStaticGeometry#

Bases: Karana.Core.Base

@class AbstractStaticGeometry 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#

@class 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

@class BoxGeometry 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

@class CapsuleGeometry 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

@class CollisionScene 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.

Parameter 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

Parameter callback:
  • Function called for each collision

Parameter filter:
  • Filter function called for each potiential 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)#

@class 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.

Parameter hex_str:

a 3 or 6 length hex string

Parameter 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

Parameter r:

the red component between 0 and 1

Parameter g:

the green component between 0 and 1

Parameter 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

Parameter r:

the red component between 0 and 1

Parameter g:

the green component between 0 and 1

Parameter b:

the blue component between 0 and 1

Parameter 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

Parameter 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

@class ConeGeometry 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

@class CylinderGeometry 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

@class GraphicalScene 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

Parameter message:
  • The content of the overlay text

Parameter x:
  • The horizontal position of the text between 0 and 1

Parameter y:
  • The vertical position of the text between 0 and 1

Parameter 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

Parameter message:
  • The content of the overlay text

Parameter x:
  • The horizontal position of the text between 0 and 1

Parameter y:
  • The vertical position of the text between 0 and 1

Parameter 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

Parameter filepath:
  • filename to render to

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

Add text in screen space

Parameter message:
  • The content of the overlay text

Parameter x:
  • The horizontal position of the text between 0 and 1

Parameter y:
  • The vertical position of the text between 0 and 1

Parameter 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.

Parameter offset:

The position of the camera.

Parameter target:

The position the camera will point at.

Parameter up:

The up vector of the camera.

setMask(mask: SupportsInt) None#

Set the bitmask for which layers should be visible.

Parameter mask:
  • The layers bitmask

setProjection(projection: PerspectiveProjection | OrthographicProjection) None#

Set the camera projection parameters

Parameter 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

Parameter 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.

Parameter relative_to:
  • Another node to draw the trail relative to.

Parameter color:
  • The color of the Trail.

class Karana.Scene.GraphicalScenePart#

Bases: ScenePart, GraphicalSceneNode

class Karana.Scene.GrayscaleTexture#

Bases: Texture

@class GrayscaleTexture 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.

Parameter 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

@class PhongMaterial A standard Phong material

See Scene layer for more discussion on the scene layer.

static create(mat: PhongMaterialInfo) PhongMaterial#

Create a PhongMaterial

Parameter 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

@class PhysicalMaterial A standard PBR material

See Scene layer for more discussion on the scene layer.

static create(mat: PhysicalMaterialInfo) PhysicalMaterial#

Create a PhysicalMaterial

Parameter 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(bottomRadius: SupportsFloat, topRadius: SupportsFloat, height: SupportsFloat)#

Bases: AbstractStaticGeometry

@class RoundFrustumGeometry 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

@class Scene 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

Parameter manager:

The scene managing this one (nullable)

class Karana.Scene.SceneNode#

Bases: Karana.Core.Base

@class SceneNode 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

Parameter parent:
  • The parent node

Parameter 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

Parameter 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

Parameter manager:

The scene node managing this one (nullable)

setScale(scale: SupportsFloat) None#

Set uniform of the node relative to its parent

Parameter 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

Parameter translation:
  • The relative translation

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

Set rotation of the node relative to its parent

Parameter quaternion:
  • The relative rotation as a unit quaternion

setVisible(visible: bool) None#

Set whether the object is visible

Parameter visible:
  • The visibility flag

class Karana.Scene.ScenePart#

Bases: SceneNode

@class ScenePart 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.

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.

Parameter scale:
  • The part’s intrinsic scale.

setMaterial(arg0: PhysicalMaterial | PhongMaterial) None#

Set the part’s material

Parameter 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

@class SphereGeometry 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

@class StaticMeshGeometry 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 Texture 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.

Parameter name:

The Texture’s name.

Parameter 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.

Parameter 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.

Parameter data:

The data to set the Texture data to.

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

Write the texture to a file.

Parameter 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

Parameter name:
  • Name of the ProxyScene.

Parameter root_frame:
  • Default Frame to attach nodes to.

Returns:

The created ProxyScene

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.

Parameter 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

Parameter 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

Parameter scene:
  • The client Scene

Parameter origin_frame:
  • The Frame to center the client’s origin at

Parameter layers:
  • Bitmask for objects to implement

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

Show the axes for a Frame

Parameter frm:

the Frame to show axes for

Parameter size:

the size of the axes

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

Unregister a client Scene to no longer be managed

Parameter 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

Parameter frm:

the Frame to view around

Parameter offset:

camera position relative to the Frame

Parameter at_offset:

camera target relative to the Frame

Parameter 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

Parameter parent:
  • The Frame to attach to

Parameter 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.

Parameter name:
  • The name of the ProxySceneNode.

Parameter 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

Parameter 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, 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, scene: ProxyScene, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944)#
class Karana.Scene.ProxyScenePart(name: str, 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, scene: ProxyScene, layers: SupportsInt = 150994944)

Bases: Karana.Scene.ScenePart, ProxySceneNode

static create(name: str, 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, scene: ProxyScene, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944) ProxyScenePart#
static create(name: str, 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, scene: ProxyScene, layers: SupportsInt = 150994944) ProxyScenePart

Create a ProxyScenePart.

Parameter name:
  • Name of the ProxyScenePart.

Parameter geometry:
  • Geometry of the ProxyScenePart.

Parameter scene:
  • The ProxyScene to add the ProxyScenePart to.

Parameter material:
  • Material for the ProxyScenePart.

Parameter 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.

Parameter scene:
  • The ProxyScene to add the ProxyScenePart to.

Parameter 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

Parameter 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

@class WebScene 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

Parameter name:
  • Name for the WebScene

Parameter 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#
class Karana.Scene.WebSceneNode(name: str, scene: WebScene)#

Bases: Karana.Scene.GraphicalSceneNode

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

Create a WebSceneNode.

Parameter name:
  • Name of the node.

Parameter scene:
  • The WebScene to add the node to.

Returns:

The created WebSceneNode.

class Karana.Scene.WebScenePart(name: str, 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, scene: WebScene, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944)#
class Karana.Scene.WebScenePart(name: str, 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, scene: WebScene, layers: SupportsInt = 150994944)

Bases: Karana.Scene.GraphicalScenePart, WebSceneNode

static create(name: str, 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, scene: WebScene, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944) WebScenePart#
static create(name: str, 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, scene: WebScene, layers: SupportsInt = 150994944) WebScenePart

Create a WebScenePart.

Parameter name:
  • Name of the WebScenePart.

Parameter geometry:
  • Geometry of the WebScenePart.

Parameter scene:
  • The GraphicalScene to add the WebScenePart to.

Parameter material:
  • Material for the WebScenePart.

Parameter 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

@class CoalScene CollisionScene implementation using the COAL library

See Scene layer for more discussion on the scene layer.

static create(name: str) CoalScene#

Create a CoalScene

Parameter 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.

Parameter name:
  • The name of the CoalSceneNode.

Parameter scene:
  • The CoalScene to add the node to.

Returns:

The created CoalSceneNode.

class Karana.Scene.CoalScenePart(name: str, 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, scene: CoalScene, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944)#
class Karana.Scene.CoalScenePart(name: str, 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, scene: CoalScene, layers: SupportsInt = 150994944)

Bases: CoalSceneNode, Karana.Scene.CollisionScenePart

static create(name: str, 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, scene: CoalScene, material: Karana.Scene.PhysicalMaterial | Karana.Scene.PhongMaterial, layers: SupportsInt = 150994944) CoalScenePart#
static create(name: str, 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, scene: CoalScene, layers: SupportsInt = 150994944) CoalScenePart

Create a CoalScenePart.

Parameter name:
  • Name of the CoalScenePart.

Parameter geometry:
  • Geometry of the CoalScenePart.

Parameter scene:
  • The GraphicalScene to add the CoalScenePart to.

Parameter material:
  • Material for the CoalScenePart.

Parameter layers:
  • Layers to use for the CoalScenePart.

Returns:

The new CoalScene part.