TriangleMeshPrimitive#

class ansys.stk.core.graphics.TriangleMeshPrimitive#

Bases: IPrimitive

Render a triangle mesh in the 3D scene. Examples of triangle meshes include polygons on the globe (e.g. states or countries), terrain and imagery extents, ellipses, and extrusions.

Overview#

set

Define the triangle mesh using an indexed triangle list specified by positions, normals, and indices. The mesh is rendered in the primitive’s reference frame.

set_with_optional_parameters

Define the triangle mesh using an indexed triangle list specified by positions, normals, indices, and optionalParameters. The mesh is rendered in the primitive’s reference frame.

set_triangulator

Define the triangle mesh using the specified triangulator. The mesh is rendered in the primitive’s reference frame.

wireframe

Get or set whether the primitive is rendered in wireframe. This is useful for debugging.

render_back_then_front_faces

Get or set whether the primitive is rendered in two passes to improve the visual quality for translucent, convex meshes.

lighting

Get or set whether the primitive is lit.

triangle_winding_order

Get or set the orientation of front-facing triangles. This is used in combination with cull face for culling.

cull_face

Get or set whether front and/or back-facing triangles may be culled. This is used in combination with triangle winding order for culling.

shade_model

Get or set the shading model for the mesh.

texture

Get or set the texture to be drawn on the triangle mesh. Textures can be obtained from textures.

texture_filter

Get or set the filter used for the texture associated with this triangle mesh.

set_hint

Get the primitive’s set hint. See the Set Hint Performance Overview for selecting an appropriate value to construct the primitive with.

central_body_clipped

Get or set whether individual points will be clipped by the central body.

two_sided_lighting

Get or set whether the primitive’s translucent geometry will be lit from both sides of the surface.

Import detail#

from ansys.stk.core.graphics import TriangleMeshPrimitive

Property detail#

property TriangleMeshPrimitive.wireframe: bool#

Get or set whether the primitive is rendered in wireframe. This is useful for debugging.

property TriangleMeshPrimitive.render_back_then_front_faces: bool#

Get or set whether the primitive is rendered in two passes to improve the visual quality for translucent, convex meshes.

property TriangleMeshPrimitive.lighting: bool#

Get or set whether the primitive is lit.

property TriangleMeshPrimitive.triangle_winding_order: WindingOrder#

Get or set the orientation of front-facing triangles. This is used in combination with cull face for culling.

property TriangleMeshPrimitive.cull_face: FaceCullingMode#

Get or set whether front and/or back-facing triangles may be culled. This is used in combination with triangle winding order for culling.

property TriangleMeshPrimitive.shade_model: RendererShadingModel#

Get or set the shading model for the mesh.

property TriangleMeshPrimitive.texture: RendererTexture2D#

Get or set the texture to be drawn on the triangle mesh. Textures can be obtained from textures.

property TriangleMeshPrimitive.texture_filter: TextureFilter2D#

Get or set the filter used for the texture associated with this triangle mesh.

property TriangleMeshPrimitive.set_hint: SetHint#

Get the primitive’s set hint. See the Set Hint Performance Overview for selecting an appropriate value to construct the primitive with.

property TriangleMeshPrimitive.central_body_clipped: bool#

Get or set whether individual points will be clipped by the central body.

property TriangleMeshPrimitive.two_sided_lighting: bool#

Get or set whether the primitive’s translucent geometry will be lit from both sides of the surface.

Method detail#

TriangleMeshPrimitive.set(self, positions: list, normals: list, indices: list) None#

Define the triangle mesh using an indexed triangle list specified by positions, normals, and indices. The mesh is rendered in the primitive’s reference frame.

Parameters:

positions : list

normals : list

indices : list

Returns:

None

TriangleMeshPrimitive.set_with_optional_parameters(self, positions: list, normals: list, indices: list, optional_parameters: TriangleMeshPrimitiveOptionalParameters) None#

Define the triangle mesh using an indexed triangle list specified by positions, normals, indices, and optionalParameters. The mesh is rendered in the primitive’s reference frame.

Parameters:

positions : list

normals : list

indices : list

optional_parameters : TriangleMeshPrimitiveOptionalParameters

Returns:

None

TriangleMeshPrimitive.set_triangulator(self, triangulator: ITriangulatorResult) None#

Define the triangle mesh using the specified triangulator. The mesh is rendered in the primitive’s reference frame.

Parameters:

triangulator : ITriangulatorResult

Returns:

None