ModelPrimitive#

class ansys.stk.core.graphics.ModelPrimitive#

Bases: IPrimitive

The model primitive loads and renders glTF 2.0 (.gltf, .glb), COLLADA (DAE) and AGI MDL (MDL) models.

Overview#

allow_collada_models

Do not use this method, as it is deprecated. support for COLLADA 3D models has been removed Support for loading COLLADA 3D model format has been officially removed. This method will allow users to continue loading COLLADA models for a short period of time.

load_with_string_uri

For convenience. Loads a glTF 2.0 (.gltf, .glb), COLLADA (DAE) or AGI MDL (MDL) model using a file path.

load_with_string_uri_and_up_axis

For convenience. Loads a glTF 2.0 (.gltf, .glb), COLLADA (DAE) or AGI MDL (MDL) model using a file path.

set_position_cartographic

For convenience. Sets the cartographic position of the model. This also sets position.

articulations

Get the model’s articulations. Articulations identify geometry and contain transformations for manipulating that geometry.

orientation

Get or set the model’s orientation. The quaternion is a rotation from the model’s local axes to the axes of the model’s reference frame.

position

Get or set the position of the model. The position is defined in the model’s reference frame. The array contains the components of the position in the order x, y, z.

scale

Get or set the linear scale used to increase or decrease the size of the rendered model.

uri_as_string

Get the URI of the file used to load the file.

Import detail#

from ansys.stk.core.graphics import ModelPrimitive

Property detail#

property ModelPrimitive.articulations: ModelArticulationCollection#

Get the model’s articulations. Articulations identify geometry and contain transformations for manipulating that geometry.

property ModelPrimitive.orientation: IOrientation#

Get or set the model’s orientation. The quaternion is a rotation from the model’s local axes to the axes of the model’s reference frame.

property ModelPrimitive.position: list#

Get or set the position of the model. The position is defined in the model’s reference frame. The array contains the components of the position in the order x, y, z.

property ModelPrimitive.scale: float#

Get or set the linear scale used to increase or decrease the size of the rendered model.

property ModelPrimitive.uri_as_string: str#

Get the URI of the file used to load the file.

Method detail#

ModelPrimitive.allow_collada_models(self, allow: bool) None#

Do not use this method, as it is deprecated. support for COLLADA 3D models has been removed Support for loading COLLADA 3D model format has been officially removed. This method will allow users to continue loading COLLADA models for a short period of time.

Parameters:

allow : bool

Returns:

None

ModelPrimitive.load_with_string_uri(self, uri: str) None#

For convenience. Loads a glTF 2.0 (.gltf, .glb), COLLADA (DAE) or AGI MDL (MDL) model using a file path.

Parameters:

uri : str

Returns:

None

ModelPrimitive.load_with_string_uri_and_up_axis(self, uri: str, up_axis: ModelUpAxis) None#

For convenience. Loads a glTF 2.0 (.gltf, .glb), COLLADA (DAE) or AGI MDL (MDL) model using a file path.

Parameters:

uri : str

up_axis : ModelUpAxis

Returns:

None

ModelPrimitive.set_position_cartographic(self, central_body: str, position: list) None#

For convenience. Sets the cartographic position of the model. This also sets position.

Parameters:

central_body : str

position : list

Returns:

None