diff --git a/spec.json b/spec.json index 40b1ab8..615cc89 100644 --- a/spec.json +++ b/spec.json @@ -19434,6 +19434,48 @@ "type" ] }, + { + "description": "Mirror the input entities over the specified axis. (Currently only supports sketches)", + "type": "object", + "properties": { + "axis": { + "description": "Axis to use as mirror.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "ids": { + "description": "ID of the mirror entities.", + "type": "array", + "items": { + "type": "string", + "format": "uuid" + } + }, + "point": { + "description": "Point through which the mirror axis passes.", + "allOf": [ + { + "$ref": "#/components/schemas/Point3d" + } + ] + }, + "type": { + "type": "string", + "enum": [ + "entity_mirror" + ] + } + }, + "required": [ + "axis", + "ids", + "point", + "type" + ] + }, { "description": "Enter edit mode", "type": "object", @@ -21338,8 +21380,8 @@ "type": "object", "properties": { "object_ids": { - "nullable": true, - "description": "Which objects to fit to", + "description": "Which objects to fit camera to; if empty, fit to all non-default objects. Defaults to empty vector.", + "default": [], "type": "array", "items": { "type": "string", diff --git a/types.go b/types.go index 30c44a6..579dac3 100755 --- a/types.go +++ b/types.go @@ -2255,24 +2255,26 @@ type ModelingCmdAngle struct { Vantage Point3D `json:"vantage" yaml:"vantage" schema:"vantage,required"` } -// ModelingCmdAnimated: Set opacity of the entity. +// ModelingCmdAnimated: Send object to front or back. type ModelingCmdAnimated struct { - // EntityID: Which entity is being changed. - EntityID UUID `json:"entity_id" yaml:"entity_id" schema:"entity_id,required"` - // Opacity: How transparent should it be? 0 or lower is totally transparent. 1 or greater is totally opaque. - Opacity float64 `json:"opacity" yaml:"opacity" schema:"opacity,required"` + // Front: Bring to front = true, send to back = false. + Front bool `json:"front" yaml:"front" schema:"front,required"` + // ObjectID: Which object is being changed. + ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdArcDegrees: Import files to the current model. +// ModelingCmdArcDegrees: Reconfigure the stream. type ModelingCmdArcDegrees struct { - // Files: Files to import. - Files []ImportFile `json:"files" yaml:"files" schema:"files,required"` - // Format: Input file format. - Format any `json:"format" yaml:"format" schema:"format,required"` + // Fps: Frames per second. + Fps int `json:"fps" yaml:"fps" schema:"fps,required"` + // Height: Height of the stream. + Height int `json:"height" yaml:"height" schema:"height,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` + // Width: Width of the stream. + Width int `json:"width" yaml:"width" schema:"width,required"` } // ModelingCmdAxis: Change what the default camera is looking at. @@ -2303,32 +2305,24 @@ type ModelingCmdAxisIs2D struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdCameraDragEnd: Create a new annotation +// ModelingCmdCameraDragEnd: Changes the current highlighted entity to these entities. type ModelingCmdCameraDragEnd struct { - // AnnotationType: What type of annotation to create. - AnnotationType AnnotationType `json:"annotation_type" yaml:"annotation_type" schema:"annotation_type,required"` - // Clobber: If true, any existing drawables within the obj will be replaced (the object will be reset) - Clobber bool `json:"clobber" yaml:"clobber" schema:"clobber,required"` - // Options: What should the annotation contain? - Options AnnotationOptions `json:"options" yaml:"options" schema:"options,required"` + // Entities: Highlight these entities. + Entities []UUID `json:"entities" yaml:"entities" schema:"entities,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdCameraDragMove: Replaces current selection with these entities (by UUID). +// ModelingCmdCameraDragMove: Removes all of the Objects in the scene type ModelingCmdCameraDragMove struct { - // Entities: Which entities to select - Entities []UUID `json:"entities" yaml:"entities" schema:"entities,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdCameraDragStart: Modifies the selection by simulating a "mouse click" at the given x,y window coordinate Returns ID of whatever was selected. +// ModelingCmdCameraDragStart: Enter edit mode type ModelingCmdCameraDragStart struct { - // SelectedAtWindow: Where in the window was selected - SelectedAtWindow Point2D `json:"selected_at_window" yaml:"selected_at_window" schema:"selected_at_window,required"` - // SelectionType: What entity was selected? - SelectionType SceneSelectionType `json:"selection_type" yaml:"selection_type" schema:"selection_type,required"` + // Target: The edit target + Target UUID `json:"target" yaml:"target" schema:"target,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } @@ -2343,20 +2337,18 @@ type ModelingCmdCap struct { Window Point2D `json:"window" yaml:"window" schema:"window,required"` } -// ModelingCmdCenter: Hide or show an object +// ModelingCmdCenter: Changes visibility of scene-wide edge lines on brep solids type ModelingCmdCenter struct { - // Hidden: Whether or not the object should be hidden. + // Hidden: Whether or not the edge lines should be hidden. Hidden bool `json:"hidden" yaml:"hidden" schema:"hidden,required"` - // ObjectID: Which object to change - ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdChildIndex: Get type of the given curve. +// ModelingCmdChildIndex: Set the default system properties used when a specific property isn't set. type ModelingCmdChildIndex struct { - // CurveID: Which curve to query. - CurveID UUID `json:"curve_id" yaml:"curve_id" schema:"curve_id,required"` + // Color: The default system color. + Color Color `json:"color" yaml:"color" schema:"color"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } @@ -2377,61 +2369,53 @@ type ModelingCmdClosePath struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdCylinderID: Focus the default camera upon an object in the scene. +// ModelingCmdCylinderID: Get the surface area of entities in the scene or the default scene. type ModelingCmdCylinderID struct { + // EntityIds: IDs of the entities to get the surface area of. If this is empty, then the default scene is included in the surface area. + EntityIds []UUID `json:"entity_ids" yaml:"entity_ids" schema:"entity_ids,required"` + // OutputUnit: The output unit for the surface area. + OutputUnit UnitArea `json:"output_unit" yaml:"output_unit" schema:"output_unit,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` - // Uuid: UUID of object to focus on. - Uuid UUID `json:"uuid" yaml:"uuid" schema:"uuid,required"` } -// ModelingCmdDefaultCameraDisableSketchMode: Enable sketch mode on the given plane. If you want to sketch on a face, use `enable_sketch_mode` instead. +// ModelingCmdDefaultCameraDisableSketchMode: Send a mouse click event Updates modified/selected entities. type ModelingCmdDefaultCameraDisableSketchMode struct { - // Animated: Animate the transition to sketch mode. - Animated bool `json:"animated" yaml:"animated" schema:"animated,required"` - // DisableCameraWithPlane: Disable the camera entirely for sketch mode and sketch on a plane (this would be the normal of that plane). - DisableCameraWithPlane Point3D `json:"disable_camera_with_plane" yaml:"disable_camera_with_plane" schema:"disable_camera_with_plane"` - // Ortho: Use an orthographic camera. - Ortho bool `json:"ortho" yaml:"ortho" schema:"ortho,required"` - // PlaneID: Sketch on this plane. - PlaneID UUID `json:"plane_id" yaml:"plane_id" schema:"plane_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` + // Window: Where the mouse is + Window Point2D `json:"window" yaml:"window" schema:"window,required"` } -// ModelingCmdDefaultCameraEnableSketchMode: Set the current tool. +// ModelingCmdDefaultCameraEnableSketchMode: Set the color of a plane. type ModelingCmdDefaultCameraEnableSketchMode struct { - // Tool: What tool should be active. - Tool SceneToolType `json:"tool" yaml:"tool" schema:"tool,required"` + // Color: What color it should be. + Color Color `json:"color" yaml:"color" schema:"color,required"` + // PlaneID: Which plane is being changed. + PlaneID UUID `json:"plane_id" yaml:"plane_id" schema:"plane_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdDefaultCameraGetSettings: Changes visibility of scene-wide edge lines on brep solids +// ModelingCmdDefaultCameraGetSettings: Update an annotation type ModelingCmdDefaultCameraGetSettings struct { - // Hidden: Whether or not the edge lines should be hidden. - Hidden bool `json:"hidden" yaml:"hidden" schema:"hidden,required"` + // AnnotationID: Which annotation to update + AnnotationID UUID `json:"annotation_id" yaml:"annotation_id" schema:"annotation_id,required"` + // Options: If any of these fields are set, they will overwrite the previous options for the annotation. + Options AnnotationOptions `json:"options" yaml:"options" schema:"options,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdDefaultCameraLookAt: Set the material properties of an object +// ModelingCmdDefaultCameraLookAt: Bring an object to the front of the scene type ModelingCmdDefaultCameraLookAt struct { - // AmbientOcclusion: Ambient Occlusion of the new material - AmbientOcclusion float64 `json:"ambient_occlusion" yaml:"ambient_occlusion" schema:"ambient_occlusion,required"` - // Color: Color of the new material - Color Color `json:"color" yaml:"color" schema:"color,required"` - // Metalness: Metalness of the new material - Metalness float64 `json:"metalness" yaml:"metalness" schema:"metalness,required"` // ObjectID: Which object to change ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` - // Roughness: Roughness of the new material - Roughness float64 `json:"roughness" yaml:"roughness" schema:"roughness,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdDefaultCameraPerspectiveSettings: Gets the next adjacent edge for the given edge, along the given face. +// ModelingCmdDefaultCameraPerspectiveSettings: Gets the edge opposite the given edge, along the given face. type ModelingCmdDefaultCameraPerspectiveSettings struct { // EdgeID: Which edge you want the opposite of. EdgeID UUID `json:"edge_id" yaml:"edge_id" schema:"edge_id,required"` @@ -2443,14 +2427,14 @@ type ModelingCmdDefaultCameraPerspectiveSettings struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdDefaultCameraZoom: Send object to front or back. +// ModelingCmdDefaultCameraZoom: Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v type ModelingCmdDefaultCameraZoom struct { - // Front: Bring to front = true, send to back = false. - Front bool `json:"front" yaml:"front" schema:"front,required"` - // ObjectID: Which object is being changed. + // ObjectID: Which face is being queried. ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` + // Uv: The 2D paramter-space u,v position to evaluate the surface at + Uv Point2D `json:"uv" yaml:"uv" schema:"uv,required"` } // ModelingCmdDistance: Camera drag continued. @@ -2465,26 +2449,22 @@ type ModelingCmdDistance struct { Window Point2D `json:"window" yaml:"window" schema:"window,required"` } -// ModelingCmdDistanceToPlane: Fade entity in or out. +// ModelingCmdDistanceToPlane: Set opacity of the entity. type ModelingCmdDistanceToPlane struct { - // DurationSeconds: How many seconds the animation should take. - DurationSeconds float64 `json:"duration_seconds" yaml:"duration_seconds" schema:"duration_seconds"` // EntityID: Which entity is being changed. EntityID UUID `json:"entity_id" yaml:"entity_id" schema:"entity_id,required"` - // FadeIn: Fade in = true, fade out = false. - FadeIn bool `json:"fade_in" yaml:"fade_in" schema:"fade_in,required"` + // Opacity: How transparent should it be? 0 or lower is totally transparent. 1 or greater is totally opaque. + Opacity float64 `json:"opacity" yaml:"opacity" schema:"opacity,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdDistanceType: Obtain curve ids for vertex ids +// ModelingCmdDistanceType: Query the given path. type ModelingCmdDistanceType struct { // PathID: Which path to query PathID UUID `json:"path_id" yaml:"path_id" schema:"path_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` - // VertexIds: IDs of the vertices for which to obtain curve ids from - VertexIds []UUID `json:"vertex_ids" yaml:"vertex_ids" schema:"vertex_ids,required"` } // ModelingCmdEdgeID: What is the UUID of this entity's n-th child? @@ -2497,66 +2477,58 @@ type ModelingCmdEdgeID struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdEditModeEnter: Exit edit mode +// ModelingCmdEditModeEnter: Get the number of objects in the scene type ModelingCmdEditModeEnter struct { // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdEntityCircularPattern: Get the surface area of entities in the scene or the default scene. +// ModelingCmdEntityCircularPattern: Get the center of mass of entities in the scene or the default scene. type ModelingCmdEntityCircularPattern struct { - // EntityIds: IDs of the entities to get the surface area of. If this is empty, then the default scene is included in the surface area. + // EntityIds: IDs of the entities to get the center of mass of. If this is empty, then the default scene is included in the center of mass. EntityIds []UUID `json:"entity_ids" yaml:"entity_ids" schema:"entity_ids,required"` - // OutputUnit: The output unit for the surface area. - OutputUnit UnitArea `json:"output_unit" yaml:"output_unit" schema:"output_unit,required"` + // OutputUnit: The output unit for the center of mass. + OutputUnit UnitLength `json:"output_unit" yaml:"output_unit" schema:"output_unit,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdEntityGetAllChildUuids: Query the given path. +// ModelingCmdEntityGetAllChildUuids: Add a gizmo showing the axes. type ModelingCmdEntityGetAllChildUuids struct { - // PathID: Which path to query - PathID UUID `json:"path_id" yaml:"path_id" schema:"path_id,required"` + // Clobber: If true, any existing drawables within the obj will be replaced (the object will be reset) + Clobber bool `json:"clobber" yaml:"clobber" schema:"clobber,required"` + // GizmoMode: If true, axes gizmo will be placed in the corner of the screen. If false, it will be placed at the origin of the scene. + GizmoMode bool `json:"gizmo_mode" yaml:"gizmo_mode" schema:"gizmo_mode,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdEntityGetChildUuid: Take a snapshot of the current view. +// ModelingCmdEntityGetChildUuid: Get control points of the given curve. type ModelingCmdEntityGetChildUuid struct { - // Format: What image format to return. - Format ImageFormat `json:"format" yaml:"format" schema:"format,required"` + // CurveID: Which curve to query. + CurveID UUID `json:"curve_id" yaml:"curve_id" schema:"curve_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdEntityGetDistance: Continue dragging the mouse. +// ModelingCmdEntityGetDistance: Start dragging the mouse. type ModelingCmdEntityGetDistance struct { - // Sequence: Logical timestamp. The client should increment this with every event in the current mouse drag. That way, if the events are being sent over an unordered channel, the API can ignore the older events. - Sequence int `json:"sequence" yaml:"sequence" schema:"sequence"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` // Window: The mouse position. Window Point2D `json:"window" yaml:"window" schema:"window,required"` } -// ModelingCmdEntityGetNumChildren: Set the default system properties used when a specific property isn't set. +// ModelingCmdEntityGetNumChildren: Set the properties of the tool lines for the scene. type ModelingCmdEntityGetNumChildren struct { - // Color: The default system color. + // Color: The color to set the tool line to. Color Color `json:"color" yaml:"color" schema:"color"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdEntityGetParentID: Set the background color of the scene. +// ModelingCmdEntityGetParentID: Sketch on some entity (e.g. a plane, a face). type ModelingCmdEntityGetParentID struct { - // Color: The color to set the background to. - Color Color `json:"color" yaml:"color" schema:"color,required"` - // Type: - Type string `json:"type" yaml:"type" schema:"type,required"` -} - -// ModelingCmdEntityID: Sketch on some entity (e.g. a plane, a face). -type ModelingCmdEntityID struct { // AdjustCamera: Should the camera move at all? AdjustCamera bool `json:"adjust_camera" yaml:"adjust_camera" schema:"adjust_camera,required"` // Animated: Should we animate or snap for the camera transition? @@ -2569,58 +2541,74 @@ type ModelingCmdEntityID struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdEntityId1: Obtain vertex ids for a path +// ModelingCmdEntityID: Get the plane for sketch mode. +type ModelingCmdEntityID struct { + // ConstraintBound: Which constraint to apply. + ConstraintBound PathComponentConstraintBound `json:"constraint_bound" yaml:"constraint_bound" schema:"constraint_bound,required"` + // ConstraintType: What part of the curve should be constrained. + ConstraintType PathComponentConstraintType `json:"constraint_type" yaml:"constraint_type" schema:"constraint_type,required"` + // ObjectID: Which curve to constrain. + ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` + // Type: + Type string `json:"type" yaml:"type" schema:"type,required"` +} + +// ModelingCmdEntityId1: Obtain curve ids for vertex ids type ModelingCmdEntityId1 struct { // PathID: Which path to query PathID UUID `json:"path_id" yaml:"path_id" schema:"path_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` + // VertexIds: IDs of the vertices for which to obtain curve ids from + VertexIds []UUID `json:"vertex_ids" yaml:"vertex_ids" schema:"vertex_ids,required"` } -// ModelingCmdEntityId2: Start dragging the mouse. +// ModelingCmdEntityId2: Obtain vertex ids for a path type ModelingCmdEntityId2 struct { + // PathID: Which path to query + PathID UUID `json:"path_id" yaml:"path_id" schema:"path_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` - // Window: The mouse position. - Window Point2D `json:"window" yaml:"window" schema:"window,required"` } -// ModelingCmdEntityIds: Disable sketch mode. If you are sketching on a face, be sure to not disable sketch mode until you have extruded. Otherwise, your object will not be fused with the face. +// ModelingCmdEntityIds: Enable sketch mode on the given plane. If you want to sketch on a face, use `enable_sketch_mode` instead. type ModelingCmdEntityIds struct { + // Animated: Animate the transition to sketch mode. + Animated bool `json:"animated" yaml:"animated" schema:"animated,required"` + // DisableCameraWithPlane: Disable the camera entirely for sketch mode and sketch on a plane (this would be the normal of that plane). + DisableCameraWithPlane Point3D `json:"disable_camera_with_plane" yaml:"disable_camera_with_plane" schema:"disable_camera_with_plane"` + // Ortho: Use an orthographic camera. + Ortho bool `json:"ortho" yaml:"ortho" schema:"ortho,required"` + // PlaneID: Sketch on this plane. + PlaneID UUID `json:"plane_id" yaml:"plane_id" schema:"plane_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdEntityLinearPattern: Reconfigure the stream. +// ModelingCmdEntityLinearPattern: Find the start and end of a curve. type ModelingCmdEntityLinearPattern struct { - // Fps: Frames per second. - Fps int `json:"fps" yaml:"fps" schema:"fps,required"` - // Height: Height of the stream. - Height int `json:"height" yaml:"height" schema:"height,required"` + // CurveID: ID of the curve being queried. + CurveID UUID `json:"curve_id" yaml:"curve_id" schema:"curve_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` - // Width: Width of the stream. - Width int `json:"width" yaml:"width" schema:"width,required"` } -// ModelingCmdEntityMakeHelix: Fit the view to the specified object(s). +// ModelingCmdEntityMakeHelix: Use perspective projection. type ModelingCmdEntityMakeHelix struct { - // ObjectIds: Which objects to fit to - ObjectIds []UUID `json:"object_ids" yaml:"object_ids" schema:"object_ids"` - // Padding: How much to pad the view frame by. - Padding float64 `json:"padding" yaml:"padding" schema:"padding,required"` + // Parameters: If this is not given, use the same parameters as last time the perspective camera was used. + Parameters PerspectiveCameraParameters `json:"parameters" yaml:"parameters" schema:"parameters"` + // Type: + Type string `json:"type" yaml:"type" schema:"type,required"` +} + +// ModelingCmdEntityMirror: Clear the selection +type ModelingCmdEntityMirror struct { // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } // ModelingCmdExport: Get the plane for sketch mode. type ModelingCmdExport struct { - // ConstraintBound: Which constraint to apply. - ConstraintBound PathComponentConstraintBound `json:"constraint_bound" yaml:"constraint_bound" schema:"constraint_bound,required"` - // ConstraintType: What part of the curve should be constrained. - ConstraintType PathComponentConstraintType `json:"constraint_type" yaml:"constraint_type" schema:"constraint_type,required"` - // ObjectID: Which curve to constrain. - ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } @@ -2639,49 +2627,61 @@ type ModelingCmdExtrude struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdFormat: Get the plane for sketch mode. +// ModelingCmdFormat: Disable sketch mode. If you are sketching on a face, be sure to not disable sketch mode until you have extruded. Otherwise, your object will not be fused with the face. type ModelingCmdFormat struct { // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdFovY: Gets all edges which are opposite the given edge, across all possible faces. +// ModelingCmdFovY: Add a hole to a Solid2d object before extruding it. type ModelingCmdFovY struct { - // AlongVector: If given, only faces parallel to this vector will be considered. - AlongVector Point3D `json:"along_vector" yaml:"along_vector" schema:"along_vector"` - // EdgeID: Which edge you want the opposites of. + // HoleID: The id of the path to use as the inner profile (hole). + HoleID UUID `json:"hole_id" yaml:"hole_id" schema:"hole_id,required"` + // ObjectID: Which object to add the hole to. + ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` + // Type: + Type string `json:"type" yaml:"type" schema:"type,required"` +} + +// ModelingCmdIds: Get a concise description of all of an extrusion's faces. +type ModelingCmdIds struct { + // EdgeID: Any edge that lies on the extrusion base path. EdgeID UUID `json:"edge_id" yaml:"edge_id" schema:"edge_id,required"` - // ObjectID: Which object is being queried. + // ObjectID: The Solid3d object whose extrusion is being queried. ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdInteraction: Enter edit mode +// ModelingCmdInteraction: Mirror the input entities over the specified axis. (Currently only supports sketches) type ModelingCmdInteraction struct { - // Target: The edit target - Target UUID `json:"target" yaml:"target" schema:"target,required"` + // Axis: Axis to use as mirror. + Axis Point3D `json:"axis" yaml:"axis" schema:"axis,required"` + // Ids: ID of the mirror entities. + Ids []UUID `json:"ids" yaml:"ids" schema:"ids,required"` + // Point: Point through which the mirror axis passes. + Point Point3D `json:"point" yaml:"point" schema:"point,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdIsClockwise: When you select some entity with the current tool, what should happen to the entity? +// ModelingCmdIsClockwise: Focus the default camera upon an object in the scene. type ModelingCmdIsClockwise struct { - // SelectionType: What type of selection should occur when you select something? - SelectionType SceneSelectionType `json:"selection_type" yaml:"selection_type" schema:"selection_type,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` + // Uuid: UUID of object to focus on. + Uuid UUID `json:"uuid" yaml:"uuid" schema:"uuid,required"` } -// ModelingCmdLength: What kind of entities can be selected? +// ModelingCmdLength: When you select some entity with the current tool, what should happen to the entity? type ModelingCmdLength struct { - // Filter: If vector is empty, clear all filters. If vector is non-empty, only the given entity types will be selectable. - Filter []EntityType `json:"filter" yaml:"filter" schema:"filter,required"` + // SelectionType: What type of selection should occur when you select something? + SelectionType SceneSelectionType `json:"selection_type" yaml:"selection_type" schema:"selection_type,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdMagnitude: Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v +// ModelingCmdMagnitude: Determines a position on a brep face evaluated by parameters u,v type ModelingCmdMagnitude struct { // ObjectID: Which face is being queried. ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` @@ -2699,16 +2699,26 @@ type ModelingCmdModelingCmdAngle struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdModelingCmdAxis: Set the units of the scene. For all following commands, the units will be interpreted as the given units. +// ModelingCmdModelingCmdAxis: Fit the view to the specified object(s). type ModelingCmdModelingCmdAxis struct { + // ObjectIds: Which objects to fit camera to; if empty, fit to all non-default objects. Defaults to empty vector. + ObjectIds []UUID `json:"object_ids" yaml:"object_ids" schema:"object_ids"` + // Padding: How much to pad the view frame by. + Padding float64 `json:"padding" yaml:"padding" schema:"padding,required"` + // Type: + Type string `json:"type" yaml:"type" schema:"type,required"` +} + +// ModelingCmdModelingCmdCenter: Set the units of the scene. For all following commands, the units will be interpreted as the given units. +type ModelingCmdModelingCmdCenter struct { // Type: Type string `json:"type" yaml:"type" schema:"type,required"` // Unit: Which units the scene uses. Unit UnitLength `json:"unit" yaml:"unit" schema:"unit,required"` } -// ModelingCmdModelingCmdCenter: Get the mass of entities in the scene or the default scene. -type ModelingCmdModelingCmdCenter struct { +// ModelingCmdModelingCmdEntityID: Get the mass of entities in the scene or the default scene. +type ModelingCmdModelingCmdEntityID struct { // EntityIds: IDs of the entities to get the mass of. If this is empty, then the default scene is included in the mass. EntityIds []UUID `json:"entity_ids" yaml:"entity_ids" schema:"entity_ids,required"` // MaterialDensity: The material density. @@ -2721,8 +2731,18 @@ type ModelingCmdModelingCmdCenter struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdModelingCmdEntityID: Get the density of entities in the scene or the default scene. -type ModelingCmdModelingCmdEntityID struct { +// ModelingCmdModelingCmdInteraction: 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. +type ModelingCmdModelingCmdInteraction struct { + // SelectedAtWindow: Coordinates of the window being clicked + SelectedAtWindow Point2D `json:"selected_at_window" yaml:"selected_at_window" schema:"selected_at_window,required"` + // Sequence: Logical timestamp. The client should increment this with every event in the current mouse drag. That way, if the events are being sent over an unordered channel, the API can ignore the older events. + Sequence int `json:"sequence" yaml:"sequence" schema:"sequence"` + // Type: + Type string `json:"type" yaml:"type" schema:"type,required"` +} + +// ModelingCmdModelingCmdNumRepetitions: Get the density of entities in the scene or the default scene. +type ModelingCmdModelingCmdNumRepetitions struct { // EntityIds: IDs of the entities to get the density of. If this is empty, then the default scene is included in the density. EntityIds []UUID `json:"entity_ids" yaml:"entity_ids" schema:"entity_ids,required"` // MaterialMass: The material mass. @@ -2735,40 +2755,16 @@ type ModelingCmdModelingCmdEntityID struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdModelingCmdInteraction: Changes the current highlighted entity to these entities. -type ModelingCmdModelingCmdInteraction struct { - // Entities: Highlight these entities. - Entities []UUID `json:"entities" yaml:"entities" schema:"entities,required"` - // Type: - Type string `json:"type" yaml:"type" schema:"type,required"` -} - -// ModelingCmdModelingCmdNumRepetitions: Get the volume of entities in the scene or the default scene. -type ModelingCmdModelingCmdNumRepetitions struct { - // EntityIds: IDs of the entities to get the volume of. If this is empty, then the default scene is included in the volume. - EntityIds []UUID `json:"entity_ids" yaml:"entity_ids" schema:"entity_ids,required"` - // OutputUnit: The output unit for the volume. - OutputUnit UnitVolume `json:"output_unit" yaml:"output_unit" schema:"output_unit,required"` - // Type: - Type string `json:"type" yaml:"type" schema:"type,required"` -} - -// ModelingCmdModelingCmdOrigin: Make a new plane +// ModelingCmdModelingCmdOrigin: Fade entity in or out. type ModelingCmdModelingCmdOrigin struct { - // Clobber: If true, any existing drawables within the obj will be replaced (the object will be reset) - Clobber bool `json:"clobber" yaml:"clobber" schema:"clobber,required"` - // Hide: If true, the plane will be created but hidden initially. - Hide bool `json:"hide" yaml:"hide" schema:"hide"` - // Origin: Origin of the plane - Origin Point3D `json:"origin" yaml:"origin" schema:"origin,required"` - // Size: What should the plane's span/extent? When rendered visually, this is both the width and height along X and Y axis respectively. - Size float64 `json:"size" yaml:"size" schema:"size,required"` + // DurationSeconds: How many seconds the animation should take. + DurationSeconds float64 `json:"duration_seconds" yaml:"duration_seconds" schema:"duration_seconds"` + // EntityID: Which entity is being changed. + EntityID UUID `json:"entity_id" yaml:"entity_id" schema:"entity_id,required"` + // FadeIn: Fade in = true, fade out = false. + FadeIn bool `json:"fade_in" yaml:"fade_in" schema:"fade_in,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` - // XAxis: What should the plane's X axis be? - XAxis Point3D `json:"x_axis" yaml:"x_axis" schema:"x_axis,required"` - // YAxis: What should the plane's Y axis be? - YAxis Point3D `json:"y_axis" yaml:"y_axis" schema:"y_axis,required"` } // ModelingCmdModelingCmdPath: Command for revolving a solid 2d. @@ -2789,24 +2785,20 @@ type ModelingCmdModelingCmdPath struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdModelingCmdSequence: Gets the edge opposite the given edge, along the given face. +// ModelingCmdModelingCmdSequence: Gets all edges which are opposite the given edge, across all possible faces. type ModelingCmdModelingCmdSequence struct { - // EdgeID: Which edge you want the opposite of. + // AlongVector: If given, only faces parallel to this vector will be considered. + AlongVector Point3D `json:"along_vector" yaml:"along_vector" schema:"along_vector"` + // EdgeID: Which edge you want the opposites of. EdgeID UUID `json:"edge_id" yaml:"edge_id" schema:"edge_id,required"` - // FaceID: Which face is used to figure out the opposite edge? - FaceID UUID `json:"face_id" yaml:"face_id" schema:"face_id,required"` // ObjectID: Which object is being queried. ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdModelingCmdTarget: Get a concise description of all of an extrusion's faces. +// ModelingCmdModelingCmdTarget: Find all IDs of selected entities type ModelingCmdModelingCmdTarget struct { - // EdgeID: Any edge that lies on the extrusion base path. - EdgeID UUID `json:"edge_id" yaml:"edge_id" schema:"edge_id,required"` - // ObjectID: The Solid3d object whose extrusion is being queried. - ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } @@ -2823,7 +2815,7 @@ type ModelingCmdModelingCmdTolerance struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdModelingCmdUp: Gets the previous adjacent edge for the given edge, along the given face. +// ModelingCmdModelingCmdUp: Gets the next adjacent edge for the given edge, along the given face. type ModelingCmdModelingCmdUp struct { // EdgeID: Which edge you want the opposite of. EdgeID UUID `json:"edge_id" yaml:"edge_id" schema:"edge_id,required"` @@ -2835,25 +2827,25 @@ type ModelingCmdModelingCmdUp struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdModelingCmdVantage: Fillets the given edge with the specified radius. +// ModelingCmdModelingCmdVantage: Gets the previous adjacent edge for the given edge, along the given face. type ModelingCmdModelingCmdVantage struct { - // EdgeID: Which edge you want to fillet. + // EdgeID: Which edge you want the opposite of. EdgeID UUID `json:"edge_id" yaml:"edge_id" schema:"edge_id,required"` - // ObjectID: Which object is being filletted. + // FaceID: Which face is used to figure out the opposite edge? + FaceID UUID `json:"face_id" yaml:"face_id" schema:"face_id,required"` + // ObjectID: Which object is being queried. ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` - // Radius: The radius of the fillet. Measured in length (using the same units that the current sketch uses). Must be positive (i.e. greater than zero). - Radius float64 `json:"radius" yaml:"radius" schema:"radius,required"` - // Tolerance: The maximum acceptable surface gap computed between the filleted surfaces. Must be positive (i.e. greater than zero). - Tolerance float64 `json:"tolerance" yaml:"tolerance" schema:"tolerance,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdModelingCmdWindow: Update an annotation +// ModelingCmdModelingCmdWindow: Create a new annotation type ModelingCmdModelingCmdWindow struct { - // AnnotationID: Which annotation to update - AnnotationID UUID `json:"annotation_id" yaml:"annotation_id" schema:"annotation_id,required"` - // Options: If any of these fields are set, they will overwrite the previous options for the annotation. + // AnnotationType: What type of annotation to create. + AnnotationType AnnotationType `json:"annotation_type" yaml:"annotation_type" schema:"annotation_type,required"` + // Clobber: If true, any existing drawables within the obj will be replaced (the object will be reset) + Clobber bool `json:"clobber" yaml:"clobber" schema:"clobber,required"` + // Options: What should the annotation contain? Options AnnotationOptions `json:"options" yaml:"options" schema:"options,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` @@ -2871,14 +2863,12 @@ type ModelingCmdMovePathPen struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdNumRepetitions: Utility method. Performs both a ray cast and projection to plane-local coordinates. Returns the plane coordinates for the given window coordinates. +// ModelingCmdNumRepetitions: Remove scene objects. type ModelingCmdNumRepetitions struct { - // PlaneID: The plane you're intersecting against. - PlaneID UUID `json:"plane_id" yaml:"plane_id" schema:"plane_id,required"` + // ObjectIds: Objects to remove. + ObjectIds []UUID `json:"object_ids" yaml:"object_ids" schema:"object_ids,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` - // Window: Window coordinates where the ray cast should be aimed. - Window Point2D `json:"window" yaml:"window" schema:"window,required"` } // ModelingCmdOrigin: Enable sketch mode, where users can sketch 2D geometry. Users choose a plane to sketch on. @@ -2899,14 +2889,22 @@ type ModelingCmdOrigin struct { YAxis Point3D `json:"y_axis" yaml:"y_axis" schema:"y_axis,required"` } -// ModelingCmdOrtho: Set the color of a plane. +// ModelingCmdOrtho: Make a new plane type ModelingCmdOrtho struct { - // Color: What color it should be. - Color Color `json:"color" yaml:"color" schema:"color,required"` - // PlaneID: Which plane is being changed. - PlaneID UUID `json:"plane_id" yaml:"plane_id" schema:"plane_id,required"` + // Clobber: If true, any existing drawables within the obj will be replaced (the object will be reset) + Clobber bool `json:"clobber" yaml:"clobber" schema:"clobber,required"` + // Hide: If true, the plane will be created but hidden initially. + Hide bool `json:"hide" yaml:"hide" schema:"hide"` + // Origin: Origin of the plane + Origin Point3D `json:"origin" yaml:"origin" schema:"origin,required"` + // Size: What should the plane's span/extent? When rendered visually, this is both the width and height along X and Y axis respectively. + Size float64 `json:"size" yaml:"size" schema:"size,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` + // XAxis: What should the plane's X axis be? + XAxis Point3D `json:"x_axis" yaml:"x_axis" schema:"x_axis,required"` + // YAxis: What should the plane's Y axis be? + YAxis Point3D `json:"y_axis" yaml:"y_axis" schema:"y_axis,required"` } // ModelingCmdPath: Move the path's "pen". @@ -2937,6 +2935,12 @@ type ModelingCmdPathID struct { Type string `json:"type" yaml:"type" schema:"type,required"` } +// ModelingCmdPoint: Exit edit mode +type ModelingCmdPoint struct { + // Type: + Type string `json:"type" yaml:"type" schema:"type,required"` +} + // ModelingCmdReq: A graphics command submitted to the KittyCAD engine via the Modeling API. type ModelingCmdReq struct { // Cmd: Which command to submit to the Kittycad engine. @@ -2945,8 +2949,10 @@ type ModelingCmdReq struct { CmdID UUID `json:"cmd_id" yaml:"cmd_id" schema:"cmd_id,required"` } -// ModelingCmdRevolutions: Use orthographic projection. +// ModelingCmdRevolutions: What kind of entities can be selected? type ModelingCmdRevolutions struct { + // Filter: If vector is empty, clear all filters. If vector is non-empty, only the given entity types will be selectable. + Filter []EntityType `json:"filter" yaml:"filter" schema:"filter,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } @@ -2973,12 +2979,12 @@ type ModelingCmdRevolveAboutEdge struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdRotateDuplicates: Get the center of mass of entities in the scene or the default scene. +// ModelingCmdRotateDuplicates: Get the volume of entities in the scene or the default scene. type ModelingCmdRotateDuplicates struct { - // EntityIds: IDs of the entities to get the center of mass of. If this is empty, then the default scene is included in the center of mass. + // EntityIds: IDs of the entities to get the volume of. If this is empty, then the default scene is included in the volume. EntityIds []UUID `json:"entity_ids" yaml:"entity_ids" schema:"entity_ids,required"` - // OutputUnit: The output unit for the center of mass. - OutputUnit UnitLength `json:"output_unit" yaml:"output_unit" schema:"output_unit,required"` + // OutputUnit: The output unit for the volume. + OutputUnit UnitVolume `json:"output_unit" yaml:"output_unit" schema:"output_unit,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } @@ -2997,42 +3003,26 @@ type ModelingCmdSegment struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdSelectWithPoint: Get the number of objects in the scene -type ModelingCmdSelectWithPoint struct { - // Type: - Type string `json:"type" yaml:"type" schema:"type,required"` -} - -// ModelingCmdSelectedAtWindow: Clear the selection -type ModelingCmdSelectedAtWindow struct { - // Type: - Type string `json:"type" yaml:"type" schema:"type,required"` -} - -// ModelingCmdSelectionType: Find all IDs of selected entities -type ModelingCmdSelectionType struct { - // Type: - Type string `json:"type" yaml:"type" schema:"type,required"` -} - -// ModelingCmdSequence: Removes all of the Objects in the scene +// ModelingCmdSequence: Removes one or more entities (by UUID) from the selection. type ModelingCmdSequence struct { + // Entities: Which entities to unselect + Entities []UUID `json:"entities" yaml:"entities" schema:"entities,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdSpacing: Find the start and end of a curve. +// ModelingCmdSpacing: Utility method. Performs both a ray cast and projection to plane-local coordinates. Returns the plane coordinates for the given window coordinates. type ModelingCmdSpacing struct { - // CurveID: ID of the curve being queried. - CurveID UUID `json:"curve_id" yaml:"curve_id" schema:"curve_id,required"` + // PlaneID: The plane you're intersecting against. + PlaneID UUID `json:"plane_id" yaml:"plane_id" schema:"plane_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` + // Window: Window coordinates where the ray cast should be aimed. + Window Point2D `json:"window" yaml:"window" schema:"window,required"` } -// ModelingCmdStartAngle: Use perspective projection. +// ModelingCmdStartAngle: Use orthographic projection. type ModelingCmdStartAngle struct { - // Parameters: If this is not given, use the same parameters as last time the perspective camera was used. - Parameters PerspectiveCameraParameters `json:"parameters" yaml:"parameters" schema:"parameters"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } @@ -3073,66 +3063,78 @@ type ModelingCmdTolerance struct { Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdUp: What type of entity is this? +// ModelingCmdUp: Set the material properties of an object type ModelingCmdUp struct { - // EntityID: ID of the entity being queried. - EntityID UUID `json:"entity_id" yaml:"entity_id" schema:"entity_id,required"` + // AmbientOcclusion: Ambient Occlusion of the new material + AmbientOcclusion float64 `json:"ambient_occlusion" yaml:"ambient_occlusion" schema:"ambient_occlusion,required"` + // Color: Color of the new material + Color Color `json:"color" yaml:"color" schema:"color,required"` + // Metalness: Metalness of the new material + Metalness float64 `json:"metalness" yaml:"metalness" schema:"metalness,required"` + // ObjectID: Which object to change + ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` + // Roughness: Roughness of the new material + Roughness float64 `json:"roughness" yaml:"roughness" schema:"roughness,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdVantage: Gets all faces which use the given edge. +// ModelingCmdVantage: What type of entity is this? type ModelingCmdVantage struct { - // EdgeID: Which edge you want the faces of. - EdgeID UUID `json:"edge_id" yaml:"edge_id" schema:"edge_id,required"` - // ObjectID: Which object is being queried. - ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` + // EntityID: ID of the entity being queried. + EntityID UUID `json:"entity_id" yaml:"entity_id" schema:"entity_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdWindow: Adds one or more entities (by UUID) to the selection. +// ModelingCmdWindow: Modifies the selection by simulating a "mouse click" at the given x,y window coordinate Returns ID of whatever was selected. type ModelingCmdWindow struct { - // Entities: Which entities to select - Entities []UUID `json:"entities" yaml:"entities" schema:"entities,required"` + // SelectedAtWindow: Where in the window was selected + SelectedAtWindow Point2D `json:"selected_at_window" yaml:"selected_at_window" schema:"selected_at_window,required"` + // SelectionType: What entity was selected? + SelectionType SceneSelectionType `json:"selection_type" yaml:"selection_type" schema:"selection_type,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdXaxis: Send a mouse move event +// ModelingCmdXaxis: Set the current tool. type ModelingCmdXaxis struct { - // Sequence: Logical timestamp. The client should increment this with every event in the current mouse drag. That way, if the events are being sent over an unordered channel, the API can ignore the older events. - Sequence int `json:"sequence" yaml:"sequence" schema:"sequence"` + // Tool: What tool should be active. + Tool SceneToolType `json:"tool" yaml:"tool" schema:"tool,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` - // Window: Where the mouse is - Window Point2D `json:"window" yaml:"window" schema:"window,required"` } -// ModelingCmdYaxis: Send a mouse click event Updates modified/selected entities. +// ModelingCmdYaxis: Send a mouse move event type ModelingCmdYaxis struct { + // Sequence: Logical timestamp. The client should increment this with every event in the current mouse drag. That way, if the events are being sent over an unordered channel, the API can ignore the older events. + Sequence int `json:"sequence" yaml:"sequence" schema:"sequence"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` // Window: Where the mouse is Window Point2D `json:"window" yaml:"window" schema:"window,required"` } -// ModelingCmdZfar: Determines whether a brep face is planar and returns its surface-local planar axes if so +// ModelingCmdZfar: Fillets the given edge with the specified radius. type ModelingCmdZfar struct { - // ObjectID: Which face is being queried. + // EdgeID: Which edge you want to fillet. + EdgeID UUID `json:"edge_id" yaml:"edge_id" schema:"edge_id,required"` + // ObjectID: Which object is being filletted. ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` + // Radius: The radius of the fillet. Measured in length (using the same units that the current sketch uses). Must be positive (i.e. greater than zero). + Radius float64 `json:"radius" yaml:"radius" schema:"radius,required"` + // Tolerance: The maximum acceptable surface gap computed between the filleted surfaces. Must be positive (i.e. greater than zero). + Tolerance float64 `json:"tolerance" yaml:"tolerance" schema:"tolerance,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` } -// ModelingCmdZnear: Determines a position on a brep face evaluated by parameters u,v +// ModelingCmdZnear: Determines whether a brep face is planar and returns its surface-local planar axes if so type ModelingCmdZnear struct { // ObjectID: Which face is being queried. ObjectID UUID `json:"object_id" yaml:"object_id" schema:"object_id,required"` // Type: Type string `json:"type" yaml:"type" schema:"type,required"` - // Uv: The 2D paramter-space u,v position to evaluate the surface at - Uv Point2D `json:"uv" yaml:"uv" schema:"uv,required"` } // MouseClick: The response from the `MouseClick` command.