/*Funktion, die eine Boundingbox eines Infill-Musters
         * (derselben Größe(!)) mit dem Voxelmodell merged.
         * Bounding-Box : true = Voxel gesetzt im Infill */
        public void InsertInfill(int infillDensity = 20, string infillType = "3DInfill", int offset = 0)
        {
            Infill m_Boundingbox = new Infill(infillDensity, infillType, offset);

            ushort[] koords = new ushort[3];
            //Schleifen die über alle Voxel des Modells gehen
            Parallel.For(0, m_Schichten.Count(), j =>
            {
                Console.WriteLine("Prozessing infill for layer:" + j);
                for (int i = 0; i < m_Schichten[j].Count(); i++)
                {
                    //Voxel die Teil des Randes sind kommen nicht in Frage
                    if (m_Schichten[j][i].getModellrand() != true)
                    {
                        lock (m_Schichten)//Why, just why?
                        {
                            koords = m_Schichten[j][i].getKoords();
                            //Falls kein Infill an Stelle des Voxels, lösche diesen
                            //aus unserem Voxelmodell
                            if (0 == m_Boundingbox.IsInfill(koords[0], koords[1], koords[2]))
                            {
                                m_Voxelmatrix[koords[0], koords[1], koords[2]] = null;
                                this.m_Schichten[j].Remove(this.m_Schichten[j][i]);
                                i--;
                            }
                        }
                    }
                }
            });
        }
예제 #2
0
 /*Funktion, die eine Boundingbox eines Infill-Musters
  * (derselben Größe(!)) mit dem Voxelmodell merged.
  * Bounding-Box : true = Voxel gesetzt im Infill */
 public void InsertInfill()
 {
     ushort[] koords = new ushort[3];
     //Schleifen die über alle Voxel des Modells gehen
     foreach (List <Voxel> schicht in m_Schichten)
     {
         for (int i = 0; i < schicht.Count(); i++)
         {
             //Voxel die Teil des Randes sind kommen nicht in Frage
             if (schicht[i].getModellrand() != true) //#Question: Modellrand anstatt Schichtrand?
             {
                 koords = schicht[i].getKoords();
                 //Falls kein Infill an Stelle des Voxels, lösche diesen
                 //aus unserem Voxelmodell
                 if (0 == m_Boundingbox.IsInfill(koords[0], koords[1], koords[2]))
                 {
                     m_Voxelmatrix[koords[0], koords[1], koords[2]] = null;
                     schicht.Remove(schicht[i]);
                     i--;
                 }
             }
         }
     }
 }