rectpack API Reference
2D rectangle packing library for Nesting algorithms and bin packing optimization.
rectpack.GuillotineBafLas
Python Library Documentation: class GuillotineBafLas in module rectpack.guillotine class GuillotineBafLas(GuillotineBaf, GuillotineLas) | GuillotineBafLas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafLas | GuillotineBaf | GuillotineLas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBafLlas
Python Library Documentation: class GuillotineBafLlas in module rectpack.guillotine class GuillotineBafLlas(GuillotineBaf, GuillotineLlas) | GuillotineBafLlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafLlas | GuillotineBaf | GuillotineLlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBafMaxas
Python Library Documentation: class GuillotineBafMaxas in module rectpack.guillotine class GuillotineBafMaxas(GuillotineBaf, GuillotineMaxas) | GuillotineBafMaxas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafMaxas | GuillotineBaf | GuillotineMaxas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBafMinas
Python Library Documentation: class GuillotineBafMinas in module rectpack.guillotine class GuillotineBafMinas(GuillotineBaf, GuillotineMinas) | GuillotineBafMinas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafMinas | GuillotineBaf | GuillotineMinas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBafSas
Python Library Documentation: class GuillotineBafSas in module rectpack.guillotine class GuillotineBafSas(GuillotineBaf, GuillotineSas) | GuillotineBafSas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafSas | GuillotineBaf | GuillotineSas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBafSlas
Python Library Documentation: class GuillotineBafSlas in module rectpack.guillotine class GuillotineBafSlas(GuillotineBaf, GuillotineSlas) | GuillotineBafSlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafSlas | GuillotineBaf | GuillotineSlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBlsfLas
Python Library Documentation: class GuillotineBlsfLas in module rectpack.guillotine class GuillotineBlsfLas(GuillotineBlsf, GuillotineLas) | GuillotineBlsfLas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfLas | GuillotineBlsf | GuillotineLas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBlsfLlas
Python Library Documentation: class GuillotineBlsfLlas in module rectpack.guillotine class GuillotineBlsfLlas(GuillotineBlsf, GuillotineLlas) | GuillotineBlsfLlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfLlas | GuillotineBlsf | GuillotineLlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBlsfMaxas
Python Library Documentation: class GuillotineBlsfMaxas in module rectpack.guillotine class GuillotineBlsfMaxas(GuillotineBlsf, GuillotineMaxas) | GuillotineBlsfMaxas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfMaxas | GuillotineBlsf | GuillotineMaxas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBlsfMinas
Python Library Documentation: class GuillotineBlsfMinas in module rectpack.guillotine class GuillotineBlsfMinas(GuillotineBlsf, GuillotineMinas) | GuillotineBlsfMinas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfMinas | GuillotineBlsf | GuillotineMinas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBlsfSas
Python Library Documentation: class GuillotineBlsfSas in module rectpack.guillotine class GuillotineBlsfSas(GuillotineBlsf, GuillotineSas) | GuillotineBlsfSas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfSas | GuillotineBlsf | GuillotineSas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBlsfSlas
Python Library Documentation: class GuillotineBlsfSlas in module rectpack.guillotine class GuillotineBlsfSlas(GuillotineBlsf, GuillotineSlas) | GuillotineBlsfSlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfSlas | GuillotineBlsf | GuillotineSlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBssfLas
Python Library Documentation: class GuillotineBssfLas in module rectpack.guillotine class GuillotineBssfLas(GuillotineBssf, GuillotineLas) | GuillotineBssfLas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBssfLas | GuillotineBssf | GuillotineLas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBssfLlas
Python Library Documentation: class GuillotineBssfLlas in module rectpack.guillotine class GuillotineBssfLlas(GuillotineBssf, GuillotineLlas) | GuillotineBssfLlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBssfLlas | GuillotineBssf | GuillotineLlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBssfMaxas
Python Library Documentation: class GuillotineBssfMaxas in module rectpack.guillotine class GuillotineBssfMaxas(GuillotineBssf, GuillotineMaxas) | GuillotineBssfMaxas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBssfMaxas | GuillotineBssf | GuillotineMaxas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBssfMinas
Python Library Documentation: class GuillotineBssfMinas in module rectpack.guillotine class GuillotineBssfMinas(GuillotineBssf, GuillotineMinas) | GuillotineBssfMinas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBssfMinas | GuillotineBssf | GuillotineMinas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBssfSas
Python Library Documentation: class GuillotineBssfSas in module rectpack.guillotine class GuillotineBssfSas(GuillotineBssf, GuillotineSas) | GuillotineBssfSas(width, height, rot=True, merge=True, *args, **kwargs) | | # Guillotine algorithms GUILLOTINE-RECT-SPLIT, Selecting one | # Axis split, and one selection criteria. | | Method resolution order: | GuillotineBssfSas | GuillotineBssf | GuillotineSas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.GuillotineBssfSlas
Python Library Documentation: class GuillotineBssfSlas in module rectpack.guillotine class GuillotineBssfSlas(GuillotineBssf, GuillotineSlas) | GuillotineBssfSlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBssfSlas | GuillotineBssf | GuillotineSlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.MaxRectsBaf
Python Library Documentation: class MaxRectsBaf in module rectpack.maxrects class MaxRectsBaf(MaxRects) | MaxRectsBaf(width, height, rot=True, *args, **kwargs) | | Best Area Fit pick maximal rectangle with smallest area | where the rectangle can be placed | | Method resolution order: | MaxRectsBaf | MaxRects | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from MaxRects: | | __init__(self, width, height, rot=True, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.MaxRectsBl
Python Library Documentation: class MaxRectsBl in module rectpack.maxrects class MaxRectsBl(MaxRects) | MaxRectsBl(width, height, rot=True, *args, **kwargs) | | Method resolution order: | MaxRectsBl | MaxRects | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from MaxRects: | | __init__(self, width, height, rot=True, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.MaxRectsBlsf
Python Library Documentation: class MaxRectsBlsf in module rectpack.maxrects class MaxRectsBlsf(MaxRects) | MaxRectsBlsf(width, height, rot=True, *args, **kwargs) | | Best Long Side Fit minimize long leftover side | | Method resolution order: | MaxRectsBlsf | MaxRects | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from MaxRects: | | __init__(self, width, height, rot=True, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.MaxRectsBssf
Python Library Documentation: class MaxRectsBssf in module rectpack.maxrects class MaxRectsBssf(MaxRects) | MaxRectsBssf(width, height, rot=True, *args, **kwargs) | | Best Sort Side Fit minimize short leftover side | | Method resolution order: | MaxRectsBssf | MaxRects | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from MaxRects: | | __init__(self, width, height, rot=True, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.PackerBBF
Python Library Documentation: class PackerBBF in module rectpack.packer class PackerBBF(Packer, PackerBBFMixin) | PackerBBF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | BBF (Bin Best Fit): Pack rectangle in bin that gives best fitness | | Method resolution order: | PackerBBF | Packer | PackerOnline | PackerBBFMixin | builtins.object | | Methods inherited from Packer: | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | add_bin(self, width, height, count=1, **kwargs) | | add_rect(self, width, height, rid=None) | | pack(self) | | ---------------------------------------------------------------------- | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __iter__(self) | | __len__(self) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Data and other attributes inherited from PackerBBFMixin: | | first_item = operator.itemgetter(0)
rectpack.PackerBFF
Python Library Documentation: class PackerBFF in module rectpack.packer class PackerBFF(Packer, PackerBFFMixin) | PackerBFF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | BFF (Bin First Fit): Pack rectangle in first bin it fits | | Method resolution order: | PackerBFF | Packer | PackerOnline | PackerBFFMixin | builtins.object | | Methods inherited from Packer: | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | add_bin(self, width, height, count=1, **kwargs) | | add_rect(self, width, height, rid=None) | | pack(self) | | ---------------------------------------------------------------------- | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __iter__(self) | | __len__(self) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.PackerBNF
Python Library Documentation: class PackerBNF in module rectpack.packer class PackerBNF(Packer, PackerBNFMixin) | PackerBNF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | BNF (Bin Next Fit): Only one open bin, if rectangle doesn't fit | go to next bin and close current one. | | Method resolution order: | PackerBNF | Packer | PackerOnline | PackerBNFMixin | builtins.object | | Methods inherited from Packer: | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | add_bin(self, width, height, count=1, **kwargs) | | add_rect(self, width, height, rid=None) | | pack(self) | | ---------------------------------------------------------------------- | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __iter__(self) | | __len__(self) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.PackerGlobal
Python Library Documentation: class PackerGlobal in module rectpack.packer class PackerGlobal(Packer, PackerBNFMixin) | PackerGlobal(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | GLOBAL: For each bin pack the rectangle with the best fitness. | | Method resolution order: | PackerGlobal | Packer | PackerOnline | PackerBNFMixin | builtins.object | | Methods defined here: | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | pack(self) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | first_item = operator.itemgetter(0) | | ---------------------------------------------------------------------- | Methods inherited from Packer: | | add_bin(self, width, height, count=1, **kwargs) | | add_rect(self, width, height, rid=None) | | ---------------------------------------------------------------------- | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __iter__(self) | | __len__(self) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.PackerOnlineBBF
Python Library Documentation: class PackerOnlineBBF in module rectpack.packer class PackerOnlineBBF(PackerOnline, PackerBBFMixin) | PackerOnlineBBF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | BBF Bin Best Fit Online variant | | Method resolution order: | PackerOnlineBBF | PackerOnline | PackerBBFMixin | builtins.object | | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | Arguments: | pack_algo (PackingAlgorithm): What packing algo to use | rotation (bool): Enable/Disable rectangle rotation | | __iter__(self) | | __len__(self) | | add_bin(self, width, height, count=1, **kwargs) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Methods inherited from PackerBBFMixin: | | add_rect(self, width, height, rid=None) | | ---------------------------------------------------------------------- | Data and other attributes inherited from PackerBBFMixin: | | first_item = operator.itemgetter(0)
rectpack.PackerOnlineBFF
Python Library Documentation: class PackerOnlineBFF in module rectpack.packer class PackerOnlineBFF(PackerOnline, PackerBFFMixin) | PackerOnlineBFF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | BFF Bin First Fit Online variant | | Method resolution order: | PackerOnlineBFF | PackerOnline | PackerBFFMixin | builtins.object | | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | Arguments: | pack_algo (PackingAlgorithm): What packing algo to use | rotation (bool): Enable/Disable rectangle rotation | | __iter__(self) | | __len__(self) | | add_bin(self, width, height, count=1, **kwargs) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Methods inherited from PackerBFFMixin: | | add_rect(self, width, height, rid=None)
rectpack.PackerOnlineBNF
Python Library Documentation: class PackerOnlineBNF in module rectpack.packer class PackerOnlineBNF(PackerOnline, PackerBNFMixin) | PackerOnlineBNF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | BNF Bin Next Fit Online variant | | Method resolution order: | PackerOnlineBNF | PackerOnline | PackerBNFMixin | builtins.object | | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | Arguments: | pack_algo (PackingAlgorithm): What packing algo to use | rotation (bool): Enable/Disable rectangle rotation | | __iter__(self) | | __len__(self) | | add_bin(self, width, height, count=1, **kwargs) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Methods inherited from PackerBNFMixin: | | add_rect(self, width, height, rid=None)
rectpack.PackingBin
Error rendering doc: tuple.index(x): x not in tuple
rectpack.PackingMode
Error rendering doc: tuple.index(x): x not in tuple
rectpack.SORT_AREA
Python Library Documentation: function <lambda> in module rectpack.packer
<lambda> lambda rectlist
# Sorting algos for rectangle lists
rectpack.SORT_DIFF
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.SORT_LSIDE
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.SORT_NONE
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.SORT_PERI
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.SORT_RATIO
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.SORT_SSIDE
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.SkylineBl
Python Library Documentation: class SkylineBl in module rectpack.skyline class SkylineBl(Skyline) | SkylineBl(width, height, rot=True, *args, **kwargs) | | Implements Bottom Left heuristic, the best fit option is that which | results in which the top side of the rectangle lies at the bottom-most | position. | | Method resolution order: | SkylineBl | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Skyline: | | __init__(self, width, height, rot=True, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.SkylineBlWm
Python Library Documentation: class SkylineBlWm in module rectpack.skyline class SkylineBlWm(SkylineBl, SkylineWMixin) | SkylineBlWm(width, height, *args, **kwargs) | | Method resolution order: | SkylineBlWm | SkylineBl | SkylineWMixin | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from SkylineWMixin: | | __init__(self, width, height, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | ---------------------------------------------------------------------- | Methods inherited from Skyline: | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.SkylineMwf
Python Library Documentation: class SkylineMwf in module rectpack.skyline class SkylineMwf(Skyline) | SkylineMwf(width, height, rot=True, *args, **kwargs) | | Implements Min Waste fit heuristic, minimizing the area wasted under the | rectangle. | | Method resolution order: | SkylineMwf | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Skyline: | | __init__(self, width, height, rot=True, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.SkylineMwfWm
Python Library Documentation: class SkylineMwfWm in module rectpack.skyline class SkylineMwfWm(SkylineMwf, SkylineWMixin) | SkylineMwfWm(width, height, *args, **kwargs) | | Method resolution order: | SkylineMwfWm | SkylineMwf | SkylineWMixin | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from SkylineWMixin: | | __init__(self, width, height, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | ---------------------------------------------------------------------- | Methods inherited from Skyline: | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.SkylineMwfl
Python Library Documentation: class SkylineMwfl in module rectpack.skyline class SkylineMwfl(Skyline) | SkylineMwfl(width, height, rot=True, *args, **kwargs) | | Implements Min Waste fit with low profile heuritic, minimizing the area | wasted below the rectangle, at the same time it tries to keep the height | minimal. | | Method resolution order: | SkylineMwfl | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Skyline: | | __init__(self, width, height, rot=True, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.SkylineMwflWm
Python Library Documentation: class SkylineMwflWm in module rectpack.skyline class SkylineMwflWm(SkylineMwfl, SkylineWMixin) | SkylineMwflWm(width, height, *args, **kwargs) | | Method resolution order: | SkylineMwflWm | SkylineMwfl | SkylineWMixin | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from SkylineWMixin: | | __init__(self, width, height, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | ---------------------------------------------------------------------- | Methods inherited from Skyline: | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.float2dec
Python Library Documentation: function float2dec in module rectpack.packer
float2dec(ft, decimal_digits)
Convert float (or int) to Decimal (rounding up) with the
requested number of decimal digits.
Arguments:
ft (float, int): Number to convert
decimal (int): Number of digits after decimal point
Return:
Decimal: Number converted to decima
rectpack.newPacker
Python Library Documentation: function newPacker in module rectpack.packer
newPacker(mode=1, bin_algo=2, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D348BDD00>, rotation=True)
Packer factory helper function
Arguments:
mode (PackingMode): Packing mode
Online: Rectangles are packed as soon are they are added
Offline: Rectangles aren't packed untils pack() is called
bin_algo (PackingBin): Bin selection heuristic
pack_algo (PackingAlgorithm): Algorithm used
rotation (boolean): Enable or disable rectangle rotation.
Returns:
Packer: Initialized packer instance.
rectpack.packer.BinFactory
Python Library Documentation: class BinFactory in module rectpack.packer class BinFactory(builtins.object) | BinFactory(width, height, count, pack_algo, *args, **kwargs) | | Methods defined here: | | __eq__(self, other) | Return self==value. | | __init__(self, width, height, count, pack_algo, *args, **kwargs) | Initialize self. See help(type(self)) for accurate signature. | | __lt__(self, other) | Return self<value. | | __str__(self) | Return str(self). | | fitness(self, width, height) | | fits_inside(self, width, height) | | is_empty(self) | | new_bin(self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __hash__ = None
rectpack.packer.Enum
Python Library Documentation: class Enum in module rectpack.packer class Enum(builtins.tuple) | Enum(iterable=(), /) | | # Packer factory | | Method resolution order: | Enum | builtins.tuple | builtins.object | | Methods defined here: | | __getattr__ = index(self, value, start=0, stop=9223372036854775807, /) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | ---------------------------------------------------------------------- | Methods inherited from builtins.tuple: | | __add__(self, value, /) | Return self+value. | | __contains__(self, key, /) | Return bool(key in self). | | __eq__(self, value, /) | Return self==value. | | __ge__(self, value, /) | Return self>=value. | | __getattribute__(self, name, /) | Return getattr(self, name). | | __getitem__(self, key, /) | Return self[key]. | | __getnewargs__(self, /) | | __gt__(self, value, /) | Return self>value. | | __hash__(self, /) | Return hash(self). | | __iter__(self, /) | Implement iter(self). | | __le__(self, value, /) | Return self<=value. | | __len__(self, /) | Return len(self). | | __lt__(self, value, /) | Return self<value. | | __mul__(self, value, /) | Return self*value. | | __ne__(self, value, /) | Return self!=value. | | __repr__(self, /) | Return repr(self). | | __rmul__(self, value, /) | Return value*self. | | count(self, value, /) | Return number of occurrences of value. | | index(self, value, start=0, stop=9223372036854775807, /) | Return first index of value. | | Raises ValueError if the value is not present. | | ---------------------------------------------------------------------- | Class methods inherited from builtins.tuple: | | __class_getitem__(...) | See PEP 585 | | ---------------------------------------------------------------------- | Static methods inherited from builtins.tuple: | | __new__(*args, **kwargs) class method of builtins.tuple | Create and return a new object. See help(type) for accurate signature.
rectpack.packer.MaxRectsBssf
Python Library Documentation: class MaxRectsBssf in module rectpack.maxrects class MaxRectsBssf(MaxRects) | MaxRectsBssf(width, height, rot=True, *args, **kwargs) | | Best Sort Side Fit minimize short leftover side | | Method resolution order: | MaxRectsBssf | MaxRects | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from MaxRects: | | __init__(self, width, height, rot=True, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.packer.Packer
Python Library Documentation: class Packer in module rectpack.packer class Packer(PackerOnline) | Packer(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | Rectangles aren't packed untils pack() is called | | Method resolution order: | Packer | PackerOnline | builtins.object | | Methods defined here: | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | add_bin(self, width, height, count=1, **kwargs) | | add_rect(self, width, height, rid=None) | | pack(self) | | ---------------------------------------------------------------------- | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __iter__(self) | | __len__(self) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.packer.PackerBBF
Python Library Documentation: class PackerBBF in module rectpack.packer class PackerBBF(Packer, PackerBBFMixin) | PackerBBF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | BBF (Bin Best Fit): Pack rectangle in bin that gives best fitness | | Method resolution order: | PackerBBF | Packer | PackerOnline | PackerBBFMixin | builtins.object | | Methods inherited from Packer: | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | add_bin(self, width, height, count=1, **kwargs) | | add_rect(self, width, height, rid=None) | | pack(self) | | ---------------------------------------------------------------------- | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __iter__(self) | | __len__(self) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Data and other attributes inherited from PackerBBFMixin: | | first_item = operator.itemgetter(0)
rectpack.packer.PackerBBFMixin
Python Library Documentation: class PackerBBFMixin in module rectpack.packer class PackerBBFMixin(builtins.object) | BBF (Bin Best Fit): Pack rectangle in bin that gives best fitness | | Methods defined here: | | add_rect(self, width, height, rid=None) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | first_item = operator.itemgetter(0)
rectpack.packer.PackerBFF
Python Library Documentation: class PackerBFF in module rectpack.packer class PackerBFF(Packer, PackerBFFMixin) | PackerBFF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | BFF (Bin First Fit): Pack rectangle in first bin it fits | | Method resolution order: | PackerBFF | Packer | PackerOnline | PackerBFFMixin | builtins.object | | Methods inherited from Packer: | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | add_bin(self, width, height, count=1, **kwargs) | | add_rect(self, width, height, rid=None) | | pack(self) | | ---------------------------------------------------------------------- | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __iter__(self) | | __len__(self) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.packer.PackerBFFMixin
Python Library Documentation: class PackerBFFMixin in module rectpack.packer class PackerBFFMixin(builtins.object) | BFF (Bin First Fit): Pack rectangle in first bin it fits | | Methods defined here: | | add_rect(self, width, height, rid=None) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.packer.PackerBNF
Python Library Documentation: class PackerBNF in module rectpack.packer class PackerBNF(Packer, PackerBNFMixin) | PackerBNF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | BNF (Bin Next Fit): Only one open bin, if rectangle doesn't fit | go to next bin and close current one. | | Method resolution order: | PackerBNF | Packer | PackerOnline | PackerBNFMixin | builtins.object | | Methods inherited from Packer: | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D34CD1080>, rotation=True) | | add_bin(self, width, height, count=1, **kwargs) | | add_rect(self, width, height, rid=None) | | pack(self) | | ---------------------------------------------------------------------- | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __iter__(self) | | __len__(self) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.packer.PackerBNFMixin
Python Library Documentation: class PackerBNFMixin in module rectpack.packer class PackerBNFMixin(builtins.object) | BNF (Bin Next Fit): Only one open bin at a time. If the rectangle | doesn't fit, close the current bin and go to the next. | | Methods defined here: | | add_rect(self, width, height, rid=None) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.packer.PackerGlobal
Python Library Documentation: class PackerGlobal in module rectpack.packer class PackerGlobal(Packer, PackerBNFMixin) | PackerGlobal(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | GLOBAL: For each bin pack the rectangle with the best fitness. | | Method resolution order: | PackerGlobal | Packer | PackerOnline | PackerBNFMixin | builtins.object | | Methods defined here: | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | pack(self) | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | first_item = operator.itemgetter(0) | | ---------------------------------------------------------------------- | Methods inherited from Packer: | | add_bin(self, width, height, count=1, **kwargs) | | add_rect(self, width, height, rid=None) | | ---------------------------------------------------------------------- | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __iter__(self) | | __len__(self) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.packer.PackerOnline
Python Library Documentation: class PackerOnline in module rectpack.packer class PackerOnline(builtins.object) | PackerOnline(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | Rectangles are packed as soon are they are added | | Methods defined here: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | Arguments: | pack_algo (PackingAlgorithm): What packing algo to use | rotation (bool): Enable/Disable rectangle rotation | | __iter__(self) | | __len__(self) | | add_bin(self, width, height, count=1, **kwargs) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.packer.PackerOnlineBBF
Python Library Documentation: class PackerOnlineBBF in module rectpack.packer class PackerOnlineBBF(PackerOnline, PackerBBFMixin) | PackerOnlineBBF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | BBF Bin Best Fit Online variant | | Method resolution order: | PackerOnlineBBF | PackerOnline | PackerBBFMixin | builtins.object | | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | Arguments: | pack_algo (PackingAlgorithm): What packing algo to use | rotation (bool): Enable/Disable rectangle rotation | | __iter__(self) | | __len__(self) | | add_bin(self, width, height, count=1, **kwargs) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Methods inherited from PackerBBFMixin: | | add_rect(self, width, height, rid=None) | | ---------------------------------------------------------------------- | Data and other attributes inherited from PackerBBFMixin: | | first_item = operator.itemgetter(0)
rectpack.packer.PackerOnlineBFF
Python Library Documentation: class PackerOnlineBFF in module rectpack.packer class PackerOnlineBFF(PackerOnline, PackerBFFMixin) | PackerOnlineBFF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | BFF Bin First Fit Online variant | | Method resolution order: | PackerOnlineBFF | PackerOnline | PackerBFFMixin | builtins.object | | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | Arguments: | pack_algo (PackingAlgorithm): What packing algo to use | rotation (bool): Enable/Disable rectangle rotation | | __iter__(self) | | __len__(self) | | add_bin(self, width, height, count=1, **kwargs) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Methods inherited from PackerBFFMixin: | | add_rect(self, width, height, rid=None)
rectpack.packer.PackerOnlineBNF
Python Library Documentation: class PackerOnlineBNF in module rectpack.packer class PackerOnlineBNF(PackerOnline, PackerBNFMixin) | PackerOnlineBNF(pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | | BNF Bin Next Fit Online variant | | Method resolution order: | PackerOnlineBNF | PackerOnline | PackerBNFMixin | builtins.object | | Methods inherited from PackerOnline: | | __getitem__(self, key) | Return bin in selected position. (excluding empty bins) | | __init__(self, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, rotation=True) | Arguments: | pack_algo (PackingAlgorithm): What packing algo to use | rotation (bool): Enable/Disable rectangle rotation | | __iter__(self) | | __len__(self) | | add_bin(self, width, height, count=1, **kwargs) | | bin_list(self) | Return a list of the dimmensions of the bins in use, that is closed | or open containing at least one rectangle | | rect_list(self) | | reset(self) | | validate_packing(self) | | ---------------------------------------------------------------------- | Data descriptors inherited from PackerOnline: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Methods inherited from PackerBNFMixin: | | add_rect(self, width, height, rid=None)
rectpack.packer.PackingBin
Error rendering doc: tuple.index(x): x not in tuple
rectpack.packer.PackingMode
Error rendering doc: tuple.index(x): x not in tuple
rectpack.packer.SORT_AREA
Python Library Documentation: function <lambda> in module rectpack.packer
<lambda> lambda rectlist
# Sorting algos for rectangle lists
rectpack.packer.SORT_DIFF
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.packer.SORT_LSIDE
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.packer.SORT_NONE
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.packer.SORT_PERI
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.packer.SORT_RATIO
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.packer.SORT_SSIDE
Python Library Documentation: function <lambda> in module rectpack.packer <lambda> lambda rectlist
rectpack.packer.float2dec
Python Library Documentation: function float2dec in module rectpack.packer
float2dec(ft, decimal_digits)
Convert float (or int) to Decimal (rounding up) with the
requested number of decimal digits.
Arguments:
ft (float, int): Number to convert
decimal (int): Number of digits after decimal point
Return:
Decimal: Number converted to decima
rectpack.packer.newPacker
Python Library Documentation: function newPacker in module rectpack.packer
newPacker(mode=1, bin_algo=2, pack_algo=<class 'rectpack.maxrects.MaxRectsBssf'>, sort_algo=<function <lambda> at 0x0000023D348BDD00>, rotation=True)
Packer factory helper function
Arguments:
mode (PackingMode): Packing mode
Online: Rectangles are packed as soon are they are added
Offline: Rectangles aren't packed untils pack() is called
bin_algo (PackingBin): Bin selection heuristic
pack_algo (PackingAlgorithm): Algorithm used
rotation (boolean): Enable or disable rectangle rotation.
Returns:
Packer: Initialized packer instance.
rectpack.guillotine.Guillotine
Python Library Documentation: class Guillotine in module rectpack.guillotine class Guillotine(rectpack.pack_algo.PackingAlgorithm) | Guillotine(width, height, rot=True, merge=True, *args, **kwargs) | | Implementation of several variants of Guillotine packing algorithm | | For a more detailed explanation of the algorithm used, see: | Jukka Jylanki - A Thousand Ways to Pack the Bin (February 27, 2010) | | Method resolution order: | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods defined here: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBaf
Python Library Documentation: class GuillotineBaf in module rectpack.guillotine class GuillotineBaf(Guillotine) | GuillotineBaf(width, height, rot=True, merge=True, *args, **kwargs) | | Implements Best Area Fit (BAF) section selection criteria for | Guillotine algorithm. | | Method resolution order: | GuillotineBaf | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBafLas
Python Library Documentation: class GuillotineBafLas in module rectpack.guillotine class GuillotineBafLas(GuillotineBaf, GuillotineLas) | GuillotineBafLas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafLas | GuillotineBaf | GuillotineLas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBafLlas
Python Library Documentation: class GuillotineBafLlas in module rectpack.guillotine class GuillotineBafLlas(GuillotineBaf, GuillotineLlas) | GuillotineBafLlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafLlas | GuillotineBaf | GuillotineLlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBafMaxas
Python Library Documentation: class GuillotineBafMaxas in module rectpack.guillotine class GuillotineBafMaxas(GuillotineBaf, GuillotineMaxas) | GuillotineBafMaxas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafMaxas | GuillotineBaf | GuillotineMaxas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBafMinas
Python Library Documentation: class GuillotineBafMinas in module rectpack.guillotine class GuillotineBafMinas(GuillotineBaf, GuillotineMinas) | GuillotineBafMinas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafMinas | GuillotineBaf | GuillotineMinas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBafSas
Python Library Documentation: class GuillotineBafSas in module rectpack.guillotine class GuillotineBafSas(GuillotineBaf, GuillotineSas) | GuillotineBafSas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafSas | GuillotineBaf | GuillotineSas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBafSlas
Python Library Documentation: class GuillotineBafSlas in module rectpack.guillotine class GuillotineBafSlas(GuillotineBaf, GuillotineSlas) | GuillotineBafSlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBafSlas | GuillotineBaf | GuillotineSlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBlsf
Python Library Documentation: class GuillotineBlsf in module rectpack.guillotine class GuillotineBlsf(Guillotine) | GuillotineBlsf(width, height, rot=True, merge=True, *args, **kwargs) | | Implements Best Long Side Fit (BLSF) section selection criteria for | Guillotine algorithm. | | Method resolution order: | GuillotineBlsf | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBlsfLas
Python Library Documentation: class GuillotineBlsfLas in module rectpack.guillotine class GuillotineBlsfLas(GuillotineBlsf, GuillotineLas) | GuillotineBlsfLas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfLas | GuillotineBlsf | GuillotineLas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBlsfLlas
Python Library Documentation: class GuillotineBlsfLlas in module rectpack.guillotine class GuillotineBlsfLlas(GuillotineBlsf, GuillotineLlas) | GuillotineBlsfLlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfLlas | GuillotineBlsf | GuillotineLlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBlsfMaxas
Python Library Documentation: class GuillotineBlsfMaxas in module rectpack.guillotine class GuillotineBlsfMaxas(GuillotineBlsf, GuillotineMaxas) | GuillotineBlsfMaxas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfMaxas | GuillotineBlsf | GuillotineMaxas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBlsfMinas
Python Library Documentation: class GuillotineBlsfMinas in module rectpack.guillotine class GuillotineBlsfMinas(GuillotineBlsf, GuillotineMinas) | GuillotineBlsfMinas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfMinas | GuillotineBlsf | GuillotineMinas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBlsfSas
Python Library Documentation: class GuillotineBlsfSas in module rectpack.guillotine class GuillotineBlsfSas(GuillotineBlsf, GuillotineSas) | GuillotineBlsfSas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfSas | GuillotineBlsf | GuillotineSas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBlsfSlas
Python Library Documentation: class GuillotineBlsfSlas in module rectpack.guillotine class GuillotineBlsfSlas(GuillotineBlsf, GuillotineSlas) | GuillotineBlsfSlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBlsfSlas | GuillotineBlsf | GuillotineSlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBssf
Python Library Documentation: class GuillotineBssf in module rectpack.guillotine class GuillotineBssf(Guillotine) | GuillotineBssf(width, height, rot=True, merge=True, *args, **kwargs) | | Implements Best Short Side Fit (BSSF) section selection criteria for | Guillotine algorithm. | | Method resolution order: | GuillotineBssf | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBssfLas
Python Library Documentation: class GuillotineBssfLas in module rectpack.guillotine class GuillotineBssfLas(GuillotineBssf, GuillotineLas) | GuillotineBssfLas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBssfLas | GuillotineBssf | GuillotineLas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBssfLlas
Python Library Documentation: class GuillotineBssfLlas in module rectpack.guillotine class GuillotineBssfLlas(GuillotineBssf, GuillotineLlas) | GuillotineBssfLlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBssfLlas | GuillotineBssf | GuillotineLlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBssfMaxas
Python Library Documentation: class GuillotineBssfMaxas in module rectpack.guillotine class GuillotineBssfMaxas(GuillotineBssf, GuillotineMaxas) | GuillotineBssfMaxas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBssfMaxas | GuillotineBssf | GuillotineMaxas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBssfMinas
Python Library Documentation: class GuillotineBssfMinas in module rectpack.guillotine class GuillotineBssfMinas(GuillotineBssf, GuillotineMinas) | GuillotineBssfMinas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBssfMinas | GuillotineBssf | GuillotineMinas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBssfSas
Python Library Documentation: class GuillotineBssfSas in module rectpack.guillotine class GuillotineBssfSas(GuillotineBssf, GuillotineSas) | GuillotineBssfSas(width, height, rot=True, merge=True, *args, **kwargs) | | # Guillotine algorithms GUILLOTINE-RECT-SPLIT, Selecting one | # Axis split, and one selection criteria. | | Method resolution order: | GuillotineBssfSas | GuillotineBssf | GuillotineSas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineBssfSlas
Python Library Documentation: class GuillotineBssfSlas in module rectpack.guillotine class GuillotineBssfSlas(GuillotineBssf, GuillotineSlas) | GuillotineBssfSlas(width, height, rot=True, merge=True, *args, **kwargs) | | Method resolution order: | GuillotineBssfSlas | GuillotineBssf | GuillotineSlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineLas
Python Library Documentation: class GuillotineLas in module rectpack.guillotine class GuillotineLas(Guillotine) | GuillotineLas(width, height, rot=True, merge=True, *args, **kwargs) | | Implements Long Axis Split (LAS) selection rule for Guillotine | algorithm. | | Method resolution order: | GuillotineLas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineLlas
Python Library Documentation: class GuillotineLlas in module rectpack.guillotine class GuillotineLlas(Guillotine) | GuillotineLlas(width, height, rot=True, merge=True, *args, **kwargs) | | Implements Long Leftover Axis Split (LLAS) selection rule for | Guillotine algorithm. | | Method resolution order: | GuillotineLlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineMaxas
Python Library Documentation: class GuillotineMaxas in module rectpack.guillotine class GuillotineMaxas(Guillotine) | GuillotineMaxas(width, height, rot=True, merge=True, *args, **kwargs) | | Implements Max Area Axis Split (MAXAS) selection rule for Guillotine | algorithm. Maximize the larger area == minimize the smaller area. | Tries to make the rectangles more even-sized. | | Method resolution order: | GuillotineMaxas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineMinas
Python Library Documentation: class GuillotineMinas in module rectpack.guillotine class GuillotineMinas(Guillotine) | GuillotineMinas(width, height, rot=True, merge=True, *args, **kwargs) | | Implements Min Area Axis Split (MINAS) selection rule for Guillotine | algorithm. | | Method resolution order: | GuillotineMinas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineSas
Python Library Documentation: class GuillotineSas in module rectpack.guillotine class GuillotineSas(Guillotine) | GuillotineSas(width, height, rot=True, merge=True, *args, **kwargs) | | Implements Short Axis Split (SAS) selection rule for Guillotine | algorithm. | | Method resolution order: | GuillotineSas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.GuillotineSlas
Python Library Documentation: class GuillotineSlas in module rectpack.guillotine class GuillotineSlas(Guillotine) | GuillotineSlas(width, height, rot=True, merge=True, *args, **kwargs) | | Implements Short Leftover Axis Split (SLAS) selection rule for | Guillotine algorithm. | | Method resolution order: | GuillotineSlas | Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Guillotine: | | __init__(self, width, height, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.PackingAlgorithm
Python Library Documentation: class PackingAlgorithm in module rectpack.pack_algo class PackingAlgorithm(builtins.object) | PackingAlgorithm(width, height, rot=True, bid=None, *args, **kwargs) | | PackingAlgorithm base class | | Methods defined here: | | __getitem__(self, key) | Return rectangle in selected position. | | __init__(self, width, height, rot=True, bid=None, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | __iter__(self) | | __len__(self) | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height, rot=False) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rot (bool): Enable rectangle rotation | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | reset(self) | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.guillotine.Rectangle
Python Library Documentation: class Rectangle in module rectpack.geometry class Rectangle(builtins.object) | Rectangle(x, y, width, height, rid=None) | | Basic rectangle primitive class. | x, y-> Lower right corner coordinates | width - | height - | | Methods defined here: | | __eq__(self, other) | Equal rectangles have same area. | | __hash__(self) | Return hash(self). | | __init__(self, x, y, width, height, rid=None) | Args: | x (int, float): | y (int, float): | width (int, float): | height (int, float): | rid (int): | | __iter__(self) | Iterate through rectangle corners | | __lt__(self, other) | Compare rectangles by area (used for sorting) | | __repr__(self) | Return repr(self). | | area(self) | Rectangle area | | contains(self, rect) | Tests if another rectangle is contained by this one | | Arguments: | rect (Rectangle): The other rectangle | | Returns: | bool: True if it is container, False otherwise | | intersection(self, rect, edges=False) | Returns the rectangle resulting of the intersection between this and another | rectangle. If the rectangles are only touching by their edges, and the | argument 'edges' is True the rectangle returned will have an area of 0. | Returns None if there is no intersection. | | Arguments: | rect (Rectangle): The other rectangle. | edges (bool): If True Rectangles touching by their edges are | considered to be intersection. In this case a rectangle of | 0 height or/and width will be returned. | | Returns: | Rectangle: Intersection. | None: There was no intersection. | | intersects(self, rect, edges=False) | Detect intersections between this and another Rectangle. | | Parameters: | rect (Rectangle): The other rectangle. | edges (bool): True to consider rectangles touching by their | edges or corners to be intersecting. | (Should have been named include_touching) | | Returns: | bool: True if the rectangles intersect, False otherwise | | join(self, other) | Try to join a rectangle to this one, if the result is also a rectangle | and the operation is successful and this rectangle is modified to the union. | | Arguments: | other (Rectangle): Rectangle to join | | Returns: | bool: True when successfully joined, False otherwise | | move(self, x, y) | Move Rectangle to x,y coordinates | | Arguments: | x (int, float): X coordinate | y (int, float): Y coordinate | | ---------------------------------------------------------------------- | Readonly properties defined here: | | bottom | Rectangle bottom edge y coordinate | | corner_bot_l | | corner_bot_r | | corner_top_l | | corner_top_r | | left | Rectangle left ednge x coordinate | | right | Rectangle right edge x coordinate | | top | Rectangle top edge y coordiante | | ---------------------------------------------------------------------- | Data descriptors defined here: | | height | | rid | | width | | x | | y
rectpack.maxrects.MaxRects
Python Library Documentation: class MaxRects in module rectpack.maxrects class MaxRects(rectpack.pack_algo.PackingAlgorithm) | MaxRects(width, height, rot=True, *args, **kwargs) | | Method resolution order: | MaxRects | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods defined here: | | __init__(self, width, height, rot=True, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.maxrects.MaxRectsBaf
Python Library Documentation: class MaxRectsBaf in module rectpack.maxrects class MaxRectsBaf(MaxRects) | MaxRectsBaf(width, height, rot=True, *args, **kwargs) | | Best Area Fit pick maximal rectangle with smallest area | where the rectangle can be placed | | Method resolution order: | MaxRectsBaf | MaxRects | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from MaxRects: | | __init__(self, width, height, rot=True, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.maxrects.MaxRectsBl
Python Library Documentation: class MaxRectsBl in module rectpack.maxrects class MaxRectsBl(MaxRects) | MaxRectsBl(width, height, rot=True, *args, **kwargs) | | Method resolution order: | MaxRectsBl | MaxRects | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from MaxRects: | | __init__(self, width, height, rot=True, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.maxrects.MaxRectsBlsf
Python Library Documentation: class MaxRectsBlsf in module rectpack.maxrects class MaxRectsBlsf(MaxRects) | MaxRectsBlsf(width, height, rot=True, *args, **kwargs) | | Best Long Side Fit minimize long leftover side | | Method resolution order: | MaxRectsBlsf | MaxRects | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from MaxRects: | | __init__(self, width, height, rot=True, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.maxrects.MaxRectsBssf
Python Library Documentation: class MaxRectsBssf in module rectpack.maxrects class MaxRectsBssf(MaxRects) | MaxRectsBssf(width, height, rot=True, *args, **kwargs) | | Best Sort Side Fit minimize short leftover side | | Method resolution order: | MaxRectsBssf | MaxRects | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from MaxRects: | | __init__(self, width, height, rot=True, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.maxrects.PackingAlgorithm
Python Library Documentation: class PackingAlgorithm in module rectpack.pack_algo class PackingAlgorithm(builtins.object) | PackingAlgorithm(width, height, rot=True, bid=None, *args, **kwargs) | | PackingAlgorithm base class | | Methods defined here: | | __getitem__(self, key) | Return rectangle in selected position. | | __init__(self, width, height, rot=True, bid=None, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | __iter__(self) | | __len__(self) | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height, rot=False) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rot (bool): Enable rectangle rotation | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | reset(self) | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.maxrects.Rectangle
Python Library Documentation: class Rectangle in module rectpack.geometry class Rectangle(builtins.object) | Rectangle(x, y, width, height, rid=None) | | Basic rectangle primitive class. | x, y-> Lower right corner coordinates | width - | height - | | Methods defined here: | | __eq__(self, other) | Equal rectangles have same area. | | __hash__(self) | Return hash(self). | | __init__(self, x, y, width, height, rid=None) | Args: | x (int, float): | y (int, float): | width (int, float): | height (int, float): | rid (int): | | __iter__(self) | Iterate through rectangle corners | | __lt__(self, other) | Compare rectangles by area (used for sorting) | | __repr__(self) | Return repr(self). | | area(self) | Rectangle area | | contains(self, rect) | Tests if another rectangle is contained by this one | | Arguments: | rect (Rectangle): The other rectangle | | Returns: | bool: True if it is container, False otherwise | | intersection(self, rect, edges=False) | Returns the rectangle resulting of the intersection between this and another | rectangle. If the rectangles are only touching by their edges, and the | argument 'edges' is True the rectangle returned will have an area of 0. | Returns None if there is no intersection. | | Arguments: | rect (Rectangle): The other rectangle. | edges (bool): If True Rectangles touching by their edges are | considered to be intersection. In this case a rectangle of | 0 height or/and width will be returned. | | Returns: | Rectangle: Intersection. | None: There was no intersection. | | intersects(self, rect, edges=False) | Detect intersections between this and another Rectangle. | | Parameters: | rect (Rectangle): The other rectangle. | edges (bool): True to consider rectangles touching by their | edges or corners to be intersecting. | (Should have been named include_touching) | | Returns: | bool: True if the rectangles intersect, False otherwise | | join(self, other) | Try to join a rectangle to this one, if the result is also a rectangle | and the operation is successful and this rectangle is modified to the union. | | Arguments: | other (Rectangle): Rectangle to join | | Returns: | bool: True when successfully joined, False otherwise | | move(self, x, y) | Move Rectangle to x,y coordinates | | Arguments: | x (int, float): X coordinate | y (int, float): Y coordinate | | ---------------------------------------------------------------------- | Readonly properties defined here: | | bottom | Rectangle bottom edge y coordinate | | corner_bot_l | | corner_bot_r | | corner_top_l | | corner_top_r | | left | Rectangle left ednge x coordinate | | right | Rectangle right edge x coordinate | | top | Rectangle top edge y coordiante | | ---------------------------------------------------------------------- | Data descriptors defined here: | | height | | rid | | width | | x | | y
rectpack.maxrects.first_item
Python Library Documentation: itemgetter in module operator object class itemgetter(builtins.object) | itemgetter(item, /, *items) | | Return a callable object that fetches the given item(s) from its operand. | After f = itemgetter(2), the call f(r) returns r[2]. | After g = itemgetter(2, 5, 3), the call g(r) returns (r[2], r[5], r[3]) | | Methods defined here: | | __call__(self, /, *args, **kwargs) | Call self as a function. | | __getattribute__(self, name, /) | Return getattr(self, name). | | __reduce__(...) | Return state information for pickling | | __repr__(self, /) | Return repr(self). | | ---------------------------------------------------------------------- | Static methods defined here: | | __new__(*args, **kwargs) | Create and return a new object. See help(type) for accurate signature. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __vectorcalloffset__
rectpack.skyline.HSegment
Python Library Documentation: class HSegment in module rectpack.geometry class HSegment(Segment) | HSegment(start, length) | | Horizontal Segment | | Method resolution order: | HSegment | Segment | builtins.object | | Methods defined here: | | __init__(self, start, length) | Create an Horizontal segment given its left most end point and its | length. | | Arguments: | - start (Point): Starting Point | - length (number): segment length | | ---------------------------------------------------------------------- | Readonly properties defined here: | | length | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object | | ---------------------------------------------------------------------- | Methods inherited from Segment: | | __eq__(self, other) | Return self==value. | | __repr__(self) | Return repr(self). | | ---------------------------------------------------------------------- | Readonly properties inherited from Segment: | | bottom | | left | | length_squared | Faster than length and useful for some comparisons | | right | | top | | ---------------------------------------------------------------------- | Data descriptors inherited from Segment: | | end | | start | | ---------------------------------------------------------------------- | Data and other attributes inherited from Segment: | | __hash__ = None
rectpack.skyline.P
Python Library Documentation: class Point in module rectpack.geometry class Point(builtins.object) | Point(x, y) | | Methods defined here: | | __eq__(self, other) | Return self==value. | | __init__(self, x, y) | Initialize self. See help(type(self)) for accurate signature. | | __repr__(self) | Return repr(self). | | distance(self, point) | Calculate distance to another point | | distance_squared(self, point) | | ---------------------------------------------------------------------- | Data descriptors defined here: | | x | | y | | ---------------------------------------------------------------------- | Data and other attributes defined here: | | __hash__ = None
rectpack.skyline.PackingAlgorithm
Python Library Documentation: class PackingAlgorithm in module rectpack.pack_algo class PackingAlgorithm(builtins.object) | PackingAlgorithm(width, height, rot=True, bid=None, *args, **kwargs) | | PackingAlgorithm base class | | Methods defined here: | | __getitem__(self, key) | Return rectangle in selected position. | | __init__(self, width, height, rot=True, bid=None, *args, **kwargs) | Initialize packing algorithm | | Arguments: | width (int, float): Packing surface width | height (int, float): Packing surface height | rot (bool): Rectangle rotation enabled or disabled | bid (string|int|...): Packing surface identification | | __iter__(self) | | __len__(self) | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height, rot=False) | Metric used to rate how much space is wasted if a rectangle is placed. | Returns a value greater or equal to zero, the smaller the value the more | 'fit' is the rectangle. If the rectangle can't be placed, returns None. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rot (bool): Enable rectangle rotation | | Returns: | int, float: Rectangle fitness | None: Rectangle can't be placed | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | reset(self) | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors defined here: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.skyline.Rectangle
Python Library Documentation: class Rectangle in module rectpack.geometry class Rectangle(builtins.object) | Rectangle(x, y, width, height, rid=None) | | Basic rectangle primitive class. | x, y-> Lower right corner coordinates | width - | height - | | Methods defined here: | | __eq__(self, other) | Equal rectangles have same area. | | __hash__(self) | Return hash(self). | | __init__(self, x, y, width, height, rid=None) | Args: | x (int, float): | y (int, float): | width (int, float): | height (int, float): | rid (int): | | __iter__(self) | Iterate through rectangle corners | | __lt__(self, other) | Compare rectangles by area (used for sorting) | | __repr__(self) | Return repr(self). | | area(self) | Rectangle area | | contains(self, rect) | Tests if another rectangle is contained by this one | | Arguments: | rect (Rectangle): The other rectangle | | Returns: | bool: True if it is container, False otherwise | | intersection(self, rect, edges=False) | Returns the rectangle resulting of the intersection between this and another | rectangle. If the rectangles are only touching by their edges, and the | argument 'edges' is True the rectangle returned will have an area of 0. | Returns None if there is no intersection. | | Arguments: | rect (Rectangle): The other rectangle. | edges (bool): If True Rectangles touching by their edges are | considered to be intersection. In this case a rectangle of | 0 height or/and width will be returned. | | Returns: | Rectangle: Intersection. | None: There was no intersection. | | intersects(self, rect, edges=False) | Detect intersections between this and another Rectangle. | | Parameters: | rect (Rectangle): The other rectangle. | edges (bool): True to consider rectangles touching by their | edges or corners to be intersecting. | (Should have been named include_touching) | | Returns: | bool: True if the rectangles intersect, False otherwise | | join(self, other) | Try to join a rectangle to this one, if the result is also a rectangle | and the operation is successful and this rectangle is modified to the union. | | Arguments: | other (Rectangle): Rectangle to join | | Returns: | bool: True when successfully joined, False otherwise | | move(self, x, y) | Move Rectangle to x,y coordinates | | Arguments: | x (int, float): X coordinate | y (int, float): Y coordinate | | ---------------------------------------------------------------------- | Readonly properties defined here: | | bottom | Rectangle bottom edge y coordinate | | corner_bot_l | | corner_bot_r | | corner_top_l | | corner_top_r | | left | Rectangle left ednge x coordinate | | right | Rectangle right edge x coordinate | | top | Rectangle top edge y coordiante | | ---------------------------------------------------------------------- | Data descriptors defined here: | | height | | rid | | width | | x | | y
rectpack.skyline.Skyline
Python Library Documentation: class Skyline in module rectpack.skyline class Skyline(rectpack.pack_algo.PackingAlgorithm) | Skyline(width, height, rot=True, *args, **kwargs) | | Class implementing Skyline algorithm as described by | Jukka Jylanki - A Thousand Ways to Pack the Bin (February 27, 2010) | | _skyline: stores all the segments at the top of the skyline. | _waste: Handles all wasted sections. | | Method resolution order: | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods defined here: | | __init__(self, width, height, rot=True, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.skyline.SkylineBl
Python Library Documentation: class SkylineBl in module rectpack.skyline class SkylineBl(Skyline) | SkylineBl(width, height, rot=True, *args, **kwargs) | | Implements Bottom Left heuristic, the best fit option is that which | results in which the top side of the rectangle lies at the bottom-most | position. | | Method resolution order: | SkylineBl | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Skyline: | | __init__(self, width, height, rot=True, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.skyline.SkylineBlWm
Python Library Documentation: class SkylineBlWm in module rectpack.skyline class SkylineBlWm(SkylineBl, SkylineWMixin) | SkylineBlWm(width, height, *args, **kwargs) | | Method resolution order: | SkylineBlWm | SkylineBl | SkylineWMixin | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from SkylineWMixin: | | __init__(self, width, height, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | ---------------------------------------------------------------------- | Methods inherited from Skyline: | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.skyline.SkylineMwf
Python Library Documentation: class SkylineMwf in module rectpack.skyline class SkylineMwf(Skyline) | SkylineMwf(width, height, rot=True, *args, **kwargs) | | Implements Min Waste fit heuristic, minimizing the area wasted under the | rectangle. | | Method resolution order: | SkylineMwf | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Skyline: | | __init__(self, width, height, rot=True, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.skyline.SkylineMwfWm
Python Library Documentation: class SkylineMwfWm in module rectpack.skyline class SkylineMwfWm(SkylineMwf, SkylineWMixin) | SkylineMwfWm(width, height, *args, **kwargs) | | Method resolution order: | SkylineMwfWm | SkylineMwf | SkylineWMixin | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from SkylineWMixin: | | __init__(self, width, height, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | ---------------------------------------------------------------------- | Methods inherited from Skyline: | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.skyline.SkylineMwfl
Python Library Documentation: class SkylineMwfl in module rectpack.skyline class SkylineMwfl(Skyline) | SkylineMwfl(width, height, rot=True, *args, **kwargs) | | Implements Min Waste fit with low profile heuritic, minimizing the area | wasted below the rectangle, at the same time it tries to keep the height | minimal. | | Method resolution order: | SkylineMwfl | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from Skyline: | | __init__(self, width, height, rot=True, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.skyline.SkylineMwflWm
Python Library Documentation: class SkylineMwflWm in module rectpack.skyline class SkylineMwflWm(SkylineMwfl, SkylineWMixin) | SkylineMwflWm(width, height, *args, **kwargs) | | Method resolution order: | SkylineMwflWm | SkylineMwfl | SkylineWMixin | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods inherited from SkylineWMixin: | | __init__(self, width, height, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | ---------------------------------------------------------------------- | Methods inherited from Skyline: | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.skyline.SkylineWMixin
Python Library Documentation: class SkylineWMixin in module rectpack.skyline class SkylineWMixin(Skyline) | SkylineWMixin(width, height, *args, **kwargs) | | Waste managment mixin | | Method resolution order: | SkylineWMixin | Skyline | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods defined here: | | __init__(self, width, height, *args, **kwargs) | _skyline is the list used to store all the skyline segments, each | one is a list with the format [x, y, width] where x is the x | coordinate of the left most point of the segment, y the y coordinate | of the segment, and width the length of the segment. The initial | segment is allways [0, 0, surface_width] | | Arguments: | width (int, float): | height (int, float): | rot (bool): Enable or disable rectangle rotation | | ---------------------------------------------------------------------- | Methods inherited from Skyline: | | add_rect(self, width, height, rid=None) | Add new rectangle | | fitness(self, width, height) | Search for the best fitness | | reset(self) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object
rectpack.skyline.WasteManager
Python Library Documentation: class WasteManager in module rectpack.waste class WasteManager(rectpack.guillotine.GuillotineBafMinas) | WasteManager(rot=True, merge=True, *args, **kwargs) | | Method resolution order: | WasteManager | rectpack.guillotine.GuillotineBafMinas | rectpack.guillotine.GuillotineBaf | rectpack.guillotine.GuillotineMinas | rectpack.guillotine.Guillotine | rectpack.pack_algo.PackingAlgorithm | builtins.object | | Methods defined here: | | __init__(self, rot=True, merge=True, *args, **kwargs) | Arguments: | width (int, float): | height (int, float): | merge (bool): Optional keyword argument | | add_waste(self, x, y, width, height) | Add new waste section | | reset(self) | | validate_packing(self) | Check for collisions between rectangles, also check all are placed | inside surface. | | ---------------------------------------------------------------------- | Methods inherited from rectpack.guillotine.Guillotine: | | add_rect(self, width, height, rid=None) | Add rectangle of widthxheight dimensions. | | Arguments: | width (int, float): Rectangle width | height (int, float): Rectangle height | rid: Optional rectangle user id | | Returns: | Rectangle: Rectangle with placemente coordinates | None: If the rectangle couldn be placed. | | fitness(self, width, height) | In guillotine algorithm case, returns the min of the fitness of all | free sections, for the given dimension, both normal and rotated | (if rotation enabled.) | | ---------------------------------------------------------------------- | Methods inherited from rectpack.pack_algo.PackingAlgorithm: | | __getitem__(self, key) | Return rectangle in selected position. | | __iter__(self) | | __len__(self) | | is_empty(self) | | rect_list(self) | Returns a list with all rectangles placed into the surface. | | Returns: | List: Format [(x, y, width, height, rid), ...] | | used_area(self) | Total area of rectangles placed | | Returns: | int, float: Area | | ---------------------------------------------------------------------- | Data descriptors inherited from rectpack.pack_algo.PackingAlgorithm: | | __dict__ | dictionary for instance variables | | __weakref__ | list of weak references to the object