Skip to content

Instantly share code, notes, and snippets.

@adamchalmers
Created May 13, 2026 17:20
Show Gist options
  • Select an option

  • Save adamchalmers/a3d40f881a71f2d03d796382acd3d2a9 to your computer and use it in GitHub Desktop.

Select an option

Save adamchalmers/a3d40f881a71f2d03d796382acd3d2a9 to your computer and use it in GitHub Desktop.
@settings(kclVersion = 2.0)
width = 7mm
sketch001 = sketch(on = XY) {
line1 = line(start = [var -3.07mm, var 2.81mm], end = [var 3.33mm, var 2.81mm])
line2 = line(start = [var 3.33mm, var 2.81mm], end = [var 3.33mm, var -3.59mm])
line3 = line(start = [var 3.33mm, var -3.59mm], end = [var -3.07mm, var -3.59mm])
line4 = line(start = [var -3.07mm, var -3.59mm], end = [var -3.07mm, var 2.81mm])
coincident([line1.end, line2.start])
coincident([line2.end, line3.start])
coincident([line3.end, line4.start])
coincident([line4.end, line1.start])
parallel([line2, line4])
parallel([line3, line1])
perpendicular([line1, line2])
horizontal(line3)
equalLength([line1, line2, line3, line4])
distance([line1.start, line1.end]) == width
line5 = line(start = [var 0mm, var 0mm], end = [var -3.07mm, var -3.59mm], construction = true)
coincident([line5.start, ORIGIN])
coincident([line5.end, line4.start])
line6 = line(start = [var 0mm, var 0mm], end = [var 3.33mm, var 2.81mm], construction = true)
coincident([line6.start, line5.start])
coincident([line6.end, line2.start])
equalLength([line6, line5])
parallel([line6, line5])
}
hidden001 = hide(sketch001)
region001 = region(point = [0mm, 3.4975mm], sketch = sketch001)
extrude001 = extrude(region001, length = width, symmetric = true)
appearance(
extrude001,
color = "#4ab8ba",
metalness = 80,
roughness = 50,
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment