+ if(i == j || !valid_planes[j]) {
+ continue;
+ }
+
+ /* clip plane polygon i with plane j */
+ poly_plane(polys + j, &plane);
+ init_poly(&clipped);
+ if((clipres = clip_poly(&clipped, polys + i, &plane)) < 0) {
+ /* completely clipped, mark it for removal */
+ valid_planes[i] = 0;
+ cell->num_polys--;
+ break;
+ }
+ }
+ }