Files
modeling-app/public/kcl-samples/pipe-flange-assembly/95479a127-hex-nut.kcl
Jonathan Tran 2d43399703 Update pipe flange assembly (#5893)
* update pipe flange assy and small change to walkie talkie

* update header in globals.kcl

* Update kcl-samples simulation test output

* Update kcl-samples simulation test output

* Update output after merge

---------

Co-authored-by: jgomez720 <114548659+jgomez720@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-03-20 03:49:06 +00:00

50 lines
1.2 KiB
Plaintext

// 95479A127 Hex Nut
// import constants
import hexNutDiameter, hexNutFlatToFlat, hexNutThickness, hexNutFlatLength from "globals.kcl"
// set units
@settings(defaultLengthUnit = in)
// create a function to make the hex nut
export fn hexNut() {
// create the base of the hex nut
hexNutBase = startSketchOn('XY')
|> startProfileAt([
hexNutFlatToFlat / 2,
hexNutFlatLength / 2
], %)
|> angledLine({
angle = 270,
length = hexNutFlatLength
}, %)
|> angledLine({
angle = 210,
length = hexNutFlatLength
}, %)
|> angledLine({
angle = 150,
length = hexNutFlatLength
}, %)
|> angledLine({
angle = 90,
length = hexNutFlatLength
}, %)
|> angledLine({
angle = 30,
length = hexNutFlatLength
}, %)
|> close()
|> extrude(length = hexNutThickness)
// create the hole in the center of the hex nut
hexNut = startSketchOn(hexNutBase, 'end')
|> circle(center = [0, 0], radius = hexNutDiameter / 2)
|> extrude(%, length = -hexNutThickness)
|> appearance(%, color = "#4edfd5")
return hexNut
}
// https://www.mcmaster.com/95479A127/