static public bool TryCreateTriangle(this Face item, Face face, out Triangle2 triangle, out Face missing) { if (item.TryCreateTriangle(face, out triangle)) { missing = FaceExtensions.CreatePoints(face.v1, item.v0); return(true); } missing = default(Face); return(false); }
private void Validate() { if (is_dirty) { is_dirty = false; center = vertexs.Average(); faces.Set( vertexs .Sort(v => - (v - center).GetAngleInDegrees()) .CloseLoop() .ConvertConnections((v0, v1) => FaceExtensions.CreatePointsAndInsidePoint(v0, v1, center)) ); } }
static public Face GetFace(this LineSegment2 item) { return(FaceExtensions.CreatePoints(item.v0, item.v1)); }
static public IEnumerable <Face> BuildFaceLoop(this IEnumerable <Vector2> item) { return(item.CloseLoop().ConvertConnections((v0, v1) => FaceExtensions.CreatePoints(v0, v1))); }