Skip to content

Commit

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

* Generated new lib

* bump v

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Kurt Hutten Irev-Dev <k.hutten@protonmail.ch>
  • Loading branch information
3 people authored Mar 6, 2024
1 parent cd8b791 commit 680b0ed
Show file tree
Hide file tree
Showing 3 changed files with 295 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kittycad/lib",
"version": "0.0.54",
"version": "0.0.55",
"description": "Javascript library for KittyCAD API",
"type": "module",
"keywords": [
Expand Down
232 changes: 232 additions & 0 deletions spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -15976,6 +15976,100 @@
"cap"
]
},
"FaceGetGradient": {
"description": "The gradient (dFdu, dFdv) + normal vector on a brep face",
"type": "object",
"properties": {
"df_du": {
"description": "dFdu",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"df_dv": {
"description": "dFdv",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"normal": {
"description": "Normal (||dFdu x dFdv||)",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
}
},
"required": [
"df_du",
"df_dv",
"normal"
]
},
"FaceGetPosition": {
"description": "The 3D position on the surface that was evaluated",
"type": "object",
"properties": {
"pos": {
"description": "The 3D position on the surface that was evaluated",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
}
},
"required": [
"pos"
]
},
"FaceIsPlanar": {
"description": "Surface-local planar axes (if available)",
"type": "object",
"properties": {
"origin": {
"nullable": true,
"description": "plane's origin",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"x_axis": {
"nullable": true,
"description": "plane's local x-axis",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"y_axis": {
"nullable": true,
"description": "plane's local y-axis",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
},
"z_axis": {
"nullable": true,
"description": "plane's local z-axis (normal)",
"allOf": [
{
"$ref": "#/components/schemas/Point3d"
}
]
}
}
},
"FailureWebSocketResponse": {
"description": "Unsuccessful Websocket response.",
"type": "object",
Expand Down Expand Up @@ -19540,6 +19634,87 @@
"type"
]
},
{
"description": "Determines whether a brep face is planar and returns its surface-local planar axes if so",
"type": "object",
"properties": {
"object_id": {
"description": "Which face is being queried.",
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"face_is_planar"
]
}
},
"required": [
"object_id",
"type"
]
},
{
"description": "Determines a position on a brep face evaluated by parameters u,v",
"type": "object",
"properties": {
"object_id": {
"description": "Which face is being queried.",
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"face_get_position"
]
},
"uv": {
"description": "The 2D paramter-space u,v position to evaluate the surface at",
"allOf": [
{
"$ref": "#/components/schemas/Point2d"
}
]
}
},
"required": [
"object_id",
"type",
"uv"
]
},
{
"description": "Determines the gradient (dFdu, dFdv) + normal vector on a brep face evaluated by parameters u,v",
"type": "object",
"properties": {
"object_id": {
"description": "Which face is being queried.",
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"face_get_gradient"
]
},
"uv": {
"description": "The 2D paramter-space u,v position to evaluate the surface at",
"allOf": [
{
"$ref": "#/components/schemas/Point2d"
}
]
}
},
"required": [
"object_id",
"type",
"uv"
]
},
{
"description": "Send object to front or back.",
"type": "object",
Expand Down Expand Up @@ -21390,6 +21565,63 @@
"type"
]
},
{
"description": "The response to the 'FaceIsPlanar' endpoint",
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/FaceIsPlanar"
},
"type": {
"type": "string",
"enum": [
"face_is_planar"
]
}
},
"required": [
"data",
"type"
]
},
{
"description": "The response to the 'FaceGetPosition' endpoint",
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/FaceGetPosition"
},
"type": {
"type": "string",
"enum": [
"face_get_position"
]
}
},
"required": [
"data",
"type"
]
},
{
"description": "The response to the 'FaceGetGradient' endpoint",
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/FaceGetGradient"
},
"type": {
"type": "string",
"enum": [
"face_get_gradient"
]
}
},
"required": [
"data",
"type"
]
},
{
"description": "The response to the 'PlaneIntersectAndProject' endpoint",
"type": "object",
Expand Down
62 changes: 62 additions & 0 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,27 @@ export interface ExtrusionFaceInfo_type {
face_id?: string;
}

export interface FaceGetGradient_type {
df_du: Point3d_type /* dFdu */;
df_dv: Point3d_type /* dFdv */;
normal: Point3d_type /* Normal (||dFdu x dFdv||) */;
}

export interface FaceGetPosition_type {
pos: Point3d_type /* The 3D position on the surface that was evaluated */;
}

export interface FaceIsPlanar_type {
/* nullable:true, description:plane's origin */
origin?: Point3d_type;
/* nullable:true, description:plane's local x-axis */
x_axis?: Point3d_type;
/* nullable:true, description:plane's local y-axis */
y_axis?: Point3d_type;
/* nullable:true, description:plane's local z-axis (normal) */
z_axis?: Point3d_type;
}

export interface FailureWebSocketResponse_type {
errors: ApiError_type[] /* The errors that occurred. */;
/*{
Expand Down Expand Up @@ -2291,6 +2312,23 @@ export type ModelingCmd_type =
tolerance: LengthUnit_type /* The maximum acceptable surface gap computed between the filleted surfaces. Must be positive (i.e. greater than zero). */;
type: 'solid3d_fillet_edge';
}
| {
/* format:uuid, description:Which face is being queried. */
object_id: string;
type: 'face_is_planar';
}
| {
/* format:uuid, description:Which face is being queried. */
object_id: string;
type: 'face_get_position';
uv: Point2d_type /* The 2D paramter-space u,v position to evaluate the surface at */;
}
| {
/* format:uuid, description:Which face is being queried. */
object_id: string;
type: 'face_get_gradient';
uv: Point2d_type /* The 2D paramter-space u,v position to evaluate the surface at */;
}
| {
front: boolean /* Bring to front = true, send to back = false. */;
/* format:uuid, description:Which object is being changed. */
Expand Down Expand Up @@ -2788,6 +2826,27 @@ export type OkModelingCmdResponse_type =
}
| {
/*{
"$ref": "#/components/schemas/FaceIsPlanar"
}*/
data: FaceIsPlanar_type;
type: 'face_is_planar';
}
| {
/*{
"$ref": "#/components/schemas/FaceGetPosition"
}*/
data: FaceGetPosition_type;
type: 'face_get_position';
}
| {
/*{
"$ref": "#/components/schemas/FaceGetGradient"
}*/
data: FaceGetGradient_type;
type: 'face_get_gradient';
}
| {
/*{
"$ref": "#/components/schemas/PlaneIntersectAndProject"
}*/
data: PlaneIntersectAndProject_type;
Expand Down Expand Up @@ -4515,6 +4574,9 @@ export interface Models {
ExtendedUserResultsPage_type: ExtendedUserResultsPage_type;
ExtrusionFaceCapType_type: ExtrusionFaceCapType_type;
ExtrusionFaceInfo_type: ExtrusionFaceInfo_type;
FaceGetGradient_type: FaceGetGradient_type;
FaceGetPosition_type: FaceGetPosition_type;
FaceIsPlanar_type: FaceIsPlanar_type;
FailureWebSocketResponse_type: FailureWebSocketResponse_type;
FbxStorage_type: FbxStorage_type;
FileCenterOfMass_type: FileCenterOfMass_type;
Expand Down

0 comments on commit 680b0ed

Please sign in to comment.