Skip to content

Commit

Permalink
Update api spec (#205)
Browse files Browse the repository at this point in the history
* YOYO NEW API SPEC!

* I have generated the latest API!

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent f0599f6 commit f040c64
Show file tree
Hide file tree
Showing 8 changed files with 727 additions and 372 deletions.
744 changes: 372 additions & 372 deletions kittycad.py.patch.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions kittycad/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@
from .extended_user_results_page import ExtendedUserResultsPage
from .extrusion_face_cap_type import ExtrusionFaceCapType
from .extrusion_face_info import ExtrusionFaceInfo
from .face_get_gradient import FaceGetGradient
from .face_get_position import FaceGetPosition
from .face_is_planar import FaceIsPlanar
from .failure_web_socket_response import FailureWebSocketResponse
from .fbx_storage import FbxStorage
from .file_center_of_mass import FileCenterOfMass
Expand Down
16 changes: 16 additions & 0 deletions kittycad/models/face_get_gradient.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@

from pydantic import BaseModel, ConfigDict

from ..models.point3d import Point3d


class FaceGetGradient(BaseModel):
"""The gradient (dFdu, dFdv) + normal vector on a brep face"""

df_du: Point3d

df_dv: Point3d

normal: Point3d

model_config = ConfigDict(protected_namespaces=())
12 changes: 12 additions & 0 deletions kittycad/models/face_get_position.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

from pydantic import BaseModel, ConfigDict

from ..models.point3d import Point3d


class FaceGetPosition(BaseModel):
"""The 3D position on the surface that was evaluated"""

pos: Point3d

model_config = ConfigDict(protected_namespaces=())
19 changes: 19 additions & 0 deletions kittycad/models/face_is_planar.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
from typing import Optional

from pydantic import BaseModel, ConfigDict

from ..models.point3d import Point3d


class FaceIsPlanar(BaseModel):
"""Surface-local planar axes (if available)"""

origin: Optional[Point3d] = None

x_axis: Optional[Point3d] = None

y_axis: Optional[Point3d] = None

z_axis: Optional[Point3d] = None

model_config = ConfigDict(protected_namespaces=())
37 changes: 37 additions & 0 deletions kittycad/models/modeling_cmd.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,40 @@ class solid3d_fillet_edge(BaseModel):
model_config = ConfigDict(protected_namespaces=())


class face_is_planar(BaseModel):
"""Determines whether a brep face is planar and returns its surface-local planar axes if so"""

object_id: str

type: Literal["face_is_planar"] = "face_is_planar"

model_config = ConfigDict(protected_namespaces=())


class face_get_position(BaseModel):
"""Determines a position on a brep face evaluated by parameters u,v"""

object_id: str

type: Literal["face_get_position"] = "face_get_position"

uv: Point2d

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"""

object_id: str

type: Literal["face_get_gradient"] = "face_get_gradient"

uv: Point2d

model_config = ConfigDict(protected_namespaces=())


class send_object(BaseModel):
"""Send object to front or back."""

Expand Down Expand Up @@ -1113,6 +1147,9 @@ class select_get(BaseModel):
solid3d_get_next_adjacent_edge,
solid3d_get_prev_adjacent_edge,
solid3d_fillet_edge,
face_is_planar,
face_get_position,
face_get_gradient,
send_object,
entity_set_opacity,
entity_fade,
Expand Down
36 changes: 36 additions & 0 deletions kittycad/models/ok_modeling_cmd_response.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
from ..models.entity_linear_pattern import EntityLinearPattern
from ..models.export import Export
from ..models.extrusion_face_info import ExtrusionFaceInfo
from ..models.face_get_gradient import FaceGetGradient
from ..models.face_get_position import FaceGetPosition
from ..models.face_is_planar import FaceIsPlanar
from ..models.get_entity_type import GetEntityType
from ..models.get_sketch_mode_plane import GetSketchModePlane
from ..models.highlight_set_entity import HighlightSetEntity
Expand Down Expand Up @@ -325,6 +328,36 @@ class curve_get_end_points(BaseModel):
model_config = ConfigDict(protected_namespaces=())


class face_is_planar(BaseModel):
"""The response to the 'FaceIsPlanar' endpoint"""

data: FaceIsPlanar

type: Literal["face_is_planar"] = "face_is_planar"

model_config = ConfigDict(protected_namespaces=())


class face_get_position(BaseModel):
"""The response to the 'FaceGetPosition' endpoint"""

data: FaceGetPosition

type: Literal["face_get_position"] = "face_get_position"

model_config = ConfigDict(protected_namespaces=())


class face_get_gradient(BaseModel):
"""The response to the 'FaceGetGradient' endpoint"""

data: FaceGetGradient

type: Literal["face_get_gradient"] = "face_get_gradient"

model_config = ConfigDict(protected_namespaces=())


class plane_intersect_and_project(BaseModel):
"""The response to the 'PlaneIntersectAndProject' endpoint"""

Expand Down Expand Up @@ -486,6 +519,9 @@ class extrusion_face_info(BaseModel):
path_get_curve_uuids_for_vertices,
path_get_vertex_uuids,
curve_get_end_points,
face_is_planar,
face_get_position,
face_get_gradient,
plane_intersect_and_project,
import_files,
mass,
Expand Down
Loading

0 comments on commit f040c64

Please sign in to comment.