Skip to content

Commit

Permalink
Add printed pulleys
Browse files Browse the repository at this point in the history
  • Loading branch information
tervay committed Dec 18, 2023
1 parent 9999a41 commit 4b2c4b6
Show file tree
Hide file tree
Showing 7 changed files with 25,821 additions and 1 deletion.
42 changes: 42 additions & 0 deletions scripts/generatePrintedPulleys.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import json


with open("src/common/models/data/cots/printedPulleys.json", "w") as f:
out = []

for bore in [
"NEO",
"Kraken",
"Falcon",
"775",
"550",
"1/2 Hex",
"3/8 Hex",
"0.875in",
"1.125in",
"MAXSpline",
"SplineXL",
]:
for pitch in [
(3, "mm", "GT2"),
(5, "mm", "HTD"),
(0.25, "in", "RT25"),
]:
for t in range(6, 84):
out.append(
{
"bore": bore,
"partNumber": f'{t}T_{bore.replace(" ", "-")}',
"pitch": {
"s": pitch[0],
"u": pitch[1],
},
"teeth": t,
"type": pitch[2],
"vendor": "Printed",
"width": {"s": 15, "u": "mm"},
"url": "#",
}
)

json.dump(out, fp=f)
3 changes: 2 additions & 1 deletion src/common/models/ExtraTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ export type FRCVendor =
| "CTRE"
| "Anderson Power"
| "NI"
| "TTB";
| "TTB"
| "Printed";
export type PulleyBeltType = "HTD" | "GT2" | "RT25";
export type ChainType = "#25" | "#35";
export type Bore =
Expand Down
6 changes: 6 additions & 0 deletions src/common/models/Gearbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,12 @@ export class Gearbox {
});
}

filterStagesForStartingBore(bore: Bore) {
this.stages[0].drivingMethods = this.stages[0].drivingMethods.filter(
(dm) => dm.bore === bore,
);
}

filterStagesForOverlappingBores() {
for (let i = 0; i < this.stages.length - 1; i++) {
const prevStage = this.stages[i];
Expand Down
Loading

1 comment on commit 4b2c4b6

@tervay
Copy link
Owner Author

@tervay tervay commented on 4b2c4b6 Dec 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for recalc ready!

✅ Preview
https://recalc-595oimxki-tervay.vercel.app

Built with commit 4b2c4b6.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.