@@ -232,7 +232,8 @@ class SlicerLayer
232
232
{
233
233
polygonList.push_back (openPolygonList[bestA]);
234
234
openPolygonList[bestA].clear ();
235
- }else if (bestResult.AtoB )
235
+ }
236
+ else if (bestResult.AtoB )
236
237
{
237
238
unsigned int n = polygonList.size ();
238
239
polygonList.push_back (ClipperLib::Polygon ());
@@ -241,20 +242,25 @@ class SlicerLayer
241
242
for (unsigned int j = openPolygonList[bestA].size () - 1 ; int (j) >= 0 ; j--)
242
243
polygonList[n].push_back (openPolygonList[bestA][j]);
243
244
openPolygonList[bestA].clear ();
244
- }else {
245
+ }
246
+ else
247
+ {
245
248
unsigned int n = polygonList.size ();
246
249
polygonList.push_back (openPolygonList[bestA]);
247
250
for (unsigned int j = bestResult.pointIdxB ; j != bestResult.pointIdxA ; j = (j + 1 ) % polygonList[bestResult.polygonIdx ].size ())
248
251
polygonList[n].push_back (polygonList[bestResult.polygonIdx ][j]);
249
252
openPolygonList[bestA].clear ();
250
253
}
251
- }else {
254
+ }
255
+ else
256
+ {
252
257
if (bestResult.pointIdxA == bestResult.pointIdxB )
253
258
{
254
259
for (unsigned int n=0 ; n<openPolygonList[bestA].size (); n++)
255
260
openPolygonList[bestB].push_back (openPolygonList[bestA][n]);
256
261
openPolygonList[bestA].clear ();
257
- }else if (bestResult.AtoB )
262
+ }
263
+ else if (bestResult.AtoB )
258
264
{
259
265
ClipperLib::Polygon poly;
260
266
for (unsigned int n = bestResult.pointIdxA ; n != bestResult.pointIdxB ; n = (n + 1 ) % polygonList[bestResult.polygonIdx ].size ())
@@ -264,15 +270,19 @@ class SlicerLayer
264
270
for (unsigned int n=0 ; n<openPolygonList[bestA].size (); n++)
265
271
openPolygonList[bestB].push_back (openPolygonList[bestA][n]);
266
272
openPolygonList[bestA].clear ();
267
- }else {
273
+ }
274
+ else
275
+ {
268
276
for (unsigned int n = bestResult.pointIdxB ; n != bestResult.pointIdxA ; n = (n + 1 ) % polygonList[bestResult.polygonIdx ].size ())
269
277
openPolygonList[bestB].push_back (polygonList[bestResult.polygonIdx ][n]);
270
278
for (unsigned int n = openPolygonList[bestA].size () - 1 ; int (n) >= 0 ; n--)
271
279
openPolygonList[bestB].push_back (openPolygonList[bestA][n]);
272
280
openPolygonList[bestA].clear ();
273
281
}
274
282
}
275
- }else {
283
+ }
284
+ else
285
+ {
276
286
break ;
277
287
}
278
288
}
0 commit comments