Ejemplo n.º 1
0
 public void AddFaceSet(IndexedFaceSet faceSet)
 {
     if (settings.Direction.SupportAnyDirection)
     {
         vectorDirOperator.AddIndexedFaceSet(faceSet);
     }
 }
Ejemplo n.º 2
0
        public void ImportAndReset(IEnumerable <IndexedFaceSet> faceSets)
        {
            var faceSetsArray = faceSets.ToArray();

            if (settings.Direction.SupportAnyDirection)
            {
                foreach (var indexedFaceSet in faceSetsArray)
                {
                    vectorDirOperator.AddIndexedFaceSet(indexedFaceSet);
                }
            }

            spatialRepository.TriangleMeshes = faceSetsArray.Select(f => f.CreateMesh()).ToList();

            currentTriangleCount = 0;
            foreach (var triangleMesh in spatialRepository.TriangleMeshes)
            {
                var rtree = new RStarTree <Triangle>();
                rtree.Add(triangleMesh.Triangles);

                currentTriangleCount += triangleMesh.Triangles.Count;

                triangleMesh.RTreeRoot = rtree;
            }
        }
Ejemplo n.º 3
0
        public long[] LoadIfc(string path)
        {
            var ifcImporter = new IfcImporter.MainInterface();

            stopwatch.Start();
            var engineFaceSets = ifcImporter.OpenIfcFile(path);

            stopwatch.Stop();
            var ifcEngineTiming = stopwatch.ElapsedMilliseconds;

            stopwatch.Reset();


            Console.WriteLine("Total Memory: {0}", GC.GetTotalMemory(true) / (1024d * 1024));
            stopwatch.Start();

            var faceSets = engineFaceSets.Select(f => new IndexedFaceSet(f.Item1, f.Item2, f.Item3)).ToArray();

            Console.WriteLine("Total Memory after Faceseting: {0}", GC.GetTotalMemory(true) / (1024d * 1024));

            var meshes = faceSets.Select(f =>
            {
                var m = f.CreateMesh(null, false);
                if (settings.Direction.SupportAnyDirection)
                {
                    vectorDirOperator.AddIndexedFaceSet(f);
                }
                return(m);
            }).ToList();

            Console.WriteLine("Total Memory after Meshing: {0}", GC.GetTotalMemory(true) / (1024d * 1024));

            foreach (var mesh in meshes.Where(m => m != null))
            {
                mesh.CreateRTree();
            }

            Console.WriteLine("Total Memory after RTreeing: {0}", GC.GetTotalMemory(true) / (1024d * 1024));


            stopwatch.Stop();
            var meshingTiming = stopwatch.ElapsedMilliseconds;

            AddImport(meshes);

            return(new [] { ifcEngineTiming, meshingTiming, meshes.Count });
        }