Sharp3DBinPacking icon indicating copy to clipboard operation
Sharp3DBinPacking copied to clipboard

Specifying dead zones within the bin

Open psarras opened this issue 4 years ago • 3 comments

Is there a way, to specify no-go zones when placing a Box inside the bin?

Alternatively, can I pre-place a box within the Bin, at a certain location?

My thought is that if you were able to do that then you can re-use this algorithm for fitting boxes in different shape boxes.

Any pointers on what I can do to achieve this?

psarras avatar Feb 19 '21 16:02 psarras

That maybe a little hard, you have to modify the algorithm to make it place the box at a certain location. For example:

  • add IsReserved to Cuboid class
  • add property List<Cuboid> ReservedCuboids to BinPackParameter
  • modify BinPackGuillotineAlgorithm.FindPositionForNewNode to detect whether the cuboid is reserved, if yes then
    • find a free cuboid contains the reserved location from_freeCuboids
    • set cuboid.IsPlaced to true and return the index of the free cuboid

If you implemented this please send me a pull request.

303248153 avatar Feb 25 '21 01:02 303248153

Hey @303248153 thanks for that. I am wondering could I do something at the start to essentially split the _freeCuboids in such a way as to avoid the reservedCuboids?

psarras avatar Mar 01 '21 17:03 psarras

Can it be that the SplitFreeCuboidAlongAxis could be modified and called earlier in order to produce for a given red rectangle these White/Pink Obstacles? Since I am not very familiar with this algorithm I am not sure if the rest of it will work!

image

psarras avatar Mar 01 '21 18:03 psarras