Feature: Various improvements
This PR includes the original PR #9 (dividers in y direction). #10 removed in favor of FreeCAD's Quantity parser.
Extra to those changes now:
-
Some entries disappeared when the checkbox was unchecked, fixed.
-
Until now the main manufacturing process was 3D printing but what if instead we take a wooden board/acrylic piece and cut the profile of the grid, could be a time saver. To achieve this the user can input a new thickness that will be placed under the grid to get the thickness of the board, the magnet holders were reworked. I know that for simplicity reasons you only really need a
1*1grid to offset itn*mtimes but at least the resultant grid is realistic -
When grids and boxes were created the bodies collided, now with an offset they fit.
Magnet parameters exposed to the user.
- Grid
- Box
Also closes #2
This PR didn't address my comments in #9 and #10 so I've moved them forward into this PR. Please consider them.
Initially I wanted to replace the height unit dimension in mm but now both units are supported? What other dimension could be used to make use of the FreeCAD's Units parser? A inch: is quite big specially when all dimensions are in mm, a cm: a z unit height is already 1cm, other units seem small/big.
In #10 I already pointed out cm as the specific alternative, and using parseQuantity is shorter, clearer, and more general. If someone is modeling a shadow-box base for something using a print that was given to them dimensioned in inches, why force them to go through a units conversion when FreeCAD already has a function that does the work for them?
Why would you not use the built-in function that makes it work like everything else in FreeCAD when it also makes the code clearer and shorter?
In #10 I already pointed out cm as the specific alternative, and using
parseQuantityis shorter, clearer, and more general. If someone is modeling a shadow-box base for something using a print that was given to them dimensioned in inches, why force them to go through a units conversion when FreeCAD already has a function that does the work for them?Why would you not use the built-in function that makes it work like everything else in FreeCAD when it also makes the code clearer and shorter?
I wanted to maintain height unit since is the "standard" value that Alan came out, the generated names of the boxes as 2x2x5 will be replaced.
I'll check it.
I wanted to maintain height unit since is the "standard" value that Alan came out, the generated names of the boxes as
2x2x5will be replaced.
Thanks for changing to use parseQuantity; note that the code suggestion I made to explicitly handle the unitless case without parseQuantity would have avoided that concern entirely.
Thank you!
I know I've been focusing on the small things to improve here. Sorry if it's felt nitpicking. I know @instancezero has been busy and wanted to help get this ready for him to easily review it.
Big picture, the magnet parameter is going to be awesome not only for different size magnets, but also for working with imperfectly-tuned printers; Someone might want 6.1mm x 2mm holes because their printer isn't tuned for perfect inside holes (a really common problem). Also, setting up for subtractive manufacturing is awesome!
I still would like to know whether the lambda failed in a new python version or something. It is a normal form and is often used in assignments like this; it's a more parallel form than moving to a def
One last request that isn't a change to the code: This has lots of really helpful changes that expand how it can be used, so README edits would be wonderful for letting people know about how they can use your changes. :heart:
Thank you!
I know I've been focusing on the small things to improve here. Sorry if it's felt nitpicking. I know @instancezero has been busy and wanted to help get this ready for him to easily review it.
No problem it was a good idea to insist about using the FreeCAD parser, it really helps.
One last request that isn't a change to the code: This has lots of really helpful changes that expand how it can be used, so README edits would be wonderful for letting people know about how they can use your changes. ❤️
Done, I think we could bump the macro to 1.3.0