From ab0f376d4a8e165c7af9a28e2615cd12467e0e70 Mon Sep 17 00:00:00 2001 From: Garux Date: Fri, 21 Dec 2018 14:45:12 +0300 Subject: [PATCH] * lower Winding_Clip ON_EPSILON to play with weird brushes w/o error --- radiant/winding.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/radiant/winding.cpp b/radiant/winding.cpp index c17a1a35..e3776c81 100644 --- a/radiant/winding.cpp +++ b/radiant/winding.cpp @@ -188,22 +188,19 @@ void WindingVertex_ClassifyPlane( const Vector3& vertex, const Plane3& plane, br } -#define DEBUG_EPSILON ON_EPSILON -const double DEBUG_EPSILON_SQUARED = DEBUG_EPSILON * DEBUG_EPSILON; - -#define WINDING_DEBUG 0 +const double ON_EPSILON_CLIP = 1.0 / ( 1 << 12 ); /// \brief Clip \p winding which lies on \p plane by \p clipPlane, resulting in \p clipped. /// If \p winding is completely in front of the plane, \p clipped will be identical to \p winding. /// If \p winding is completely in back of the plane, \p clipped will be empty. /// If \p winding intersects the plane, the edge of \p clipped which lies on \p clipPlane will store the value of \p adjacent. void Winding_Clip( const FixedWinding& winding, const Plane3& plane, const Plane3& clipPlane, std::size_t adjacent, FixedWinding& clipped ){ - PlaneClassification classification = Winding_ClassifyDistance( plane3_distance_to_point( clipPlane, winding.back().vertex ), ON_EPSILON ); + PlaneClassification classification = Winding_ClassifyDistance( plane3_distance_to_point( clipPlane, winding.back().vertex ), ON_EPSILON_CLIP ); PlaneClassification nextClassification; // for each edge for ( std::size_t next = 0, i = winding.size() - 1; next != winding.size(); i = next, ++next, classification = nextClassification ) { - nextClassification = Winding_ClassifyDistance( plane3_distance_to_point( clipPlane, winding[next].vertex ), ON_EPSILON ); + nextClassification = Winding_ClassifyDistance( plane3_distance_to_point( clipPlane, winding[next].vertex ), ON_EPSILON_CLIP ); const FixedWindingVertex& vertex = winding[i]; // if first vertex of edge is ON