public static List <Polygon> OutlinePolygonsByShell(Shell shell, GridBasis basis)
        {
            double  bottom     = shell.BBox.Min.Z;
            double  top        = shell.BBox.Max.Z;
            Range1i levelRange = new Range1i(basis.Level(bottom), basis.Level(top));

            List <Polygon> polygons = new List <Polygon>();

            for (int level = levelRange.Low; level <= levelRange.High; ++level)
            {
                double    height  = basis.FloorHeight(level);
                Outline2d outline = shell.GetFloorOutline(height);
                if (outline == null)
                {
                    continue;
                }
                if (outline.Polygons == null)
                {
                    continue;
                }

                foreach (Polygon2d polygon in outline.Polygons)
                {
                    polygons.Add(PolygonByPolygon2d(polygon, height));
                }
            }

            return(polygons);
        }
 internal Grid2d(Outline2d outline, GridBasis basis)
 {
     m_outline = outline;
     m_basis   = basis;
     m_extents = m_basis.Extend(m_outline.BBox);
     m_axes    = null;
 }
        public static List <Polygon> PolygonsByOutline2d(Outline2d outline, double height)
        {
            if (outline == null || outline.Polygons == null)
            {
                return(null);
            }
            List <Polygon> polygons = new List <Polygon>();

            foreach (Polygon2d polygon in outline.Polygons)
            {
                polygons.Add(PolygonByPolygon2d(polygon, height));
            }
            return(polygons);
        }
Beispiel #4
0
        internal void OutputOutline(ref string text, double height, Outline2d outline)
        {
            if (outline == null || outline.Polygons == null)
            {
                return;
            }

            string tag = "outline";

            OutputHeader(ref text, tag, "height " + EncodeDouble(height));
            IndentIn();

            foreach (Polygon2d polygon in outline.Polygons)
            {
                OutputPolygon(ref text, polygon);
            }

            IndentOut();
            OutputFooter(ref text, tag);
        }
 public static Grid2d ByOutline(Outline2d outline, GridBasis basis)
 {
     return(new Grid2d(outline, basis));
 }