Compare commits

..

23 Commits

Author SHA1 Message Date
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
64e8aa2816 Update api spec (#212)
* YOYO NEW API SPEC!

* fixes

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-04-12 12:03:34 -07:00
38801b52a7 fix
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-04-11 11:23:34 -07:00
e73f39cfa9 reviewers
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-04-11 11:16:11 -07:00
7536ca8683 assignee
Signed-off-by: Jess Frazelle <github@jessfraz.com>
2024-04-11 11:05:49 -07:00
25 changed files with 1739 additions and 861 deletions

View File

@ -67,6 +67,9 @@ jobs:
gh pr create --title "Update lang spec docs for python" \ gh pr create --title "Update lang spec docs for python" \
--body "Updating the generated docs for python" \ --body "Updating the generated docs for python" \
--head "$NEW_BRANCH" \ --head "$NEW_BRANCH" \
--reviewer jessfraz \
--reviewer irev-dev \
--reviewer franknoirot \
--base main || true --base main || true
env: env:
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}

View File

@ -1270,7 +1270,7 @@ def generateAnyOfType(path: str, name: str, schema: dict, data: dict):
f.write("from ." + camel_to_snake(ref_name) + " import " + ref_name + "\n") f.write("from ." + camel_to_snake(ref_name) + " import " + ref_name + "\n")
all_options.append(ref_name) all_options.append(ref_name)
if isNestedObjectOneOf(schema): if isNestedObjectAnyOf(schema):
# We want to write each of the nested objects. # We want to write each of the nested objects.
for any_of in schema["anyOf"]: for any_of in schema["anyOf"]:
# Get the nested object. # Get the nested object.
@ -1326,6 +1326,47 @@ def generateAnyOfType(path: str, name: str, schema: dict, data: dict):
f.write(object_code) f.write(object_code)
f.write("\n") f.write("\n")
all_options.append(object_name) all_options.append(object_name)
else:
# We want to write each of the nested objects.
for any_of in schema["anyOf"]:
# Get the nested object.
if "properties" in any_of:
for prop_name in any_of["properties"]:
nested_object = any_of["properties"][prop_name]
if nested_object == {}:
f.write("from typing import Any\n")
f.write(prop_name + " = Any\n")
f.write("\n")
all_options.append(prop_name)
elif "$ref" in nested_object:
ref = nested_object["$ref"]
ref_name = ref[ref.rfind("/") + 1 :]
f.write(
"from ."
+ camel_to_snake(ref_name)
+ " import "
+ ref_name
+ "\n"
)
f.write("\n")
if prop_name != ref_name:
f.write(prop_name + " = " + ref_name + "\n")
f.write("\n")
all_options.append(prop_name)
else:
object_code = generateObjectTypeCode(
prop_name, nested_object, "object", data, None, None
)
f.write(object_code)
f.write("\n")
all_options.append(prop_name)
elif "type" in any_of and any_of["type"] == "string":
enum_code = generateEnumTypeCode(
any_of["enum"][0], any_of, "string", []
)
f.write(enum_code)
f.write("\n")
all_options.append(any_of["enum"][0])
# Write the sum type. # Write the sum type.
description = getAnyOfDescription(schema) description = getAnyOfDescription(schema)
@ -1953,6 +1994,40 @@ def getOneOfRefType(schema: dict) -> str:
raise Exception("Cannot get oneOf ref type for schema: ", schema) raise Exception("Cannot get oneOf ref type for schema: ", schema)
def isNestedObjectAnyOf(schema: dict) -> bool:
if "anyOf" not in schema:
return False
is_nested_object = False
for any_of in schema["anyOf"]:
# Check if each are an object w 1 property in it.
if (
"type" in any_of
and any_of["type"] == "object"
and "properties" in any_of
and len(any_of["properties"]) == 1
):
for prop_name in any_of["properties"]:
nested_object = any_of["properties"][prop_name]
if "type" in nested_object and nested_object["type"] == "object":
is_nested_object = True
else:
is_nested_object = False
break
elif (
"type" in any_of
and any_of["type"] == "string"
and "enum" in any_of
and len(any_of["enum"]) == 1
):
is_nested_object = True
else:
is_nested_object = False
break
return is_nested_object
def isNestedObjectOneOf(schema: dict) -> bool: def isNestedObjectOneOf(schema: dict) -> bool:
if "oneOf" not in schema: if "oneOf" not in schema:
return False return False
@ -1961,7 +2036,8 @@ def isNestedObjectOneOf(schema: dict) -> bool:
for one_of in schema["oneOf"]: for one_of in schema["oneOf"]:
# Check if each are an object w 1 property in it. # Check if each are an object w 1 property in it.
if ( if (
one_of["type"] == "object" "type" in one_of
and one_of["type"] == "object"
and "properties" in one_of and "properties" in one_of
and len(one_of["properties"]) == 1 and len(one_of["properties"]) == 1
): ):
@ -1973,7 +2049,10 @@ def isNestedObjectOneOf(schema: dict) -> bool:
is_nested_object = False is_nested_object = False
break break
elif ( elif (
one_of["type"] == "string" and "enum" in one_of and len(one_of["enum"]) == 1 "type" in one_of
and one_of["type"] == "string"
and "enum" in one_of
and len(one_of["enum"]) == 1
): ):
is_nested_object = True is_nested_object = True
else: else:

View File

@ -20,7 +20,7 @@ poetry run python generate/generate.py
# Format and lint. # Format and lint.
poetry run isort . 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 ruff check --fix .
poetry run mypy . || true poetry run mypy . || true

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -0,0 +1,24 @@
from typing import Union
from pydantic import BaseModel, ConfigDict, RootModel
class response(BaseModel):
"""Response to the modeling command."""
model_config = ConfigDict(protected_namespaces=())
class errors(BaseModel):
"""Errors that occurred during the modeling command."""
model_config = ConfigDict(protected_namespaces=())
BatchResponse = RootModel[
Union[
response,
errors,
]
]

View File

@ -3,6 +3,7 @@ from typing import Optional
from pydantic import BaseModel, ConfigDict from pydantic import BaseModel, ConfigDict
from ..models.point3d import Point3d from ..models.point3d import Point3d
from ..models.point4d import Point4d
class CameraSettings(BaseModel): class CameraSettings(BaseModel):
@ -12,6 +13,8 @@ class CameraSettings(BaseModel):
fov_y: Optional[float] = None fov_y: Optional[float] = None
orientation: Point4d
ortho: bool ortho: bool
ortho_scale: Optional[float] = None 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" 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 """# 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" 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 """# Client sent invalid JSON. """ # noqa: E501
INVALID_JSON = "invalid_json" INVALID_JSON = "invalid_json"
"""# Client sent invalid BSON. """ # noqa: E501 """# 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): class GetSketchModePlane(BaseModel):
"""The plane for sketch mode.""" """The plane for sketch mode."""
origin: Point3d
x_axis: Point3d x_axis: Point3d
y_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.annotation_type import AnnotationType
from ..models.camera_drag_interaction_type import CameraDragInteractionType from ..models.camera_drag_interaction_type import CameraDragInteractionType
from ..models.color import Color from ..models.color import Color
from ..models.cut_type import CutType
from ..models.distance_type import DistanceType from ..models.distance_type import DistanceType
from ..models.entity_type import EntityType from ..models.entity_type import EntityType
from ..models.image_format import ImageFormat from ..models.image_format import ImageFormat
from ..models.import_file import ImportFile from ..models.import_file import ImportFile
from ..models.input_format import InputFormat from ..models.input_format import InputFormat
from ..models.length_unit import LengthUnit from ..models.length_unit import LengthUnit
from ..models.linear_transform import LinearTransform
from ..models.modeling_cmd_id import ModelingCmdId from ..models.modeling_cmd_id import ModelingCmdId
from ..models.output_format import OutputFormat from ..models.output_format import OutputFormat
from ..models.path_component_constraint_bound import PathComponentConstraintBound from ..models.path_component_constraint_bound import PathComponentConstraintBound
@ -97,6 +99,20 @@ class revolve(BaseModel):
model_config = ConfigDict(protected_namespaces=()) 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): class revolve_about_edge(BaseModel):
"""Command for revolving a solid 2d about a brep edge""" """Command for revolving a solid 2d about a brep edge"""
@ -190,7 +206,7 @@ class default_camera_perspective_settings(BaseModel):
center: Point3d center: Point3d
fov_y: float fov_y: Optional[float] = None
sequence: Optional[int] = None sequence: Optional[int] = None
@ -202,9 +218,9 @@ class default_camera_perspective_settings(BaseModel):
vantage: Point3d vantage: Point3d
z_far: float z_far: Optional[float] = None
z_near: float z_near: Optional[float] = None
model_config = ConfigDict(protected_namespaces=()) model_config = ConfigDict(protected_namespaces=())
@ -219,38 +235,6 @@ class default_camera_zoom(BaseModel):
model_config = ConfigDict(protected_namespaces=()) 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): class export(BaseModel):
"""Export the scene to a file.""" """Export the scene to a file."""
@ -319,6 +303,18 @@ class entity_get_distance(BaseModel):
model_config = ConfigDict(protected_namespaces=()) 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): class entity_linear_pattern(BaseModel):
"""Create a linear pattern using this entity.""" """Create a linear pattern using this entity."""
@ -373,6 +369,20 @@ class entity_make_helix(BaseModel):
model_config = ConfigDict(protected_namespaces=()) 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): class edit_mode_enter(BaseModel):
"""Enter edit mode""" """Enter edit mode"""
@ -481,6 +491,16 @@ class update_annotation(BaseModel):
model_config = ConfigDict(protected_namespaces=()) 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): class object_visible(BaseModel):
"""Hide or show an object""" """Hide or show an object"""
@ -614,6 +634,8 @@ class solid3d_get_prev_adjacent_edge(BaseModel):
class solid3d_fillet_edge(BaseModel): class solid3d_fillet_edge(BaseModel):
"""Fillets the given edge with the specified radius.""" """Fillets the given edge with the specified radius."""
cut_type: Optional[CutType] = None
edge_id: str edge_id: str
object_id: str object_id: str
@ -649,6 +671,16 @@ class face_get_position(BaseModel):
model_config = ConfigDict(protected_namespaces=()) 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): class face_get_gradient(BaseModel):
"""Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v""" """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=()) 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): 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.""" """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 ortho: bool
planar_normal: Optional[Point3d] = None
type: Literal["enable_sketch_mode"] = "enable_sketch_mode" type: Literal["enable_sketch_mode"] = "enable_sketch_mode"
model_config = ConfigDict(protected_namespaces=()) model_config = ConfigDict(protected_namespaces=())
@ -1147,6 +1165,28 @@ class default_camera_set_perspective(BaseModel):
model_config = ConfigDict(protected_namespaces=()) 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): class solid3d_get_extrusion_face_info(BaseModel):
"""Get a concise description of all of an extrusion's faces.""" """Get a concise description of all of an extrusion's faces."""
@ -1199,6 +1239,7 @@ ModelingCmd = RootModel[
extend_path, extend_path,
extrude, extrude,
revolve, revolve,
solid3d_shell_face,
revolve_about_edge, revolve_about_edge,
close_path, close_path,
camera_drag_start, camera_drag_start,
@ -1208,17 +1249,17 @@ ModelingCmd = RootModel[
default_camera_look_at, default_camera_look_at,
default_camera_perspective_settings, default_camera_perspective_settings,
default_camera_zoom, default_camera_zoom,
default_camera_enable_sketch_mode,
default_camera_disable_sketch_mode,
export, export,
entity_get_parent_id, entity_get_parent_id,
entity_get_num_children, entity_get_num_children,
entity_get_child_uuid, entity_get_child_uuid,
entity_get_all_child_uuids, entity_get_all_child_uuids,
entity_get_distance, entity_get_distance,
entity_linear_pattern_transform,
entity_linear_pattern, entity_linear_pattern,
entity_circular_pattern, entity_circular_pattern,
entity_make_helix, entity_make_helix,
entity_mirror,
edit_mode_enter, edit_mode_enter,
select_with_point, select_with_point,
select_add, select_add,
@ -1229,6 +1270,7 @@ ModelingCmd = RootModel[
highlight_set_entities, highlight_set_entities,
new_annotation, new_annotation,
update_annotation, update_annotation,
edge_lines_visible,
object_visible, object_visible,
object_bring_to_front, object_bring_to_front,
object_set_material_params_pbr, object_set_material_params_pbr,
@ -1242,6 +1284,7 @@ ModelingCmd = RootModel[
solid3d_fillet_edge, solid3d_fillet_edge,
face_is_planar, face_is_planar,
face_get_position, face_get_position,
face_get_center,
face_get_gradient, face_get_gradient,
send_object, send_object,
entity_set_opacity, entity_set_opacity,
@ -1251,7 +1294,6 @@ ModelingCmd = RootModel[
set_tool, set_tool,
mouse_move, mouse_move,
mouse_click, mouse_click,
sketch_mode_enable,
sketch_mode_disable, sketch_mode_disable,
get_sketch_mode_plane, get_sketch_mode_plane,
curve_set_constraint, curve_set_constraint,
@ -1285,6 +1327,8 @@ ModelingCmd = RootModel[
set_selection_filter, set_selection_filter,
default_camera_set_orthographic, default_camera_set_orthographic,
default_camera_set_perspective, default_camera_set_perspective,
zoom_to_fit,
view_isometric,
solid3d_get_extrusion_face_info, solid3d_get_extrusion_face_info,
edit_mode_exit, edit_mode_exit,
select_clear, select_clear,

View File

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

View File

@ -1,8 +1,9 @@
from typing import List, Literal, Union from typing import Dict, List, Literal, Union
from pydantic import BaseModel, ConfigDict, Field, RootModel from pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated from typing_extensions import Annotated
from ..models.batch_response import BatchResponse
from ..models.ice_server import IceServer from ..models.ice_server import IceServer
from ..models.ok_modeling_cmd_response import OkModelingCmdResponse from ..models.ok_modeling_cmd_response import OkModelingCmdResponse
from ..models.raw_file import RawFile from ..models.raw_file import RawFile
@ -82,6 +83,24 @@ class modeling(BaseModel):
model_config = ConfigDict(protected_namespaces=()) model_config = ConfigDict(protected_namespaces=())
class ModelingBatchData(BaseModel):
""""""
responses: Dict[str, BatchResponse]
model_config = ConfigDict(protected_namespaces=())
class modeling_batch(BaseModel):
"""Response to a ModelingBatch."""
data: ModelingBatchData
type: Literal["modeling_batch"] = "modeling_batch"
model_config = ConfigDict(protected_namespaces=())
class ExportData(BaseModel): class ExportData(BaseModel):
"""""" """"""
@ -139,6 +158,7 @@ OkWebSocketResponseData = RootModel[
trickle_ice, trickle_ice,
sdp_answer, sdp_answer,
modeling, modeling,
modeling_batch,
export, export,
metrics_request, metrics_request,
pong, pong,

View File

@ -22,7 +22,7 @@ class line(BaseModel):
class arc(BaseModel): class arc(BaseModel):
"""A circular arc segment.""" """A circular arc segment. Arcs can be drawn clockwise when start > end."""
center: Point2d center: Point2d
@ -68,7 +68,7 @@ class tangential_arc(BaseModel):
class tangential_arc_to(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 angle_snap_increment: Optional[Angle] = None

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 pydantic import BaseModel, ConfigDict
from ..models.uuid import Uuid
class Session(BaseModel): class Session(BaseModel):
@ -9,12 +10,14 @@ class Session(BaseModel):
created_at: datetime.datetime created_at: datetime.datetime
expires_at: datetime.datetime expires: datetime.datetime
token: str id: Uuid
session_token: Uuid
updated_at: datetime.datetime updated_at: datetime.datetime
user_id: str user_id: Uuid
model_config = ConfigDict(protected_namespaces=()) 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 pydantic import BaseModel, ConfigDict, Field, RootModel
from typing_extensions import Annotated from typing_extensions import Annotated
@ -75,6 +75,16 @@ class metrics_response(BaseModel):
model_config = ConfigDict(protected_namespaces=()) 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[ WebSocketRequest = RootModel[
Annotated[ Annotated[
Union[ Union[
@ -84,6 +94,7 @@ WebSocketRequest = RootModel[
modeling_cmd_batch_req, modeling_cmd_batch_req,
ping, ping,
metrics_response, metrics_response,
headers,
], ],
Field(discriminator="type"), 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] [tool.poetry]
name = "kittycad" name = "kittycad"
version = "0.6.11" version = "0.6.15"
description = "A client library for accessing KittyCAD" description = "A client library for accessing KittyCAD"
authors = [] authors = []

766
spec.json

File diff suppressed because it is too large Load Diff