Remove start sketch at (#5586)

* remove start sketch at

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>

* updates

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

* fixes

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

---------

Signed-off-by: Jess Frazelle <github@jessfraz.com>
This commit is contained in:
Jess Frazelle
2025-03-01 16:32:46 -08:00
committed by GitHub
parent c3bdc6f106
commit 66f3500ca9
84 changed files with 5416 additions and 7913 deletions

View File

@ -7,7 +7,8 @@ fn cube(length, center) {
p2 = [ l + x, l + y]
p3 = [ l + x, -l + y]
return startSketchAt(p0)
return startSketchOn(XY)
|> startProfileAt(p0, %)
|> line(endAbsolute = p1)
|> line(endAbsolute = p2)
|> line(endAbsolute = p3)

View File

@ -1,31 +1,32 @@
const rpizWidth = 30
const rpizLength = 65
rpizWidth = 30
rpizLength = 65
const caseThickness = 1
caseThickness = 1
const border = 4
border = 4
const screwHeight = 4
screwHeight = 4
const caseWidth = rpizWidth + border * 2
const caseLength = rpizLength + border * 2
const caseHeight = 8
caseWidth = rpizWidth + border * 2
caseLength = rpizLength + border * 2
caseHeight = 8
const widthBetweenScrews = 23
const lengthBetweenScrews = 29 * 2
widthBetweenScrews = 23
lengthBetweenScrews = 29 * 2
const miniHdmiDistance = 12.4
const microUsb1Distance = 41.4
const microUsb2Distance = 54
miniHdmiDistance = 12.4
microUsb1Distance = 41.4
microUsb2Distance = 54
const miniHdmiWidth = 11.2
const microUsbWidth = 7.4
const connectorPadding = 4
miniHdmiWidth = 11.2
microUsbWidth = 7.4
connectorPadding = 4
const miniHdmiHole = startSketchAt([
miniHdmiHole = startSketchOn(XY)
|> startProfileAt([
0,
border + miniHdmiDistance - (miniHdmiWidth / 2)
])
], %)
|> lineTo([
0,
border + miniHdmiDistance + miniHdmiWidth / 2
@ -40,7 +41,7 @@ const miniHdmiHole = startSketchAt([
], %)
|> close()
const case = startSketchOn('XY')
case = startSketchOn('XY')
|> startProfileAt([0, 0], %)
|> line(endAbsolute = [caseWidth, 0], $edge1)
|> line(endAbsolute = [caseWidth, caseLength], $edge2)
@ -59,7 +60,7 @@ const case = startSketchOn('XY')
fn m25Screw = (x, y, height) => {
const screw = startSketchOn("XY")
screw = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> circle(center= [x, y], radius=2.5)
|> hole(circle(center= [x, y], radius = 1.25), %)

View File

@ -7,7 +7,8 @@ let corner_radius = 5.0
// At first I thought this was going to be symmetric,
// but I measured intentionally to not be symmetric,
// because your wrist isn't a perfect cylindrical surface
let brace_base = startSketchAt([corner_radius, 0])
let brace_base = startSketchOn(XY)
|> startProfileAt([corner_radius, 0], %)
|> line(end = [width - corner_radius, 0.0])
|> tangentialArcToRelative([corner_radius, corner_radius], %)
|> yLine(25.0 - corner_radius, %)
@ -34,7 +35,8 @@ let brace_base = startSketchAt([corner_radius, 0])
|> tangentialArcToRelative([corner_radius, -corner_radius], %)
|> close()
let inner = startSketchAt([0, 0])
let inner = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> xLine(1.0, %)
|> tangentialArcToRelative([corner_radius, corner_radius], %)
|> yLine(25.0 - (corner_radius * 2), %)

View File

@ -21,7 +21,7 @@ Gt = cond([false, false, true])
fn Lte = (a, b) => { return Not(Gt(a, b)) }
fn Gte = (a, b) => { return Not(Lt(a, b)) }
// L-system
// L-system
// Note: it was most concise to encode productions directly in axioms.
// Change them as you need.
@ -100,6 +100,8 @@ fn F = (state, F) => {
}
fn LSystem = (args, axioms) => {
myThing = startSketchOn(XY)
|> startProfileAt([0, 0], %)
return axioms({
depthMax: args.iterations,
depth: 0,
@ -107,7 +109,7 @@ fn LSystem = (args, axioms) => {
factor: args.factor,
currentAngle: 0,
angle: args.angle,
q: startSketchAt([0, 0]),
q = myThing,
})
}
@ -116,6 +118,6 @@ LSystem({
factor: 1.36,
angle: 60,
}, (q) => {
result = q |> F(%, F) |> Add(%) |> Add(%) |> F(%, F) |> Add(%) |> Add(%) |> F(%, F)
result = q |> F(%, F) |> Add(%) |> Add(%) |> F(%, F) |> Add(%) |> Add(%) |> F(%, F)
return result.q
})

View File

@ -8,7 +8,8 @@ const filletR = thickness * 2
const shelfMountL = 9
const wallMountL = 8
const bracket = startSketchAt([0, 0])
const bracket = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, wallMountL])
|> tangentialArc({
radius: filletR,

View File

@ -7,7 +7,8 @@ fn cube = (length, center) => {
let p2 = [ l + x, l + y]
let p3 = [ l + x, -l + y]
return startSketchAt(p0)
return startSketchOn(XY)
|> startProfileAt(p0, %)
|> line(endAbsolute = p1)
|> line(endAbsolute = p2)
|> line(endAbsolute = p3)

View File

@ -1,4 +1,5 @@
const boxSketch = startSketchAt([0, 0])
const boxSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10])
|> tangentialArc({radius: 5, offset: 90}, %)
|> line(end = [5, -15])

View File

@ -153,7 +153,8 @@ async fn kcl_test_negative_args() {
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_basic_tangential_arc_with_point() {
let code = r#"boxSketch = startSketchAt([0, 0])
let code = r#"boxSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10])
|> tangentialArcToRelative([-5, 5], %)
|> line(end = [5, -15])
@ -166,7 +167,8 @@ async fn kcl_test_basic_tangential_arc_with_point() {
#[tokio::test(flavor = "multi_thread")]
async fn kcl_test_basic_tangential_arc_to() {
let code = r#"boxSketch = startSketchAt([0, 0])
let code = r#"boxSketch = startSketchOn(XY)
|> startProfileAt([0, 0], %)
|> line(end = [0, 10])
|> tangentialArcTo([-5, 15], %)
|> line(end = [5, -15])