Ejemplo n.º 1
0
 def project_to_XYZ(self):
     assert self.face != None
     surface = BRepAdaptor_Surface(self.face)
     if self.face.Orientation() == TopAbs_REVERSED:
         u_tmp = self.u
         self.reverse_u()
         xyz = surface.Value(self.u, self.v)
         self.u = u_tmp
     else:
         xyz = surface.Value(self.u, self.v)
     self.x = xyz.X()
     self.y = xyz.Y()
     self.z = xyz.Z()
Ejemplo n.º 2
0
    def pln_on_face(self, face=TopoDS_Face()):
        face_adaptor = BRepAdaptor_Surface(face)
        face_trf = face_adaptor.Trsf()
        face_pln = face_adaptor.Plane()
        #face_dir = face_adaptor.Direction()

        face_umin = face_adaptor.FirstUParameter()
        face_vmin = face_adaptor.FirstVParameter()
        face_umax = face_adaptor.LastUParameter()
        face_vmax = face_adaptor.LastVParameter()
        face_u = (face_umax + face_umin) / 2
        face_v = (face_vmax + face_vmin) / 2
        face_pnt = face_adaptor.Value(face_u, face_v)

        return face_pln