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#
Define the surface mesh using the specified surfaceTriangulator. The mesh is rendered in the primitiveβs reference frame. |
|
Define the surface mesh using the specified surfaceTriangulator. The mesh is rendered in the primitiveβs reference frame. |
|
Determine whether or not the video card supports the surface mesh primitive with the given renderingMethod. |
|
Determine whether or not the video card supports the surface mesh primitive. This is equivalent to calling Supported with automatic. |
Get or set the texture applied to this primitive when rendering. |
|
Get or set whether the primitive is rendered in wireframe. This is useful for debugging. |
|
Get the orientation of front-facing triangles in the mesh. |
|
Get the primitiveβs set hint. See the Set Hint Performance Overview for selecting an appropriate value to construct the primitive with. |
|
Get the rendering method used to render the mesh. |
|
Get or set the filter used when a texture is applied to this primitive. |
|
Get or set the matrix used to transform texture coordinates when a texture is applied to this primitive. |
|
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.
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:
- 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:
- 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: