spyrrow 0.4.0__cp313-cp313-macosx_10_12_x86_64.whl → 0.6.0__cp313-cp313-macosx_10_12_x86_64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of spyrrow might be problematic. Click here for more details.
- spyrrow/__init__.pyi +18 -22
- spyrrow/spyrrow.cpython-313-darwin.so +0 -0
- {spyrrow-0.4.0.dist-info → spyrrow-0.6.0.dist-info}/METADATA +3 -3
- spyrrow-0.6.0.dist-info/RECORD +8 -0
- {spyrrow-0.4.0.dist-info → spyrrow-0.6.0.dist-info}/WHEEL +1 -1
- spyrrow-0.4.0.dist-info/RECORD +0 -8
- {spyrrow-0.4.0.dist-info → spyrrow-0.6.0.dist-info}/licenses/LICENSE.txt +0 -0
spyrrow/__init__.pyi
CHANGED
|
@@ -3,52 +3,51 @@ from typing import TypeAlias
|
|
|
3
3
|
Point: TypeAlias = tuple[float, float]
|
|
4
4
|
|
|
5
5
|
class Item:
|
|
6
|
-
id:
|
|
6
|
+
id: str
|
|
7
7
|
demand: int
|
|
8
8
|
shape: list[Point]
|
|
9
9
|
allowed_orientations: list[float]
|
|
10
10
|
|
|
11
11
|
def __init__(
|
|
12
12
|
self,
|
|
13
|
-
id:
|
|
13
|
+
id: str,
|
|
14
14
|
shape: list[Point],
|
|
15
15
|
demand: int,
|
|
16
|
-
allowed_orientations: list[float],
|
|
16
|
+
allowed_orientations: list[float] | None,
|
|
17
17
|
):
|
|
18
18
|
"""
|
|
19
19
|
An Item represents any closed 2D shape by its outer boundary.
|
|
20
20
|
|
|
21
21
|
Spyrrow doesn't support hole(s) inside the shape as of yet. Therefore no Item can be nested inside another.
|
|
22
22
|
|
|
23
|
-
Continous rotation is not supported as of yet. A workaround is to specify any integer degrees between 0 and 360
|
|
24
|
-
to the allowed_orientations list.
|
|
25
|
-
|
|
26
23
|
Args:
|
|
27
|
-
id: The Item identifier
|
|
28
|
-
|
|
24
|
+
id (str): The Item identifier
|
|
25
|
+
Needs to be unique accross all Items of a StripPackingInstance
|
|
29
26
|
shape: An ordered list of (x,y) defining the shape boundary. The shape is represented as a polygon formed by this list of points.
|
|
30
27
|
The origin point can be included twice as the finishing point. If not, [last point, first point] is infered to be the last straight line of the shape.
|
|
31
28
|
demand: The quantity of identical Items to be placed inside the strip. Should be positive.
|
|
32
|
-
allowed_orientations: List of angles in degrees allowed.
|
|
29
|
+
allowed_orientations (list[float]|None): List of angles in degrees allowed.
|
|
30
|
+
An empty list is equivalent to [0.].
|
|
31
|
+
A None value means that the item is free to rotate
|
|
33
32
|
The algorithmn is only very weakly sensible to the length of the list given.
|
|
34
33
|
|
|
35
34
|
"""
|
|
36
|
-
|
|
37
|
-
def to_json_str(self)->str:
|
|
38
|
-
"""
|
|
35
|
+
|
|
36
|
+
def to_json_str(self) -> str:
|
|
37
|
+
"""Return a string of the JSON representation of the object"""
|
|
39
38
|
|
|
40
39
|
class PlacedItem:
|
|
41
40
|
"""
|
|
42
41
|
An object representing where a copy of an Item was placed inside the strip.
|
|
43
42
|
|
|
44
43
|
Attributes:
|
|
45
|
-
id (
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
id (str): The Item identifier referencing the items of the StripPackingInstance
|
|
45
|
+
rotation (float): The rotation angle in degrees, assuming that the original Item was defined with 0° as its rotation angle.
|
|
46
|
+
Use the origin (0.0,0.0) as the rotation point.
|
|
47
|
+
translation (tuple[float,float]): the translation vector in the X-Y axis. To apply after the rotation
|
|
48
48
|
"""
|
|
49
49
|
|
|
50
|
-
id:
|
|
51
|
-
shape: list[Point]
|
|
50
|
+
id: str
|
|
52
51
|
translation: Point
|
|
53
52
|
rotation: float
|
|
54
53
|
|
|
@@ -82,14 +81,11 @@ class StripPackingInstance:
|
|
|
82
81
|
An empty string '' can be used, if the user doesn't have a use for this name.
|
|
83
82
|
strip_height (float): the fixed height of the strip. The unit should be compatible with the Item
|
|
84
83
|
items (list[Item]): The Items which defines the instances. All Items should be defined with the same scale ( same length unit).
|
|
85
|
-
Items ids should be an increasing series starting at 0 until len(items)-1.
|
|
86
|
-
|
|
87
84
|
Raises:
|
|
88
85
|
ValueError
|
|
89
86
|
"""
|
|
90
|
-
def to_json_str(self)->str:
|
|
91
|
-
"""
|
|
92
|
-
|
|
87
|
+
def to_json_str(self) -> str:
|
|
88
|
+
"""Return a string of the JSON representation of the object"""
|
|
93
89
|
|
|
94
90
|
def solve(self, computation_time: int = 600) -> StripPackingSolution:
|
|
95
91
|
"""
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spyrrow
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.0
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -35,10 +35,10 @@ pip install spyrrow
|
|
|
35
35
|
import spyrrow
|
|
36
36
|
|
|
37
37
|
rectangle1 = spyrrow.Item(
|
|
38
|
-
|
|
38
|
+
"rectangle", [(0, 0), (1, 0), (1, 1), (0, 1), (0, 0)], demand=4, allowed_orientations=[0]
|
|
39
39
|
)
|
|
40
40
|
triangle1 = spyrrow.Item(
|
|
41
|
-
|
|
41
|
+
"triangle",
|
|
42
42
|
[(0, 0), (1, 0), (1, 1), (0, 0)],
|
|
43
43
|
demand=6,
|
|
44
44
|
allowed_orientations=[0, 90, 180, -90],
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
spyrrow-0.6.0.dist-info/METADATA,sha256=hTkD2cL-edcgg30N50h0bCmFoB1y_gsrgevJWp76_iY,2156
|
|
2
|
+
spyrrow-0.6.0.dist-info/WHEEL,sha256=1PvTxnZQ01vZExvGdfkvDLWGNQJcHQ9DLKricByR1z8,106
|
|
3
|
+
spyrrow-0.6.0.dist-info/licenses/LICENSE.txt,sha256=JOcOnGFqH2ZNyuMV3DBGh5kNL_3IqaS5832hwXhZ-Js,1076
|
|
4
|
+
spyrrow/__init__.py,sha256=MajlSBAliv8o8SqAqLgJARyi3egmvNIaXKTDXxvIAFY,111
|
|
5
|
+
spyrrow/__init__.pyi,sha256=NqgZwO1Kh-acAVTdl6Z2YVhKLcCIF6GRHy2V_oZgJNc,3885
|
|
6
|
+
spyrrow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
spyrrow/spyrrow.cpython-313-darwin.so,sha256=c01qLmqRi-zrKJ5ETFIOsqecEdMyIhqTwLPNeK2p2QY,1671860
|
|
8
|
+
spyrrow-0.6.0.dist-info/RECORD,,
|
spyrrow-0.4.0.dist-info/RECORD
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
spyrrow-0.4.0.dist-info/METADATA,sha256=xISpeyAxcBngcjpXGDIIwv7I3AfHo56GUUpwojWvk5A,2136
|
|
2
|
-
spyrrow-0.4.0.dist-info/WHEEL,sha256=zAURN41HE7eECKRZmuiOtDfTjqy9EVWhOpFIBiTRrcw,106
|
|
3
|
-
spyrrow-0.4.0.dist-info/licenses/LICENSE.txt,sha256=JOcOnGFqH2ZNyuMV3DBGh5kNL_3IqaS5832hwXhZ-Js,1076
|
|
4
|
-
spyrrow/__init__.py,sha256=MajlSBAliv8o8SqAqLgJARyi3egmvNIaXKTDXxvIAFY,111
|
|
5
|
-
spyrrow/__init__.pyi,sha256=MZXI5_RK5wSwDwPSZIV-m75mgi_ZW35MQuPQVpAiFHc,4010
|
|
6
|
-
spyrrow/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
-
spyrrow/spyrrow.cpython-313-darwin.so,sha256=hf7Q_X8PeCPMJoVxhzdowJpCzBHF1k3bSloLUDqqpz0,1423708
|
|
8
|
-
spyrrow-0.4.0.dist-info/RECORD,,
|
|
File without changes
|