44import height, width, thickness, chamferLength, offset, screenWidth, screenHeight, screenYPosition, screenDepth, speakerBoxWidth, speakerBoxHeight from "globals.kcl"
55
66// Create a function for the body
7- export fn body() {
8- bodySketch = startSketchOn('XZ')
9- |> startProfileAt([-width / 2, height / 2], %)
10- |> xLine(width, %, $chamfer1)
11- |> yLine(-height, %, $chamfer2)
12- |> xLine(-width, %, $chamfer3)
13- |> close(%, $chamfer4)
14- bodyExtrude = extrude(thickness, bodySketch)
15- |> chamfer({
16- length = chamferLength,
17- tags = [
18- getNextAdjacentEdge(chamfer1),
19- getNextAdjacentEdge(chamfer2),
20- getNextAdjacentEdge(chamfer3),
21- getNextAdjacentEdge(chamfer4)
22- ]
23- }, %)
24- // |> appearance({
25- // color = '#707980',
26- // metalness = 90,
27- // roughness = 90
28- // }, %)
29-
30-
7+ bodySketch = startSketchOn('XZ')
8+ |> startProfileAt([-width / 2, height / 2], %)
9+ |> xLine(width, %, $chamfer1)
10+ |> yLine(-height, %, $chamfer2)
11+ |> xLine(-width, %, $chamfer3)
12+ |> close(%, $chamfer4)
13+ bodyExtrude = extrude(thickness, bodySketch)
14+ |> chamfer({
15+ length = chamferLength,
16+ tags = [
17+ getNextAdjacentEdge(chamfer1),
18+ getNextAdjacentEdge(chamfer2),
19+ getNextAdjacentEdge(chamfer3),
20+ getNextAdjacentEdge(chamfer4)
21+ ]
22+ }, %)
23+ // |> appearance({
24+ // color = '#707980',
25+ // metalness = 90,
26+ // roughness = 90
27+ // }, %)
3128
32- // Define the offset for the indentation
33- sketch002 = startSketchOn(bodyExtrude, 'END')
34- |> startProfileAt([
35- -width / 2 + offset,
36- height / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))
37- ], %)
38- |> angledLineToY({ angle = 45, to = height / 2 - offset }, %)
39- |> lineTo([
40- width / 2 - (chamferLength + offset / 2 * cos(toRadians(45))),
41- height / 2 - offset
42- ], %)
43- |> angledLineToX({ angle = -45, to = width / 2 - offset }, %)
44- |> lineTo([
45- width / 2 - offset,
46- -(height / 2 - (chamferLength + offset / 2 * cos(toRadians(45))))
47- ], %)
48- |> angledLineToY({
49- angle = -135,
50- to = -height / 2 + offset
51- }, %)
52- |> lineTo([
53- -(width / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))),
54- -height / 2 + offset
55- ], %)
56- |> angledLineToX({
57- angle = -225,
58- to = -width / 2 + offset
59- }, %)
60- |> close(%)
61- extrude002 = extrude(-0.0625, sketch002)
62- // |> appearance({
63- // color = '#707980',
64- // metalness = 90,
65- // roughness = 90
66- // }, %)
6729
6830
69- // Create the pocket for the screen
70- sketch003 = startSketchOn(extrude002, 'start')
71- |> startProfileAt([-screenWidth / 2, screenYPosition], %)
72- |> xLine(screenWidth, %, $seg01)
73- |> yLine(-screenHeight, %)
74- |> xLine(-segLen(seg01), %)
75- |> lineTo([profileStartX(%), profileStartY(%)], %)
76- |> close(%)
77- extrude003 = extrude(screenDepth, sketch003)
78- // |> appearance({
79- // color = '#707980',
80- // metalness = 90,
81- // roughness = 90
82- // }, %)
83-
31+ // Define the offset for the indentation
32+ sketch002 = startSketchOn(bodyExtrude, 'END')
33+ |> startProfileAt([
34+ -width / 2 + offset,
35+ height / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))
36+ ], %)
37+ |> angledLineToY({ angle = 45, to = height / 2 - offset }, %)
38+ |> lineTo([
39+ width / 2 - (chamferLength + offset / 2 * cos(toRadians(45))),
40+ height / 2 - offset
41+ ], %)
42+ |> angledLineToX({ angle = -45, to = width / 2 - offset }, %)
43+ |> lineTo([
44+ width / 2 - offset,
45+ -(height / 2 - (chamferLength + offset / 2 * cos(toRadians(45))))
46+ ], %)
47+ |> angledLineToY({
48+ angle = -135,
49+ to = -height / 2 + offset
50+ }, %)
51+ |> lineTo([
52+ -(width / 2 - (chamferLength + offset / 2 * cos(toRadians(45)))),
53+ -height / 2 + offset
54+ ], %)
55+ |> angledLineToX({
56+ angle = -225,
57+ to = -width / 2 + offset
58+ }, %)
59+ |> close(%)
60+ extrude002 = extrude(-0.0625, sketch002)
61+ // |> appearance({
62+ // color = '#707980',
63+ // metalness = 90,
64+ // roughness = 90
65+ // }, %)
66+
67+
68+ // Create the pocket for the screen
69+ sketch003 = startSketchOn(extrude002, 'start')
70+ |> startProfileAt([-screenWidth / 2, screenYPosition], %)
71+ |> xLine(screenWidth, %, $seg01)
72+ |> yLine(-screenHeight, %)
73+ |> xLine(-segLen(seg01), %)
74+ |> lineTo([profileStartX(%), profileStartY(%)], %)
75+ |> close(%)
76+ extrude003 = extrude(screenDepth, sketch003)
77+ // |> appearance({
78+ // color = '#707980',
79+ // metalness = 90,
80+ // roughness = 90
81+ // }, %)
82+
8483
85- // Create the speaker box
86- sketch004 = startSketchOn(extrude002, 'start')
87- |> startProfileAt([-1.25 / 2, -.125], %)
88- |> xLine(speakerBoxWidth, %)
89- |> yLine(-speakerBoxHeight, %)
90- |> xLine(-speakerBoxWidth, %)
91- |> close(%)
92-
93- extrude004 = extrude(-.5, sketch004)
84+ // Create the speaker box
85+ sketch004 = startSketchOn(extrude002, 'start')
86+ |> startProfileAt([-1.25 / 2, -.125], %)
87+ |> xLine(speakerBoxWidth, %)
88+ |> yLine(-speakerBoxHeight, %)
89+ |> xLine(-speakerBoxWidth, %)
90+ |> close(%)
9491
95- return extrude004
96- }
92+ export body = extrude(-.5, sketch004)
0 commit comments