Commit Graph

67 Commits

Author SHA1 Message Date
Joel Ebel
ffb35824ec Form panel and cutouts in 2D then extrude
Panel and Holes are all in 2D. Leave the LinearExtrude to the PanL
modules just before adding text. Perform all translating in the PanL
modules, rather than the top level code.
2018-05-18 20:26:17 -04:00
Joel Ebel
0a8234aafa Do not rename FootFilet to Filet. 2018-05-18 01:37:45 -04:00
Joel Ebel
cc471eecaf Extrude the whole foot at once
Generate a cross-section of the foot in 2D, then rotate/extrude the
whole thing at once. This is a little easier to reason about than
working in 3D. You can use debug view to see just the cross section with
more ease. It save a line of code, too.
2018-05-18 01:35:16 -04:00
Joel Ebel
7d85d60ca4 Separate decorations into LeftDecorations
Mirror LeftDecorations to get the right decorations.
2018-05-18 01:17:04 -04:00
Joel Ebel
9ddb6d7516 Simplify Decorations module
split a single decoration into its own module, and give it a most
generic translation. This makes the Decorations module cleaner and
easier to understand, because you can easily see exactly how much you
are translating each decoration.

Rather than translating the decoration to make it fit the other side of
the box, rotate it. It makes the translation cleaner, and it's a little
easier to understand. The decorations are the same on each side, just
rotated 180 degrees from one another.

I might still make all the left side decorations and rotate that 180
degrees for the right side.
2018-05-18 00:55:11 -04:00
Joel Ebel
3754009a43 Make RoundBox smarter to reduce code duplication
RoundBox now takes an xshrink and yzshrink argument, which tell it how
much to shrink the box from the Length, Width, and Height parameters.
They defaul to 0. The removes the need to translate the calls to
RoundBox or to repeatedly provide adjustments to its arguments that are
very similar. As a result, the MainBox module is now much simpler and
easier to understand.
2018-05-18 00:24:54 -04:00
Joel Ebel
300029c3d2 Split up the man box code into modules
The Coque module is now very simple and self-commenting about what it
does. The complexity is in the referenced modules, which are much
shorter and easier to read. I'll split things up just a bit more, but
wanted to check this in first.
2018-05-17 23:59:55 -04:00
Joel Ebel
d6f26ae90d Parametrize the box fixation tabs
This is the last part to make the box fully scalable. Now if you double
every parameter, the box doubles in all dimensions. The panel features
are not changed, however. That's up to you to fix.

The tab cutouts are now scaled off of the screw hole size, since that
fixes the diameter of the tab.

I've also added an OuterMargin which adjusts the spacing you need
between the tab and the box wall. This is a property of your printer,
and shouldn't be changed when you scale other aspects of the box. I
might base other dimensions, like the panel gap on this value as well.
2018-05-16 16:08:05 -04:00
Joel Ebel
f911138c93 Rename 'm' to PanelGap for readability 2018-05-16 14:57:15 -04:00
Joel Ebel
5e2f400758 Make it go to 11. Also fix the CText angles. 2018-05-16 14:55:01 -04:00
Joel Ebel
4ec9e798e3 Simplify top shell rotation 2018-05-16 13:41:05 -04:00
Joel Ebel
e15258361c Adjust holes based on wall thickness
Rather than fixed at 20mm, these are now sized based on wall thickness,
supporting arbitrary wall thickness, and making debug views more
appealing.
2018-05-16 13:28:14 -04:00
Joel Ebel
4855a03729 Position mounting tabs/holes relative to parameters
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.
2018-05-16 13:19:51 -04:00
Joel Ebel
d9312ae7a8 Improve subtraction on interior rails
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.
2018-05-16 00:27:45 -04:00
Joel Ebel
fb647fbd18 Add a small amount to vent thickness to ensure it goes through the wall 2018-05-15 23:47:58 -04:00
Joel Ebel
2ffdd54ce8 Use "offset" instead of minkowski with a circle
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.
2018-05-15 23:21:01 -04:00
Joel Ebel
85c85ff905 Re-work panel, roundbox, and SquareHole
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.
2018-05-15 22:06:09 -04:00
Joel Ebel
43f87b8e70 Make it clear Filet is a radius
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.
2018-05-15 16:31:11 -04:00
Joel Ebel
d46a492d0b Re-work of vent/decoration holes
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.
2018-05-15 00:25:39 -04:00
Joel Ebel
6b91772037 reorder font arguments on PCB to match others 2018-05-14 15:58:34 -04:00
Joel Ebel
7e4e1ab121 Use debug modifier on PCB parent
Rather than debug both the text and the PCB, just debug the parent of
both. This requires that the text be 3, so go ahead and extrude it by
FontThick.
2018-05-14 15:55:09 -04:00
Joel Ebel
27785d60d8 fix ridiculous font thickness used in testing 2018-05-14 15:28:55 -04:00
Joel Ebel
e02a276c6b Support VAlign for LText
Add new argument that defaults to baseline.
Update comments to describe the new option.
Update some HAlign documentation with more details.
2018-05-14 15:21:14 -04:00
Joel Ebel
f2e0268a6c Unify text() arguments.
Re-order arguments to match docs and be consistent.
Remove valign from CText, as baseline was the default value.
Remove an unnecessary space.
2018-05-14 15:08:09 -04:00
Joel Ebel
92f4d55b3a Stop translating text by 0.5 and back again.
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.
2018-05-14 14:50:16 -04:00
Joel Ebel
c4b257ddad Parameterize font thickness 2018-05-14 14:42:30 -04:00
Joel Ebel
d81f830cba Remove an extra echo and fix spacing/comments 2018-05-14 12:30:17 -04:00
Joel Ebel
d5ecdf7133 Add comment for Round parameter
With this comment, it appears as a boolean in the customizer.
2018-05-14 12:23:36 -04:00
Joel Ebel
8f0da75667 Add a boolean parameter for Round
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.
2018-05-13 23:28:18 -04:00
Joel Ebel
6c431a3b4c Minor spacing fixes. 2018-05-13 22:30:38 -04:00
Joel Ebel
502e623485 Support holes in thicker panels
Panel cutouts were limited to 10mm. Scale them by PanelThick to make
debugging more appealing and support ridiculously thick panels.
2018-05-09 13:18:36 -04:00
Joel Ebel
30ff50a8f3 Shorten some long lines. 2018-05-08 23:35:36 -04:00
Joel Ebel
30dcdeb6c7 Widen foot to get full filet. 2018-05-08 23:29:22 -04:00
Joel Ebel
61eb5c4ddd simplify translation 2018-05-08 23:27:46 -04:00
Joel Ebel
9546fba70e Support FootFilet in parameters
Default it to Thick so it scales with the box.
2018-05-08 23:25:48 -04:00
Joel Ebel
b1dfdd74e1 Support taller feet
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.
2018-05-08 23:15:23 -04:00
Joel Ebel
55e7cf32ea Center box decorations on the box.
Previously they were shifted to the front by half the vent width. This
should be better parametrized still. Particularly the closeness to the
edge.
2018-05-08 23:05:20 -04:00
Joel Ebel
948e585f82 Fix position of front panel 2018-05-08 23:01:26 -04:00
Joel Ebel
22c7e7f369 Support PanelThick different from Thick
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.
2018-05-08 22:55:15 -04:00
Joel Ebel
0fde4bf5a5 Remove some unnecessary shifting of cutouts
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.
2018-05-08 22:46:27 -04:00
Joel Ebel
a23913215d Also fix height of interior through-box 2018-05-08 22:38:14 -04:00
Joel Ebel
3b13aafbdd Scale upper cutout cube to thickness
Rather than fixed 100
2018-05-08 22:29:14 -04:00
Joel Ebel
abbc0a8cec Large rail box decreased in vertical height.
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.
2018-05-08 22:19:42 -04:00
Joel Ebel
687ba3448f Center the interior box
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.
2018-05-08 22:14:57 -04:00
Joel Ebel
5ac9a55a59 Remove Thick = Thick*2
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.
2018-05-08 22:05:11 -04:00
Joel Ebel
85047a9ee1 Set hole sizes and CutoutMargin
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
2018-05-07 23:26:42 -04:00
Joel Ebel
748fe0490f Separate conveniance variable for front and back 2018-05-07 22:55:48 -04:00
Joel Ebel
72910f55ae Add a PCBThick parameter
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.
2018-05-07 22:52:51 -04:00
Joel Ebel
2942f6005c Use FootHeight as height above box interior.
It is also the depth of  the screw hole, which is likely how it will be
calculated.
2018-05-07 22:20:13 -04:00
Joel Ebel
b0027648f0 Calculate foot positions parametrically
Add paramaters for X and Y positions of all 4 feet.
Use those when creating feet relative to the board position.
2018-05-07 01:43:55 -04:00