From 3418ac11906667598cb1b490b69f16fa133aa50a Mon Sep 17 00:00:00 2001 From: Sahib Yar Date: Thu, 21 Jan 2016 15:47:17 +0500 Subject: [PATCH] resolved the issue of 'Wrong Rotation Checking' #3 --- 3D-Bin-Packing/Guillotine3D.cs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/3D-Bin-Packing/Guillotine3D.cs b/3D-Bin-Packing/Guillotine3D.cs index 2f75afd..318abb1 100644 --- a/3D-Bin-Packing/Guillotine3D.cs +++ b/3D-Bin-Packing/Guillotine3D.cs @@ -23,6 +23,8 @@ class Guillotine3D Dictionary> Container_Containing_Boxes = new Dictionary>(); List> sorted_box_List; + + /* return the container which has the smallest volume of all the unopened containers; @@ -114,8 +116,8 @@ Boolean has_free_space(String Container_Key, Box box) else if (box.AllowedRotationsY && container.Width >= box.Width && - container.Length >= box.Width && - container.Width >= box.Length) + container.Length >= box.Height && + container.Height >= box.Length) return true; } } @@ -153,8 +155,8 @@ Boolean has_free_space(String Container_Key, Box box) //along Y-axis rotation is allowed else if (box.AllowedRotationsY && container.Width >= box.Width && - container.Length >= box.Width && - container.Width >= box.Length) + container.Length >= box.Height && + container.Height >= box.Length) return true; } } @@ -190,12 +192,11 @@ Boolean has_free_space(String Container_Key, Box box) //along Y-axis rotation is allowed else if (box.AllowedRotationsY && container.Width >= box.Width && - container.Length >= box.Width && - container.Width >= box.Length) + container.Length >= box.Height && + container.Height >= box.Length) return true; } } - //after mergin top_only containers }