if( (subCeil - subFloor) > subdivisions )
{
/* clip the winding */
- ClipWindingEpsilon( w, planeNormal, d, epsilon, &frontWinding, &backWinding );
+ ClipWindingEpsilon( w, planeNormal, d, epsilon, &frontWinding, &backWinding ); /* not strict; we assume we always keep a winding */
/* the clip may not produce two polygons if it was epsilon close */
if( frontWinding == NULL )
}
plane = &mapplanes[ node->planenum ];
- ClipWindingEpsilon ( w, plane->normal, plane->dist,
- ON_EPSILON, &front, &back );
+ ClipWindingEpsilonStrict ( w, plane->normal, plane->dist,
+ ON_EPSILON, &front, &back ); /* strict, we handle the "winding disappeared" case */
+ if(!front && !back)
+ {
+ /* in doubt, register it in both nodes */
+ front = CopyWinding(w);
+ back = CopyWinding(w);
+ }
FreeWinding( w );
ClipSideIntoTree_r( front, side, node->children[0] );
}
/* clip the winding by this plane */
- ClipWindingEpsilonStrict( w, plane1, plane1[ 3 ], ON_EPSILON, &front, &back );
+ ClipWindingEpsilonStrict( w, plane1, plane1[ 3 ], ON_EPSILON, &front, &back ); /* strict; we handle the "winding disappeared" case */
/* filter by this plane */
refs = 0;