BoxPacker icon indicating copy to clipboard operation
BoxPacker copied to clipboard

Satchel / Bag Option

Open cseufert opened this issue 7 years ago • 8 comments

It would be great to have a way to pack into satchels as well as boxes, or really small items. Australia Post sells small, medium and large prepaid satchels. (https://auspost.com.au/sending/satchels-and-packaging/send-in-satchel-or-envelope/flat-rate-satchels)

I can see this being fairly tricky, as the length and width get smaller depending on the height of the item placed inside.

Do you have any tips if I were to have a go at implementing this myself?

cseufert avatar Jun 07 '18 06:06 cseufert

Yeah, to do this properly will be quite difficult - unpicking the assumptions in the code that width/height/depth are fixed would be doable, but care would need to be taken not to regress performance too much.

The main problem though would actually modelling the shape of the satchel - I'm not sure I even know what words to search for to find the appropriate formula 🤔

dvdoug avatar Jun 13 '18 20:06 dvdoug

Howdy,

Since envelopes, satchels, etc have become common in shipping, I thought I would chime in and support the addition of this functionality. This is known as the Tea Bag problem and the math is actually pretty straightforward: https://en.wikipedia.org/wiki/Paper_bag_problem

spectravp avatar Nov 29 '18 23:11 spectravp

@spectravp knowing the formal name for this problem is very helpful, thank you! Unfortunately I don't think that formula is quite sufficient for what's needed here, as a simple volume comparison isn't enough - we need to do something along the lines of calculating the (dynamic) depth of the open satchel at points along it's length so it's possible to make a decision about fit.

I see some reading ahead of me

dvdoug avatar Dec 02 '18 14:12 dvdoug

Understood and I agree. Knowing the total volume is only half the equation. I’m pretty sure I saw a formula for determining dimensions at any given point within the tea bag. Let me see if I can find that for you.

spectravp avatar Dec 02 '18 17:12 spectravp

As a simple workaround you could probably introduce two or more "boxes" for each envelope using predetermined dimensions based on how full it is height-wise. E.g. a 10x14 envelope might have the following rough sizes:

  • 10x14x0.5
  • 9x11x1.5
  • 8x10x2.5
  • 6x8x4.5

colinmollenhour avatar Aug 22 '19 06:08 colinmollenhour

Any update on this? I'm looking for a way of calculating how many items fit in a satchel-like container for shipping. Perhaps interested in sponsoring the development of this feature and a couple others if possible.

noknokcody avatar Oct 28 '20 23:10 noknokcody

Hi @noknokcody - I saw you reached out on LinkedIn, have replied to you there.

dvdoug avatar Nov 01 '20 17:11 dvdoug

The (simple) way I solved this was.

    1. Set the bag height to 0.
    1. Sort the remaining items
    1. Add the first items height to my bag and make width and length the same amount shorter.
    1. Try fitting items
    1. If items left return to 2.

Simple and far from perfect but seems to work reasonably well.

erikkvarnbranna avatar May 03 '21 20:05 erikkvarnbranna