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

StorageShelf and UniversalBox do not work with Edgetype "t" - Triangle for handle #406

Closed
SuksAE opened this issue Jun 16, 2022 · 11 comments

Comments

@SuksAE
Copy link
Contributor

SuksAE commented Jun 16, 2022

Tested with default settings, just top_edge parameter set to "t"

TypeTray seems to work fine...

@SuksAE
Copy link
Contributor Author

SuksAE commented Jun 16, 2022

tested on your https://www.festi.info/boxes.py/ server...

@HaSHsss
Copy link
Contributor

HaSHsss commented Jun 16, 2022

That is known issue
#305

@SuksAE
Copy link
Contributor Author

SuksAE commented Jun 16, 2022

If in universalbox.py line 78
self.h = h = self.adjustSize(h, b, self.top_edge)
is commented out, it seems to work as it should.
But I admit that I did not test all combinations of top and bottom edge types.

So maybe someone with deeper knowledge about the need of this adjustment should have a look...

@HaSHsss
Copy link
Contributor

HaSHsss commented Jun 16, 2022

if just comment this line, then the height of the layout is calculated incorrectly

I suggest this option.

if self.top_edge == "t":
    self.h = h = self.adjustSize(h, b, e2=False)
else:
    self.h = h = self.adjustSize(h, b, self.top_edge)

on line 78

@HaSHsss
Copy link
Contributor

HaSHsss commented Jun 16, 2022

RoundedTriangleEdge (t Triangle for handle) have native default height 150mm
so if set h = 200mm it's works fine

I see the easiest way to solve the issue, is just ignore the height of the Triangle handle, but keep considering the height of other top_edge views

@florianfesti
Copy link
Owner

I suggest this option.

if self.top_edge == "t":
    self.h = h = self.adjustSize(h, b, e2=False)
else:
    self.h = h = self.adjustSize(h, b, self.top_edge)

on line 78

this sounds like an easy solution. Guess I have been overthinking this issue.

@SuksAE
Copy link
Contributor Author

SuksAE commented Jun 17, 2022

Guys I must appologise - I was to tired to get this sorted out yesterday, I should have stopped programming earlier.

Now, after a few hours of sleep, I guess I figured it out:

The problem is that the default values of most generators specify an OUTSIDE hight of 100mm. The default heigt of the Triange on the other hand is 150mm. This can't fit, so the height computes negative and this destorts the output.

I propose following 2 steps:

  1. change the default height value of the triangle (edges.py line 2359) to 50mm instead of 150mm to fit into the 100mm default height of most generators
  2. include a check at the end of adjustSize() (__init__.py line 587 ) if the return value is negative and either
  • raise an error and stop processing, or
  • warn the user about the negative result via text in ANNOTATIONS color within the output file and continue processing with the negative value

@HaSHsss
Copy link
Contributor

HaSHsss commented Jun 17, 2022

I like this idea, to change default triangle height to 50 mm
but it's not enough.

On first pic, parameters for
RoundedTriangleEdge height =50mm
Outside size x/y/h = 100mm
on second pic, same size, just for inside

So we have 2 completely different boxes turned out,

I think we need to change

  1. the triangle height to 50mm
  2. height calculations for Outside

50mm
50mm_2

@SuksAE
Copy link
Contributor Author

SuksAE commented Jun 18, 2022

For me, these pictures seems to be OK.

From my understanding, the "outside" parameter, as described here: https://florianfesti.github.io/boxes/html/usermanual.html#outside, works as follows:

  • when checked, the workpiece, including all outside attachment (like handles, hinges, ...), shall fit within a box defined by the given X, Y and H parameters. I use this feature if the workpiece shall fit within a given space like in e.g. a closet or drawer

  • when not checked, the workpiece shall be able to contain a payload whichs size is defined by X, Y and H. The general outside dimensions of the workpiece (and this includes all external attachments) are not considered in this case. I use this feature if I want the workpiece to store e.g. a tool with a fixed size.

But please correct me if I am wrong...

@HaSHsss
Copy link
Contributor

HaSHsss commented Jun 19, 2022

For me, these pictures seems to be OK.

From my understanding, the "outside" parameter, as described here: https://florianfesti.github.io/boxes/html/usermanual.html#outside, works as follows:

  • when checked, the workpiece, including all outside attachment (like handles, hinges, ...), shall fit within a box defined by the given X, Y and H parameters. I use this feature if the workpiece shall fit within a given space like in e.g. a closet or drawer
  • when not checked, the workpiece shall be able to contain a payload whichs size is defined by X, Y and H. The general outside dimensions of the workpiece (and this includes all external attachments) are not considered in this case. I use this feature if I want the workpiece to store e.g. a tool with a fixed size.

But please correct me if I am wrong...

I really don't like such a strong difference in layouts. Anyway, Logic should be standard for all layouts

You're right.
Probably shouldn't make an exception for 1 layout

@florianfesti
Copy link
Owner

Yeah, this issue is more complicated than it looks at first glance. If now reduced the default height of the triangle to 50 which makes the issue go away for the default values. But it does not address the underlying issues:

There is no check for values that mess up the generators. This is to some extend by design. Weird values may be useful e.g. for creating a lid from a box with a stackable edge at the bottom and zero height.

But this made into more of a problem by not telling the users the results of the outside option. This is an issue in its own though. There is even a ticket for this: #373

Guess adjustSize needs to grow a way to print the new values. Negative values could be colored red to draw attention to situations like this. That way we should be able to get away without checks on the most of the sizes

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

No branches or pull requests

3 participants