Make the tab size relative to the screw hole size.
Position the tabs based on Thick, PanelThick, and the tab size.
The are now scaled properly as you increase the related parameters.
There was some artifacting and errors resulting from the inner rails not
producing a valid 2-manifold object. Make the rails larger so they
interect the box, and make the subtraction the full height and width of
the box so the boundary isn't indeterminate.
The last change didn't work if Filet is 0. minkowski didn't work well
with a 2D null argument either. This is a better solution, plus it saves
a line.
The preview works fine, but there's still an issue with the full render.
Do the minkowski in 2D so that if Filet is 0, and half the minkowski is
null, you don't have to fix the height. Then translate, extrude, and
rotate it.
Update the comment at the top, which described Filet as a diameter,
which was incorrect for most of the file.
Make it clear that the circle used in foot creation is a radius. It
already was, but provide r= in the argument so it's unambiguous.
SquareHole was treating its filet as a diameter, rather than a radius.
Switch it to treat Filet as a radius. This does make the example square
holes rounder.
Make all vent holes Thick + Filet thick so they extend to the end of the
rounded corner, particularly for large filets, but not too far in for
small filets.
Make all decorations Thick/2 so they scale with the thickness.
Separate the vents by a square Thick x Thick pillar.
Generate the position of the first vent/decoration based on the panel
thickness, wall thickness, margin, and vent spacing so that there is one
pillar's width beteween the interior edge and the first vent.
Bring the decoration/vent in from 1mm outside the box both horizontally
and vertically to prevent artifacts. This does result in vents reaching
under the box farther than previously, but I think the aesthetic is
pleasing, and it handles strange cases better, such as thick walls and
tiny filets.
I suspect this was an artifact before text was linear_extruded, as it
has a default thickness of 1, so shifting by 0.5 placed it on the
surface. Linear extrude was added, and then the calls to LText and CText
were shifted the other direction by 0.5 to get them on the surface. This
now just results in two unnecessary translates, so I've removed them.
I also removed the shift from the "PCB" text. It's thickness has no
bearing on the print, so there's no reason to shift it. If you wanted to
later linear_extrude it, this would get in your way.
Use it to set either a round or beveled corner. Use it for RoundBox,
Panel, and the feet edge.
Set all other circles (except the tabs) to fn=100 for smoothness.
Make the foot exterior cutout square as tall as FootHeight.
Previously making it taller than 100 made the top wider.
This is obviously ridiculous, but no harder to do right, and looks nicer
when debugging.
If PanelThick is equal to Thick, all is the same. If it is different,
then only the ends are scaled. Everything in the middle, including box
decorations and feet remain in the same position relative to the
interior of the panels.
The 45 degree box for the bottom angled cutout of the box tabs was
unnecessarily shifted.
The rectangular cutout for the sides of the tabs was unnecessarily wide,
and the margin depended on the thickness, which doesn't make much sense.
It depends more on the printer, so this margin should be parametrized in
a later CL.
While it has no impact on the outcome, the large outer box was taller
than it needed to be, and didn't accurately represent the box size when
debugged. This was probably an error of the Thick = Thick*2 change.
The interior box (fins for holding the panel) was oddly not centered.
Shift it using the proper parameters for it to be centered.
It also was shifted vertically by 0.1 to remove "the artifact" I'm not
sure what this artifact is, so I'm removing the shift until I see reason
not to. It also makes the interior hole of the feet shorter by 0.1 and
the tolerance under the board 0.1 less, so it seems a bit wrong to have
in place.
The Coque module was setting Thick = Thick*2 which causes confusion
while reading, likelihood of errors, and difficulty in modification.
I removed this, and replace every invocation with Thick*2, simplifying
where appropriate. This is largely in preparation of separating Panel
thickness from Thick.
Add ScrewHole and FootHole parameters
Set them to #4 coarse thread size.
Use them in appropriate places on tabs and feet
Add CutoutMargin parameter as a margin around interior cutouts.
Apply it to foot, CylinderHole, and SquareHole
Use it to calculate the top margin from the top of the board.
Draw the transparent board with appropriate thickness
Provide convenience variables for board position on panel.
Add parameters for PCB size and margins on all sides.
Generate the box dimensions from these sizes.
Place the PCB appropriately based on the margins.
This has a change in definition, as the previous PCB size was the size
of the square made by the mounting holes. Now it is the size of the
actual PCB.
Holes are still mounted 5mm inside the edges. Hole positioning will come
soon.
Fixed a few minor issues in the process (typoed "square" in previous
commit")
Put curly braces around blocks that didn't have them for consistency.
Notably, re-ordered arguments for "cylinder" since the manual says if
you have named arguments, all following arguments must be named. So now
all cylinders have the height first, unnamed, followed by either r= or
d=, and then $fn= if it isn't otherwise specified in the block.
Add/remove lots of spacing for consistency. Add/remove a few parenthesis
for arithmetic readability.
Actually undo previous spacing because I disagree with the style guide
referenced previously.