예제 #1
0
        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);
        }
예제 #2
0
        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))
                    );
            }
        }
예제 #3
0
 static public Face GetFace(this LineSegment2 item)
 {
     return(FaceExtensions.CreatePoints(item.v0, item.v1));
 }
예제 #4
0
 static public IEnumerable <Face> BuildFaceLoop(this IEnumerable <Vector2> item)
 {
     return(item.CloseLoop().ConvertConnections((v0, v1) => FaceExtensions.CreatePoints(v0, v1)));
 }