Compare commits

..

21 Commits

Author SHA1 Message Date
24171eea43 Update api spec (#233)
* YOYO NEW API SPEC!

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* I have generated the latest API!

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Jess Frazelle <github@jessfraz.com>
2024-07-03 21:24:03 -07:00
a008a9d1aa Update api spec (#232)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-07-01 11:23:48 -07:00
5011954847 updates
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-23 21:02:23 -07:00
2c7445c5a6 bump
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-06-23 20:58:46 -07:00
bf5e3e1839 Update api spec (#231)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-21 18:46:02 -07:00
f80767454a Update api spec (#229)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-20 11:10:00 -07:00
bfb243c233 Update api spec (#228)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-17 07:50:42 -07:00
e0209e29d6 Update api spec (#227)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-05 18:40:25 -07:00
213c4d681c Update api spec (#226)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-06-04 09:38:51 -07:00
60c42befdf Update api spec (#225)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-23 14:05:38 -07:00
d31d9507d2 Update api spec (#221)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-19 22:16:13 -07:00
ca84069e9a Update api spec (#220)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-16 12:09:12 -07:00
dd2e3848cc Update api spec (#219)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-08 15:02:59 -07:00
8c56b88113 Update api spec (#218)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-03 12:11:18 -07:00
cc0bb86a53 Update api spec (#217)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-05-02 14:03:09 -07:00
b3eeaef41d bump
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-04-22 13:43:15 -07:00
0ac4e4c9c0 Update api spec (#216)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-22 13:41:53 -07:00
35bbe91eb4 bump tag
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-04-22 11:39:19 -07:00
b4ce8e9642 Update api spec (#215)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-22 11:10:19 -07:00
479cf6a937 Update api spec (#214)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-18 14:44:34 -07:00
acea57bcba Update api spec (#213)
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2024-04-17 09:49:04 -07:00
25 changed files with 1695 additions and 988 deletions

View File

@ -20,7 +20,7 @@ poetry run python generate/generate.py
# Format and lint.
poetry run isort .
poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py
poetry run black . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py kittycad/models/*.py kittycad/api/*.py kittycad/api/*/*.py
poetry run ruff check --fix .
poetry run mypy . || true

File diff suppressed because it is too large Load Diff

View File

@ -14,6 +14,7 @@ from ...models.web_socket_response import WebSocketResponse
def _get_kwargs(
fps: int,
post_effect: PostEffectType,
show_grid: bool,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
@ -45,6 +46,13 @@ def _get_kwargs(
else:
url = url + "?post_effect=" + str(post_effect)
if show_grid is not None:
if "?" in url:
url = url + "&show_grid=" + str(show_grid).lower()
else:
url = url + "?show_grid=" + str(show_grid).lower()
if unlocked_framerate is not None:
if "?" in url:
@ -87,6 +95,7 @@ def _get_kwargs(
def sync(
fps: int,
post_effect: PostEffectType,
show_grid: bool,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
@ -101,6 +110,7 @@ def sync(
fps=fps,
pool=pool,
post_effect=post_effect,
show_grid=show_grid,
unlocked_framerate=unlocked_framerate,
video_res_height=video_res_height,
video_res_width=video_res_width,
@ -114,6 +124,7 @@ def sync(
async def asyncio(
fps: int,
post_effect: PostEffectType,
show_grid: bool,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
@ -128,6 +139,7 @@ async def asyncio(
fps=fps,
pool=pool,
post_effect=post_effect,
show_grid=show_grid,
unlocked_framerate=unlocked_framerate,
video_res_height=video_res_height,
video_res_width=video_res_width,
@ -152,6 +164,7 @@ class WebSocket:
self,
fps: int,
post_effect: PostEffectType,
show_grid: bool,
unlocked_framerate: bool,
video_res_height: int,
video_res_width: int,
@ -162,6 +175,7 @@ class WebSocket:
self.ws = sync(
fps,
post_effect,
show_grid,
unlocked_framerate,
video_res_height,
video_res_width,

View File

@ -357,6 +357,7 @@ def test_ws_simple():
with modeling_commands_ws.WebSocket(
client=client,
fps=30,
show_grid=False,
post_effect=PostEffectType.NOEFFECT,
unlocked_framerate=False,
video_res_height=360,
@ -386,6 +387,7 @@ def test_ws_import():
client=client,
fps=30,
post_effect=PostEffectType.NOEFFECT,
show_grid=False,
unlocked_framerate=False,
video_res_height=360,
video_res_width=480,

View File

@ -6808,6 +6808,7 @@ def test_modeling_commands_ws():
client=client,
fps=10,
post_effect=PostEffectType.PHOSPHOR,
show_grid=False,
unlocked_framerate=False,
video_res_height=10,
video_res_width=10,
@ -6844,6 +6845,7 @@ async def test_modeling_commands_ws_async():
client=client,
fps=10,
post_effect=PostEffectType.PHOSPHOR,
show_grid=False,
unlocked_framerate=False,
video_res_height=10,
video_res_width=10,

View File

@ -42,6 +42,7 @@ from .camera_settings import CameraSettings
from .card_details import CardDetails
from .center_of_mass import CenterOfMass
from .client_metrics import ClientMetrics
from .close_path import ClosePath
from .cluster import Cluster
from .code_language import CodeLanguage
from .code_output import CodeOutput
@ -57,6 +58,7 @@ from .curve_get_type import CurveGetType
from .curve_type import CurveType
from .customer import Customer
from .customer_balance import CustomerBalance
from .cut_type import CutType
from .default_camera_focus_on import DefaultCameraFocusOn
from .default_camera_get_settings import DefaultCameraGetSettings
from .default_camera_zoom import DefaultCameraZoom
@ -78,6 +80,7 @@ from .entity_get_distance import EntityGetDistance
from .entity_get_num_children import EntityGetNumChildren
from .entity_get_parent_id import EntityGetParentId
from .entity_linear_pattern import EntityLinearPattern
from .entity_linear_pattern_transform import EntityLinearPatternTransform
from .entity_type import EntityType
from .environment import Environment
from .error import Error
@ -89,6 +92,7 @@ from .extended_user import ExtendedUser
from .extended_user_results_page import ExtendedUserResultsPage
from .extrusion_face_cap_type import ExtrusionFaceCapType
from .extrusion_face_info import ExtrusionFaceInfo
from .face_get_center import FaceGetCenter
from .face_get_gradient import FaceGetGradient
from .face_get_position import FaceGetPosition
from .face_is_planar import FaceIsPlanar
@ -131,6 +135,7 @@ from .kcl_code_completion_request import KclCodeCompletionRequest
from .kcl_code_completion_response import KclCodeCompletionResponse
from .leaf_node import LeafNode
from .length_unit import LengthUnit
from .linear_transform import LinearTransform
from .mass import Mass
from .meta_cluster_info import MetaClusterInfo
from .metadata import Metadata
@ -179,6 +184,7 @@ from .plane_intersect_and_project import PlaneIntersectAndProject
from .ply_storage import PlyStorage
from .point2d import Point2d
from .point3d import Point3d
from .point4d import Point4d
from .pong import Pong
from .post_effect_type import PostEffectType
from .privacy_settings import PrivacySettings
@ -252,6 +258,7 @@ from .user_org_role import UserOrgRole
from .user_results_page import UserResultsPage
from .uuid import Uuid
from .verification_token_response import VerificationTokenResponse
from .view_isometric import ViewIsometric
from .volume import Volume
from .web_socket_request import WebSocketRequest
from .web_socket_response import WebSocketResponse
@ -260,3 +267,4 @@ from .zoo_product_subscriptions import ZooProductSubscriptions
from .zoo_product_subscriptions_org_request import ZooProductSubscriptionsOrgRequest
from .zoo_product_subscriptions_user_request import ZooProductSubscriptionsUserRequest
from .zoo_tool import ZooTool
from .zoom_to_fit import ZoomToFit

View File

@ -3,6 +3,7 @@ from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.point3d import Point3d
from ..models.point4d import Point4d
class CameraSettings(BaseModel):
@ -12,6 +13,8 @@ class CameraSettings(BaseModel):
fov_y: Optional[float] = None
orientation: Point4d
ortho: bool
ortho_scale: Optional[float] = None

View File

@ -0,0 +1,11 @@
from pydantic import BaseModel, ConfigDict
class ClosePath(BaseModel):
"""The response from the `ClosePath` command."""
face_id: str
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,13 @@
from enum import Enum
class CutType(str, Enum):
"""What kind of cut to do""" # noqa: E501
"""# Round off an edge. """ # noqa: E501
FILLET = "fillet"
"""# Cut away an edge. """ # noqa: E501
CHAMFER = "chamfer"
def __str__(self) -> str:
return str(self.value)

View File

@ -0,0 +1,12 @@
from typing import List
from pydantic import BaseModel, ConfigDict
class EntityLinearPatternTransform(BaseModel):
"""The response from the `EntityLinearPatternTransform` command."""
entity_ids: List[str]
model_config = ConfigDict(protected_namespaces=())

View File

@ -10,6 +10,10 @@ class ErrorCode(str, Enum):
INTERNAL_API = "internal_api"
"""# User requested something geometrically or graphically impossible. Don't retry this request, as it's inherently impossible. Instead, read the error message and change your request. """ # noqa: E501
BAD_REQUEST = "bad_request"
"""# Auth token is missing from the request """ # noqa: E501
AUTH_TOKEN_MISSING = "auth_token_missing"
"""# Auth token is invalid in some way (expired, incorrect format, etc) """ # noqa: E501
AUTH_TOKEN_INVALID = "auth_token_invalid"
"""# Client sent invalid JSON. """ # noqa: E501
INVALID_JSON = "invalid_json"
"""# Client sent invalid BSON. """ # noqa: E501

View File

@ -0,0 +1,12 @@
from pydantic import BaseModel, ConfigDict
from ..models.point3d import Point3d
class FaceGetCenter(BaseModel):
"""The 3D center of mass on the surface"""
pos: Point3d
model_config = ConfigDict(protected_namespaces=())

View File

@ -7,6 +7,8 @@ from ..models.point3d import Point3d
class GetSketchModePlane(BaseModel):
"""The plane for sketch mode."""
origin: Point3d
x_axis: Point3d
y_axis: Point3d

View File

@ -0,0 +1,17 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
from ..models.point3d import Point3d
class LinearTransform(BaseModel):
"""Ways to transform each solid being replicated in a repeating pattern."""
replicate: Optional[bool] = None
scale: Optional[Point3d] = None
translate: Optional[Point3d] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -8,12 +8,14 @@ from ..models.annotation_options import AnnotationOptions
from ..models.annotation_type import AnnotationType
from ..models.camera_drag_interaction_type import CameraDragInteractionType
from ..models.color import Color
from ..models.cut_type import CutType
from ..models.distance_type import DistanceType
from ..models.entity_type import EntityType
from ..models.image_format import ImageFormat
from ..models.import_file import ImportFile
from ..models.input_format import InputFormat
from ..models.length_unit import LengthUnit
from ..models.linear_transform import LinearTransform
from ..models.modeling_cmd_id import ModelingCmdId
from ..models.output_format import OutputFormat
from ..models.path_component_constraint_bound import PathComponentConstraintBound
@ -97,6 +99,20 @@ class revolve(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class solid3d_shell_face(BaseModel):
"""Command for revolving a solid 2d."""
face_ids: List[str]
object_id: str
shell_thickness: LengthUnit
type: Literal["solid3d_shell_face"] = "solid3d_shell_face"
model_config = ConfigDict(protected_namespaces=())
class revolve_about_edge(BaseModel):
"""Command for revolving a solid 2d about a brep edge"""
@ -190,7 +206,7 @@ class default_camera_perspective_settings(BaseModel):
center: Point3d
fov_y: float
fov_y: Optional[float] = None
sequence: Optional[int] = None
@ -202,9 +218,9 @@ class default_camera_perspective_settings(BaseModel):
vantage: Point3d
z_far: float
z_far: Optional[float] = None
z_near: float
z_near: Optional[float] = None
model_config = ConfigDict(protected_namespaces=())
@ -219,38 +235,6 @@ class default_camera_zoom(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class default_camera_enable_sketch_mode(BaseModel):
"""Enable sketch mode, where users can sketch 2D geometry. Users choose a plane to sketch on."""
animated: bool
distance_to_plane: float
origin: Point3d
ortho: bool
type: Literal["default_camera_enable_sketch_mode"] = (
"default_camera_enable_sketch_mode"
)
x_axis: Point3d
y_axis: Point3d
model_config = ConfigDict(protected_namespaces=())
class default_camera_disable_sketch_mode(BaseModel):
"""Disable sketch mode, from the default camera."""
type: Literal["default_camera_disable_sketch_mode"] = (
"default_camera_disable_sketch_mode"
)
model_config = ConfigDict(protected_namespaces=())
class export(BaseModel):
"""Export the scene to a file."""
@ -319,6 +303,18 @@ class entity_get_distance(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_linear_pattern_transform(BaseModel):
"""Create a linear pattern using this entity."""
entity_id: str
transform: List[LinearTransform]
type: Literal["entity_linear_pattern_transform"] = "entity_linear_pattern_transform"
model_config = ConfigDict(protected_namespaces=())
class entity_linear_pattern(BaseModel):
"""Create a linear pattern using this entity."""
@ -373,6 +369,20 @@ class entity_make_helix(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_mirror(BaseModel):
"""Mirror the input entities over the specified axis. (Currently only supports sketches)"""
axis: Point3d
ids: List[str]
point: Point3d
type: Literal["entity_mirror"] = "entity_mirror"
model_config = ConfigDict(protected_namespaces=())
class edit_mode_enter(BaseModel):
"""Enter edit mode"""
@ -481,6 +491,16 @@ class update_annotation(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class edge_lines_visible(BaseModel):
"""Changes visibility of scene-wide edge lines on brep solids"""
hidden: bool
type: Literal["edge_lines_visible"] = "edge_lines_visible"
model_config = ConfigDict(protected_namespaces=())
class object_visible(BaseModel):
"""Hide or show an object"""
@ -614,6 +634,8 @@ class solid3d_get_prev_adjacent_edge(BaseModel):
class solid3d_fillet_edge(BaseModel):
"""Fillets the given edge with the specified radius."""
cut_type: Optional[CutType] = None
edge_id: str
object_id: str
@ -649,6 +671,16 @@ class face_get_position(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class face_get_center(BaseModel):
"""Obtains the surface \"center of mass\" """
object_id: str
type: Literal["face_get_center"] = "face_get_center"
model_config = ConfigDict(protected_namespaces=())
class face_get_gradient(BaseModel):
"""Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v"""
@ -763,22 +795,6 @@ class mouse_click(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class sketch_mode_enable(BaseModel):
"""Enable sketch mode on the given plane. If you want to sketch on a face, use `enable_sketch_mode` instead."""
animated: bool
disable_camera_with_plane: Optional[Point3d] = None
ortho: bool
plane_id: str
type: Literal["sketch_mode_enable"] = "sketch_mode_enable"
model_config = ConfigDict(protected_namespaces=())
class sketch_mode_disable(BaseModel):
"""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."""
@ -820,6 +836,8 @@ class enable_sketch_mode(BaseModel):
ortho: bool
planar_normal: Optional[Point3d] = None
type: Literal["enable_sketch_mode"] = "enable_sketch_mode"
model_config = ConfigDict(protected_namespaces=())
@ -1147,6 +1165,28 @@ class default_camera_set_perspective(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class zoom_to_fit(BaseModel):
"""Fit the view to the specified object(s)."""
object_ids: Optional[List[str]] = None
padding: float
type: Literal["zoom_to_fit"] = "zoom_to_fit"
model_config = ConfigDict(protected_namespaces=())
class view_isometric(BaseModel):
"""Fit the view to the scene with an isometric view."""
padding: Optional[float] = None
type: Literal["view_isometric"] = "view_isometric"
model_config = ConfigDict(protected_namespaces=())
class solid3d_get_extrusion_face_info(BaseModel):
"""Get a concise description of all of an extrusion's faces."""
@ -1199,6 +1239,7 @@ ModelingCmd = RootModel[
extend_path,
extrude,
revolve,
solid3d_shell_face,
revolve_about_edge,
close_path,
camera_drag_start,
@ -1208,17 +1249,17 @@ ModelingCmd = RootModel[
default_camera_look_at,
default_camera_perspective_settings,
default_camera_zoom,
default_camera_enable_sketch_mode,
default_camera_disable_sketch_mode,
export,
entity_get_parent_id,
entity_get_num_children,
entity_get_child_uuid,
entity_get_all_child_uuids,
entity_get_distance,
entity_linear_pattern_transform,
entity_linear_pattern,
entity_circular_pattern,
entity_make_helix,
entity_mirror,
edit_mode_enter,
select_with_point,
select_add,
@ -1229,6 +1270,7 @@ ModelingCmd = RootModel[
highlight_set_entities,
new_annotation,
update_annotation,
edge_lines_visible,
object_visible,
object_bring_to_front,
object_set_material_params_pbr,
@ -1242,6 +1284,7 @@ ModelingCmd = RootModel[
solid3d_fillet_edge,
face_is_planar,
face_get_position,
face_get_center,
face_get_gradient,
send_object,
entity_set_opacity,
@ -1251,7 +1294,6 @@ ModelingCmd = RootModel[
set_tool,
mouse_move,
mouse_click,
sketch_mode_enable,
sketch_mode_disable,
get_sketch_mode_plane,
curve_set_constraint,
@ -1285,6 +1327,8 @@ ModelingCmd = RootModel[
set_selection_filter,
default_camera_set_orthographic,
default_camera_set_perspective,
zoom_to_fit,
view_isometric,
solid3d_get_extrusion_face_info,
edit_mode_exit,
select_clear,

View File

@ -6,6 +6,7 @@ from typing_extensions import Annotated
from ..models.camera_drag_end import CameraDragEnd
from ..models.camera_drag_move import CameraDragMove
from ..models.center_of_mass import CenterOfMass
from ..models.close_path import ClosePath
from ..models.curve_get_control_points import CurveGetControlPoints
from ..models.curve_get_end_points import CurveGetEndPoints
from ..models.curve_get_type import CurveGetType
@ -20,8 +21,10 @@ from ..models.entity_get_distance import EntityGetDistance
from ..models.entity_get_num_children import EntityGetNumChildren
from ..models.entity_get_parent_id import EntityGetParentId
from ..models.entity_linear_pattern import EntityLinearPattern
from ..models.entity_linear_pattern_transform import EntityLinearPatternTransform
from ..models.export import Export
from ..models.extrusion_face_info import ExtrusionFaceInfo
from ..models.face_get_center import FaceGetCenter
from ..models.face_get_gradient import FaceGetGradient
from ..models.face_get_position import FaceGetPosition
from ..models.face_is_planar import FaceIsPlanar
@ -48,7 +51,9 @@ from ..models.solid3d_get_opposite_edge import Solid3dGetOppositeEdge
from ..models.solid3d_get_prev_adjacent_edge import Solid3dGetPrevAdjacentEdge
from ..models.surface_area import SurfaceArea
from ..models.take_snapshot import TakeSnapshot
from ..models.view_isometric import ViewIsometric
from ..models.volume import Volume
from ..models.zoom_to_fit import ZoomToFit
class empty(BaseModel):
@ -129,6 +134,16 @@ class entity_get_all_child_uuids(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class close_path(BaseModel):
"""The response to the 'ClosePath' endpoint"""
data: ClosePath
type: Literal["close_path"] = "close_path"
model_config = ConfigDict(protected_namespaces=())
class camera_drag_move(BaseModel):
"""The response to the 'CameraDragMove' endpoint"""
@ -169,6 +184,26 @@ class default_camera_zoom(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class zoom_to_fit(BaseModel):
"""The response to the 'ZoomToFit' endpoint"""
data: ZoomToFit
type: Literal["zoom_to_fit"] = "zoom_to_fit"
model_config = ConfigDict(protected_namespaces=())
class view_isometric(BaseModel):
"""The response to the 'ViewIsometric' endpoint"""
data: ViewIsometric
type: Literal["view_isometric"] = "view_isometric"
model_config = ConfigDict(protected_namespaces=())
class get_num_objects(BaseModel):
"""The response to the 'GetNumObjects' endpoint"""
@ -371,6 +406,16 @@ class face_get_position(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class face_get_center(BaseModel):
"""The response to the 'FaceGetCenter' endpoint"""
data: FaceGetCenter
type: Literal["face_get_center"] = "face_get_center"
model_config = ConfigDict(protected_namespaces=())
class face_get_gradient(BaseModel):
"""The response to the 'FaceGetGradient' endpoint"""
@ -481,6 +526,16 @@ class entity_get_distance(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class entity_linear_pattern_transform(BaseModel):
"""The response to the 'EntityLinearPatternTransform' endpoint"""
data: EntityLinearPatternTransform
type: Literal["entity_linear_pattern_transform"] = "entity_linear_pattern_transform"
model_config = ConfigDict(protected_namespaces=())
class entity_linear_pattern(BaseModel):
"""The response to the 'EntityLinearPattern' endpoint"""
@ -532,10 +587,13 @@ OkModelingCmdResponse = RootModel[
entity_get_num_children,
entity_get_parent_id,
entity_get_all_child_uuids,
close_path,
camera_drag_move,
camera_drag_end,
default_camera_get_settings,
default_camera_zoom,
zoom_to_fit,
view_isometric,
get_num_objects,
default_camera_focus_on,
select_get,
@ -556,6 +614,7 @@ OkModelingCmdResponse = RootModel[
curve_get_end_points,
face_is_planar,
face_get_position,
face_get_center,
face_get_gradient,
plane_intersect_and_project,
import_files,
@ -567,6 +626,7 @@ OkModelingCmdResponse = RootModel[
center_of_mass,
get_sketch_mode_plane,
entity_get_distance,
entity_linear_pattern_transform,
entity_linear_pattern,
entity_circular_pattern,
solid3d_get_extrusion_face_info,

View File

@ -22,7 +22,7 @@ class line(BaseModel):
class arc(BaseModel):
"""A circular arc segment."""
"""A circular arc segment. Arcs can be drawn clockwise when start > end."""
center: Point2d
@ -68,7 +68,7 @@ class tangential_arc(BaseModel):
class tangential_arc_to(BaseModel):
"""Adds a tangent arc from current pen position to the new position."""
"""Adds a tangent arc from current pen position to the new position. Arcs will choose a clockwise or counter-clockwise direction based on the arc end position."""
angle_snap_increment: Optional[Angle] = None

View File

@ -1,3 +1,4 @@
from typing import Optional
from pydantic import BaseModel, ConfigDict
@ -6,10 +7,10 @@ from pydantic import BaseModel, ConfigDict
class PerspectiveCameraParameters(BaseModel):
"""Defines a perspective view."""
fov_y: float
fov_y: Optional[float] = None
z_far: float
z_far: Optional[float] = None
z_near: float
z_near: Optional[float] = None
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,17 @@
from pydantic import BaseModel, ConfigDict
class Point4d(BaseModel):
"""A point in homogeneous (4D) space"""
w: float
x: float
y: float
z: float
model_config = ConfigDict(protected_namespaces=())

View File

@ -2,6 +2,7 @@ import datetime
from pydantic import BaseModel, ConfigDict
from ..models.uuid import Uuid
class Session(BaseModel):
@ -9,12 +10,14 @@ class Session(BaseModel):
created_at: datetime.datetime
expires_at: datetime.datetime
expires: datetime.datetime
token: str
id: Uuid
session_token: Uuid
updated_at: datetime.datetime
user_id: str
user_id: Uuid
model_config = ConfigDict(protected_namespaces=())

View File

@ -0,0 +1,12 @@
from pydantic import BaseModel, ConfigDict
from ..models.camera_settings import CameraSettings
class ViewIsometric(BaseModel):
"""The response from the `ViewIsometric` command."""
settings: CameraSettings
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,4 +1,4 @@
from typing import List, Literal, Optional, Union
from typing import Dict, List, Literal, Optional, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated
@ -75,6 +75,16 @@ class metrics_response(BaseModel):
model_config = ConfigDict(protected_namespaces=())
class headers(BaseModel):
"""Authentication header request."""
headers: Dict[str, str]
type: Literal["headers"] = "headers"
model_config = ConfigDict(protected_namespaces=())
WebSocketRequest = RootModel[
Annotated[
Union[
@ -84,6 +94,7 @@ WebSocketRequest = RootModel[
modeling_cmd_batch_req,
ping,
metrics_response,
headers,
],
Field(discriminator="type"),
]

View File

@ -0,0 +1,12 @@
from pydantic import BaseModel, ConfigDict
from ..models.camera_settings import CameraSettings
class ZoomToFit(BaseModel):
"""The response from the `ZoomToFit` command."""
settings: CameraSettings
model_config = ConfigDict(protected_namespaces=())

View File

@ -1,6 +1,6 @@
[tool.poetry]
name = "kittycad"
version = "0.6.12"
version = "0.6.16"
description = "A client library for accessing KittyCAD"
authors = []

715
spec.json
View File

@ -12350,6 +12350,14 @@
"$ref": "#/components/schemas/PostEffectType"
}
},
{
"in": "query",
"name": "show_grid",
"description": "If true, will show the grid at the start of the session.",
"schema": {
"type": "boolean"
}
},
{
"in": "query",
"name": "unlocked_framerate",
@ -14431,6 +14439,14 @@
"type": "number",
"format": "float"
},
"orientation": {
"description": "The Camera's orientation (in the form of a quaternion)",
"allOf": [
{
"$ref": "#/components/schemas/Point4d"
}
]
},
"ortho": {
"description": "Whether or not the camera is in ortho mode",
"type": "boolean"
@ -14460,6 +14476,7 @@
},
"required": [
"center",
"orientation",
"ortho",
"pos",
"up"
@ -14600,6 +14617,20 @@
"rtc_total_freezes_duration_sec"
]
},
"ClosePath": {
"description": "The response from the `ClosePath` command.",
"type": "object",
"properties": {
"face_id": {
"description": "The UUID of the lone face of the resulting solid2D.",
"type": "string",
"format": "uuid"
}
},
"required": [
"face_id"
]
},
"Cluster": {
"description": "Cluster information.",
"type": "object",
@ -15355,6 +15386,25 @@
"updated_at"
]
},
"CutType": {
"description": "What kind of cut to do",
"oneOf": [
{
"description": "Round off an edge.",
"type": "string",
"enum": [
"fillet"
]
},
{
"description": "Cut away an edge.",
"type": "string",
"enum": [
"chamfer"
]
}
]
},
"DefaultCameraFocusOn": {
"description": "The response from the `DefaultCameraFocusOn` command.",
"type": "object"
@ -15740,6 +15790,23 @@
"entity_ids"
]
},
"EntityLinearPatternTransform": {
"description": "The response from the `EntityLinearPatternTransform` command.",
"type": "object",
"properties": {
"entity_ids": {
"description": "The UUIDs of the entities that were created.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
}
},
"required": [
"entity_ids"
]
},
"EntityType": {
"description": "The type of entity",
"type": "string",
@ -15825,6 +15892,20 @@
"bad_request"
]
},
{
"description": "Auth token is missing from the request",
"type": "string",
"enum": [
"auth_token_missing"
]
},
{
"description": "Auth token is invalid in some way (expired, incorrect format, etc)",
"type": "string",
"enum": [
"auth_token_invalid"
]
},
{
"description": "Client sent invalid JSON.",
"type": "string",
@ -16163,6 +16244,23 @@
"cap"
]
},
"FaceGetCenter": {
"description": "The 3D center of mass on the surface",
"type": "object",
"properties": {
"pos": {
"description": "The 3D position on the surface center of mass",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
}
},
"required": [
"pos"
]
},
"FaceGetGradient": {
"description": "The gradient (dFdu, dFdv) + normal vector on a brep face",
"type": "object",
@ -17100,6 +17198,14 @@
"description": "The plane for sketch mode.",
"type": "object",
"properties": {
"origin": {
"description": "The origin.",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"x_axis": {
"description": "The x axis.",
"allOf": [
@ -17126,6 +17232,7 @@
}
},
"required": [
"origin",
"x_axis",
"y_axis",
"z_axis"
@ -18192,6 +18299,43 @@
"type": "number",
"format": "double"
},
"LinearTransform": {
"description": "Ways to transform each solid being replicated in a repeating pattern.",
"type": "object",
"properties": {
"replicate": {
"description": "Whether to replicate the original solid in this instance.",
"default": true,
"type": "boolean"
},
"scale": {
"description": "Scale the replica's size along each axis. Defaults to (1, 1, 1) (i.e. the same size as the original).",
"default": {
"x": 1.0,
"y": 1.0,
"z": 1.0
},
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"translate": {
"description": "Translate the replica this far along each dimension. Defaults to zero vector (i.e. same position as the original).",
"default": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
}
}
},
"Mass": {
"description": "The mass response.",
"type": "object",
@ -18712,6 +18856,45 @@
"type"
]
},
{
"description": "Command for revolving a solid 2d.",
"type": "object",
"properties": {
"face_ids": {
"description": "Which faces to remove, leaving only the shell.",
"type": "array",
"items": {
"type": "string",
"format": "uuid"
}
},
"object_id": {
"description": "Which Solid3D is being shelled.",
"type": "string",
"format": "uuid"
},
"shell_thickness": {
"description": "How thick the shell should be. Smaller values mean a thinner shell.",
"allOf": [
{
"$ref": "#/components/schemas/LengthUnit"
}
]
},
"type": {
"type": "string",
"enum": [
"solid3d_shell_face"
]
}
},
"required": [
"face_ids",
"object_id",
"shell_thickness",
"type"
]
},
{
"description": "Command for revolving a solid 2d about a brep edge",
"type": "object",
@ -18964,6 +19147,7 @@
]
},
"fov_y": {
"nullable": true,
"description": "The field of view angle in the y direction, in degrees.",
"type": "number",
"format": "float"
@ -18998,11 +19182,13 @@
]
},
"z_far": {
"nullable": true,
"description": "The distance to the far clipping plane.",
"type": "number",
"format": "float"
},
"z_near": {
"nullable": true,
"description": "The distance to the near clipping plane.",
"type": "number",
"format": "float"
@ -19010,12 +19196,9 @@
},
"required": [
"center",
"fov_y",
"type",
"up",
"vantage",
"z_far",
"z_near"
"vantage"
]
},
{
@ -19039,79 +19222,6 @@
"type"
]
},
{
"description": "Enable sketch mode, where users can sketch 2D geometry. Users choose a plane to sketch on.",
"type": "object",
"properties": {
"animated": {
"description": "Should we animate or snap for the camera transition?",
"type": "boolean"
},
"distance_to_plane": {
"description": "How far to the sketching plane?",
"type": "number",
"format": "float"
},
"origin": {
"description": "What's the origin of the sketching plane?",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"ortho": {
"description": "Should the camera use orthographic projection? In other words, should an object's size in the rendered image stay constant regardless of its distance from the camera.",
"type": "boolean"
},
"type": {
"type": "string",
"enum": [
"default_camera_enable_sketch_mode"
]
},
"x_axis": {
"description": "Which 3D axis of the scene should be the X axis of the sketching plane?",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"y_axis": {
"description": "Which 3D axis of the scene should be the Y axis of the sketching plane?",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
}
},
"required": [
"animated",
"distance_to_plane",
"origin",
"ortho",
"type",
"x_axis",
"y_axis"
]
},
{
"description": "Disable sketch mode, from the default camera.",
"type": "object",
"properties": {
"type": {
"type": "string",
"enum": [
"default_camera_disable_sketch_mode"
]
}
},
"required": [
"type"
]
},
{
"description": "Export the scene to a file.",
"type": "object",
@ -19272,6 +19382,35 @@
"type"
]
},
{
"description": "Create a linear pattern using this entity.",
"type": "object",
"properties": {
"entity_id": {
"description": "ID of the entity being copied.",
"type": "string",
"format": "uuid"
},
"transform": {
"description": "How to transform each repeated solid. The total number of repetitions equals the size of this list.",
"type": "array",
"items": {
"$ref": "#/components/schemas/LinearTransform"
}
},
"type": {
"type": "string",
"enum": [
"entity_linear_pattern_transform"
]
}
},
"required": [
"entity_id",
"transform",
"type"
]
},
{
"description": "Create a linear pattern using this entity.",
"type": "object",
@ -19425,6 +19564,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",
@ -19689,6 +19870,26 @@
"type"
]
},
{
"description": "Changes visibility of scene-wide edge lines on brep solids",
"type": "object",
"properties": {
"hidden": {
"description": "Whether or not the edge lines should be hidden.",
"type": "boolean"
},
"type": {
"type": "string",
"enum": [
"edge_lines_visible"
]
}
},
"required": [
"hidden",
"type"
]
},
{
"description": "Hide or show an object",
"type": "object",
@ -19998,6 +20199,15 @@
"description": "Fillets the given edge with the specified radius.",
"type": "object",
"properties": {
"cut_type": {
"description": "How to apply the cut.",
"default": "fillet",
"allOf": [
{
"$ref": "#/components/schemas/CutType"
}
]
},
"edge_id": {
"description": "Which edge you want to fillet.",
"type": "string",
@ -20090,6 +20300,27 @@
"uv"
]
},
{
"description": "Obtains the surface \"center of mass\"",
"type": "object",
"properties": {
"object_id": {
"description": "Which face is being queried.",
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"face_get_center"
]
}
},
"required": [
"object_id",
"type"
]
},
{
"description": "Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v",
"type": "object",
@ -20375,46 +20606,6 @@
"window"
]
},
{
"description": "Enable sketch mode on the given plane. If you want to sketch on a face, use `enable_sketch_mode` instead.",
"type": "object",
"properties": {
"animated": {
"description": "Animate the transition to sketch mode.",
"type": "boolean"
},
"disable_camera_with_plane": {
"nullable": true,
"description": "Disable the camera entirely for sketch mode and sketch on a plane (this would be the normal of that plane).",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"ortho": {
"description": "Use an orthographic camera.",
"type": "boolean"
},
"plane_id": {
"description": "Sketch on this plane.",
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"sketch_mode_enable"
]
}
},
"required": [
"animated",
"ortho",
"plane_id",
"type"
]
},
{
"description": "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": "object",
@ -20505,6 +20696,15 @@
"description": "Should the camera use orthographic projection? In other words, should an object's size in the rendered image stay constant regardless of its distance from the camera.",
"type": "boolean"
},
"planar_normal": {
"nullable": true,
"description": "If provided, ensures that the normal of the sketch plane must be aligned with this supplied normal (otherwise the camera position will be used to infer the normal to point towards the viewer)",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"type": {
"type": "string",
"enum": [
@ -21304,6 +21504,57 @@
"type"
]
},
{
"description": "Fit the view to the specified object(s).",
"type": "object",
"properties": {
"object_ids": {
"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",
"format": "uuid"
}
},
"padding": {
"description": "How much to pad the view frame by.",
"type": "number",
"format": "float"
},
"type": {
"type": "string",
"enum": [
"zoom_to_fit"
]
}
},
"required": [
"padding",
"type"
]
},
{
"description": "Fit the view to the scene with an isometric view.",
"type": "object",
"properties": {
"padding": {
"description": "How much to pad the view frame by.",
"default": 0.0,
"type": "number",
"format": "float"
},
"type": {
"type": "string",
"enum": [
"view_isometric"
]
}
},
"required": [
"type"
]
},
{
"description": "Get a concise description of all of an extrusion's faces.",
"type": "object",
@ -21632,6 +21883,25 @@
"type"
]
},
{
"description": "The response to the 'ClosePath' endpoint",
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ClosePath"
},
"type": {
"type": "string",
"enum": [
"close_path"
]
}
},
"required": [
"data",
"type"
]
},
{
"description": "The response to the 'CameraDragMove' endpoint",
"type": "object",
@ -21708,6 +21978,44 @@
"type"
]
},
{
"description": "The response to the 'ZoomToFit' endpoint",
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ZoomToFit"
},
"type": {
"type": "string",
"enum": [
"zoom_to_fit"
]
}
},
"required": [
"data",
"type"
]
},
{
"description": "The response to the 'ViewIsometric' endpoint",
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ViewIsometric"
},
"type": {
"type": "string",
"enum": [
"view_isometric"
]
}
},
"required": [
"data",
"type"
]
},
{
"description": "The response to the 'GetNumObjects' endpoint",
"type": "object",
@ -22088,6 +22396,25 @@
"type"
]
},
{
"description": "The response to the 'FaceGetCenter' endpoint",
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/FaceGetCenter"
},
"type": {
"type": "string",
"enum": [
"face_get_center"
]
}
},
"required": [
"data",
"type"
]
},
{
"description": "The response to the 'FaceGetGradient' endpoint",
"type": "object",
@ -22297,6 +22624,25 @@
"type"
]
},
{
"description": "The response to the 'EntityLinearPatternTransform' endpoint",
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/EntityLinearPatternTransform"
},
"type": {
"type": "string",
"enum": [
"entity_linear_pattern_transform"
]
}
},
"required": [
"data",
"type"
]
},
{
"description": "The response to the 'EntityLinearPattern' endpoint",
"type": "object",
@ -23273,7 +23619,7 @@
]
},
{
"description": "A circular arc segment.",
"description": "A circular arc segment. Arcs can be drawn clockwise when start > end.",
"type": "object",
"properties": {
"center": {
@ -23380,7 +23726,7 @@
"type": "object",
"properties": {
"offset": {
"description": "Offset of the arc.",
"description": "Offset of the arc. Negative values will arc clockwise.",
"allOf": [
{
"$ref": "#/components/schemas/Angle"
@ -23409,7 +23755,7 @@
]
},
{
"description": "Adds a tangent arc from current pen position to the new position.",
"description": "Adds a tangent arc from current pen position to the new position. Arcs will choose a clockwise or counter-clockwise direction based on the arc end position.",
"type": "object",
"properties": {
"angle_snap_increment": {
@ -23575,26 +23921,24 @@
"type": "object",
"properties": {
"fov_y": {
"nullable": true,
"description": "Camera frustum vertical field of view.",
"type": "number",
"format": "float"
},
"z_far": {
"nullable": true,
"description": "Camera frustum far plane.",
"type": "number",
"format": "float"
},
"z_near": {
"nullable": true,
"description": "Camera frustum near plane.",
"type": "number",
"format": "float"
}
},
"required": [
"fov_y",
"z_far",
"z_near"
]
}
},
"PlanInterval": {
"description": "A plan's interval.",
@ -23709,6 +24053,34 @@
"z"
]
},
"Point4d": {
"description": "A point in homogeneous (4D) space",
"type": "object",
"properties": {
"w": {
"type": "number",
"format": "float"
},
"x": {
"type": "number",
"format": "float"
},
"y": {
"type": "number",
"format": "float"
},
"z": {
"type": "number",
"format": "float"
}
},
"required": [
"w",
"x",
"y",
"z"
]
},
"Pong": {
"description": "The response from the `/ping` endpoint.",
"type": "object",
@ -24232,35 +24604,53 @@
"type": "object",
"properties": {
"created_at": {
"title": "DateTime",
"description": "The date and time the session was created.",
"type": "string",
"format": "date-time"
},
"expires_at": {
"expires": {
"title": "DateTime",
"description": "The date and time the session expires.",
"type": "string",
"format": "date-time"
},
"token": {
"id": {
"description": "The unique identifier for the session.",
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
},
"session_token": {
"description": "The session token.",
"type": "string",
"format": "uuid"
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
},
"updated_at": {
"title": "DateTime",
"description": "The date and time the session was last updated.",
"type": "string",
"format": "date-time"
},
"user_id": {
"description": "The user ID of the user that the session belongs to.",
"type": "string",
"format": "uuid"
"allOf": [
{
"$ref": "#/components/schemas/Uuid"
}
]
}
},
"required": [
"created_at",
"expires_at",
"token",
"expires",
"id",
"session_token",
"updated_at",
"user_id"
]
@ -27057,6 +27447,23 @@
"updated_at"
]
},
"ViewIsometric": {
"description": "The response from the `ViewIsometric` command.",
"type": "object",
"properties": {
"settings": {
"description": "Camera settings",
"allOf": [
{
"$ref": "#/components/schemas/CameraSettings"
}
]
}
},
"required": [
"settings"
]
},
"Volume": {
"description": "The volume response.",
"type": "object",
@ -27239,6 +27646,29 @@
"metrics",
"type"
]
},
{
"description": "Authentication header request.",
"type": "object",
"properties": {
"headers": {
"description": "The authentication header.",
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"type": {
"type": "string",
"enum": [
"headers"
]
}
},
"required": [
"headers",
"type"
]
}
]
},
@ -27421,6 +27851,23 @@
]
}
]
},
"ZoomToFit": {
"description": "The response from the `ZoomToFit` command.",
"type": "object",
"properties": {
"settings": {
"description": "Camera settings",
"allOf": [
{
"$ref": "#/components/schemas/CameraSettings"
}
]
}
},
"required": [
"settings"
]
}
},
"responses": {