2023-11-28 17:22:38 -08:00
|
|
|
from typing import Any, Dict, List, Type, TypeVar, Union, cast
|
2023-07-07 19:22:51 -07:00
|
|
|
|
|
|
|
import attr
|
|
|
|
|
|
|
|
from ..models.system import System
|
2023-07-31 12:50:30 -07:00
|
|
|
from ..models.unit_length import UnitLength
|
2023-07-07 19:22:51 -07:00
|
|
|
from ..types import UNSET, Unset
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
WO = TypeVar("WO", bound="fbx")
|
2023-11-27 16:01:20 -08:00
|
|
|
|
2023-08-30 15:59:51 -07:00
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class fbx:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""Autodesk Filmbox (FBX) format.""" # noqa: E501
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
type: str = "fbx"
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
type = self.type
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
field_dict["type"] = type
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[WO], src_dict: Dict[str, Any]) -> WO:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
type = d.pop("type", UNSET)
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
fbx = cls(
|
|
|
|
type=type,
|
|
|
|
)
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
fbx.additional_properties = d
|
|
|
|
return fbx
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-30 15:59:51 -07:00
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
NK = TypeVar("NK", bound="gltf")
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
@attr.s(auto_attribs=True)
|
2023-08-16 16:31:50 -07:00
|
|
|
class gltf:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""Binary glTF 2.0. We refer to this as glTF since that is how our customers refer to it, but this can also import binary glTF (glb).""" # noqa: E501
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
type: str = "gltf"
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
type = self.type
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
field_dict["type"] = type
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[NK], src_dict: Dict[str, Any]) -> NK:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
type = d.pop("type", UNSET)
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
gltf = cls(
|
|
|
|
type=type,
|
|
|
|
)
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
gltf.additional_properties = d
|
|
|
|
return gltf
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-07-07 19:22:51 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
UQ = TypeVar("UQ", bound="obj")
|
2023-07-07 19:22:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
2023-08-30 18:30:23 -07:00
|
|
|
class obj:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""Wavefront OBJ format.""" # noqa: E501
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
coords: Union[Unset, System] = UNSET
|
|
|
|
type: str = "obj"
|
|
|
|
units: Union[Unset, UnitLength] = UNSET
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
2023-11-28 17:22:38 -08:00
|
|
|
coords: Union[Unset, System] = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
if not isinstance(self.coords, Unset):
|
|
|
|
coords = self.coords
|
|
|
|
type = self.type
|
2023-11-28 17:22:38 -08:00
|
|
|
units: Union[Unset, UnitLength] = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
if not isinstance(self.units, Unset):
|
|
|
|
units = self.units
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if coords is not UNSET:
|
2023-11-28 17:22:38 -08:00
|
|
|
_coords: System = cast(System, coords)
|
|
|
|
field_dict["coords"] = _coords.to_dict()
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict["type"] = type
|
|
|
|
if units is not UNSET:
|
|
|
|
field_dict["units"] = units
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[UQ], src_dict: Dict[str, Any]) -> UQ:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
_coords = d.pop("coords", UNSET)
|
|
|
|
coords: Union[Unset, System]
|
|
|
|
if isinstance(_coords, Unset):
|
|
|
|
coords = UNSET
|
2023-11-28 15:17:44 -08:00
|
|
|
if _coords is None:
|
|
|
|
coords = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
else:
|
2023-11-28 15:17:44 -08:00
|
|
|
coords = System.from_dict(_coords)
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
type = d.pop("type", UNSET)
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
_units = d.pop("units", UNSET)
|
|
|
|
units: Union[Unset, UnitLength]
|
|
|
|
if isinstance(_units, Unset):
|
|
|
|
units = UNSET
|
2023-11-28 15:17:44 -08:00
|
|
|
if _units is None:
|
|
|
|
units = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
else:
|
2023-11-28 15:17:44 -08:00
|
|
|
units = _units
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
obj = cls(
|
|
|
|
coords=coords,
|
|
|
|
type=type,
|
|
|
|
units=units,
|
|
|
|
)
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
obj.additional_properties = d
|
|
|
|
return obj
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-07-07 19:22:51 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
QE = TypeVar("QE", bound="ply")
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
@attr.s(auto_attribs=True)
|
2023-08-30 18:30:23 -07:00
|
|
|
class ply:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""The PLY Polygon File Format.""" # noqa: E501
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
coords: Union[Unset, System] = UNSET
|
|
|
|
type: str = "ply"
|
|
|
|
units: Union[Unset, UnitLength] = UNSET
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
2023-11-28 17:22:38 -08:00
|
|
|
coords: Union[Unset, System] = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
if not isinstance(self.coords, Unset):
|
|
|
|
coords = self.coords
|
|
|
|
type = self.type
|
2023-11-28 17:22:38 -08:00
|
|
|
units: Union[Unset, UnitLength] = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
if not isinstance(self.units, Unset):
|
|
|
|
units = self.units
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if coords is not UNSET:
|
2023-11-28 17:22:38 -08:00
|
|
|
_coords: System = cast(System, coords)
|
|
|
|
field_dict["coords"] = _coords.to_dict()
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict["type"] = type
|
|
|
|
if units is not UNSET:
|
|
|
|
field_dict["units"] = units
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[QE], src_dict: Dict[str, Any]) -> QE:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
_coords = d.pop("coords", UNSET)
|
|
|
|
coords: Union[Unset, System]
|
|
|
|
if isinstance(_coords, Unset):
|
|
|
|
coords = UNSET
|
2023-11-28 15:17:44 -08:00
|
|
|
if _coords is None:
|
|
|
|
coords = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
else:
|
2023-11-28 15:17:44 -08:00
|
|
|
coords = System.from_dict(_coords)
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
type = d.pop("type", UNSET)
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
_units = d.pop("units", UNSET)
|
|
|
|
units: Union[Unset, UnitLength]
|
|
|
|
if isinstance(_units, Unset):
|
|
|
|
units = UNSET
|
2023-11-28 15:17:44 -08:00
|
|
|
if _units is None:
|
|
|
|
units = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
else:
|
2023-11-28 15:17:44 -08:00
|
|
|
units = _units
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
ply = cls(
|
|
|
|
coords=coords,
|
|
|
|
type=type,
|
|
|
|
units=units,
|
|
|
|
)
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
ply.additional_properties = d
|
|
|
|
return ply
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-07-07 19:22:51 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
XH = TypeVar("XH", bound="sldprt")
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-07-31 12:50:30 -07:00
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
2023-08-30 18:30:23 -07:00
|
|
|
class sldprt:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""SolidWorks part (SLDPRT) format.""" # noqa: E501
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
type: str = "sldprt"
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
type = self.type
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
field_dict["type"] = type
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[XH], src_dict: Dict[str, Any]) -> XH:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
type = d.pop("type", UNSET)
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
sldprt = cls(
|
|
|
|
type=type,
|
|
|
|
)
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
sldprt.additional_properties = d
|
|
|
|
return sldprt
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-09-29 16:05:40 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-08-30 18:30:23 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
KT = TypeVar("KT", bound="step")
|
2023-08-30 18:30:23 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
|
|
|
class step:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""ISO 10303-21 (STEP) format.""" # noqa: E501
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
type: str = "step"
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
type = self.type
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
field_dict["type"] = type
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
return field_dict
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[KT], src_dict: Dict[str, Any]) -> KT:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
type = d.pop("type", UNSET)
|
2023-08-30 18:30:23 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
step = cls(
|
|
|
|
type=type,
|
|
|
|
)
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
step.additional_properties = d
|
|
|
|
return step
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
2023-07-31 12:50:30 -07:00
|
|
|
|
2023-11-27 16:01:20 -08:00
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
2023-07-31 12:50:30 -07:00
|
|
|
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
BV = TypeVar("BV", bound="stl")
|
2023-07-07 19:22:51 -07:00
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
2023-08-16 16:31:50 -07:00
|
|
|
class stl:
|
2023-11-27 16:01:20 -08:00
|
|
|
"""*ST**ereo**L**ithography format.""" # noqa: E501
|
|
|
|
|
|
|
|
coords: Union[Unset, System] = UNSET
|
|
|
|
type: str = "stl"
|
|
|
|
units: Union[Unset, UnitLength] = UNSET
|
|
|
|
|
|
|
|
additional_properties: Dict[str, Any] = attr.ib(init=False, factory=dict)
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
2023-11-28 17:22:38 -08:00
|
|
|
coords: Union[Unset, System] = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
if not isinstance(self.coords, Unset):
|
|
|
|
coords = self.coords
|
|
|
|
type = self.type
|
2023-11-28 17:22:38 -08:00
|
|
|
units: Union[Unset, UnitLength] = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
if not isinstance(self.units, Unset):
|
|
|
|
units = self.units
|
|
|
|
|
|
|
|
field_dict: Dict[str, Any] = {}
|
|
|
|
field_dict.update(self.additional_properties)
|
|
|
|
field_dict.update({})
|
|
|
|
if coords is not UNSET:
|
2023-11-28 17:22:38 -08:00
|
|
|
_coords: System = cast(System, coords)
|
|
|
|
field_dict["coords"] = _coords.to_dict()
|
2023-11-27 16:01:20 -08:00
|
|
|
field_dict["type"] = type
|
|
|
|
if units is not UNSET:
|
|
|
|
field_dict["units"] = units
|
|
|
|
|
|
|
|
return field_dict
|
|
|
|
|
|
|
|
@classmethod
|
2023-11-28 14:29:16 -08:00
|
|
|
def from_dict(cls: Type[BV], src_dict: Dict[str, Any]) -> BV:
|
2023-11-27 16:01:20 -08:00
|
|
|
d = src_dict.copy()
|
|
|
|
_coords = d.pop("coords", UNSET)
|
|
|
|
coords: Union[Unset, System]
|
|
|
|
if isinstance(_coords, Unset):
|
|
|
|
coords = UNSET
|
2023-11-28 15:17:44 -08:00
|
|
|
if _coords is None:
|
|
|
|
coords = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
else:
|
2023-11-28 15:17:44 -08:00
|
|
|
coords = System.from_dict(_coords)
|
2023-11-27 16:01:20 -08:00
|
|
|
|
|
|
|
type = d.pop("type", UNSET)
|
|
|
|
|
|
|
|
_units = d.pop("units", UNSET)
|
|
|
|
units: Union[Unset, UnitLength]
|
|
|
|
if isinstance(_units, Unset):
|
|
|
|
units = UNSET
|
2023-11-28 15:17:44 -08:00
|
|
|
if _units is None:
|
|
|
|
units = UNSET
|
2023-11-27 16:01:20 -08:00
|
|
|
else:
|
2023-11-28 15:17:44 -08:00
|
|
|
units = _units
|
2023-11-27 16:01:20 -08:00
|
|
|
|
|
|
|
stl = cls(
|
|
|
|
coords=coords,
|
|
|
|
type=type,
|
|
|
|
units=units,
|
|
|
|
)
|
|
|
|
|
|
|
|
stl.additional_properties = d
|
|
|
|
return stl
|
|
|
|
|
|
|
|
@property
|
|
|
|
def additional_keys(self) -> List[str]:
|
|
|
|
return list(self.additional_properties.keys())
|
|
|
|
|
|
|
|
def __getitem__(self, key: str) -> Any:
|
|
|
|
return self.additional_properties[key]
|
|
|
|
|
|
|
|
def __setitem__(self, key: str, value: Any) -> None:
|
|
|
|
self.additional_properties[key] = value
|
|
|
|
|
|
|
|
def __delitem__(self, key: str) -> None:
|
|
|
|
del self.additional_properties[key]
|
|
|
|
|
|
|
|
def __contains__(self, key: str) -> bool:
|
|
|
|
return key in self.additional_properties
|
|
|
|
|
2023-07-07 19:22:51 -07:00
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
GY = TypeVar("GY", bound="InputFormat")
|
|
|
|
|
|
|
|
|
|
|
|
@attr.s(auto_attribs=True)
|
2023-11-28 14:16:05 -08:00
|
|
|
class InputFormat:
|
|
|
|
|
|
|
|
"""Input format specifier."""
|
|
|
|
|
|
|
|
type: Union[
|
|
|
|
fbx,
|
|
|
|
gltf,
|
|
|
|
obj,
|
|
|
|
ply,
|
|
|
|
sldprt,
|
|
|
|
step,
|
|
|
|
stl,
|
2023-11-28 14:29:16 -08:00
|
|
|
]
|
2023-11-28 14:16:05 -08:00
|
|
|
|
|
|
|
def __init__(
|
|
|
|
self,
|
|
|
|
type: Union[
|
2023-11-28 14:29:16 -08:00
|
|
|
fbx,
|
|
|
|
gltf,
|
|
|
|
obj,
|
|
|
|
ply,
|
|
|
|
sldprt,
|
|
|
|
step,
|
|
|
|
stl,
|
2023-11-28 14:16:05 -08:00
|
|
|
],
|
|
|
|
):
|
|
|
|
self.type = type
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if isinstance(self.type, fbx):
|
2023-11-28 14:29:16 -08:00
|
|
|
GU: fbx = self.type
|
|
|
|
return GU.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, gltf):
|
2023-11-28 14:29:16 -08:00
|
|
|
UP: gltf = self.type
|
|
|
|
return UP.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, obj):
|
2023-11-28 14:29:16 -08:00
|
|
|
DJ: obj = self.type
|
|
|
|
return DJ.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, ply):
|
2023-11-28 14:29:16 -08:00
|
|
|
TR: ply = self.type
|
|
|
|
return TR.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, sldprt):
|
2023-11-28 14:29:16 -08:00
|
|
|
JF: sldprt = self.type
|
|
|
|
return JF.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, step):
|
2023-11-28 14:29:16 -08:00
|
|
|
EL: step = self.type
|
|
|
|
return EL.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
elif isinstance(self.type, stl):
|
2023-11-28 14:29:16 -08:00
|
|
|
LF: stl = self.type
|
|
|
|
return LF.to_dict()
|
2023-11-28 14:16:05 -08:00
|
|
|
|
|
|
|
raise Exception("Unknown type")
|
|
|
|
|
2023-11-28 14:29:16 -08:00
|
|
|
@classmethod
|
|
|
|
def from_dict(cls: Type[GY], d: Dict[str, Any]) -> GY:
|
2023-11-28 14:16:05 -08:00
|
|
|
if d.get("type") == "fbx":
|
2023-11-28 14:29:16 -08:00
|
|
|
SS: fbx = fbx()
|
|
|
|
SS.from_dict(d)
|
|
|
|
return cls(type=SS)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "gltf":
|
2023-11-28 14:29:16 -08:00
|
|
|
AZ: gltf = gltf()
|
|
|
|
AZ.from_dict(d)
|
|
|
|
return cls(type=AZ)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "obj":
|
2023-11-28 14:29:16 -08:00
|
|
|
WJ: obj = obj()
|
|
|
|
WJ.from_dict(d)
|
|
|
|
return cls(type=WJ)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "ply":
|
2023-11-28 14:29:16 -08:00
|
|
|
YD: ply = ply()
|
|
|
|
YD.from_dict(d)
|
|
|
|
return cls(type=YD)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "sldprt":
|
2023-11-28 14:29:16 -08:00
|
|
|
VP: sldprt = sldprt()
|
|
|
|
VP.from_dict(d)
|
|
|
|
return cls(type=VP)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "step":
|
2023-11-28 14:29:16 -08:00
|
|
|
ZG: step = step()
|
|
|
|
ZG.from_dict(d)
|
|
|
|
return cls(type=ZG)
|
2023-11-28 14:16:05 -08:00
|
|
|
elif d.get("type") == "stl":
|
2023-11-28 14:29:16 -08:00
|
|
|
CS: stl = stl()
|
|
|
|
CS.from_dict(d)
|
|
|
|
return cls(type=CS)
|
2023-11-28 14:16:05 -08:00
|
|
|
|
|
|
|
raise Exception("Unknown type")
|