Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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": "2.0.14",
"version": "2.0.15",
"description": "Javascript library for KittyCAD API",
"type": "module",
"keywords": [
Expand Down
148 changes: 141 additions & 7 deletions spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -20221,7 +20221,7 @@
]
},
"units": {
"description": "The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc.\n\nDefaults to meters.",
"description": "The units of the input data.\n\nThis is very important for correct scaling and when calculating physics properties like mass, etc.\n\nDefaults to millimeters.",
"allOf": [
{
"$ref": "#/components/schemas/UnitLength"
Expand Down Expand Up @@ -20254,7 +20254,7 @@
]
},
"units": {
"description": "The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc.",
"description": "The units of the input data.\n\nThis is very important for correct scaling and when calculating physics properties like mass, etc.\n\nDefaults to millimeters.",
"allOf": [
{
"$ref": "#/components/schemas/UnitLength"
Expand Down Expand Up @@ -20327,7 +20327,7 @@
]
},
"units": {
"description": "The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc.",
"description": "The units of the input data.\n\nThis is very important for correct scaling and when calculating physics properties like mass, etc.\n\nDefaults to millimeters.",
"allOf": [
{
"$ref": "#/components/schemas/UnitLength"
Expand Down Expand Up @@ -24169,6 +24169,72 @@
"type"
]
},
{
"description": "Project an entity on to a plane.",
"type": "object",
"properties": {
"entity_id": {
"description": "Which entity to project (vertex or edge).",
"type": "string",
"format": "uuid"
},
"plane_id": {
"description": "Which plane to project entity_id onto.",
"type": "string",
"format": "uuid"
},
"type": {
"type": "string",
"enum": [
"project_entity_to_plane"
]
},
"use_plane_coords": {
"description": "If true: the projected points are returned in the plane_id's coordinate system, else: the projected points are returned in the world coordinate system.",
"type": "boolean"
}
},
"required": [
"entity_id",
"plane_id",
"type",
"use_plane_coords"
]
},
{
"description": "Project a list of points on to a plane.",
"type": "object",
"properties": {
"plane_id": {
"description": "The id of the plane used for the projection.",
"type": "string",
"format": "uuid"
},
"points": {
"description": "The list of points that will be projected.",
"type": "array",
"items": {
"$ref": "#/components/schemas/Point3d"
}
},
"type": {
"type": "string",
"enum": [
"project_points_to_plane"
]
},
"use_plane_coords": {
"description": "If true: the projected points are returned in the plane_id's coordinate sysetm. else: the projected points are returned in the world coordinate system.",
"type": "boolean"
}
},
"required": [
"plane_id",
"points",
"type",
"use_plane_coords"
]
},
{
"description": "Take a snapshot of the current view.",
"type": "object",
Expand Down Expand Up @@ -24570,7 +24636,7 @@
]
},
{
"description": "Set the units of the scene. For all following commands, the units will be interpreted as the given units.",
"description": "Set the units of the scene. For all following commands, the units will be interpreted as the given units. Any previously executed commands will not be affected or have their units changed. They will remain in the units they were originally executed in.",
"type": "object",
"properties": {
"type": {
Expand Down Expand Up @@ -26823,6 +26889,42 @@
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectEntityToPlane"
},
"type": {
"type": "string",
"enum": [
"project_entity_to_plane"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/components/schemas/ProjectPointsToPlane"
},
"type": {
"type": "string",
"enum": [
"project_points_to_plane"
]
}
},
"required": [
"data",
"type"
]
},
{
"type": "object",
"properties": {
Expand Down Expand Up @@ -28170,7 +28272,7 @@
]
},
"units": {
"description": "Export length unit.\n\nDefaults to meters.",
"description": "Export length unit.\n\nDefaults to millimeters.",
"allOf": [
{
"$ref": "#/components/schemas/UnitLength"
Expand Down Expand Up @@ -28219,7 +28321,7 @@
]
},
"units": {
"description": "Export length unit.\n\nDefaults to meters.",
"description": "Export length unit.\n\nDefaults to millimeters.",
"allOf": [
{
"$ref": "#/components/schemas/UnitLength"
Expand Down Expand Up @@ -28294,7 +28396,7 @@
]
},
"units": {
"description": "Export length unit.\n\nDefaults to meters.",
"description": "Export length unit.\n\nDefaults to millimeters.",
"allOf": [
{
"$ref": "#/components/schemas/UnitLength"
Expand Down Expand Up @@ -28992,6 +29094,38 @@
"can_train_on_data"
]
},
"ProjectEntityToPlane": {
"description": "The response from the `ProjectEntityToPlane` command.",
"type": "object",
"properties": {
"projected_points": {
"description": "Projected points.",
"type": "array",
"items": {
"$ref": "#/components/schemas/Point3d"
}
}
},
"required": [
"projected_points"
]
},
"ProjectPointsToPlane": {
"description": "The response from the `ProjectPointsToPlane` command.",
"type": "object",
"properties": {
"projected_points": {
"description": "Projected points.",
"type": "array",
"items": {
"$ref": "#/components/schemas/Point3d"
}
}
},
"required": [
"projected_points"
]
},
"RawFile": {
"description": "A raw file with unencoded contents to be passed over binary websockets. When raw files come back for exports it is sent as binary/bson, not text/json.",
"type": "object",
Expand Down
65 changes: 58 additions & 7 deletions src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1803,9 +1803,11 @@ Defaults to the [KittyCAD co-ordinate system].
[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html */
coords: System_type;
type: 'obj';
/* The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc.
/* The units of the input data.

Defaults to meters. */
This is very important for correct scaling and when calculating physics properties like mass, etc.

Defaults to millimeters. */
units: UnitLength_type;
}
| {
Expand All @@ -1816,7 +1818,12 @@ Defaults to the [KittyCAD co-ordinate system].
[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html */
coords: System_type;
type: 'ply';
units: UnitLength_type /* The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. */;
/* The units of the input data.

This is very important for correct scaling and when calculating physics properties like mass, etc.

Defaults to millimeters. */
units: UnitLength_type;
}
| {
/*{
Expand All @@ -1842,7 +1849,12 @@ Defaults to the [KittyCAD co-ordinate system].
[KittyCAD co-ordinate system]: ../coord/constant.KITTYCAD.html */
coords: System_type;
type: 'stl';
units: UnitLength_type /* The units of the input data. This is very important for correct scaling and when calculating physics properties like mass, etc. */;
/* The units of the input data.

This is very important for correct scaling and when calculating physics properties like mass, etc.

Defaults to millimeters. */
units: UnitLength_type;
};

export interface Invoice_type {
Expand Down Expand Up @@ -2925,6 +2937,21 @@ export type ModelingCmd_type =
curve_id: string;
type: 'curve_get_control_points';
}
| {
/* format:uuid, description:Which entity to project (vertex or edge). */
entity_id: string;
/* format:uuid, description:Which plane to project entity_id onto. */
plane_id: string;
type: 'project_entity_to_plane';
use_plane_coords: boolean /* If true: the projected points are returned in the plane_id's coordinate system, else: the projected points are returned in the world coordinate system. */;
}
| {
/* format:uuid, description:The id of the plane used for the projection. */
plane_id: string;
points: Point3d_type[] /* The list of points that will be projected. */;
type: 'project_points_to_plane';
use_plane_coords: boolean /* If true: the projected points are returned in the plane_id's coordinate sysetm. else: the projected points are returned in the world coordinate system. */;
}
| {
format: ImageFormat_type /* What image format to return. */;
type: 'take_snapshot';
Expand Down Expand Up @@ -3824,6 +3851,20 @@ export type OkModelingCmdResponse_type =
}
| {
/*{
"$ref": "#/components/schemas/ProjectEntityToPlane"
}*/
data: ProjectEntityToPlane_type;
type: 'project_entity_to_plane';
}
| {
/*{
"$ref": "#/components/schemas/ProjectPointsToPlane"
}*/
data: ProjectPointsToPlane_type;
type: 'project_points_to_plane';
}
| {
/*{
"$ref": "#/components/schemas/CurveGetType"
}*/
data: CurveGetType_type;
Expand Down Expand Up @@ -4291,7 +4332,7 @@ Defaults to the [KittyCAD co-ordinate system].
type: 'obj';
/* Export length unit.

Defaults to meters. */
Defaults to millimeters. */
units: UnitLength_type;
}
| {
Expand All @@ -4306,7 +4347,7 @@ Defaults to the [KittyCAD co-ordinate system].
type: 'ply';
/* Export length unit.

Defaults to meters. */
Defaults to millimeters. */
units: UnitLength_type;
}
| {
Expand All @@ -4330,7 +4371,7 @@ Defaults to the [KittyCAD co-ordinate system].
type: 'stl';
/* Export length unit.

Defaults to meters. */
Defaults to millimeters. */
units: UnitLength_type;
};

Expand Down Expand Up @@ -4537,6 +4578,14 @@ export interface PrivacySettings_type {
can_train_on_data: boolean /* If we can train on the data. If the user is a member of an organization, the organization's setting will override this. The organization's setting takes priority. */;
}

export interface ProjectEntityToPlane_type {
projected_points: Point3d_type[] /* Projected points. */;
}

export interface ProjectPointsToPlane_type {
projected_points: Point3d_type[] /* Projected points. */;
}

export interface RawFile_type {
/*{
"format": "uint8",
Expand Down Expand Up @@ -6192,6 +6241,8 @@ export interface Models {
Pong_type: Pong_type;
PostEffectType_type: PostEffectType_type;
PrivacySettings_type: PrivacySettings_type;
ProjectEntityToPlane_type: ProjectEntityToPlane_type;
ProjectPointsToPlane_type: ProjectPointsToPlane_type;
RawFile_type: RawFile_type;
ReconfigureStream_type: ReconfigureStream_type;
RemoveSceneObjects_type: RemoveSceneObjects_type;
Expand Down