Skip to content

Commit e63cb43

Browse files
committed
Adding caster and tires
1 parent 018cb60 commit e63cb43

1 file changed

Lines changed: 67 additions & 13 deletions

File tree

BaseBot.groovy

Lines changed: 67 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ import eu.mihosoft.vrl.v3d.Cube
88
import eu.mihosoft.vrl.v3d.Cylinder
99
import eu.mihosoft.vrl.v3d.FileUtil
1010
import eu.mihosoft.vrl.v3d.RoundedCube
11+
import eu.mihosoft.vrl.v3d.Sphere
1112
import eu.mihosoft.vrl.v3d.Transform
1213
import eu.mihosoft.vrl.v3d.parametrics.LengthParameter
14+
import javafx.scene.paint.Color
1315

1416
double caseRounding = 4
1517

@@ -417,30 +419,68 @@ top.setManufacturing({ toMfg ->
417419
.toZMin()
418420
})
419421
LengthParameter tailLength = new LengthParameter("Cable Cut Out Length",30,[500, 0.01])
420-
tailLength.setMM(100)
422+
tailLength.setMM(25)
421423
CSG motor = Vitamins.get("hobbyServo", "tproSG90")
422424
CSG horn = Vitamins.get("hobbyServoHorn", "tproSG90_1")
423425
.movez(motor.getMaxZ())
426+
double hornDepth = horn.getTotalZ()
427+
double halfServoDistance = motor.getTotalX()/2
428+
CSG tire = Vitamins.get("oRing", "2inchOD")
429+
430+
CSG wheepCore = new Cylinder(tire.getTotalZ()/2-3, hornDepth).toCSG()
431+
.roty(90)
432+
.moveToCenterX()
433+
.difference(tire)
434+
.roty(-90)
435+
.toZMin()
436+
.movez(motor.getMaxZ())
437+
CSG tireAlligned = tire.roty(90)
438+
.movez(motor.getMaxZ()+wheepCore.getTotalZ()/2)
439+
424440
Transform leftSide = new Transform()
441+
.movez(-8)
442+
.movey(10)
443+
.roty(90)
444+
.movex(bot.getMinX())
445+
.movez(bot.getMinZ()-halfServoDistance)
446+
.movey(5)
447+
425448
Transform rightSide = new Transform()
426-
427-
CSG asmOfDrive = motor.union(horn).rotz(180)
428-
.movez(-8)
429-
.movey(10)
449+
.movez(-8)
450+
.movey(10)
451+
.roty(-90)
452+
.movex(bot.getMaxX())
453+
.movez(bot.getMinZ()-halfServoDistance)
454+
.movey(5)
455+
456+
CSG asmOfDrive = motor
457+
.union(horn)
458+
.rotz(180)
430459

431460
CSG leftDrive = asmOfDrive.transformed(leftSide)
432-
.roty(90)
433-
.movex(bot.getMinX())
461+
434462

435463
CSG rightDrive = asmOfDrive.transformed(rightSide)
436-
.roty(-90)
437-
.movex(bot.getMaxX())
464+
438465

439466
CSG bothDrive = leftDrive.union(rightDrive)
440-
.toZMax()
441-
.movez(bot.getMinZ())
442-
.movey(5)
467+
468+
443469

470+
CSG leftWheel = wheepCore.transformed(leftSide).difference(leftDrive)
471+
CSG rightWheel = wheepCore.transformed(rightSide).difference(rightDrive)
472+
CSG tireMovedR = tireAlligned.transformed(rightSide).setColor(Color.BLACK)
473+
tireMovedR.setManufacturing({ toMfg ->
474+
return null
475+
})
476+
CSG tireMovedL = tireAlligned.transformed(leftSide).setColor(Color.BLACK)
477+
tireMovedL.setManufacturing({ toMfg ->
478+
return null
479+
})
480+
bothDrive.setColor(Color.SILVER)
481+
bothDrive.setManufacturing({ toMfg ->
482+
return null
483+
})
444484
CSG servoBlock = new Cube(bot.getTotalX()-caseRounding*2,bot.getTotalY()-caseRounding*2, bothDrive.getTotalZ())
445485
.toCSG()
446486
.toZMax()
@@ -449,14 +489,28 @@ CSG servoBlock = new Cube(bot.getTotalX()-caseRounding*2,bot.getTotalY()-caseRou
449489
.movey(bot.getMaxY()-caseRounding)
450490
.toXMax()
451491
.movex(bot.getMaxX()-caseRounding)
492+
CSG servoCover = servoBlock.difference(servoBlock.movez(2))
493+
.movez(-2)
494+
double distanceFromBottomToGround= Math.abs(tireMovedR.getMinZ()- servoCover.getMinZ())
495+
CSG Caster= new Sphere(distanceFromBottomToGround,20,30).toCSG()
496+
497+
Caster=Caster.difference(Caster.getBoundingBox().toZMin())
498+
.movez(servoCover.getMinZ())
499+
.movex(servoCover.getCenterX())
500+
.toYMax()
501+
.movey(servoCover.getMaxY())
502+
servoCover=servoCover.union(Caster)
452503
CSG blockCordCut = servoBlock.toYMax()
453504
.movey(servoBlock.getMinY()+12)
454505
.movez(-5)
455506
bot=bot.union(servoBlock)
456507
.difference(bothDrive)
457508
.difference(blockCordCut)
509+
510+
CSG coverscrew = Vitamins.get("chamferedScrew", "M3x16")
511+
458512

459-
return [top,bot]
513+
return [top,bot,servoCover,bothDrive,leftWheel,rightWheel,tireMovedR,tireMovedL]
460514

461515

462516

0 commit comments

Comments
 (0)