2023-11-29 10:32:31 -08:00
from typing import Literal , Union
2023-07-07 19:22:51 -07:00
2023-11-29 10:32:31 -08:00
from pydantic import BaseModel , Field , RootModel
from typing_extensions import Annotated
2023-07-07 19:22:51 -07:00
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
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
class fbx ( BaseModel ) :
""" Autodesk Filmbox (FBX) format. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
storage : FbxStorage
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " fbx " ] = " fbx "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class gltf ( BaseModel ) :
""" 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. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
presentation : GltfPresentation
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
storage : GltfStorage
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " gltf " ] = " gltf "
2023-07-07 19:22:51 -07:00
2023-11-28 23:50:50 -08:00
class obj ( BaseModel ) :
""" Wavefront OBJ format. """
2023-07-07 19:22:51 -07:00
2023-11-28 23:50:50 -08:00
coords : System
2023-07-07 19:22:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " obj " ] = " obj "
2023-07-07 19:22:51 -07:00
2023-11-28 23:50:50 -08:00
units : UnitLength
2023-07-07 19:22:51 -07:00
2023-11-28 23:50:50 -08:00
class ply ( BaseModel ) :
""" The PLY Polygon File Format. """
2023-07-07 19:22:51 -07:00
2023-11-28 23:50:50 -08:00
coords : System
2023-07-07 19:22:51 -07:00
2023-11-28 23:50:50 -08:00
selection : Selection
2023-07-31 12:50:30 -07:00
2023-11-28 23:50:50 -08:00
storage : PlyStorage
2023-07-31 12:50:30 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " ply " ] = " ply "
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
units : UnitLength
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
class step ( BaseModel ) :
""" ISO 10303-21 (STEP) format. """
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
coords : System
2023-07-31 12:50:30 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " step " ] = " step "
2023-07-07 19:22:51 -07:00
2023-11-28 23:50:50 -08:00
class stl ( BaseModel ) :
""" *ST**ereo**L**ithography format. """
2023-07-07 19:22:51 -07:00
2023-11-28 23:50:50 -08:00
coords : System
2023-07-07 19:22:51 -07:00
2023-11-28 23:50:50 -08:00
selection : Selection
2023-07-07 19:22:51 -07:00
2023-11-28 23:50:50 -08:00
storage : StlStorage
2023-07-07 19:22:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " stl " ] = " stl "
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
units : UnitLength
2023-11-27 16:01:20 -08:00
2023-07-07 19:22:51 -07:00
2023-11-29 00:39:14 -08:00
OutputFormat = RootModel [
2023-11-29 10:32:31 -08:00
Annotated [
Union [
fbx ,
gltf ,
obj ,
ply ,
step ,
stl ,
] ,
Field ( discriminator = " type " ) ,
2023-11-28 14:29:16 -08:00
]
2023-11-29 00:39:14 -08:00
]