2023-07-07 19:22:51 -07:00
from typing import Any , Dict , List , Type , TypeVar , Union
import attr
2023-08-30 15:59:51 -07:00
from . . models . fbx_storage import FbxStorage
from . . models . gltf_presentation import GltfPresentation
from . . models . gltf_storage import GltfStorage
from . . models . ply_storage import PlyStorage
2023-11-27 16:01:20 -08:00
from . . models . selection import Selection
2023-08-30 15:59:51 -07:00
from . . models . stl_storage import StlStorage
2023-07-07 19:22:51 -07:00
from . . models . system import System
2023-09-29 15:51:03 -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
UJ = TypeVar ( " UJ " , 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
storage : Union [ Unset , FbxStorage ] = UNSET
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 ] :
if not isinstance ( self . storage , Unset ) :
storage = self . storage
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 ( { } )
if storage is not UNSET :
field_dict [ " storage " ] = storage
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 [ UJ ] , src_dict : Dict [ str , Any ] ) - > UJ :
d = src_dict . copy ( )
_storage = d . pop ( " storage " , UNSET )
storage : Union [ Unset , FbxStorage ]
if isinstance ( _storage , Unset ) :
storage = UNSET
else :
storage = _storage # type: ignore[arg-type]
2023-08-30 15:59:51 -07:00
2023-11-27 16:01:20 -08:00
type = d . pop ( " type " , UNSET )
2023-08-30 15:59:51 -07:00
2023-11-27 16:01:20 -08:00
fbx = cls (
storage = storage ,
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
RU = TypeVar ( " RU " , 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
""" glTF 2.0. We refer to this as glTF since that is how our customers refer to it, although by default it will be in binary format and thus technically (glb). If you prefer ascii output, you can set that option for the export. """ # noqa: E501
2023-07-07 19:22:51 -07:00
2023-11-27 16:01:20 -08:00
presentation : Union [ Unset , GltfPresentation ] = UNSET
storage : Union [ Unset , GltfStorage ] = UNSET
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 ] :
if not isinstance ( self . presentation , Unset ) :
presentation = self . presentation
if not isinstance ( self . storage , Unset ) :
storage = self . storage
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 ( { } )
if presentation is not UNSET :
field_dict [ " presentation " ] = presentation
if storage is not UNSET :
field_dict [ " storage " ] = storage
field_dict [ " type " ] = type
2023-07-07 19:22: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 [ RU ] , src_dict : Dict [ str , Any ] ) - > RU :
d = src_dict . copy ( )
_presentation = d . pop ( " presentation " , UNSET )
presentation : Union [ Unset , GltfPresentation ]
if isinstance ( _presentation , Unset ) :
presentation = UNSET
else :
presentation = _presentation # type: ignore[arg-type]
2023-07-07 19:22:51 -07:00
2023-11-27 16:01:20 -08:00
_storage = d . pop ( " storage " , UNSET )
storage : Union [ Unset , GltfStorage ]
if isinstance ( _storage , Unset ) :
storage = UNSET
else :
storage = _storage # 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
gltf = cls (
presentation = presentation ,
storage = storage ,
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
DL = TypeVar ( " DL " , bound = " obj " )
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 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-07-07 19:22:51 -07:00
2023-11-27 16:01:20 -08:00
@classmethod
def from_dict ( cls : Type [ DL ] , src_dict : Dict [ str , Any ] ) - > DL :
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-09-29 15:51:03 -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
QT = TypeVar ( " QT " , bound = " ply " )
2023-07-31 12:50:30 -07:00
@attr.s ( auto_attribs = True )
2023-08-16 16:31:50 -07:00
class ply :
2023-11-27 16:01:20 -08:00
""" The PLY Polygon File Format. """ # noqa: E501
coords : Union [ Unset , System ] = UNSET
selection : Union [ Unset , Selection ] = UNSET
storage : Union [ Unset , PlyStorage ] = UNSET
type : str = " ply "
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
if not isinstance ( self . selection , Unset ) :
selection = self . selection
if not isinstance ( self . storage , Unset ) :
storage = self . storage
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
if selection is not UNSET :
2023-11-28 13:13:13 -08:00
field_dict [ " selection " ] = selection . to_dict ( )
2023-11-27 16:01:20 -08:00
if storage is not UNSET :
field_dict [ " storage " ] = storage
field_dict [ " type " ] = type
if units is not UNSET :
field_dict [ " units " ] = units
return field_dict
@classmethod
def from_dict ( cls : Type [ QT ] , src_dict : Dict [ str , Any ] ) - > QT :
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]
_selection = d . pop ( " selection " , UNSET )
selection : Union [ Unset , Selection ]
if isinstance ( _selection , Unset ) :
selection = UNSET
else :
selection = _selection # type: ignore[arg-type]
_storage = d . pop ( " storage " , UNSET )
storage : Union [ Unset , PlyStorage ]
if isinstance ( _storage , Unset ) :
storage = UNSET
else :
storage = _storage # 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]
ply = cls (
coords = coords ,
selection = selection ,
storage = storage ,
type = type ,
units = units ,
)
ply . additional_properties = d
return ply
@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
PT = TypeVar ( " PT " , bound = " step " )
2023-07-31 12:50:30 -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 step :
2023-11-27 16:01:20 -08:00
""" ISO 10303-21 (STEP) 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 = " step "
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
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
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 [ PT ] , src_dict : Dict [ str , Any ] ) - > PT :
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
step = cls (
coords = coords ,
type = type ,
)
2023-07-07 19:22:51 -07:00
2023-11-27 16:01:20 -08:00
step . additional_properties = d
return step
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-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-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
HR = TypeVar ( " HR " , 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
selection : Union [ Unset , Selection ] = UNSET
storage : Union [ Unset , StlStorage ] = 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
if not isinstance ( self . selection , Unset ) :
selection = self . selection
if not isinstance ( self . storage , Unset ) :
storage = self . storage
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
if selection is not UNSET :
2023-11-28 13:13:13 -08:00
field_dict [ " selection " ] = selection . to_dict ( )
2023-11-27 16:01:20 -08:00
if storage is not UNSET :
field_dict [ " storage " ] = storage
field_dict [ " type " ] = type
if units is not UNSET :
field_dict [ " units " ] = units
return field_dict
@classmethod
def from_dict ( cls : Type [ HR ] , src_dict : Dict [ str , Any ] ) - > HR :
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]
_selection = d . pop ( " selection " , UNSET )
selection : Union [ Unset , Selection ]
if isinstance ( _selection , Unset ) :
selection = UNSET
else :
selection = _selection # type: ignore[arg-type]
_storage = d . pop ( " storage " , UNSET )
storage : Union [ Unset , StlStorage ]
if isinstance ( _storage , Unset ) :
storage = UNSET
else :
storage = _storage # 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 ,
selection = selection ,
storage = storage ,
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-08-30 15:59:51 -07:00
OutputFormat = Union [ fbx , gltf , obj , ply , step , stl ]