* benchmark retry Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix times Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix times Signed-off-by: Jess Frazelle <github@jessfraz.com> * dont use a custom iter Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * just parse Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * A snapshot a day keeps the bugs away! 📷🐛 (OS: namespace-profile-ubuntu-8-cores) * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * use runs on Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
		
			
				
	
	
		
			96 lines
		
	
	
		
			215 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
			
		
		
	
	
			96 lines
		
	
	
		
			215 KiB
		
	
	
	
		
			Markdown
		
	
	
	
	
	
---
 | 
						|
title: "chamfer"
 | 
						|
excerpt: "Cut a straight transitional edge along a tagged path."
 | 
						|
layout: manual
 | 
						|
---
 | 
						|
 | 
						|
Cut a straight transitional edge along a tagged path.
 | 
						|
 | 
						|
Chamfer is similar in function and use to a fillet, except a fillet will blend the transition along an edge, rather than cut a sharp, straight transitional edge.
 | 
						|
 | 
						|
```js
 | 
						|
chamfer(
 | 
						|
  solid: Solid,
 | 
						|
  length: number,
 | 
						|
  tags: [EdgeReference],
 | 
						|
  tag?: TagDeclarator,
 | 
						|
): Solid
 | 
						|
```
 | 
						|
 | 
						|
 | 
						|
### Arguments
 | 
						|
 | 
						|
| Name | Type | Description | Required |
 | 
						|
|----------|------|-------------|----------|
 | 
						|
| `solid` | [`Solid`](/docs/kcl/types/Solid) | The solid whose edges should be chamfered | Yes |
 | 
						|
| `length` | [`number`](/docs/kcl/types/number) | The length of the chamfer | Yes |
 | 
						|
| `tags` | [`[EdgeReference]`](/docs/kcl/types/EdgeReference) | The paths you want to chamfer | Yes |
 | 
						|
| [`tag`](/docs/kcl/types/tag) | [`TagDeclarator`](/docs/kcl/types#tag-declaration) | Create a new tag which refers to this chamfer | No |
 | 
						|
 | 
						|
### Returns
 | 
						|
 | 
						|
[`Solid`](/docs/kcl/types/Solid)
 | 
						|
 | 
						|
 | 
						|
### Examples
 | 
						|
 | 
						|
```js
 | 
						|
// Chamfer a mounting plate.
 | 
						|
width = 20
 | 
						|
length = 10
 | 
						|
thickness = 1
 | 
						|
chamferLength = 2
 | 
						|
 | 
						|
mountingPlateSketch = startSketchOn("XY")
 | 
						|
  |> startProfileAt([-width / 2, -length / 2], %)
 | 
						|
  |> line(endAbsolute = [width / 2, -length / 2], tag = $edge1)
 | 
						|
  |> line(endAbsolute = [width / 2, length / 2], tag = $edge2)
 | 
						|
  |> line(endAbsolute = [-width / 2, length / 2], tag = $edge3)
 | 
						|
  |> close(tag = $edge4)
 | 
						|
 | 
						|
mountingPlate = extrude(mountingPlateSketch, length = thickness)
 | 
						|
  |> chamfer(
 | 
						|
       length = chamferLength,
 | 
						|
       tags = [
 | 
						|
         getNextAdjacentEdge(edge1),
 | 
						|
         getNextAdjacentEdge(edge2),
 | 
						|
         getNextAdjacentEdge(edge3),
 | 
						|
         getNextAdjacentEdge(edge4)
 | 
						|
       ],
 | 
						|
     )
 | 
						|
```
 | 
						|
 | 
						|

 | 
						|
 | 
						|
```js
 | 
						|
// Sketch on the face of a chamfer.
 | 
						|
fn cube(pos, scale) {
 | 
						|
  sg = startSketchOn('XY')
 | 
						|
    |> startProfileAt(pos, %)
 | 
						|
    |> line(end = [0, scale])
 | 
						|
    |> line(end = [scale, 0])
 | 
						|
    |> line(end = [0, -scale])
 | 
						|
 | 
						|
  return sg
 | 
						|
}
 | 
						|
 | 
						|
part001 = cube([0, 0], 20)
 | 
						|
  |> close(tag = $line1)
 | 
						|
  |> extrude(length = 20)
 | 
						|
  // We tag the chamfer to reference it later.
 | 
						|
  |> chamfer(length = 10, tags = [getOppositeEdge(line1)], tag = $chamfer1)
 | 
						|
 | 
						|
sketch001 = startSketchOn(part001, chamfer1)
 | 
						|
  |> startProfileAt([10, 10], %)
 | 
						|
  |> line(end = [2, 0])
 | 
						|
  |> line(end = [0, 2])
 | 
						|
  |> line(end = [-2, 0])
 | 
						|
  |> line(endAbsolute = [profileStartX(%), profileStartY(%)])
 | 
						|
  |> close()
 | 
						|
  |> extrude(length = 10)
 | 
						|
```
 | 
						|
 | 
						|

 | 
						|
 | 
						|
 |