Skip to content
This repository has been archived by the owner on Jun 29, 2023. It is now read-only.

Commit

Permalink
resolved the issue of 'Wrong Rotation Checking' #3
Browse files Browse the repository at this point in the history
  • Loading branch information
SahibYar committed Jan 21, 2016
1 parent ae45cd2 commit 3418ac1
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions 3D-Bin-Packing/Guillotine3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ class Guillotine3D
Dictionary<String, List<Box>> Container_Containing_Boxes = new Dictionary<string, List<Box>>();

List<KeyValuePair<String, Box>> sorted_box_List;


/*
return the container which has the
smallest volume of all the unopened containers;
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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;
}
}
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 3418ac1

Please sign in to comment.