Check if point's index exists before adding it to the list of points

that need to split faces when avoiding creating degenerate faces
while merging CSG faces.
This commit is contained in:
Marcel Admiraal 2020-06-21 14:47:14 +01:00
parent 277d2f1f50
commit f5b99b578e

View File

@ -904,8 +904,12 @@ void CSGBrushOperation::Build2DFaces::_merge_faces(const Vector<int> &p_segment_
vertices[p_segment_indices[closest_idx]].point
};
if (are_segements_parallel(edge1, edge2, vertex_snap2)) {
degenerate_points.push_back(outer_edge_idx[0]);
degenerate_points.push_back(outer_edge_idx[1]);
if (!degenerate_points.find(outer_edge_idx[0])) {
degenerate_points.push_back(outer_edge_idx[0]);
}
if (!degenerate_points.find(outer_edge_idx[1])) {
degenerate_points.push_back(outer_edge_idx[1]);
}
continue;
}