public VertexList(VertexPointTool tool, VertexSolid solid) { Tool = tool; Solid = solid; Points = new ThreadSafeList <VertexPoint>(); Update(); }
public IEnumerable <VertexError> GetErrors(VertexSolid solid) { foreach (var group in GetCoplanarFaces(solid.Copy).GroupBy(x => x.Plane)) { yield return(new VertexError(Key, solid).Add(group)); } }
public VertexError(string key, VertexSolid solid) { Key = key; Solid = solid; Faces = new List <MutableFace>(); Points = new List <MutableVertex>(); }
private MutableFace GetSplitFace(out VertexSolid solid) { solid = null; var selected = GetVisiblePoints().Where(x => x.IsSelected).ToList(); // Must have two points selected if (selected.Count != 2) { return(null); } solid = selected[0].Solid; // Selection must share a face var commonFace = selected[0].GetAdjacentFaces().Intersect(selected[1].GetAdjacentFaces()).ToList(); if (commonFace.Count != 1) { return(null); } var face = commonFace[0]; var s = selected[0].Position; var e = selected[1].Position; var edges = face.GetEdges(); // The points cannot be adjacent return(edges.Any(x => (x.Start == s && x.End == e) || (x.Start == e && x.End == s)) ? null : face); }
public IEnumerable <VertexError> GetErrors(VertexSolid solid) { foreach (var face in GetBackwardsFaces(solid.Copy, 0.5f)) { yield return(new VertexError(Key, solid).Add(face)); } }
public IEnumerable <VertexError> GetErrors(VertexSolid solid) { foreach (var face in solid.Copy.Faces.Where(x => !IsConvex(x))) { yield return(new VertexError(Key, solid).Add(face)); } }
public VertexList(VertexScaleTool tool, VertexSolid solid) { Tool = tool; Solid = solid; Points = new List <VertexPoint>(); Update(); }
public VertexPoint(VertexScaleTool tool, VertexSolid solid) { Tool = tool; DraggingPosition = Position = Vector3.Zero; Solid = solid; Vertices = new List <MutableVertex>(); Faces = new List <MutableFace>(); }
public IEnumerable <VertexError> GetErrors(VertexSolid solid) { foreach (var face in solid.Copy.Faces) { var nonPlanar = face.Vertices.Where(x => face.Plane.OnPlane(x.Position, 0.5f) != 0).ToList(); if (nonPlanar.Any()) { yield return(new VertexError(Key, solid).Add(face).Add(nonPlanar)); } } }
public IEnumerable <VertexError> GetErrors(VertexSolid solid) { foreach (var face in solid.Copy.Faces) { var overlapping = face.Vertices.GroupBy(x => x.Position.Round(2)).Where(x => x.Count() > 1).ToList(); foreach (var ol in overlapping) { yield return(new VertexError(Key, solid).Add(face).Add(ol)); } } }
public SolidFace(VertexSolid solid, MutableFace face) { Solid = solid; Face = face; }