Skip to content

Commit

Permalink
✨ feat(enclosure): add port geometry to loop pedal
Browse files Browse the repository at this point in the history
- introduce port diameter calculation in mm
- add port geometry to section geometry
- update button height for enclosure thickness change
  • Loading branch information
isfopo committed Nov 30, 2024
1 parent 3923881 commit ba11979
Showing 1 changed file with 31 additions and 15 deletions.
46 changes: 31 additions & 15 deletions hardware/enclosure/LoopPedalEnclosure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const buttons = {
countPerSection: 2,
};

const port = {
diameter: convert(3 / 4, "in").to("mm"),
};

const dimensions = {
face: convert(4, "in").to("mm"),
back: convert(2, "in").to("mm"),
Expand Down Expand Up @@ -67,7 +71,7 @@ const sectionGeo = ({ isEndSection }: SectionOptions) => {
const buttonGeo = (i: number) =>
cylinder({
radius: buttons.diameter / 2,
height: dimensions.thickness * 2,
height: dimensions.thickness * 3,
center: [
i * (section.width / buttons.countPerSection) -
(isEndSection === "right" ? rod.nut.height / 2 : 0),
Expand All @@ -85,23 +89,35 @@ const sectionGeo = ({ isEndSection }: SectionOptions) => {
)
);

const portGeo = rotate(
[-Math.PI / 2, 0, 0],
cylinder({
radius: port.diameter / 2,
height: dimensions.thickness * 3,
center: [
-dimensions.back / 2,
-section.adjustedWidth(isEndSection) / 2,
-offsetRadius,
],
})
);

return subtract(
union(
extrudeLinear(
{ height: section.adjustedWidth(isEndSection) },
subtract(
union(
expand({ delta: dimensions.thickness }, ...shafts()),
expand(
{ delta: dimensions.thickness },
face,
back
) as unknown as Geom2[]
),
...shafts(true)
)
extrudeLinear(
{ height: section.adjustedWidth(isEndSection) },
subtract(
union(
expand({ delta: dimensions.thickness }, ...shafts()),
expand(
{ delta: dimensions.thickness },
face,
back
) as unknown as Geom2[]
),
...shafts(true)
)
),
portGeo,
buttonsGeo
);
};
Expand Down

0 comments on commit ba11979

Please sign in to comment.