SurfaceMeshPrimitive#

class ansys.stk.core.graphics.SurfaceMeshPrimitive#

Bases: IPrimitive

A triangle mesh primitive for meshes on the surface that need to conform to terrain.

Overview#

set

Define the surface mesh using the specified surfaceTriangulator. The mesh is rendered in the primitive’s reference frame.

set_without_texturing

Define the surface mesh using the specified surfaceTriangulator. The mesh is rendered in the primitive’s reference frame.

supported

Determine whether or not the video card supports the surface mesh primitive with the given renderingMethod.

supported_with_default_rendering_method

Determine whether or not the video card supports the surface mesh primitive. This is equivalent to calling Supported with automatic.

texture

Get or set the texture applied to this primitive when rendering.

wireframe

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

triangle_winding_order

Get the orientation of front-facing triangles in the 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.

rendering_method

Get the rendering method used to render the mesh.

texture_filter

Get or set the filter used when a texture is applied to this primitive.

texture_matrix

Get or set the matrix used to transform texture coordinates when a texture is applied to this primitive.

transparent_texture_border

Get or set the boolean that defines if the color obtained from texture coordinates beyond the texture border should be considered transparent or not. This is typically used in conjunction with the a texture matrix.

Examples#

Draw a new Surface Mesh

# Scenario scenario: Scenario object
manager = scenario.scene_manager
cartesianPts = [
    [6030.721052],
    [1956.627139],
    [-692.397578],
    [5568.375825],
    [2993.600713],
    [-841.076362],
    [5680.743568],
    [2490.379622],
    [-1480.882721],
]  # X, Y, Z (km)

triangles = manager.initializers.surface_polygon_triangulator.compute("Earth", cartesianPts)
surfaceMesh = manager.initializers.surface_mesh_primitive.initialize()
surfaceMesh.color = Colors.Red
surfaceMesh.set(triangles)
manager.primitives.add(surfaceMesh)
manager.render()

Import detail#

from ansys.stk.core.graphics import SurfaceMeshPrimitive

Property detail#

property SurfaceMeshPrimitive.texture: RendererTexture2D#

Get or set the texture applied to this primitive when rendering.

property SurfaceMeshPrimitive.wireframe: bool#

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

property SurfaceMeshPrimitive.triangle_winding_order: WindingOrder#

Get the orientation of front-facing triangles in the mesh.

property SurfaceMeshPrimitive.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 SurfaceMeshPrimitive.rendering_method: SurfaceMeshRenderingMethod#

Get the rendering method used to render the mesh.

property SurfaceMeshPrimitive.texture_filter: TextureFilter2D#

Get or set the filter used when a texture is applied to this primitive.

property SurfaceMeshPrimitive.texture_matrix: TextureMatrix#

Get or set the matrix used to transform texture coordinates when a texture is applied to this primitive.

property SurfaceMeshPrimitive.transparent_texture_border: bool#

Get or set the boolean that defines if the color obtained from texture coordinates beyond the texture border should be considered transparent or not. This is typically used in conjunction with the a texture matrix.

Method detail#

SurfaceMeshPrimitive.set(self, surface_triangulator: SurfaceTriangulatorResult) None#

Define the surface mesh using the specified surfaceTriangulator. The mesh is rendered in the primitive’s reference frame.

Parameters:

surface_triangulator : SurfaceTriangulatorResult

Returns:

None

SurfaceMeshPrimitive.set_without_texturing(self, surface_triangulator: SurfaceTriangulatorResult) None#

Define the surface mesh using the specified surfaceTriangulator. The mesh is rendered in the primitive’s reference frame.

Parameters:

surface_triangulator : SurfaceTriangulatorResult

Returns:

None

SurfaceMeshPrimitive.supported(self, rendering_method: SurfaceMeshRenderingMethod) bool#

Determine whether or not the video card supports the surface mesh primitive with the given renderingMethod.

Parameters:

rendering_method : SurfaceMeshRenderingMethod

Returns:

bool

SurfaceMeshPrimitive.supported_with_default_rendering_method(self) bool#

Determine whether or not the video card supports the surface mesh primitive. This is equivalent to calling Supported with automatic.

Returns:

bool