-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeode_solid_mesh3d.py
More file actions
64 lines (50 loc) · 2 KB
/
Copy pathgeode_solid_mesh3d.py
File metadata and controls
64 lines (50 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Standard library imports
from __future__ import annotations
# Third party imports
import opengeode as og
import opengeode_geosciences as og_geosciences
import opengeode_inspector as og_inspector
# Local application imports
from .geode_vertex_set import GeodeVertexSet
from .types import ViewerElementsType
class GeodeSolidMesh3D(GeodeVertexSet):
solid_mesh: og.SolidMesh3D
def __init__(self, solid_mesh: og.SolidMesh3D | None = None) -> None:
self.solid_mesh = solid_mesh if solid_mesh is not None else og.SolidMesh3D()
super().__init__(self.solid_mesh)
@classmethod
def is_3D(cls) -> bool:
return True
@classmethod
def is_viewable(cls) -> bool:
return True
@classmethod
def viewer_elements_type(cls) -> ViewerElementsType:
return "polyhedra"
def builder(self) -> og.SolidMeshBuilder3D:
return og.SolidMeshBuilder3D.create(self.solid_mesh)
def inspect(self) -> og_inspector.SolidInspectionResult:
return og_inspector.inspect_solid3D(self.solid_mesh)
def assign_crs(
self, crs_name: str, info: og_geosciences.GeographicCoordinateSystemInfo
) -> None:
builder = self.builder()
og_geosciences.assign_solid_mesh_geographic_coordinate_system_info3D(
self.solid_mesh, builder, crs_name, info
)
def convert_crs(
self, crs_name: str, info: og_geosciences.GeographicCoordinateSystemInfo
) -> None:
builder = self.builder()
og_geosciences.convert_solid_mesh_coordinate_reference_system3D(
self.solid_mesh, builder, crs_name, info
)
def create_crs(
self, crs_name: str, input: og.CoordinateSystem2D, output: og.CoordinateSystem2D
) -> None:
builder = self.builder()
og.create_solid_mesh_coordinate_system3D(
self.solid_mesh, builder, crs_name, input, output
)
def polyhedron_attribute_manager(self) -> og.AttributeManager:
return self.solid_mesh.polyhedron_attribute_manager()