diff --git a/package.json b/package.json index e231ef1f..f416ebe7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kittycad/lib", - "version": "2.0.14", + "version": "2.0.15", "description": "Javascript library for KittyCAD API", "type": "module", "keywords": [ diff --git a/spec.json b/spec.json index 0942cb0a..4636a16b 100644 --- a/spec.json +++ b/spec.json @@ -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" @@ -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" @@ -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" @@ -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", @@ -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": { @@ -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": { @@ -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" @@ -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" @@ -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" @@ -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", diff --git a/src/models.ts b/src/models.ts index 782ff1f9..47b75e9e 100644 --- a/src/models.ts +++ b/src/models.ts @@ -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; } | { @@ -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; } | { /*{ @@ -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 { @@ -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'; @@ -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; @@ -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; } | { @@ -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; } | { @@ -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; }; @@ -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", @@ -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;