Beispiel #1
0
 def OnFileChanges_STLFilm( self, event ):
   logging.warning("OnFileChanges_STLFilm")
   _dir=self.f.m_filePicker_Film.GetTextCtrl().GetValue()
   if os.path.split(_dir)[1][-3:].lower()=="stl":
     a=pystl.cSTL(_dir)
     self.f.oSTLFilm.pointsSTL=a.read(scale=1)
   else:
     self.f.oNoteBook.MessageLog("\nExtension du Fichier Film Sélectionné non conforme {}".format(_dir),"ERROR")
     self.f.m_filePicker_Moule.GetTextCtrl().SetValue("*.STL")
     return
   self.f.oSTLFilm.flag_new_STL=True
   self.f.oSTLFilm.Refresh(True)
   self.f.oProjetIMD.projet["root"]["fichier STL film"]=_dir
   #On donne les points du film à l'objet OpenGL qui visualise le moule
   _z=self.f.m_int_distance_moule_film.GetValue() #Distance Moule Film à intégrer
   self.f.oSTLMoule.other_points=list(numpy.array(self.f.oSTLFilm.pointsSTL)+(0,0,_z))
   self.f.oSTLMoule.flag_other_points=True
   self.f.oSTLMoule.Refresh(True)
Beispiel #2
0
 def OnFileChanges_STLMoule( self, event ):
   logging.warning("OnFileChanges_STLMoule")
   _dir=self.f.m_filePicker_Moule.GetTextCtrl().GetValue()
   if os.path.split(_dir)[1][-3:].lower()=="stl":
     a=pystl.cSTL(_dir)
     self.f.oSTLMoule.pointsSTL=a.read(scale=1)
   elif  os.path.split(_dir)[1][-3:].lower()=="obj":
     self.f.oSTLMoule.pointsSTL,_=vtk2obj.get_from_obj(_dir)
   else:
     self.f.oNoteBook.MessageLog("\nExtension du Fichier Moule Sélectionné non conforme {}".format(_dir),"ERROR")
     self.f.m_filePicker_Moule.GetTextCtrl().SetValue("*.STL")
     return
   c1,c2,c3,c4=Common.FindCorners(self.f.oSTLMoule.pointsSTL)
   self.f.m_int_largeur_cadre.SetValue(int(0.75*(c3[0]-c1[0]))) # Proposer un Film de 75% taille du Moule
   self.f.m_int_hauteur_cadre.SetValue(int(0.75*(c4[1]-c2[1])))
   self.f.m_int_pas_film.SetValue(4)
   self.f.oSTLMoule.flag_new_STL=True
   self.f.oSTLMoule.Refresh(True)
   self.f.oProjetIMD.projet["root"]["fichier STL moule"]=_dir