SurfacePolygonTriangulatorInitializer#
- class ansys.stk.core.graphics.SurfacePolygonTriangulatorInitializer#
Triangulates a polygon, with an optional hole, on a central body, into a triangle mesh and a surrounding boundary. The mesh is commonly visualized with the triangle mesh primitive or surface mesh primitiveβ¦
Overview#
Compute the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified positions. This is equivalent to calling Compute with an altitude of 0, a granularity of 1 degree, and a positionsWindingOrder of compute. |
|
For convenience. Computes the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified cartographic positions. This is equivalent to converting each position in positions to cartesian and calling Compute. |
|
Compute the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified positions with a hole specified by holePositions. This is equivalent to calling Compute with an altitude of 0 and a granularity of 1 degree. |
|
Compute the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified positions with a hole specified by holePositions. |
|
Compute the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified positions. |
|
For convenience. Computes the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified cartographic positions. This is equivalent to converting each position in positions to cartesian and calling Compute. |
Examples#
Draw a new Surface Extent Triangulator
# Scenario scenario: Scenario object
manager = scenario.scene_manager
installPath = r"C:\Program Files\AGI\STK 12" if os.name == "nt" else os.environ["STK_INSTALL_DIR"]
texture_path = os.path.join(installPath, "STKData", "VO", "Textures", "AGI_logo_small.png")
texture = manager.textures.load_from_string_uri(texture_path)
mesh = manager.initializers.surface_mesh_primitive.initialize()
mesh.texture = texture
mesh.translucency = 0
cartographicExtent = [[-55], [10], [-24], [30]]
triangles = manager.initializers.surface_extent_triangulator.compute_simple("Earth", cartographicExtent)
mesh.set(triangles)
mesh.translucency = 0.25
c0 = [[10], [-55]]
c1 = [[30], [-55]]
c2 = [[30], [-24]]
c3 = [[10], [-24]]
mesh.texture_matrix = manager.initializers.texture_matrix.initialize_with_rectangles(c0, c1, c2, c3)
mesh.transparent_texture_border = True
manager.primitives.add(mesh)
manager.render()
Import detail#
from ansys.stk.core.graphics import SurfacePolygonTriangulatorInitializer
Method detail#
- SurfacePolygonTriangulatorInitializer.compute(self, central_body: str, positions: list) SurfaceTriangulatorResult #
Compute the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified positions. This is equivalent to calling Compute with an altitude of 0, a granularity of 1 degree, and a positionsWindingOrder of compute.
- SurfacePolygonTriangulatorInitializer.compute_cartographic(self, central_body: str, positions: list) SurfaceTriangulatorResult #
For convenience. Computes the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified cartographic positions. This is equivalent to converting each position in positions to cartesian and calling Compute.
- SurfacePolygonTriangulatorInitializer.compute_with_hole(self, central_body: str, positions: list, hole_positions: list) SurfaceTriangulatorResult #
Compute the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified positions with a hole specified by holePositions. This is equivalent to calling Compute with an altitude of 0 and a granularity of 1 degree.
- SurfacePolygonTriangulatorInitializer.compute_with_hole_altitude_and_granularity(self, central_body: str, positions: list, hole_positions: list, altitude: float, granularity: float) SurfaceTriangulatorResult #
Compute the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified positions with a hole specified by holePositions.
- SurfacePolygonTriangulatorInitializer.compute_with_altitude_and_granularity(self, central_body: str, positions: list, altitude: float, granularity: float, positions_winding_order: WindingOrder) SurfaceTriangulatorResult #
Compute the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified positions.
- SurfacePolygonTriangulatorInitializer.compute_cartographic_with_altitude_and_granularity(self, central_body: str, positions: list, altitude: float, granularity: float, positions_winding_order: WindingOrder) SurfaceTriangulatorResult #
For convenience. Computes the triangulation on the specified centralBody for a polygon whose boundary is defined by the specified cartographic positions. This is equivalent to converting each position in positions to cartesian and calling Compute.