Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify code for screw placement #110

Open
wants to merge 5 commits into
base: refaktor
Choose a base branch
from

Conversation

mbugert
Copy link

@mbugert mbugert commented May 12, 2022

Originally, I only wanted to make a small fix to how screw holes are rendered and propose some screw-related extensions later. Then I realized that the code wasn't ready for the extensions, so I had to refactor it first. Sorry for that. 🤷

Apart from some renaming here and there, there are two major changes:

  • Commit cd1ad5f decouples the creation and placement of screw-related shapes. Beforehand, screw insert dimensions had to be passed around a lot.
  • Based on that, commit dea4f21 simplifies the code generating the bottom plate. Using the previous commit, it's possible to represent screw holes for the bottom plate as 2D shapes (not very tall 3D shapes anymore) which makes the code a lot cleaner. It also fixes Bottom plate sticking out for 5-column manuform #112.

WDYT?

There were two functions screw-insert-holes and screw-insert-screw-holes
whose difference was unclear. screw-insert-screw-holes creates the holes
for the bottom plate only, so it was renamed to
screw-insert-holes-plate.
@mbugert mbugert changed the title Rename screw-insert-screw-holes for readability Add docs for screw inserts and improve code readability May 14, 2022
@mbugert mbugert marked this pull request as draft May 16, 2022 09:45
Responsibility for creating and positioning shapes of screw insert
holes was scattered across multiple methods which made it hard to
maintain. In particular, dimensions of the screw insert shape had to
be passed to the `screw-insert` and `screw-placement` functions which
do not need this information, as they mostly do positioning work.
Screw insert shapes are now created directly in `screw-insert-hole`
and others. `screw-insert` is renamed to `screw-placement-common` to
better reflect the changes.
Bottom plate generation in manuform.clj relied on several hacky 3D
operations (micro-translations before projection operations and
extruded screw hole shapes). This is replaced with 2D operations
followed by a single linear_extrude. This commit also fixes the
non-aligning bottom plate mentioned in ibnuda#112.
@mbugert mbugert changed the title Add docs for screw inserts and improve code readability Simplify code for screw placement May 18, 2022
@mbugert mbugert marked this pull request as ready for review May 18, 2022 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bottom plate sticking out for 5-column manuform
1 participant