Skip to content

Commit 8f621a8

Browse files
committed
feat(robot): add front "wheel"
1 parent fe48aad commit 8f621a8

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

src/models/robotWars.ts

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import {
2121
translateY,
2222
translateZ,
2323
} from '@jscad/modeling/src/operations/transforms'
24+
import { sphere } from '@jscad/modeling/src/primitives'
2425
import { degToRad } from '@jscad/modeling/src/utils'
2526
import { hexagonGrid } from '../utils/hexagon'
2627

@@ -205,6 +206,37 @@ const cableHolder = () => {
205206
)
206207
}
207208

209+
const frontWheel = () =>
210+
union(
211+
cylinder({
212+
height: 20,
213+
radius: 5,
214+
center: [5, 0, 10],
215+
}),
216+
cuboid({
217+
center: [2.5, 0, 10],
218+
size: [5, 10, 20],
219+
}),
220+
rotateX(
221+
degToRad(90),
222+
intersect(
223+
cylinder({
224+
height: 10,
225+
radius: 20,
226+
segments: 20,
227+
}),
228+
cuboid({
229+
size: [40, 40, 40],
230+
center: [-20, 20, 0],
231+
}),
232+
),
233+
),
234+
sphere({
235+
radius: 5,
236+
center: [5, 0, 20],
237+
}),
238+
)
239+
208240
export const robotBody = (): (Geom2 | Geom3 | Poly3 | Path2)[] => {
209241
const pcbWidth = 63.5
210242
const padding = 15
@@ -369,9 +401,9 @@ export const robotBody = (): (Geom2 | Geom3 | Poly3 | Path2)[] => {
369401
[-11 - 44.25, width - 29, 2],
370402
rotateZ(degToRad(180), cableHolder()),
371403
),
372-
373404
translate([-6, 22, 2], cableHolder()),
374405
translate([-6, width - 22, 2], rotateZ(degToRad(180), cableHolder())),
406+
translate([-length + 20, width / 2, 0], frontWheel()),
375407
),
376408
]
377409
}

0 commit comments

Comments
 (0)