diff --git a/docs/kcl/chamfer.md b/docs/kcl/chamfer.md index 8470275a7..5865ee32c 100644 --- a/docs/kcl/chamfer.md +++ b/docs/kcl/chamfer.md @@ -18,7 +18,7 @@ chamfer(data: ChamferData, extrude_group: ExtrudeGroup) -> ExtrudeGroup const width = 20 const length = 10 const thickness = 1 -const chamferRadius = 2 +const chamferLength = 2 const mountingPlateSketch = startSketchOn("XY") |> startProfileAt([-width / 2, -length / 2], %) @@ -29,7 +29,7 @@ const mountingPlateSketch = startSketchOn("XY") const mountingPlate = extrude(thickness, mountingPlateSketch) |> chamfer({ - radius: chamferRadius, + length: chamferLength, tags: [ getNextAdjacentEdge('edge1', %), getNextAdjacentEdge('edge2', %), @@ -46,8 +46,8 @@ const mountingPlate = extrude(thickness, mountingPlateSketch) * `data`: `ChamferData` - Data for chamfers. (REQUIRED) ```js { - // The radius of the chamfer. - radius: number, + // The length of the chamfer. + length: number, // The tags of the paths you want to chamfer. tags: [uuid | string], diff --git a/docs/kcl/std.json b/docs/kcl/std.json index cb3234a09..d1971cb4a 100644 --- a/docs/kcl/std.json +++ b/docs/kcl/std.json @@ -18155,12 +18155,12 @@ "description": "Data for chamfers.", "type": "object", "required": [ - "radius", + "length", "tags" ], "properties": { - "radius": { - "description": "The radius of the chamfer.", + "length": { + "description": "The length of the chamfer.", "type": "number", "format": "double" }, @@ -19702,7 +19702,7 @@ "unpublished": false, "deprecated": false, "examples": [ - "const width = 20\nconst length = 10\nconst thickness = 1\nconst chamferRadius = 2\n\nconst mountingPlateSketch = startSketchOn(\"XY\")\n |> startProfileAt([-width / 2, -length / 2], %)\n |> lineTo([width / 2, -length / 2], %, 'edge1')\n |> lineTo([width / 2, length / 2], %, 'edge2')\n |> lineTo([-width / 2, length / 2], %, 'edge3')\n |> close(%, 'edge4')\n\nconst mountingPlate = extrude(thickness, mountingPlateSketch)\n |> chamfer({\n radius: chamferRadius,\n tags: [\n getNextAdjacentEdge('edge1', %),\n getNextAdjacentEdge('edge2', %),\n getNextAdjacentEdge('edge3', %),\n getNextAdjacentEdge('edge4', %)\n ]\n }, %)" + "const width = 20\nconst length = 10\nconst thickness = 1\nconst chamferLength = 2\n\nconst mountingPlateSketch = startSketchOn(\"XY\")\n |> startProfileAt([-width / 2, -length / 2], %)\n |> lineTo([width / 2, -length / 2], %, 'edge1')\n |> lineTo([width / 2, length / 2], %, 'edge2')\n |> lineTo([-width / 2, length / 2], %, 'edge3')\n |> close(%, 'edge4')\n\nconst mountingPlate = extrude(thickness, mountingPlateSketch)\n |> chamfer({\n length: chamferLength,\n tags: [\n getNextAdjacentEdge('edge1', %),\n getNextAdjacentEdge('edge2', %),\n getNextAdjacentEdge('edge3', %),\n getNextAdjacentEdge('edge4', %)\n ]\n }, %)" ] }, { diff --git a/src/wasm-lib/kcl/src/std/chamfer.rs b/src/wasm-lib/kcl/src/std/chamfer.rs index 5701f56d6..4d2e166e3 100644 --- a/src/wasm-lib/kcl/src/std/chamfer.rs +++ b/src/wasm-lib/kcl/src/std/chamfer.rs @@ -19,8 +19,8 @@ pub(crate) const DEFAULT_TOLERANCE: f64 = 0.0000001; #[ts(export)] #[serde(rename_all = "camelCase")] pub struct ChamferData { - /// The radius of the chamfer. - pub radius: f64, + /// The length of the chamfer. + pub length: f64, /// The tags of the paths you want to chamfer. pub tags: Vec, } @@ -50,7 +50,7 @@ pub async fn chamfer(args: Args) -> Result { /// const width = 20 /// const length = 10 /// const thickness = 1 -/// const chamferRadius = 2 +/// const chamferLength = 2 /// /// const mountingPlateSketch = startSketchOn("XY") /// |> startProfileAt([-width/2, -length/2], %) @@ -61,7 +61,7 @@ pub async fn chamfer(args: Args) -> Result { /// /// const mountingPlate = extrude(thickness, mountingPlateSketch) /// |> chamfer({ -/// radius: chamferRadius, +/// length: chamferLength, /// tags: [ /// getNextAdjacentEdge('edge1', %), /// getNextAdjacentEdge('edge2', %), @@ -114,7 +114,7 @@ async fn inner_chamfer( ModelingCmd::Solid3DFilletEdge { edge_id, object_id: extrude_group.id, - radius: data.radius, + radius: data.length, tolerance: DEFAULT_TOLERANCE, // We can let the user set this in the future. cut_type: Some(kittycad::types::CutType::Chamfer), },