Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const outerRadius = 8.9 / 2;
- const ringHeight = 1.2;
- const innerRadius = 7.26 / 2;
- const stopperHeight = 0.3;
- function innerRing(offset = 0) {
- return cylinder({ r1: innerRadius + offset, r2: innerRadius + offset, h: ringHeight * 2, fn: 128 }).translate([
- 0,
- 0,
- -ringHeight
- ]);
- }
- function innerTab() {
- const w = 2;
- const tabDepth = 0.075;
- const tabHeight = 0.8;
- return intersection(
- cube({ size: [innerRadius + tabDepth, w, tabHeight] }).translate([0, -w / 2, -stopperHeight]),
- innerRing(tabDepth)
- );
- }
- function innerTabStop() {
- const w = 1;
- return cube({ size: [1, w, 0.45] })
- .translate([innerRadius - 0.5, -w / 2, -stopperHeight - 0.05])
- .rotateX(1.5);
- }
- function ring() {
- const stopperRadius = 9.6 / 2;
- const innerTabStopAngle = 68.15;
- return union(
- difference(
- union(
- cylinder({ r1: outerRadius, r2: outerRadius, h: ringHeight, fn: 128 }),
- cylinder({ r1: stopperRadius, r2: stopperRadius, h: stopperHeight, fn: 128 }).translate([0, 0, -stopperHeight])
- ),
- innerRing(),
- innerTab().rotateZ(60),
- innerTab().rotateZ(60 + 120),
- innerTab().rotateZ(60 + 240)
- ),
- difference(
- union(
- innerTabStop().rotateZ(innerTabStopAngle),
- innerTabStop().rotateZ(innerTabStopAngle + 120),
- innerTabStop().rotateZ(innerTabStopAngle + 240)
- ),
- innerRing(),
- cylinder({ r1: stopperRadius, r2: stopperRadius, h: stopperHeight, fn: 128 }).translate([
- 0,
- 0,
- -stopperHeight * 2
- ])
- )
- );
- }
- function tab() {
- const w = 1.5;
- const tabDepth = 0.2;
- const tabHeight = 0.4;
- return intersection(
- difference(
- cube({ size: [outerRadius + tabDepth, w, tabHeight] })
- .translate([0, -w / 2, ringHeight / 2 - tabHeight / 2])
- .rotateX(2.5)
- .setColor(1, 0, 0),
- innerRing()
- ),
- cylinder({ r1: outerRadius + tabDepth, r2: outerRadius + tabDepth, h: ringHeight, fn: 128 })
- );
- }
- function main() {
- return union(ring(), tab().rotateZ(120), tab().rotateZ(240), tab());
- }
Add Comment
Please, Sign In to add comment