paulh-rnd / TabbedBoxMaker

Inkscape tabbed box generator plugin - quickly design complex "finger jointed" boxes
GNU General Public License v2.0
200 stars 47 forks source link

Add Waffle-block style tabs, refactor tab and layout code #15

Closed jimmc closed 4 years ago

jimmc commented 7 years ago

This branch is based on my dimples branch rather than master, but as the PR for dimples is still outstanding, this PR is against master, so accepting this PR will also pull in the dimples code if the dimples PR has not been merged.

In this PR, I have refactored the box style, layout, and tab generation code to be orthogonal, so you can mix and match among them as desired. As part of that refactoring, there were a few obscure bugs that got fixed. Also, the location of the tabs on each box face is no longer a function of the selected box type or layout, so the specific tab positions are different for some combinations of those values than before this change.

The box type now controls only which faces are included in the output, and which sides of the remaining faces do or do not have tabs. The location of all tabs that remain are not a function of the box type.

In the layout, when an entire row or column of pieces is missing due to the selected box type not having a complete set of faces, the remaining rows or columns are shifted so as to keep the layout compact.

The new Rotate-Symmetric tab type allows producing Waffle-block style tabs. In particular, if making a cube, all faces will have the identical shape and are thus interchangeable.

The size of the faces on open boxes is now a function of the box-dimensions inner/outer choice. The concept here is that, when a face is missing, the outer dimension is no longer the inner dimension plus the material thickness, because that side doesn't exist. If outer is specified, the code now produces a result that will exactly fit inside an enclosing box with those inner dimensions; if inner is specified, then a box of the specified dimensions will exactly fit inside the produced box, flush with the open faces of the box.

Dividers only work properly with XY-symmetric tabs (the previous primary style). They previously did not work with the "alternate tab style" (which is called Antisymmetric in this change), and I did not investigate that part of the code nor attempt to make them work with the new Rotate-symmetric tab style.

Here is a screenshot showing the box dialog along with a generated box that uses the Rotate-symmetric waffle-block style tabs.

screen shot 2017-04-24 at 12 27 47 pm
paulh-rnd commented 7 years ago

Looks great! Sorry I haven't had time to play with it yet, been very busy but it looks like you've made a lot of really good changes. Hopefully I'll get a chance over the next week or so. Thanks again

On Tue., 25 Apr. 2017, 8:56 am Jim McBeath, notifications@github.com wrote:

This branch is based on my dimples branch rather than master, but as the PR for dimples is still outstanding, this PR is against master, so accepting this PR will also pull in the dimples code if the dimples PR has not been merged.

In this PR, I have refactored the box style, layout, and tab generation code to be orthogonal, so you can mix and match among them as desired. As part of that refactoring, there were a few obscure bugs that got fixed. Also, the location of the tabs on each box face is no longer a function of the selected box type or layout, so the specific tab positions are different for some combinations of those values than before this change.

The box type now controls only which faces are included in the output, and which sides of the remaining faces do or do not have tabs. The location of all tabs that remain are not a function of the box type.

In the layout, when an entire row or column of pieces is missing due to the selected box type not having a complete set of faces, the remaining rows or columns are shifted so as to keep the layout compact.

The new Rotate-Symmetric tab type allows producing Waffle-block style tabs. In particular, if making a cube, all faces will have the identical shape and are thus interchangeable.

The size of the faces on open boxes is now a function of the box-dimensions inner/outer choice. The concept here is that, when a face is missing, the outer dimension is no longer the inner dimension plus the material thickness, because that side doesn't exist. If outer is specified, the code now produces a result that will exactly fit inside an enclosing box with those inner dimensions; if inner is specified, then a box of the specified dimensions will exactly fit inside the produced box, flush with the open faces of the box.

Dividers only work properly with XY-symmetric tabs (the previous primary style). They previously did not work with the "alternate tab style" (which is called Antisymmetric in this change), and I did not investigate that part of the code nor attempt to make them work with the new Rotate-symmetric tab style.

Here is a screenshot showing the box dialog along with a generated box that uses the Rotate-symmetric waffle-block style tabs.

[image: screen shot 2017-04-24 at 12 27 47 pm] https://cloud.githubusercontent.com/assets/116825/25361547/9d8c809a-2903-11e7-9aa6-738c75aae090.png

You can view, comment on, or merge this pull request online at:

https://github.com/paulh-rnd/TabbedBoxMaker/pull/15 Commit Summary

  • Add optional dimples on tabs.
  • Update README.md for dimples
  • Make boxtype, layout, and tab style orthogonal.

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/paulh-rnd/TabbedBoxMaker/pull/15, or mute the thread https://github.com/notifications/unsubscribe-auth/AJw768lZwjh3r7ElqfKE6g1L59YJbF7aks5rzSiegaJpZM4NGz2n .

paulh-rnd commented 4 years ago

@jimmc wow, again I apologise for the long delay getting to this, and WOW, thanks so much for this great contribution - what you've done is outstanding! Far cleaner than my kludged-together code (can you tell I really don't know Python? :D )

This fixes at least two known bugs, I'll merge this in and have a go at fixing some of the remaining ones. Just one thing: it seems now that the "Tab Width: Fixed/Proportional" option doesn't do anything any more, is that right? I'm fine with that, I never really saw the point of that option, and I think your tab styles are better options anyway.

Thanks again

jimmc commented 4 years ago

Paul,

Unfortunately, it has been long enough since I touched that code that I don't remember that level of detail, so I can't tell you anything about the Fixed/Proportional option.

Thanks for merging my PR. :-)

-- Jim

On Fri, Jan 03, 2020 at 03:22:08AM -0800, paulh-rnd wrote:

@jimmc wow, again I apologise for the long delay getting to this, and WOW, thanks so much for this great contribution - what you've done is outstanding! Far cleaner than my kludged-together code (can you tell I really don't know Python? :D )

This fixes at least two known bugs, I'll merge this in and have a go at fixing some of the remaining ones. Just one thing: it seems now that the "Tab Width: Fixed/Proportional" option doesn't do anything any more, is that right? I'm fine with that, I never really saw the point of that option, and I think your tab styles are better options anyway.

Thanks again