2023-11-29 10:32:31 -08:00
from typing import List , Literal , Optional , Union
2023-04-27 13:59:37 -07:00
2023-11-29 10:32:31 -08:00
from pydantic import BaseModel , Field , RootModel
from typing_extensions import Annotated
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
2023-12-21 08:14:08 -08:00
from . . models . distance_type import DistanceType
2024-01-06 14:56:45 -08:00
from . . models . entity_type import EntityType
2023-08-30 15:59:51 -07:00
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
2024-01-06 14:56:45 -08:00
from . . models . perspective_camera_parameters import PerspectiveCameraParameters
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-29 10:32:31 -08:00
type : Literal [ " start_path " ] = " 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-29 10:32:31 -08:00
type : Literal [ " move_path_pen " ] = " 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-29 10:32:31 -08:00
type : Literal [ " extend_path " ] = " 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-29 10:32:31 -08:00
type : Literal [ " extrude " ] = " 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-29 10:32:31 -08:00
path_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " close_path " ] = " 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-29 10:32:31 -08:00
type : Literal [ " camera_drag_start " ] = " 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-29 10:32:31 -08:00
type : Literal [ " camera_drag_move " ] = " 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-29 10:32:31 -08:00
type : Literal [ " camera_drag_end " ] = " 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-29 10:32:31 -08:00
type : Literal [ " default_camera_look_at " ] = " 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-29 10:32:31 -08:00
type : Literal [ " default_camera_zoom " ] = " 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-29 10:32:31 -08:00
type : Literal [
" default_camera_enable_sketch_mode "
] = " 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-29 10:32:31 -08:00
type : Literal [
" default_camera_disable_sketch_mode "
] = " 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-29 10:32:31 -08:00
type : Literal [ " default_camera_focus_on " ] = " default_camera_focus_on "
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
uuid : str
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-29 10:32:31 -08:00
entity_ids : List [ str ]
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-29 10:32:31 -08:00
type : Literal [ " export " ] = " 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-29 10:32:31 -08:00
entity_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " entity_get_parent_id " ] = " 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-29 10:32:31 -08:00
entity_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " entity_get_num_children " ] = " 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-29 10:32:31 -08:00
entity_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " entity_get_child_uuid " ] = " 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-29 10:32:31 -08:00
entity_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " entity_get_all_child_uuids " ] = " 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-29 10:32:31 -08:00
target : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " edit_mode_enter " ] = " 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-29 10:32:31 -08:00
type : Literal [ " edit_mode_exit " ] = " 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-29 10:32:31 -08:00
type : Literal [ " select_with_point " ] = " 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-29 10:32:31 -08:00
type : Literal [ " select_clear " ] = " 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-29 10:32:31 -08:00
entities : List [ str ]
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " select_add " ] = " 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-29 10:32:31 -08:00
entities : List [ str ]
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " select_remove " ] = " 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-29 10:32:31 -08:00
entities : List [ str ]
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " select_replace " ] = " 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-29 10:32:31 -08:00
type : Literal [ " select_get " ] = " 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-29 10:32:31 -08:00
type : Literal [ " highlight_set_entity " ] = " 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-29 10:32:31 -08:00
entities : List [ str ]
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " highlight_set_entities " ] = " 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-29 10:32:31 -08:00
type : Literal [ " new_annotation " ] = " 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-29 10:32:31 -08:00
annotation_id : str
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-29 10:32:31 -08:00
type : Literal [ " update_annotation " ] = " 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-29 10:32:31 -08:00
object_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " object_visible " ] = " 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-29 10:32:31 -08:00
object_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " object_bring_to_front " ] = " 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-29 10:32:31 -08:00
entity_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " get_entity_type " ] = " 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-29 10:32:31 -08:00
hole_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
object_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid2d_add_hole " ] = " 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-29 10:32:31 -08:00
edge_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
object_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid3d_get_all_edge_faces " ] = " 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-29 10:32:31 -08:00
edge_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
object_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid3d_get_all_opposite_edges " ] = " 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-29 10:32:31 -08:00
edge_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
face_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
object_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid3d_get_opposite_edge " ] = " 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-29 10:32:31 -08:00
edge_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
face_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
object_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid3d_get_next_adjacent_edge " ] = " 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-29 10:32:31 -08:00
edge_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
face_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
object_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " solid3d_get_prev_adjacent_edge " ] = " 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-29 10:32:31 -08:00
object_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " send_object " ] = " 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-29 10:32:31 -08:00
entity_id : str
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-29 10:32:31 -08:00
type : Literal [ " entity_set_opacity " ] = " 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-29 10:32:31 -08:00
entity_id : str
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-29 10:32:31 -08:00
type : Literal [ " entity_fade " ] = " 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-29 10:32:31 -08:00
type : Literal [ " make_plane " ] = " 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-29 10:32:31 -08:00
plane_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " plane_set_color " ] = " 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-29 10:32:31 -08:00
type : Literal [ " set_tool " ] = " 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-29 10:32:31 -08:00
type : Literal [ " mouse_move " ] = " 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-29 10:32:31 -08:00
type : Literal [ " mouse_click " ] = " 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-29 10:32:31 -08:00
plane_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " sketch_mode_enable " ] = " 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-29 10:32:31 -08:00
type : Literal [ " sketch_mode_disable " ] = " 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-29 10:32:31 -08:00
curve_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " curve_get_type " ] = " 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-29 10:32:31 -08:00
curve_id : str
2023-08-30 15:59:51 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " curve_get_control_points " ] = " 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-29 10:32:31 -08:00
type : Literal [ " take_snapshot " ] = " 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-29 10:32:31 -08:00
type : Literal [ " make_axes_gizmo " ] = " 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-29 10:32:31 -08:00
path_id : str
2023-09-06 11:27:00 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " path_get_info " ] = " 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-29 10:32:31 -08:00
path_id : str
2023-09-06 11:27:00 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [
" path_get_curve_uuids_for_vertices "
] = " path_get_curve_uuids_for_vertices "
2023-09-06 11:27:00 -07:00
2023-11-29 10:32:31 -08:00
vertex_ids : List [ str ]
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-29 10:32:31 -08:00
path_id : str
2023-09-06 11:27:00 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " path_get_vertex_uuids " ] = " 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-29 10:32:31 -08:00
type : Literal [ " handle_mouse_drag_start " ] = " 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-29 10:32:31 -08:00
type : Literal [ " handle_mouse_drag_move " ] = " 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-29 10:32:31 -08:00
type : Literal [ " handle_mouse_drag_end " ] = " 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-29 10:32:31 -08:00
object_ids : List [ str ]
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " remove_scene_objects " ] = " 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-29 10:32:31 -08:00
plane_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " plane_intersect_and_project " ] = " 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-29 10:32:31 -08:00
curve_id : str
2023-09-29 15:51:03 -07:00
2023-11-29 10:32:31 -08:00
type : Literal [ " curve_get_end_points " ] = " 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-29 10:32:31 -08:00
type : Literal [ " reconfigure_stream " ] = " 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-29 10:32:31 -08:00
type : Literal [ " import_files " ] = " 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-29 10:32:31 -08:00
entity_ids : List [ str ]
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-29 10:32:31 -08:00
type : Literal [ " mass " ] = " mass "
2023-11-27 16:01:20 -08:00
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-29 10:32:31 -08:00
entity_ids : List [ str ]
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
2023-11-29 10:32:31 -08:00
type : Literal [ " density " ] = " density "
2023-11-27 16:01:20 -08:00
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-29 10:32:31 -08:00
entity_ids : List [ str ]
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-29 10:32:31 -08:00
type : Literal [ " volume " ] = " 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-29 10:32:31 -08:00
entity_ids : List [ str ]
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-29 10:32:31 -08:00
type : Literal [ " center_of_mass " ] = " 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-29 10:32:31 -08:00
entity_ids : List [ str ]
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-29 10:32:31 -08:00
type : Literal [ " surface_area " ] = " 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
2023-11-29 10:32:31 -08:00
type : Literal [ " get_sketch_mode_plane " ] = " get_sketch_mode_plane "
2023-11-27 16:01:20 -08:00
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-29 10:32:31 -08:00
object_id : str
2023-11-27 16:01:20 -08:00
2023-11-29 10:32:31 -08:00
type : Literal [ " curve_set_constraint " ] = " curve_set_constraint "
2023-11-27 16:01:20 -08:00
2023-12-21 08:14:08 -08:00
class enable_sketch_mode ( BaseModel ) :
""" Sketch on some entity (e.g. a plane, a face) """
animated : bool
entity_id : str
ortho : bool
type : Literal [ " enable_sketch_mode " ] = " enable_sketch_mode "
class object_set_material_params_pbr ( BaseModel ) :
""" Set the material properties of an object """
ambient_occlusion : float
color : Color
metalness : float
object_id : str
roughness : float
type : Literal [ " object_set_material_params_pbr " ] = " object_set_material_params_pbr "
class entity_get_distance ( BaseModel ) :
""" What is the distance between these two entities? """
distance_type : DistanceType
entity_id1 : str
entity_id2 : str
type : Literal [ " entity_get_distance " ] = " entity_get_distance "
class entity_linear_pattern ( BaseModel ) :
""" Duplicate the given entity, evenly spaced along the chosen axis. """
axis : Point3d
entity_id : str
num_repetitions : int
spacing : float
type : Literal [ " entity_linear_pattern " ] = " entity_linear_pattern "
2024-01-06 14:56:45 -08:00
class set_selection_type ( BaseModel ) :
""" When you select some entity with the current tool, what should happen to the entity? """
selection_type : SceneSelectionType
type : Literal [ " set_selection_type " ] = " set_selection_type "
class set_selection_filter ( BaseModel ) :
""" What kind of entities can be selected? """
filter : List [ EntityType ]
type : Literal [ " set_selection_filter " ] = " set_selection_filter "
class default_camera_set_orthographic ( BaseModel ) :
""" Use orthographic projection. """
type : Literal [ " default_camera_set_orthographic " ] = " default_camera_set_orthographic "
class default_camera_set_perspective ( BaseModel ) :
""" Use perspective projection. """
parameters : Optional [ PerspectiveCameraParameters ] = None
type : Literal [ " default_camera_set_perspective " ] = " default_camera_set_perspective "
2023-11-29 00:39:14 -08:00
ModelingCmd = RootModel [
2023-11-29 10:32:31 -08:00
Annotated [
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-12-21 08:14:08 -08:00
enable_sketch_mode ,
object_set_material_params_pbr ,
entity_get_distance ,
entity_linear_pattern ,
2024-01-06 14:56:45 -08:00
set_selection_type ,
set_selection_filter ,
default_camera_set_orthographic ,
default_camera_set_perspective ,
2023-11-29 10:32:31 -08:00
] ,
Field ( discriminator = " type " ) ,
2023-11-28 14:29:16 -08:00
]
2023-11-29 00:39:14 -08:00
]