浏览代码

Avoid CSG freeze condition on degenerates

Juan Linietsky 7 年之前
父节点
当前提交
ec7ed5f360
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      modules/csg/csg.cpp

+ 3 - 0
modules/csg/csg.cpp

@@ -409,6 +409,9 @@ void CSGBrushOperation::BuildPoly::clip(const CSGBrush *p_brush, int p_face, Mes
 
 	//transform A points to 2D
 
+	if (segment[0].distance_to(segment[1]) < CMP_EPSILON)
+		return; //too small
+
 	_clip_segment(p_brush, p_face, segment, mesh_merge, p_for_B);
 }