2023-11-28 23:50:50 -08:00
from typing import Any , Dict , List , Optional , Type , TypeVar , Union
from uuid import UUID
2023-04-27 13:59:37 -07:00
import attr
2023-11-28 23:50:50 -08:00
from pydantic import BaseModel , GetCoreSchemaHandler
from pydantic_core import CoreSchema , core_schema
2023-04-27 13:59:37 -07:00
2023-08-16 16:31:50 -07:00
from . . models . annotation_options import AnnotationOptions
from . . models . annotation_type import AnnotationType
2023-07-07 18:03:18 -07:00
from . . models . camera_drag_interaction_type import CameraDragInteractionType
2023-08-30 15:59:51 -07:00
from . . models . color import Color
from . . models . image_format import ImageFormat
2023-11-28 23:50:50 -08:00
from . . models . import_file import ImportFile
2023-11-27 16:01:20 -08:00
from . . models . input_format import InputFormat
2023-07-07 18:03:18 -07:00
from . . models . modeling_cmd_id import ModelingCmdId
2023-07-31 12:50:30 -07:00
from . . models . output_format import OutputFormat
2023-11-27 16:01:20 -08:00
from . . models . path_component_constraint_bound import PathComponentConstraintBound
from . . models . path_component_constraint_type import PathComponentConstraintType
2023-07-07 18:03:18 -07:00
from . . models . path_segment import PathSegment
2023-05-23 14:24:13 -07:00
from . . models . point2d import Point2d
2023-07-07 18:03:18 -07:00
from . . models . point3d import Point3d
2023-08-16 16:31:50 -07:00
from . . models . scene_selection_type import SceneSelectionType
2023-08-30 15:59:51 -07:00
from . . models . scene_tool_type import SceneToolType
2023-09-29 15:51:03 -07:00
from . . models . unit_area import UnitArea
from . . models . unit_density import UnitDensity
from . . models . unit_length import UnitLength
from . . models . unit_mass import UnitMass
from . . models . unit_volume import UnitVolume
2023-04-27 13:59:37 -07:00
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
class start_path ( BaseModel ) :
""" Start a path. """
2023-04-27 13:59:37 -07:00
2023-11-28 23:50:50 -08:00
type : str = " start_path "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class move_path_pen ( BaseModel ) :
""" Move the path ' s " pen " . """
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
path : ModelingCmdId
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
to : Point3d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " move_path_pen "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class extend_path ( BaseModel ) :
""" Extend a path by adding a new segment which starts at the path ' s " pen " . If no " pen " location has been set before (via `MovePen`), then the pen is at the origin. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
path : ModelingCmdId
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
segment : PathSegment
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " extend_path "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class extrude ( BaseModel ) :
""" Extrude a 2D solid. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
cap : bool
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
distance : float
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
target : ModelingCmdId
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " extrude "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class close_path ( BaseModel ) :
""" Closes a path, converting it to a 2D solid. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
path_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " close_path "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class camera_drag_start ( BaseModel ) :
""" Camera drag started. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
interaction : CameraDragInteractionType
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " camera_drag_start "
2023-08-30 18:30:23 -07:00
2023-11-28 23:50:50 -08:00
window : Point2d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class camera_drag_move ( BaseModel ) :
""" Camera drag continued. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
interaction : CameraDragInteractionType
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
sequence : Optional [ int ] = None
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
type : str = " camera_drag_move "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
window : Point2d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class camera_drag_end ( BaseModel ) :
""" Camera drag ended. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
interaction : CameraDragInteractionType
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " camera_drag_end "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
window : Point2d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class default_camera_look_at ( BaseModel ) :
""" Change what the default camera is looking at. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
center : Point3d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " default_camera_look_at "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
up : Point3d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
vantage : Point3d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class default_camera_zoom ( BaseModel ) :
""" Adjust zoom of the default camera. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
magnitude : float
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " default_camera_zoom "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class default_camera_enable_sketch_mode ( BaseModel ) :
""" Enable sketch mode, where users can sketch 2D geometry. Users choose a plane to sketch on. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
animated : bool
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
distance_to_plane : float
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
origin : Point3d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
ortho : bool
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " default_camera_enable_sketch_mode "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
x_axis : Point3d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
y_axis : Point3d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class default_camera_disable_sketch_mode ( BaseModel ) :
""" Disable sketch mode, from the default camera. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " default_camera_disable_sketch_mode "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class default_camera_focus_on ( BaseModel ) :
""" Focus default camera on object. """
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
type : str = " default_camera_focus_on "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
uuid : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class export ( BaseModel ) :
""" Export the scene to a file. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
entity_ids : List [ UUID ]
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
format : OutputFormat
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
source_unit : UnitLength
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " export "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class entity_get_parent_id ( BaseModel ) :
""" What is this entity ' s parent? """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
entity_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " entity_get_parent_id "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class entity_get_num_children ( BaseModel ) :
""" How many children does the entity have? """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
entity_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " entity_get_num_children "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class entity_get_child_uuid ( BaseModel ) :
""" What is the UUID of this entity ' s n-th child? """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
child_index : int
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
entity_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " entity_get_child_uuid "
2023-09-29 16:05:40 -07:00
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class entity_get_all_child_uuids ( BaseModel ) :
""" What are all UUIDs of this entity ' s children? """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
entity_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " entity_get_all_child_uuids "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class edit_mode_enter ( BaseModel ) :
""" Enter edit mode """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
target : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " edit_mode_enter "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class edit_mode_exit ( BaseModel ) :
""" Exit edit mode """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " edit_mode_exit "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class select_with_point ( BaseModel ) :
""" Modifies the selection by simulating a " mouse click " at the given x,y window coordinate Returns ID of whatever was selected. """
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
selected_at_window : Point2d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
selection_type : SceneSelectionType
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " select_with_point "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class select_clear ( BaseModel ) :
""" Clear the selection """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " select_clear "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class select_add ( BaseModel ) :
""" Adds one or more entities (by UUID) to the selection. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
entities : List [ UUID ]
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " select_add "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class select_remove ( BaseModel ) :
""" Removes one or more entities (by UUID) from the selection. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
entities : List [ UUID ]
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " select_remove "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class select_replace ( BaseModel ) :
""" Replaces the current selection with these new entities (by UUID). Equivalent to doing SelectClear then SelectAdd. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
entities : List [ UUID ]
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " select_replace "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class select_get ( BaseModel ) :
""" Find all IDs of selected entities """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " select_get "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class highlight_set_entity ( BaseModel ) :
""" Changes the current highlighted entity to whichever one is at the given window coordinate. If there ' s no entity at this location, clears the highlight. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
selected_at_window : Point2d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
sequence : Optional [ int ] = None
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " highlight_set_entity "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class highlight_set_entities ( BaseModel ) :
""" Changes the current highlighted entity to these entities. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
entities : List [ UUID ]
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " highlight_set_entities "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class new_annotation ( BaseModel ) :
""" Create a new annotation """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
annotation_type : AnnotationType
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
clobber : bool
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
options : AnnotationOptions
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " new_annotation "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class update_annotation ( BaseModel ) :
""" Update an annotation """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
annotation_id : UUID
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
options : AnnotationOptions
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " update_annotation "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class object_visible ( BaseModel ) :
""" Hide or show an object """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
hidden : bool
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
object_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " object_visible "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class object_bring_to_front ( BaseModel ) :
""" Bring an object to the front of the scene """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
object_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " object_bring_to_front "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class get_entity_type ( BaseModel ) :
""" What type of entity is this? """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
entity_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " get_entity_type "
2023-09-29 16:05:40 -07:00
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class solid2d_add_hole ( BaseModel ) :
""" Add a hole to a Solid2d object before extruding it. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
hole_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
object_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " solid2d_add_hole "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class solid3d_get_all_edge_faces ( BaseModel ) :
""" Gets all faces which use the given edge. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
edge_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
object_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " solid3d_get_all_edge_faces "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class solid3d_get_all_opposite_edges ( BaseModel ) :
""" Gets all edges which are opposite the given edge, across all possible faces. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
along_vector : Optional [ Point3d ] = None
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
edge_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
object_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " solid3d_get_all_opposite_edges "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class solid3d_get_opposite_edge ( BaseModel ) :
""" Gets the edge opposite the given edge, along the given face. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
edge_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
face_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
object_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
type : str = " solid3d_get_opposite_edge "
2023-09-29 16:05:40 -07:00
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class solid3d_get_next_adjacent_edge ( BaseModel ) :
""" Gets the next adjacent edge for the given edge, along the given face. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
edge_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
face_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
object_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
type : str = " solid3d_get_next_adjacent_edge "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class solid3d_get_prev_adjacent_edge ( BaseModel ) :
""" Gets the previous adjacent edge for the given edge, along the given face. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
edge_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
face_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
object_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
type : str = " solid3d_get_prev_adjacent_edge "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class send_object ( BaseModel ) :
""" Sends object to front or back. """
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
front : bool
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
object_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
type : str = " send_object "
2023-09-29 15:51:03 -07:00
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class entity_set_opacity ( BaseModel ) :
""" Set opacity of the entity. """
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
entity_id : UUID
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
opacity : float
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
type : str = " entity_set_opacity "
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
class entity_fade ( BaseModel ) :
""" Fade the entity in or out. """
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
duration_seconds : Optional [ float ] = None
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
entity_id : UUID
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
fade_in : bool
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
type : str = " entity_fade "
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
class make_plane ( BaseModel ) :
""" Make a plane. """
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
clobber : bool
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
hide : Optional [ bool ] = None
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
origin : Point3d
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
size : float
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
type : str = " make_plane "
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
x_axis : Point3d
2023-10-17 15:35:56 -07:00
2023-11-28 23:50:50 -08:00
y_axis : Point3d
2023-10-17 15:35:56 -07:00
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class plane_set_color ( BaseModel ) :
""" Set the plane ' s color. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
color : Color
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
plane_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " plane_set_color "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class set_tool ( BaseModel ) :
""" Set the active tool. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
tool : SceneToolType
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " set_tool "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class mouse_move ( BaseModel ) :
""" Send a mouse move event. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
sequence : Optional [ int ] = None
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " mouse_move "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
window : Point2d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class mouse_click ( BaseModel ) :
""" Send a mouse click event. Updates modified/selected entities. """
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
type : str = " mouse_click "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
window : Point2d
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class sketch_mode_enable ( BaseModel ) :
""" Enable sketch mode on the given plane. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
animated : bool
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
disable_camera_with_plane : Optional [ Point3d ] = None
2023-08-30 18:30:23 -07:00
2023-11-28 23:50:50 -08:00
ortho : bool
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
plane_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " sketch_mode_enable "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class sketch_mode_disable ( BaseModel ) :
""" Disable sketch mode. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " sketch_mode_disable "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class curve_get_type ( BaseModel ) :
""" Get type of a given curve. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
curve_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " curve_get_type "
2023-09-29 16:05:40 -07:00
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class curve_get_control_points ( BaseModel ) :
""" Get control points of a given curve. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
curve_id : UUID
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " curve_get_control_points "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class take_snapshot ( BaseModel ) :
""" Take a snapshot. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
format : ImageFormat
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " take_snapshot "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class make_axes_gizmo ( BaseModel ) :
""" Add a gizmo showing the axes. """
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
clobber : bool
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
gizmo_mode : bool
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
type : str = " make_axes_gizmo "
2023-08-30 15:59:51 -07:00
2023-11-28 23:50:50 -08:00
class path_get_info ( BaseModel ) :
""" Query the given path """
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
path_id : UUID
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
type : str = " path_get_info "
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
class path_get_curve_uuids_for_vertices ( BaseModel ) :
""" Get curves for vertices within a path """
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
path_id : UUID
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
type : str = " path_get_curve_uuids_for_vertices "
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
vertex_ids : List [ UUID ]
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
class path_get_vertex_uuids ( BaseModel ) :
""" Get vertices within a path """
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
path_id : UUID
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
type : str = " path_get_vertex_uuids "
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
class handle_mouse_drag_start ( BaseModel ) :
""" Start dragging mouse. """
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
type : str = " handle_mouse_drag_start "
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
window : Point2d
2023-09-06 11:27:00 -07:00
2023-11-28 23:50:50 -08:00
class handle_mouse_drag_move ( BaseModel ) :
""" Continue dragging mouse. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
sequence : Optional [ int ] = None
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
type : str = " handle_mouse_drag_move "
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
window : Point2d
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class handle_mouse_drag_end ( BaseModel ) :
""" Stop dragging mouse. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
type : str = " handle_mouse_drag_end "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
window : Point2d
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class remove_scene_objects ( BaseModel ) :
""" Remove scene objects. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
object_ids : List [ UUID ]
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
type : str = " remove_scene_objects "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class plane_intersect_and_project ( BaseModel ) :
""" Utility method. Performs both a ray cast and projection to plane-local coordinates. Returns the plane coordinates for the given window coordinates. """
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
plane_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
type : str = " plane_intersect_and_project "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
window : Point2d
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class curve_get_end_points ( BaseModel ) :
""" Find the start and end of a curve. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
curve_id : UUID
2023-09-29 15:51:03 -07:00
2023-11-27 16:01:20 -08:00
type : str = " curve_get_end_points "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class reconfigure_stream ( BaseModel ) :
""" Reconfigure the stream. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
fps : int
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
height : int
2023-09-29 15:51:03 -07:00
2023-11-27 16:01:20 -08:00
type : str = " reconfigure_stream "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
width : int
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class import_files ( BaseModel ) :
""" Import files to the current model. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
files : List [ ImportFile ]
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
format : InputFormat
2023-09-29 15:51:03 -07:00
2023-11-27 16:01:20 -08:00
type : str = " import_files "
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
class mass ( BaseModel ) :
""" Get the mass of entities in the scene or the default scene. """
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
entity_ids : List [ UUID ]
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
material_density : float
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
material_density_unit : UnitDensity
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
output_unit : UnitMass
2023-09-29 15:51:03 -07:00
2023-11-28 23:50:50 -08:00
source_unit : UnitLength
2023-09-29 15:51:03 -07:00
2023-11-27 16:01:20 -08:00
type : str = " mass "
2023-11-28 23:50:50 -08:00
class density ( BaseModel ) :
""" Get the density of entities in the scene or the default scene. """
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
entity_ids : List [ UUID ]
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
material_mass : float
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
material_mass_unit : UnitMass
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
output_unit : UnitDensity
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
source_unit : UnitLength
2023-11-27 16:01:20 -08:00
type : str = " density "
2023-11-28 23:50:50 -08:00
class volume ( BaseModel ) :
""" Get the volume of entities in the scene or the default scene. """
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
entity_ids : List [ UUID ]
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
output_unit : UnitVolume
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
source_unit : UnitLength
2023-09-29 16:05:40 -07:00
2023-11-27 16:01:20 -08:00
type : str = " volume "
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
class center_of_mass ( BaseModel ) :
""" Get the center of mass of entities in the scene or the default scene. """
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
entity_ids : List [ UUID ]
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
output_unit : UnitLength
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
source_unit : UnitLength
2023-09-29 16:05:40 -07:00
2023-11-27 16:01:20 -08:00
type : str = " center_of_mass "
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
class surface_area ( BaseModel ) :
""" Get the surface area of entities in the scene or the default scene. """
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
entity_ids : List [ UUID ]
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
output_unit : UnitArea
2023-09-29 16:05:40 -07:00
2023-11-28 23:50:50 -08:00
source_unit : UnitLength
2023-09-29 16:05:40 -07:00
2023-11-27 16:01:20 -08:00
type : str = " surface_area "
2023-09-29 16:05:40 -07:00
2023-10-12 09:02:59 -07:00
2023-11-28 23:50:50 -08:00
class get_sketch_mode_plane ( BaseModel ) :
""" Get the plane of the sketch mode. This is useful for getting the normal of the plane after a user selects a plane. """
2023-11-27 16:01:20 -08:00
type : str = " get_sketch_mode_plane "
2023-10-12 09:02:59 -07:00
2023-11-28 23:50:50 -08:00
class curve_set_constraint ( BaseModel ) :
""" Constrain a curve. """
2023-10-12 09:02:59 -07:00
2023-11-28 23:50:50 -08:00
constraint_bound : PathComponentConstraintBound
2023-10-12 09:02:59 -07:00
2023-11-28 23:50:50 -08:00
constraint_type : PathComponentConstraintType
2023-11-27 16:01:20 -08:00
2023-11-28 23:50:50 -08:00
object_id : UUID
2023-11-27 16:01:20 -08:00
type : str = " curve_set_constraint "
2023-11-28 14:29:16 -08:00
GY = TypeVar ( " GY " , bound = " ModelingCmd " )
@attr.s ( auto_attribs = True )
2023-11-28 14:16:05 -08:00
class ModelingCmd :
""" Commands that the KittyCAD engine can execute. """
type : Union [
start_path ,
move_path_pen ,
extend_path ,
extrude ,
close_path ,
camera_drag_start ,
camera_drag_move ,
camera_drag_end ,
default_camera_look_at ,
default_camera_zoom ,
default_camera_enable_sketch_mode ,
default_camera_disable_sketch_mode ,
default_camera_focus_on ,
export ,
entity_get_parent_id ,
entity_get_num_children ,
entity_get_child_uuid ,
entity_get_all_child_uuids ,
edit_mode_enter ,
edit_mode_exit ,
select_with_point ,
select_clear ,
select_add ,
select_remove ,
select_replace ,
select_get ,
highlight_set_entity ,
highlight_set_entities ,
new_annotation ,
update_annotation ,
object_visible ,
object_bring_to_front ,
get_entity_type ,
solid2d_add_hole ,
solid3d_get_all_edge_faces ,
solid3d_get_all_opposite_edges ,
solid3d_get_opposite_edge ,
solid3d_get_next_adjacent_edge ,
solid3d_get_prev_adjacent_edge ,
send_object ,
entity_set_opacity ,
entity_fade ,
make_plane ,
plane_set_color ,
set_tool ,
mouse_move ,
mouse_click ,
sketch_mode_enable ,
sketch_mode_disable ,
curve_get_type ,
curve_get_control_points ,
take_snapshot ,
make_axes_gizmo ,
path_get_info ,
path_get_curve_uuids_for_vertices ,
path_get_vertex_uuids ,
handle_mouse_drag_start ,
handle_mouse_drag_move ,
handle_mouse_drag_end ,
remove_scene_objects ,
plane_intersect_and_project ,
curve_get_end_points ,
reconfigure_stream ,
import_files ,
mass ,
density ,
volume ,
center_of_mass ,
surface_area ,
get_sketch_mode_plane ,
curve_set_constraint ,
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
start_path ,
move_path_pen ,
extend_path ,
extrude ,
close_path ,
camera_drag_start ,
camera_drag_move ,
camera_drag_end ,
default_camera_look_at ,
default_camera_zoom ,
default_camera_enable_sketch_mode ,
default_camera_disable_sketch_mode ,
default_camera_focus_on ,
export ,
entity_get_parent_id ,
entity_get_num_children ,
entity_get_child_uuid ,
entity_get_all_child_uuids ,
edit_mode_enter ,
edit_mode_exit ,
select_with_point ,
select_clear ,
select_add ,
select_remove ,
select_replace ,
select_get ,
highlight_set_entity ,
highlight_set_entities ,
new_annotation ,
update_annotation ,
object_visible ,
object_bring_to_front ,
get_entity_type ,
solid2d_add_hole ,
solid3d_get_all_edge_faces ,
solid3d_get_all_opposite_edges ,
solid3d_get_opposite_edge ,
solid3d_get_next_adjacent_edge ,
solid3d_get_prev_adjacent_edge ,
send_object ,
entity_set_opacity ,
entity_fade ,
make_plane ,
plane_set_color ,
set_tool ,
mouse_move ,
mouse_click ,
sketch_mode_enable ,
sketch_mode_disable ,
curve_get_type ,
curve_get_control_points ,
take_snapshot ,
make_axes_gizmo ,
path_get_info ,
path_get_curve_uuids_for_vertices ,
path_get_vertex_uuids ,
handle_mouse_drag_start ,
handle_mouse_drag_move ,
handle_mouse_drag_end ,
remove_scene_objects ,
plane_intersect_and_project ,
curve_get_end_points ,
reconfigure_stream ,
import_files ,
mass ,
density ,
volume ,
center_of_mass ,
surface_area ,
get_sketch_mode_plane ,
curve_set_constraint ,
2023-11-28 14:16:05 -08:00
] ,
) :
self . type = type
2023-11-28 23:50:50 -08:00
def model_dump ( self ) - > Dict [ str , Any ] :
2023-11-28 14:16:05 -08:00
if isinstance ( self . type , start_path ) :
2023-11-28 23:50:50 -08:00
ON : start_path = self . type
return ON . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , move_path_pen ) :
2023-11-28 23:50:50 -08:00
US : move_path_pen = self . type
return US . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , extend_path ) :
2023-11-28 23:50:50 -08:00
FH : extend_path = self . type
return FH . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , extrude ) :
2023-11-28 23:50:50 -08:00
BB : extrude = self . type
return BB . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , close_path ) :
2023-11-28 23:50:50 -08:00
TV : close_path = self . type
return TV . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , camera_drag_start ) :
2023-11-28 23:50:50 -08:00
CE : camera_drag_start = self . type
return CE . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , camera_drag_move ) :
2023-11-28 23:50:50 -08:00
LT : camera_drag_move = self . type
return LT . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , camera_drag_end ) :
2023-11-28 23:50:50 -08:00
YY : camera_drag_end = self . type
return YY . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , default_camera_look_at ) :
2023-11-28 23:50:50 -08:00
FZ : default_camera_look_at = self . type
return FZ . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , default_camera_zoom ) :
2023-11-28 23:50:50 -08:00
NN : default_camera_zoom = self . type
return NN . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , default_camera_enable_sketch_mode ) :
2023-11-28 23:50:50 -08:00
VI : default_camera_enable_sketch_mode = self . type
return VI . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , default_camera_disable_sketch_mode ) :
2023-11-28 23:50:50 -08:00
QF : default_camera_disable_sketch_mode = self . type
return QF . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , default_camera_focus_on ) :
2023-11-28 23:50:50 -08:00
OJ : default_camera_focus_on = self . type
return OJ . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , export ) :
2023-11-28 23:50:50 -08:00
YF : export = self . type
return YF . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , entity_get_parent_id ) :
2023-11-28 23:50:50 -08:00
LK : entity_get_parent_id = self . type
return LK . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , entity_get_num_children ) :
2023-11-28 23:50:50 -08:00
WB : entity_get_num_children = self . type
return WB . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , entity_get_child_uuid ) :
2023-11-28 23:50:50 -08:00
HC : entity_get_child_uuid = self . type
return HC . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , entity_get_all_child_uuids ) :
2023-11-28 23:50:50 -08:00
PV : entity_get_all_child_uuids = self . type
return PV . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , edit_mode_enter ) :
2023-11-28 23:50:50 -08:00
TP : edit_mode_enter = self . type
return TP . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , edit_mode_exit ) :
2023-11-28 23:50:50 -08:00
OM : edit_mode_exit = self . type
return OM . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , select_with_point ) :
2023-11-28 23:50:50 -08:00
RS : select_with_point = self . type
return RS . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , select_clear ) :
2023-11-28 23:50:50 -08:00
MP : select_clear = self . type
return MP . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , select_add ) :
2023-11-28 23:50:50 -08:00
RO : select_add = self . type
return RO . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , select_remove ) :
2023-11-28 23:50:50 -08:00
BA : select_remove = self . type
return BA . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , select_replace ) :
2023-11-28 23:50:50 -08:00
CB : select_replace = self . type
return CB . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , select_get ) :
2023-11-28 23:50:50 -08:00
TO : select_get = self . type
return TO . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , highlight_set_entity ) :
2023-11-28 23:50:50 -08:00
EO : highlight_set_entity = self . type
return EO . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , highlight_set_entities ) :
2023-11-28 23:50:50 -08:00
QO : highlight_set_entities = self . type
return QO . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , new_annotation ) :
2023-11-28 23:50:50 -08:00
IZ : new_annotation = self . type
return IZ . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , update_annotation ) :
2023-11-28 23:50:50 -08:00
NK : update_annotation = self . type
return NK . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , object_visible ) :
2023-11-28 23:50:50 -08:00
QE : object_visible = self . type
return QE . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , object_bring_to_front ) :
2023-11-28 23:50:50 -08:00
KT : object_bring_to_front = self . type
return KT . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , get_entity_type ) :
2023-11-28 23:50:50 -08:00
GU : get_entity_type = self . type
return GU . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , solid2d_add_hole ) :
2023-11-28 23:50:50 -08:00
UP : solid2d_add_hole = self . type
return UP . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , solid3d_get_all_edge_faces ) :
2023-11-28 23:50:50 -08:00
DJ : solid3d_get_all_edge_faces = self . type
return DJ . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , solid3d_get_all_opposite_edges ) :
2023-11-28 23:50:50 -08:00
TR : solid3d_get_all_opposite_edges = self . type
return TR . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , solid3d_get_opposite_edge ) :
2023-11-28 23:50:50 -08:00
JF : solid3d_get_opposite_edge = self . type
return JF . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , solid3d_get_next_adjacent_edge ) :
2023-11-28 23:50:50 -08:00
EL : solid3d_get_next_adjacent_edge = self . type
return EL . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , solid3d_get_prev_adjacent_edge ) :
2023-11-28 23:50:50 -08:00
LF : solid3d_get_prev_adjacent_edge = self . type
return LF . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , send_object ) :
2023-11-28 23:50:50 -08:00
GN : send_object = self . type
return GN . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , entity_set_opacity ) :
2023-11-28 23:50:50 -08:00
VJ : entity_set_opacity = self . type
return VJ . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , entity_fade ) :
2023-11-28 23:50:50 -08:00
YW : entity_fade = self . type
return YW . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , make_plane ) :
2023-11-28 23:50:50 -08:00
NO : make_plane = self . type
return NO . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , plane_set_color ) :
2023-11-28 23:50:50 -08:00
RG : plane_set_color = self . type
return RG . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , set_tool ) :
2023-11-28 23:50:50 -08:00
LD : set_tool = self . type
return LD . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , mouse_move ) :
2023-11-28 23:50:50 -08:00
TN : mouse_move = self . type
return TN . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , mouse_click ) :
2023-11-28 23:50:50 -08:00
UG : mouse_click = self . type
return UG . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , sketch_mode_enable ) :
2023-11-28 23:50:50 -08:00
NZ : sketch_mode_enable = self . type
return NZ . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , sketch_mode_disable ) :
2023-11-28 23:50:50 -08:00
LO : sketch_mode_disable = self . type
return LO . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , curve_get_type ) :
2023-11-28 23:50:50 -08:00
OW : curve_get_type = self . type
return OW . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , curve_get_control_points ) :
2023-11-28 23:50:50 -08:00
PQ : curve_get_control_points = self . type
return PQ . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , take_snapshot ) :
2023-11-28 23:50:50 -08:00
OU : take_snapshot = self . type
return OU . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , make_axes_gizmo ) :
2023-11-28 23:50:50 -08:00
XI : make_axes_gizmo = self . type
return XI . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , path_get_info ) :
2023-11-28 23:50:50 -08:00
PS : path_get_info = self . type
return PS . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , path_get_curve_uuids_for_vertices ) :
2023-11-28 23:50:50 -08:00
XL : path_get_curve_uuids_for_vertices = self . type
return XL . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , path_get_vertex_uuids ) :
2023-11-28 23:50:50 -08:00
FT : path_get_vertex_uuids = self . type
return FT . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , handle_mouse_drag_start ) :
2023-11-28 23:50:50 -08:00
SC : handle_mouse_drag_start = self . type
return SC . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , handle_mouse_drag_move ) :
2023-11-28 23:50:50 -08:00
JA : handle_mouse_drag_move = self . type
return JA . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , handle_mouse_drag_end ) :
2023-11-28 23:50:50 -08:00
UK : handle_mouse_drag_end = self . type
return UK . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , remove_scene_objects ) :
2023-11-28 23:50:50 -08:00
MT : remove_scene_objects = self . type
return MT . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , plane_intersect_and_project ) :
2023-11-28 23:50:50 -08:00
TF : plane_intersect_and_project = self . type
return TF . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , curve_get_end_points ) :
2023-11-28 23:50:50 -08:00
JD : curve_get_end_points = self . type
return JD . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , reconfigure_stream ) :
2023-11-28 23:50:50 -08:00
BH : reconfigure_stream = self . type
return BH . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , import_files ) :
2023-11-28 23:50:50 -08:00
CN : import_files = self . type
return CN . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , mass ) :
2023-11-28 23:50:50 -08:00
SO : mass = self . type
return SO . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , density ) :
2023-11-28 23:50:50 -08:00
AM : density = self . type
return AM . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , volume ) :
2023-11-28 23:50:50 -08:00
SG : volume = self . type
return SG . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , center_of_mass ) :
2023-11-28 23:50:50 -08:00
SY : center_of_mass = self . type
return SY . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , surface_area ) :
2023-11-28 23:50:50 -08:00
WS : surface_area = self . type
return WS . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , get_sketch_mode_plane ) :
2023-11-28 23:50:50 -08:00
MK : get_sketch_mode_plane = self . type
return MK . model_dump ( )
2023-11-28 14:16:05 -08:00
elif isinstance ( self . type , curve_set_constraint ) :
2023-11-28 23:50:50 -08:00
FY : curve_set_constraint = self . type
return FY . model_dump ( )
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 " ) == " start_path " :
2023-11-28 23:50:50 -08:00
PC : start_path = start_path ( * * d )
return cls ( type = PC )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " move_path_pen " :
2023-11-28 23:50:50 -08:00
KQ : move_path_pen = move_path_pen ( * * d )
return cls ( type = KQ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " extend_path " :
2023-11-28 23:50:50 -08:00
NH : extend_path = extend_path ( * * d )
return cls ( type = NH )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " extrude " :
2023-11-28 23:50:50 -08:00
PJ : extrude = extrude ( * * d )
return cls ( type = PJ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " close_path " :
2023-11-28 23:50:50 -08:00
CR : close_path = close_path ( * * d )
return cls ( type = CR )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " camera_drag_start " :
2023-11-28 23:50:50 -08:00
MS : camera_drag_start = camera_drag_start ( * * d )
return cls ( type = MS )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " camera_drag_move " :
2023-11-28 23:50:50 -08:00
ED : camera_drag_move = camera_drag_move ( * * d )
return cls ( type = ED )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " camera_drag_end " :
2023-11-28 23:50:50 -08:00
DO : camera_drag_end = camera_drag_end ( * * d )
return cls ( type = DO )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " default_camera_look_at " :
2023-11-28 23:50:50 -08:00
GL : default_camera_look_at = default_camera_look_at ( * * d )
return cls ( type = GL )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " default_camera_zoom " :
2023-11-28 23:50:50 -08:00
OH : default_camera_zoom = default_camera_zoom ( * * d )
return cls ( type = OH )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " default_camera_enable_sketch_mode " :
2023-11-28 23:50:50 -08:00
ET : default_camera_enable_sketch_mode = default_camera_enable_sketch_mode (
* * d
)
return cls ( type = ET )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " default_camera_disable_sketch_mode " :
2023-11-28 23:50:50 -08:00
DI : default_camera_disable_sketch_mode = default_camera_disable_sketch_mode (
* * d
2023-11-28 14:29:16 -08:00
)
2023-11-28 23:50:50 -08:00
return cls ( type = DI )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " default_camera_focus_on " :
2023-11-28 23:50:50 -08:00
UF : default_camera_focus_on = default_camera_focus_on ( * * d )
return cls ( type = UF )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " export " :
2023-11-28 23:50:50 -08:00
PY : export = export ( * * d )
return cls ( type = PY )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " entity_get_parent_id " :
2023-11-28 23:50:50 -08:00
AR : entity_get_parent_id = entity_get_parent_id ( * * d )
return cls ( type = AR )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " entity_get_num_children " :
2023-11-28 23:50:50 -08:00
KK : entity_get_num_children = entity_get_num_children ( * * d )
return cls ( type = KK )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " entity_get_child_uuid " :
2023-11-28 23:50:50 -08:00
FM : entity_get_child_uuid = entity_get_child_uuid ( * * d )
return cls ( type = FM )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " entity_get_all_child_uuids " :
2023-11-28 23:50:50 -08:00
QI : entity_get_all_child_uuids = entity_get_all_child_uuids ( * * d )
return cls ( type = QI )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " edit_mode_enter " :
2023-11-28 23:50:50 -08:00
CF : edit_mode_enter = edit_mode_enter ( * * d )
return cls ( type = CF )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " edit_mode_exit " :
2023-11-28 23:50:50 -08:00
EN : edit_mode_exit = edit_mode_exit ( * * d )
return cls ( type = EN )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " select_with_point " :
2023-11-28 23:50:50 -08:00
LR : select_with_point = select_with_point ( * * d )
return cls ( type = LR )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " select_clear " :
2023-11-28 23:50:50 -08:00
WF : select_clear = select_clear ( * * d )
return cls ( type = WF )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " select_add " :
2023-11-28 23:50:50 -08:00
DN : select_add = select_add ( * * d )
return cls ( type = DN )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " select_remove " :
2023-11-28 23:50:50 -08:00
OR : select_remove = select_remove ( * * d )
return cls ( type = OR )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " select_replace " :
2023-11-28 23:50:50 -08:00
LC : select_replace = select_replace ( * * d )
return cls ( type = LC )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " select_get " :
2023-11-28 23:50:50 -08:00
ZP : select_get = select_get ( * * d )
return cls ( type = ZP )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " highlight_set_entity " :
2023-11-28 23:50:50 -08:00
NY : highlight_set_entity = highlight_set_entity ( * * d )
return cls ( type = NY )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " highlight_set_entities " :
2023-11-28 23:50:50 -08:00
KX : highlight_set_entities = highlight_set_entities ( * * d )
return cls ( type = KX )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " new_annotation " :
2023-11-28 23:50:50 -08:00
WO : new_annotation = new_annotation ( * * d )
return cls ( type = WO )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " update_annotation " :
2023-11-28 23:50:50 -08:00
UQ : update_annotation = update_annotation ( * * d )
return cls ( type = UQ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " object_visible " :
2023-11-28 23:50:50 -08:00
XH : object_visible = object_visible ( * * d )
return cls ( type = XH )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " object_bring_to_front " :
2023-11-28 23:50:50 -08:00
BV : object_bring_to_front = object_bring_to_front ( * * d )
return cls ( type = BV )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " get_entity_type " :
2023-11-28 23:50:50 -08:00
SS : get_entity_type = get_entity_type ( * * d )
return cls ( type = SS )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " solid2d_add_hole " :
2023-11-28 23:50:50 -08:00
AZ : solid2d_add_hole = solid2d_add_hole ( * * d )
return cls ( type = AZ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " solid3d_get_all_edge_faces " :
2023-11-28 23:50:50 -08:00
WJ : solid3d_get_all_edge_faces = solid3d_get_all_edge_faces ( * * d )
return cls ( type = WJ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " solid3d_get_all_opposite_edges " :
2023-11-28 23:50:50 -08:00
YD : solid3d_get_all_opposite_edges = solid3d_get_all_opposite_edges ( * * d )
return cls ( type = YD )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " solid3d_get_opposite_edge " :
2023-11-28 23:50:50 -08:00
VP : solid3d_get_opposite_edge = solid3d_get_opposite_edge ( * * d )
return cls ( type = VP )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " solid3d_get_next_adjacent_edge " :
2023-11-28 23:50:50 -08:00
ZG : solid3d_get_next_adjacent_edge = solid3d_get_next_adjacent_edge ( * * d )
return cls ( type = ZG )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " solid3d_get_prev_adjacent_edge " :
2023-11-28 23:50:50 -08:00
CS : solid3d_get_prev_adjacent_edge = solid3d_get_prev_adjacent_edge ( * * d )
return cls ( type = CS )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " send_object " :
2023-11-28 23:50:50 -08:00
GD : send_object = send_object ( * * d )
return cls ( type = GD )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " entity_set_opacity " :
2023-11-28 23:50:50 -08:00
OX : entity_set_opacity = entity_set_opacity ( * * d )
return cls ( type = OX )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " entity_fade " :
2023-11-28 23:50:50 -08:00
QX : entity_fade = entity_fade ( * * d )
return cls ( type = QX )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " make_plane " :
2023-11-28 23:50:50 -08:00
VX : make_plane = make_plane ( * * d )
return cls ( type = VX )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " plane_set_color " :
2023-11-28 23:50:50 -08:00
IT : plane_set_color = plane_set_color ( * * d )
return cls ( type = IT )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " set_tool " :
2023-11-28 23:50:50 -08:00
UA : set_tool = set_tool ( * * d )
return cls ( type = UA )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " mouse_move " :
2023-11-28 23:50:50 -08:00
MZ : mouse_move = mouse_move ( * * d )
return cls ( type = MZ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " mouse_click " :
2023-11-28 23:50:50 -08:00
CY : mouse_click = mouse_click ( * * d )
return cls ( type = CY )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " sketch_mode_enable " :
2023-11-28 23:50:50 -08:00
LI : sketch_mode_enable = sketch_mode_enable ( * * d )
return cls ( type = LI )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " sketch_mode_disable " :
2023-11-28 23:50:50 -08:00
XJ : sketch_mode_disable = sketch_mode_disable ( * * d )
return cls ( type = XJ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " curve_get_type " :
2023-11-28 23:50:50 -08:00
JQ : curve_get_type = curve_get_type ( * * d )
return cls ( type = JQ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " curve_get_control_points " :
2023-11-28 23:50:50 -08:00
IM : curve_get_control_points = curve_get_control_points ( * * d )
return cls ( type = IM )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " take_snapshot " :
2023-11-28 23:50:50 -08:00
KL : take_snapshot = take_snapshot ( * * d )
return cls ( type = KL )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " make_axes_gizmo " :
2023-11-28 23:50:50 -08:00
PO : make_axes_gizmo = make_axes_gizmo ( * * d )
return cls ( type = PO )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " path_get_info " :
2023-11-28 23:50:50 -08:00
WR : path_get_info = path_get_info ( * * d )
return cls ( type = WR )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " path_get_curve_uuids_for_vertices " :
2023-11-28 23:50:50 -08:00
ZX : path_get_curve_uuids_for_vertices = path_get_curve_uuids_for_vertices (
* * d
)
return cls ( type = ZX )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " path_get_vertex_uuids " :
2023-11-28 23:50:50 -08:00
NX : path_get_vertex_uuids = path_get_vertex_uuids ( * * d )
return cls ( type = NX )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " handle_mouse_drag_start " :
2023-11-28 23:50:50 -08:00
TX : handle_mouse_drag_start = handle_mouse_drag_start ( * * d )
return cls ( type = TX )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " handle_mouse_drag_move " :
2023-11-28 23:50:50 -08:00
SK : handle_mouse_drag_move = handle_mouse_drag_move ( * * d )
return cls ( type = SK )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " handle_mouse_drag_end " :
2023-11-28 23:50:50 -08:00
CX : handle_mouse_drag_end = handle_mouse_drag_end ( * * d )
return cls ( type = CX )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " remove_scene_objects " :
2023-11-28 23:50:50 -08:00
LJ : remove_scene_objects = remove_scene_objects ( * * d )
return cls ( type = LJ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " plane_intersect_and_project " :
2023-11-28 23:50:50 -08:00
HF : plane_intersect_and_project = plane_intersect_and_project ( * * d )
return cls ( type = HF )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " curve_get_end_points " :
2023-11-28 23:50:50 -08:00
RZ : curve_get_end_points = curve_get_end_points ( * * d )
return cls ( type = RZ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " reconfigure_stream " :
2023-11-28 23:50:50 -08:00
SX : reconfigure_stream = reconfigure_stream ( * * d )
return cls ( type = SX )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " import_files " :
2023-11-28 23:50:50 -08:00
GS : import_files = import_files ( * * d )
return cls ( type = GS )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " mass " :
2023-11-28 23:50:50 -08:00
ZS : mass = mass ( * * d )
return cls ( type = ZS )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " density " :
2023-11-28 23:50:50 -08:00
GK : density = density ( * * d )
return cls ( type = GK )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " volume " :
2023-11-28 23:50:50 -08:00
QZ : volume = volume ( * * d )
return cls ( type = QZ )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " center_of_mass " :
2023-11-28 23:50:50 -08:00
YK : center_of_mass = center_of_mass ( * * d )
return cls ( type = YK )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " surface_area " :
2023-11-28 23:50:50 -08:00
SL : surface_area = surface_area ( * * d )
return cls ( type = SL )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " get_sketch_mode_plane " :
2023-11-28 23:50:50 -08:00
TU : get_sketch_mode_plane = get_sketch_mode_plane ( * * d )
return cls ( type = TU )
2023-11-28 14:16:05 -08:00
elif d . get ( " type " ) == " curve_set_constraint " :
2023-11-28 23:50:50 -08:00
FD : curve_set_constraint = curve_set_constraint ( * * d )
return cls ( type = FD )
2023-11-28 14:16:05 -08:00
raise Exception ( " Unknown type " )
2023-11-28 23:50:50 -08:00
@classmethod
def __get_pydantic_core_schema__ (
cls , source_type : Any , handler : GetCoreSchemaHandler
) - > CoreSchema :
return core_schema . no_info_after_validator_function (
cls ,
handler (
Union [
start_path ,
move_path_pen ,
extend_path ,
extrude ,
close_path ,
camera_drag_start ,
camera_drag_move ,
camera_drag_end ,
default_camera_look_at ,
default_camera_zoom ,
default_camera_enable_sketch_mode ,
default_camera_disable_sketch_mode ,
default_camera_focus_on ,
export ,
entity_get_parent_id ,
entity_get_num_children ,
entity_get_child_uuid ,
entity_get_all_child_uuids ,
edit_mode_enter ,
edit_mode_exit ,
select_with_point ,
select_clear ,
select_add ,
select_remove ,
select_replace ,
select_get ,
highlight_set_entity ,
highlight_set_entities ,
new_annotation ,
update_annotation ,
object_visible ,
object_bring_to_front ,
get_entity_type ,
solid2d_add_hole ,
solid3d_get_all_edge_faces ,
solid3d_get_all_opposite_edges ,
solid3d_get_opposite_edge ,
solid3d_get_next_adjacent_edge ,
solid3d_get_prev_adjacent_edge ,
send_object ,
entity_set_opacity ,
entity_fade ,
make_plane ,
plane_set_color ,
set_tool ,
mouse_move ,
mouse_click ,
sketch_mode_enable ,
sketch_mode_disable ,
curve_get_type ,
curve_get_control_points ,
take_snapshot ,
make_axes_gizmo ,
path_get_info ,
path_get_curve_uuids_for_vertices ,
path_get_vertex_uuids ,
handle_mouse_drag_start ,
handle_mouse_drag_move ,
handle_mouse_drag_end ,
remove_scene_objects ,
plane_intersect_and_project ,
curve_get_end_points ,
reconfigure_stream ,
import_files ,
mass ,
density ,
volume ,
center_of_mass ,
surface_area ,
get_sketch_mode_plane ,
curve_set_constraint ,
]
) ,
)