Skip to content

Commit cbee380

Browse files
committed
Fix shape inflate
1 parent c2bdf04 commit cbee380

File tree

4 files changed

+317
-1
lines changed

4 files changed

+317
-1
lines changed
Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,190 @@
1+
{
2+
"bin_types": [
3+
{
4+
"copies": 1,
5+
"copies_min": 0,
6+
"cost": 579.6,
7+
"elements": [
8+
{
9+
"end": {
10+
"x": 110.23622047244095,
11+
"y": 0.0
12+
},
13+
"start": {
14+
"x": 0.0,
15+
"y": 0.0
16+
},
17+
"type": "LineSegment"
18+
},
19+
{
20+
"end": {
21+
"x": 110.23622047244095,
22+
"y": 81.49606299212599
23+
},
24+
"start": {
25+
"x": 110.23622047244095,
26+
"y": 0.0
27+
},
28+
"type": "LineSegment"
29+
},
30+
{
31+
"end": {
32+
"x": 0.0,
33+
"y": 81.49606299212599
34+
},
35+
"start": {
36+
"x": 110.23622047244095,
37+
"y": 81.49606299212599
38+
},
39+
"type": "LineSegment"
40+
},
41+
{
42+
"end": {
43+
"x": 0.0,
44+
"y": 0.0
45+
},
46+
"start": {
47+
"x": 0.0,
48+
"y": 81.49606299212599
49+
},
50+
"type": "LineSegment"
51+
}
52+
],
53+
"type": "general"
54+
}
55+
],
56+
"item_types": [
57+
{
58+
"allowed_rotations": [
59+
{
60+
"end": 0.0,
61+
"start": 0.0
62+
}
63+
],
64+
"copies": 1,
65+
"profit": 294.50058871535737,
66+
"shapes": [
67+
{
68+
"elements": [
69+
{
70+
"end": {
71+
"x": 19.685039370000002,
72+
"y": 15.7480315
73+
},
74+
"start": {
75+
"x": 23.62204724,
76+
"y": 15.7480315
77+
},
78+
"type": "LineSegment"
79+
},
80+
{
81+
"end": {
82+
"x": 19.685039370000002,
83+
"y": 3.93700787
84+
},
85+
"start": {
86+
"x": 19.685039370000002,
87+
"y": 15.7480315
88+
},
89+
"type": "LineSegment"
90+
},
91+
{
92+
"end": {
93+
"x": 3.93700787,
94+
"y": 3.93700787
95+
},
96+
"start": {
97+
"x": 19.685039370000002,
98+
"y": 3.93700787
99+
},
100+
"type": "LineSegment"
101+
},
102+
{
103+
"end": {
104+
"x": 3.93700787,
105+
"y": 19.685039370000002
106+
},
107+
"start": {
108+
"x": 3.93700787,
109+
"y": 3.93700787
110+
},
111+
"type": "LineSegment"
112+
},
113+
{
114+
"end": {
115+
"x": 23.62204724,
116+
"y": 19.685039370000002
117+
},
118+
"start": {
119+
"x": 3.93700787,
120+
"y": 19.685039370000002
121+
},
122+
"type": "LineSegment"
123+
},
124+
{
125+
"end": {
126+
"x": 23.62204724,
127+
"y": 23.62204724
128+
},
129+
"start": {
130+
"x": 23.62204724,
131+
"y": 19.685039370000002
132+
},
133+
"type": "LineSegment"
134+
},
135+
{
136+
"end": {
137+
"x": 0.0,
138+
"y": 23.62204724
139+
},
140+
"start": {
141+
"x": 23.62204724,
142+
"y": 23.62204724
143+
},
144+
"type": "LineSegment"
145+
},
146+
{
147+
"end": {
148+
"x": 0.0,
149+
"y": 0.0
150+
},
151+
"start": {
152+
"x": 0.0,
153+
"y": 23.62204724
154+
},
155+
"type": "LineSegment"
156+
},
157+
{
158+
"end": {
159+
"x": 23.62204724,
160+
"y": 0.0
161+
},
162+
"start": {
163+
"x": 0.0,
164+
"y": 0.0
165+
},
166+
"type": "LineSegment"
167+
},
168+
{
169+
"end": {
170+
"x": 23.62204724,
171+
"y": 15.7480315
172+
},
173+
"start": {
174+
"x": 23.62204724,
175+
"y": 0.0
176+
},
177+
"type": "LineSegment"
178+
}
179+
],
180+
"type": "general"
181+
}
182+
]
183+
}
184+
],
185+
"objective": "BinPackingWithLeftovers",
186+
"parameters": {
187+
"item_bin_minimum_spacing": 0.0,
188+
"item_item_minimum_spacing": 1.968503937007874
189+
}
190+
}
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
{
2+
"bins": [
3+
{
4+
"copies": 1,
5+
"id": 0,
6+
"items": [
7+
{
8+
"angle": 0.0,
9+
"id": 0,
10+
"item_shapes": [
11+
{
12+
"shape": [
13+
{
14+
"type": "LineSegment",
15+
"xe": 19.685039370000002,
16+
"xs": 23.62204724,
17+
"ye": 15.7480315,
18+
"ys": 15.7480315
19+
},
20+
{
21+
"type": "LineSegment",
22+
"xe": 19.685039370000002,
23+
"xs": 19.685039370000002,
24+
"ye": 3.93700787,
25+
"ys": 15.7480315
26+
},
27+
{
28+
"type": "LineSegment",
29+
"xe": 3.93700787,
30+
"xs": 19.685039370000002,
31+
"ye": 3.93700787,
32+
"ys": 3.93700787
33+
},
34+
{
35+
"type": "LineSegment",
36+
"xe": 3.93700787,
37+
"xs": 3.93700787,
38+
"ye": 19.685039370000002,
39+
"ys": 3.93700787
40+
},
41+
{
42+
"type": "LineSegment",
43+
"xe": 23.62204724,
44+
"xs": 3.93700787,
45+
"ye": 19.685039370000002,
46+
"ys": 19.685039370000002
47+
},
48+
{
49+
"type": "LineSegment",
50+
"xe": 23.62204724,
51+
"xs": 23.62204724,
52+
"ye": 23.62204724,
53+
"ys": 19.685039370000002
54+
},
55+
{
56+
"type": "LineSegment",
57+
"xe": 0.0,
58+
"xs": 23.62204724,
59+
"ye": 23.62204724,
60+
"ys": 23.62204724
61+
},
62+
{
63+
"type": "LineSegment",
64+
"xe": 0.0,
65+
"xs": 0.0,
66+
"ye": 0.0,
67+
"ys": 23.62204724
68+
},
69+
{
70+
"type": "LineSegment",
71+
"xe": 23.62204724,
72+
"xs": 0.0,
73+
"ye": 0.0,
74+
"ys": 0.0
75+
},
76+
{
77+
"type": "LineSegment",
78+
"xe": 23.62204724,
79+
"xs": 23.62204724,
80+
"ye": 15.7480315,
81+
"ys": 0.0
82+
}
83+
]
84+
}
85+
],
86+
"mirror": false,
87+
"x": 0.0,
88+
"y": 0.0
89+
}
90+
],
91+
"shape": [
92+
{
93+
"type": "LineSegment",
94+
"xe": 110.23622047244095,
95+
"xs": 0.0,
96+
"ye": 0.0,
97+
"ys": 0.0
98+
},
99+
{
100+
"type": "LineSegment",
101+
"xe": 110.23622047244095,
102+
"xs": 110.23622047244095,
103+
"ye": 81.49606299212599,
104+
"ys": 0.0
105+
},
106+
{
107+
"type": "LineSegment",
108+
"xe": 0.0,
109+
"xs": 110.23622047244095,
110+
"ye": 81.49606299212599,
111+
"ys": 81.49606299212599
112+
},
113+
{
114+
"type": "LineSegment",
115+
"xe": 0.0,
116+
"xs": 0.0,
117+
"ye": 0.0,
118+
"ys": 81.49606299212599
119+
}
120+
]
121+
}
122+
]
123+
}

extern/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ FetchContent_MakeAvailable(optimizationtools)
1414
FetchContent_Declare(
1515
shape
1616
GIT_REPOSITORY https://github.com/fontanf/shape.git
17-
GIT_TAG 155ed98ccda6dcb81f0a30ea958b5d618a5099d2
17+
GIT_TAG c89eaae026b9e7f06b7aa73526241da27370caad
1818
#SOURCE_DIR "${PROJECT_SOURCE_DIR}/../shape/"
1919
EXCLUDE_FROM_ALL)
2020
FetchContent_MakeAvailable(shape)

test/irregular/irregular_test.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,4 +184,7 @@ INSTANTIATE_TEST_SUITE_P(
184184
}, {
185185
fs::path("data") / "irregular" / "users" / "2025-05-09.json",
186186
fs::path("data") / "irregular" / "users" / "2025-05-09_solution.json"
187+
}, {
188+
fs::path("data") / "irregular" / "users" / "2025-05-12.json",
189+
fs::path("data") / "irregular" / "users" / "2025-05-12_solution.json"
187190
}}));

0 commit comments

Comments
 (0)