mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-05 21:13:58 -06:00
re-add functions for arrange
To avoid api break new functions are added with the depricated decorator
This commit is contained in:
parent
e2578554e6
commit
4eb0ba9861
1 changed files with 28 additions and 0 deletions
|
@ -6,6 +6,7 @@ from pynest2d import Point, Box, Item, NfpConfig, nest
|
|||
from typing import List, TYPE_CHECKING, Optional, Tuple
|
||||
|
||||
from UM.Application import Application
|
||||
from UM.Decorators import deprecated
|
||||
from UM.Logger import Logger
|
||||
from UM.Math.Matrix import Matrix
|
||||
from UM.Math.Polygon import Polygon
|
||||
|
@ -149,3 +150,30 @@ class Nest2DArrange(Arranger):
|
|||
not_fit_count += 1
|
||||
|
||||
return grouped_operation, not_fit_count
|
||||
|
||||
|
||||
@deprecated("Use the Nest2DArrange class instead")
|
||||
def findNodePlacement(nodes_to_arrange: List["SceneNode"], build_volume: "BuildVolume",
|
||||
fixed_nodes: Optional[List["SceneNode"]] = None, factor=10000) -> Tuple[bool, List[Item]]:
|
||||
arranger = Nest2DArrange(nodes_to_arrange, build_volume, fixed_nodes, factor=factor)
|
||||
return arranger.findNodePlacement()
|
||||
|
||||
|
||||
@deprecated("Use the Nest2DArrange class instead")
|
||||
def createGroupOperationForArrange(nodes_to_arrange: List["SceneNode"],
|
||||
build_volume: "BuildVolume",
|
||||
fixed_nodes: Optional[List["SceneNode"]] = None,
|
||||
factor=10000,
|
||||
add_new_nodes_in_scene: bool = False) -> Tuple[GroupedOperation, int]:
|
||||
arranger = Nest2DArrange(nodes_to_arrange, build_volume, fixed_nodes, factor=factor)
|
||||
return arranger.createGroupOperationForArrange(add_new_nodes_in_scene=add_new_nodes_in_scene)
|
||||
|
||||
|
||||
@deprecated("Use the Nest2DArrange class instead")
|
||||
def arrange(nodes_to_arrange: List["SceneNode"],
|
||||
build_volume: "BuildVolume",
|
||||
fixed_nodes: Optional[List["SceneNode"]] = None,
|
||||
factor=10000,
|
||||
add_new_nodes_in_scene: bool = False) -> bool:
|
||||
arranger = Nest2DArrange(nodes_to_arrange, build_volume, fixed_nodes, factor=factor)
|
||||
return arranger.arrange(add_new_nodes_in_scene=add_new_nodes_in_scene)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue