Files
modeling-app/rust/kcl-lib/e2e/executor/inputs/lego.kcl
Jess Frazelle c3bdc6f106 Move the wasm lib, and cleanup rust directory and all references (#5585)
* git mv src/wasm-lib rust

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv wasm-lib to workspace

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv kcl-lib

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* mv derive docs

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* resolve file paths

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* clippy

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* move more shit

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix more paths

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* make yarn build:wasm work

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix scripts

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fixups

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* better references

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix cargo ci

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix reference

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix more ci

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix tests

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* cargo sort

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix script

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fmt

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* fix a dep

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* sort

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* remove unused deps

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* Revert "remove unused deps"

This reverts commit fbabdb062e275fd5cbc1476f8480a1afee15d972.

* updates

Signed-off-by: Jess Frazelle <github@jessfraz.com>

* deps;

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>

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
2025-03-01 21:59:01 +00:00

57 lines
1.4 KiB
Plaintext

// Lego Brick
const lbumps = 10 // number of bumps long
const wbumps = 6 // number of bumps wide
const pitch = 8.0
const clearance = 0.1
const bumpDiam = 4.8
const bumpHeight = 1.8
const height = 3.2
const t = (pitch - (2 * clearance) - bumpDiam) / 2.0
const postDiam = pitch - t // works out to 6.5
const total_length = lbumps * pitch - (2.0 * clearance)
const total_width = wbumps * pitch - (2.0 * clearance)
const lSegments = total_length / (lbumps + 1)
const wSegments = total_width / (wbumps + 1)
// make the base
const s = startSketchOn('XY')
|> startProfileAt([-total_width / 2, -total_length / 2], %)
|> line(end = [total_width, 0])
|> line(end = [0, total_length])
|> line(end = [-total_width, 0])
|> close()
|> extrude(length = height)
const shellExtrude = startSketchOn(s, "start")
|> startProfileAt([
-(total_width / 2 - t),
-(total_length / 2 - t)
], %)
|> line(end = [total_width - (2 * t), 0])
|> line(end = [0, total_length - (2 * t)])
|> line(end = [-(total_width - (2 * t)), 0])
|> close()
|> extrude(length = -(height - t))
const peg = startSketchOn(s, "end")
|> circle( center= [
-(total_width / 2 - wSegments),
-(total_length / 2 - lSegments)
], radius= bumpDiam / 2)
|> patternLinear2d(
axis = [1, 0],
instances = 6,
distance = 7
)
|> patternLinear2d(
axis = [0, 1],
instances = 10,
distance = 7
)
|> extrude(length = bumpHeight)