-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgeode_polyhedral_solid3d.py
More file actions
72 lines (54 loc) · 2.41 KB
/
Copy pathgeode_polyhedral_solid3d.py
File metadata and controls
72 lines (54 loc) · 2.41 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
65
66
67
68
69
70
71
72
# Standard library imports
from __future__ import annotations
# Third party imports
import opengeode as og
import geode_viewables as viewables
# Local application imports
from .types import GeodeMeshType
from .geode_solid_mesh3d import GeodeSolidMesh3D
class GeodePolyhedralSolid3D(GeodeSolidMesh3D):
polyhedral_solid: og.PolyhedralSolid3D
def __init__(self, polyhedral_solid: og.PolyhedralSolid3D | None = None) -> None:
self.polyhedral_solid = (
polyhedral_solid
if polyhedral_solid is not None
else og.PolyhedralSolid3D.create()
)
super().__init__(self.polyhedral_solid)
@classmethod
def geode_object_type(cls) -> GeodeMeshType:
return "PolyhedralSolid3D"
def native_extension(self) -> str:
return self.polyhedral_solid.native_extension()
def builder(self) -> og.PolyhedralSolidBuilder3D:
return og.PolyhedralSolidBuilder3D.create(self.polyhedral_solid)
@classmethod
def load(cls, filename: str) -> GeodePolyhedralSolid3D:
return GeodePolyhedralSolid3D(og.load_polyhedral_solid3D(filename))
@classmethod
def additional_files(cls, filename: str) -> og.AdditionalFiles:
return og.polyhedral_solid_additional_files3D(filename)
@classmethod
def is_loadable(cls, filename: str) -> og.Percentage:
return og.is_polyhedral_solid_loadable3D(filename)
@classmethod
def input_extensions(cls) -> list[str]:
return og.PolyhedralSolidInputFactory3D.list_creators()
@classmethod
def output_extensions(cls) -> list[str]:
return og.PolyhedralSolidOutputFactory3D.list_creators()
@classmethod
def object_priority(cls, filename: str) -> int:
return og.polyhedral_solid_object_priority3D(filename)
def is_saveable(self, filename: str) -> bool:
return og.is_polyhedral_solid_saveable3D(self.polyhedral_solid, filename)
def save(self, filename: str) -> list[str]:
return og.save_polyhedral_solid3D(self.polyhedral_solid, filename)
def save_viewable(self, filename_without_extension: str) -> str:
return viewables.save_viewable_polyhedral_solid3D(
self.polyhedral_solid, filename_without_extension
)
def save_light_viewable(self, filename_without_extension: str) -> str:
return viewables.save_light_viewable_polyhedral_solid3D(
self.polyhedral_solid, filename_without_extension
)