func xpos_algorithm() {local addamt CellNum // Arguments: 1-gid, 2-numCells, 3-startGid, 4-binNum, 5- binNum, 6-binSize; Return: x position of cell
CellNum=$1 - $3+1
return (int((CellNum-1)/$5)%$4)*$6+$6/2
}
func ypos_algorithm() {local CellNum // Arguments: gid, numCells, startGid, binNum, binNum, binSize; Return: y position of cell
CellNum=$1 - $3+1
return (int((CellNum-1)/$5)%$4)*$6+$6/2
}
func zpos_algorithm() {local CellNum, addheight // Arguments: 1-gid, 2-numCells, 3-startGid, 4-binNum, 5-binSize, cell layer Zo; Return: z position of cell
CellNum=$1 - $3+1
addheight=0
if ($6>0) {addheight=LayerVector.sum(0,$6-1)}
return ((CellNum-1)%$4)*$5+$5/2+addheight
}