2023-07-07 19:22:51 -07:00
|
|
|
from typing import Any, Dict, List, Type, TypeVar, Union
|
|
|
|
|
|
|
|
import attr
|
2023-11-28 14:16:05 -08:00
|
|
|
from typing_extensions import Self
|
2023-07-07 19:22:51 -07:00
|
|
|
|
|
|
|
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-27 16:01:20 -08:00
|
|
|
WF = TypeVar("WF", bound="fbx")
|
|
|
|
|
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
|
|
|
|
def from_dict(cls: Type[WF], src_dict: Dict[str, Any]) -> WF:
|
|
|
|
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-27 16:01:20 -08:00
|
|
|
RO = TypeVar("RO", 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
|
|
|
|
def from_dict(cls: Type[RO], src_dict: Dict[str, Any]) -> RO:
|
|
|
|
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-27 16:01:20 -08:00
|
|
|
DN = TypeVar("DN", 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]:
|
|
|
|
if not isinstance(self.coords, Unset):
|
|
|
|
coords = self.coords
|
|
|
|
type = self.type
|
|
|
|
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 13:13:13 -08:00
|
|
|
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
|
|
|
|
def from_dict(cls: Type[DN], src_dict: Dict[str, Any]) -> DN:
|
|
|
|
d = src_dict.copy()
|
|
|
|
_coords = d.pop("coords", UNSET)
|
|
|
|
coords: Union[Unset, System]
|
|
|
|
if isinstance(_coords, Unset):
|
|
|
|
coords = UNSET
|
|
|
|
else:
|
|
|
|
coords = _coords # type: ignore[arg-type]
|
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
|
|
|
|
else:
|
|
|
|
units = _units # type: ignore[arg-type]
|
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-27 16:01:20 -08:00
|
|
|
BA = TypeVar("BA", 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]:
|
|
|
|
if not isinstance(self.coords, Unset):
|
|
|
|
coords = self.coords
|
|
|
|
type = self.type
|
|
|
|
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 13:13:13 -08:00
|
|
|
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
|
|
|
|
def from_dict(cls: Type[BA], src_dict: Dict[str, Any]) -> BA:
|
|
|
|
d = src_dict.copy()
|
|
|
|
_coords = d.pop("coords", UNSET)
|
|
|
|
coords: Union[Unset, System]
|
|
|
|
if isinstance(_coords, Unset):
|
|
|
|
coords = UNSET
|
|
|
|
else:
|
|
|
|
coords = _coords # type: ignore[arg-type]
|
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
|
|
|
|
else:
|
|
|
|
units = _units # type: ignore[arg-type]
|
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-27 16:01:20 -08:00
|
|
|
OR = TypeVar("OR", 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
|
|
|
|
def from_dict(cls: Type[OR], src_dict: Dict[str, Any]) -> OR:
|
|
|
|
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-27 16:01:20 -08:00
|
|
|
CB = TypeVar("CB", 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
|
|
|
|
def from_dict(cls: Type[CB], src_dict: Dict[str, Any]) -> CB:
|
|
|
|
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-27 16:01:20 -08:00
|
|
|
LC = TypeVar("LC", 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]:
|
|
|
|
if not isinstance(self.coords, Unset):
|
|
|
|
coords = self.coords
|
|
|
|
type = self.type
|
|
|
|
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 13:13:13 -08:00
|
|
|
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
|
|
|
|
def from_dict(cls: Type[LC], src_dict: Dict[str, Any]) -> LC:
|
|
|
|
d = src_dict.copy()
|
|
|
|
_coords = d.pop("coords", UNSET)
|
|
|
|
coords: Union[Unset, System]
|
|
|
|
if isinstance(_coords, Unset):
|
|
|
|
coords = UNSET
|
|
|
|
else:
|
|
|
|
coords = _coords # type: ignore[arg-type]
|
|
|
|
|
|
|
|
type = d.pop("type", UNSET)
|
|
|
|
|
|
|
|
_units = d.pop("units", UNSET)
|
|
|
|
units: Union[Unset, UnitLength]
|
|
|
|
if isinstance(_units, Unset):
|
|
|
|
units = UNSET
|
|
|
|
else:
|
|
|
|
units = _units # type: ignore[arg-type]
|
|
|
|
|
|
|
|
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:16:05 -08:00
|
|
|
class InputFormat:
|
|
|
|
|
|
|
|
"""Input format specifier."""
|
|
|
|
|
|
|
|
type: Union[
|
|
|
|
fbx,
|
|
|
|
gltf,
|
|
|
|
obj,
|
|
|
|
ply,
|
|
|
|
sldprt,
|
|
|
|
step,
|
|
|
|
stl,
|
|
|
|
] = None
|
|
|
|
|
|
|
|
def __init__(
|
|
|
|
self,
|
|
|
|
type: Union[
|
|
|
|
type(fbx),
|
|
|
|
type(gltf),
|
|
|
|
type(obj),
|
|
|
|
type(ply),
|
|
|
|
type(sldprt),
|
|
|
|
type(step),
|
|
|
|
type(stl),
|
|
|
|
],
|
|
|
|
):
|
|
|
|
self.type = type
|
|
|
|
|
|
|
|
def to_dict(self) -> Dict[str, Any]:
|
|
|
|
if isinstance(self.type, fbx):
|
|
|
|
n: fbx = self.type
|
|
|
|
return n.to_dict()
|
|
|
|
elif isinstance(self.type, gltf):
|
|
|
|
n: gltf = self.type
|
|
|
|
return n.to_dict()
|
|
|
|
elif isinstance(self.type, obj):
|
|
|
|
n: obj = self.type
|
|
|
|
return n.to_dict()
|
|
|
|
elif isinstance(self.type, ply):
|
|
|
|
n: ply = self.type
|
|
|
|
return n.to_dict()
|
|
|
|
elif isinstance(self.type, sldprt):
|
|
|
|
n: sldprt = self.type
|
|
|
|
return n.to_dict()
|
|
|
|
elif isinstance(self.type, step):
|
|
|
|
n: step = self.type
|
|
|
|
return n.to_dict()
|
|
|
|
elif isinstance(self.type, stl):
|
|
|
|
n: stl = self.type
|
|
|
|
return n.to_dict()
|
|
|
|
|
|
|
|
raise Exception("Unknown type")
|
|
|
|
|
|
|
|
def from_dict(self, d) -> Self:
|
|
|
|
if d.get("type") == "fbx":
|
|
|
|
n: fbx = fbx()
|
|
|
|
n.from_dict(d)
|
|
|
|
self.type = n
|
|
|
|
return Self
|
|
|
|
elif d.get("type") == "gltf":
|
|
|
|
n: gltf = gltf()
|
|
|
|
n.from_dict(d)
|
|
|
|
self.type = n
|
|
|
|
return self
|
|
|
|
elif d.get("type") == "obj":
|
|
|
|
n: obj = obj()
|
|
|
|
n.from_dict(d)
|
|
|
|
self.type = n
|
|
|
|
return self
|
|
|
|
elif d.get("type") == "ply":
|
|
|
|
n: ply = ply()
|
|
|
|
n.from_dict(d)
|
|
|
|
self.type = n
|
|
|
|
return self
|
|
|
|
elif d.get("type") == "sldprt":
|
|
|
|
n: sldprt = sldprt()
|
|
|
|
n.from_dict(d)
|
|
|
|
self.type = n
|
|
|
|
return self
|
|
|
|
elif d.get("type") == "step":
|
|
|
|
n: step = step()
|
|
|
|
n.from_dict(d)
|
|
|
|
self.type = n
|
|
|
|
return self
|
|
|
|
elif d.get("type") == "stl":
|
|
|
|
n: stl = stl()
|
|
|
|
n.from_dict(d)
|
|
|
|
self.type = n
|
|
|
|
return self
|
|
|
|
|
|
|
|
raise Exception("Unknown type")
|