Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use correct script file to match HardwareDimensions #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions scripts/Cchannel.groovy
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import com.neuronrobotics.bowlerstudio.vitamins.Vitamins;
import eu.mihosoft.vrl.v3d.parametrics.*;

CSG getFlat() {
CSG getFlat(int hcl) {
double thickness = 1.6002; //aluminum, steel is 1.1684
double holeWidth = 4.6609;
double holeXInset = 4.1, holeYInset = 3.3;
double pitch = 12.7;

int holeCountLength = 5, holeCountWidth = 1;
int holeCountLength = hcl, holeCountWidth = 1;

CSG plate = new Cube(holeCountLength * pitch, holeCountWidth * pitch - thickness, thickness).toCSG();
plate = plate.movex(-plate.getMinX()).movey(-plate.getMinY()).movez(-plate.getMinZ());
Expand Down Expand Up @@ -41,12 +41,23 @@ CSG getFlat() {
}

CSG getCChannel() {
double thickness = 1.6002; //aluminum, steel is 1.1684
String type = "vexCchannel"
if (args==null) {
args=["Steel 2x5"]
}
StringParameter size = new StringParameter(type + " Default",
args.get(0),
Vitamins.listVitaminSizes(type))

HashMap<String,Object> vexConfig = Vitamins.getConfiguration(type, size.getStrValue())

double thickness = vexConfig.thickness
double holeWidth = 4.6609, holeThinGap = 1.6764;
double holeXInset = 4.1, holeYInset = 3.3;
double pitch = 12.7;

int holeCountLength = 5, holeCountWidth = 2;
int holeCountLength = (int) vexConfig.holeCountLength
int holeCountWidth = (int) vexConfig.holeCountWidth

CSG plate = new Cube(holeCountLength * pitch, holeCountWidth * pitch - thickness, thickness).toCSG();
plate = plate.movex(-plate.getMinX()).movey(-plate.getMinY()).movez(-plate.getMinZ());
Expand Down Expand Up @@ -80,7 +91,7 @@ CSG getCChannel() {

plate = plate.difference(holeSet);

CSG side = getFlat().rotx(-90).movez(thickness);
CSG side = getFlat(holeCountLength).rotx(-90).movez(thickness);
plate = plate.union(side).union(side.movey(plate.getTotalY() + side.getTotalY()));

//Center corner at (0, 0)
Expand Down
108 changes: 0 additions & 108 deletions scripts/Cchannelscript.groovy

This file was deleted.