Ejemplo n.º 1
0
        static public void Seal(this MeshBuilder item, Plane plane, float edge_tolerance, float plane_tolerance)
        {
            FaceCloud  faces       = new FaceCloud(edge_tolerance);
            PlaneSpace plane_space = plane.GetPlaneSpace();

            foreach (LineSegment3 edge in item.GetTriangles().Convert(t => t.GetEdges()).Flatten().Unique())
            {
                if (plane.IsCoplanar(edge, plane_tolerance))
                {
                    faces.AddFace(plane_space.ProjectLineSegment(edge).GetFace());
                }
            }

            item.AddTriangles(
                plane_space.InflateTriangles(faces.Tesselate())
                .Convert(t => t.GetReversedWinding())
                );
        }
Ejemplo n.º 2
0
 static public Polygon BuildPolygon(this FaceCloud item)
 {
     return(new Polygon(item.Tesselate()));
 }
Ejemplo n.º 3
0
 static public IEnumerable <PolygonTriangle> Tesselate(this FaceCloud item)
 {
     return(item.GetVertexLoops().Convert(l => l.TesselateLoop()).Flatten());
 }
Ejemplo n.º 4
0
 static public void AddFaces(this FaceCloud item, params Face[] faces)
 {
     item.AddFaces((IEnumerable <Face>)faces);
 }
Ejemplo n.º 5
0
 static public void AddFaces(this FaceCloud item, IEnumerable <Face> faces)
 {
     faces.Process(f => item.AddFace(f));
 }