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()));
 }