pack3d icon indicating copy to clipboard operation
pack3d copied to clipboard

Endless loop

Open Megidd opened this issue 3 years ago • 0 comments

I ran the command:

./binpack 4 helmet.stl 2 Pharaoh.stl 10 Utah_teapot_solid.stl

But it took forever at this stage:

loading mesh... 148.879948ms
loading mesh... 86.407924ms
loading mesh... 1.248878ms
bin packing... 

Location

As far as I check by stepping through the code with debugger, the location of the endless loop is the recursive call to this function at this file and line:

// github.com/fogleman/pack3d/binpack/pack.go

func pack(items []Item, box Box, hash *SpatialHash, minVolume Vector) Result {
	// ...
				r[j] = pack(items, b[i][j], hash, minVolume) // Line 117
	// ...
}

Screenshot_20221114_154925

Megidd avatar Nov 14 '22 12:11 Megidd