Beispiel #1
0
        public static bool DoSurfaceFile(List <string> stlFileNames, IMonitor mon)
        {
            GlobalGeometryObject.SurfaceFileName = "";
            StlTool stlTool = new StlTool(mon);
            string  tmp     = Path.GetTempFileName() + ".stl";

            if (!stlTool.Merge(tmp, stlFileNames))
            {
                return(false);
            }
            List <string> solids = stlTool.GetSolidNameList(stlFileNames);

            if (solids == null)
            {
                return(false);
            }
            if (solids.Count == 0)
            {
                return(false);
            }
            GlobalGeometryObject.SurfacePartList.Clear();
            GlobalGeometryObject.SurfacePartList.AddRange(solids);
            GlobalGeometryObject.SurfaceFileName = tmp;
            GlobalGeometryObject.Volume          = CalculateVolumeFromStl(tmp);
            return(true);
        }
Beispiel #2
0
        public static bool DoSurfaceFile(string stlFileName, IMonitor mon)
        {
            GlobalGeometryObject.SurfaceFileName = stlFileName;
            StlTool       stlTool = new StlTool(mon);
            List <string> solids  = stlTool.GetSolidNameList(stlFileName);

            if (solids == null)
            {
                return(false);
            }
            if (solids.Count == 0)
            {
                return(false);
            }
            GlobalGeometryObject.SurfacePartList.Clear();
            GlobalGeometryObject.SurfacePartList.AddRange(solids);
            GlobalGeometryObject.Volume = CalculateVolumeFromStl(stlFileName);
            return(true);
        }