rename radius to length for chamfer; (#2702)
Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
@ -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],
|
||||
|
@ -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 }, %)"
|
||||
]
|
||||
},
|
||||
{
|
||||
|
@ -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<EdgeReference>,
|
||||
}
|
||||
@ -50,7 +50,7 @@ pub async fn chamfer(args: Args) -> Result<MemoryItem, KclError> {
|
||||
/// 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<MemoryItem, KclError> {
|
||||
///
|
||||
/// 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),
|
||||
},
|
||||
|
Reference in New Issue
Block a user