(self, filename)
return mesh_points
Method to parse the file `filename`. It returns a matrix with all
        the coordinates.

        :param string filename: name of the input file.

        :return: mesh_points: it is a `n_points`-by-3 matrix containing
            the coordinates of the points of the mesh
        :rtype: numpy.ndarray
Method to parse the file `filename`. It returns a matrix with all
        the coordinates.
Method to parse the file filename . It returns a matrix with all the coordinates .
def parse(self, filename):
        """
        Method to parse the file `filename`. It returns a matrix with all
        the coordinates.

        :param string filename: name of the input file.

        :return: mesh_points: it is a `n_points`-by-3 matrix containing
            the coordinates of the points of the mesh
        :rtype: numpy.ndarray

        """
        self.infile = filename
        self.shape = self.load_shape_from_file(filename)

        # cycle on the faces to get the control points
        # init some quantities
        n_faces = 0
        control_point_position = [0]
        faces_explorer = TopExp_Explorer(self.shape, TopAbs_FACE)
        mesh_points = np.zeros(shape=(0, 3))

        while faces_explorer.More():
            # performing some conversions to get the right format (BSplineSurface)
            face = topods_Face(faces_explorer.Current())
            nurbs_converter = BRepBuilderAPI_NurbsConvert(face)
            nurbs_converter.Perform(face)
            nurbs_face = nurbs_converter.Shape()
            brep_face = BRep_Tool.Surface(topods_Face(nurbs_face))
            bspline_face = geomconvert_SurfaceToBSplineSurface(brep_face)

            # openCascade object
            occ_face = bspline_face

            # extract the Control Points of each face
            n_poles_u = occ_face.NbUPoles()
            n_poles_v = occ_face.NbVPoles()
            control_polygon_coordinates = np.zeros(
                shape=(n_poles_u * n_poles_v, 3))

            # cycle over the poles to get their coordinates
            i = 0
            for pole_u_direction in range(n_poles_u):
                for pole_v_direction in range(n_poles_v):
                    control_point_coordinates = occ_face.Pole(
                        pole_u_direction + 1, pole_v_direction + 1)
                    control_polygon_coordinates[i, :] = [
                        control_point_coordinates.X(),
                        control_point_coordinates.Y(),
                        control_point_coordinates.Z()
                    ]
                    i += 1
            # pushing the control points coordinates to the mesh_points array
            # (used for FFD)
            mesh_points = np.append(
                mesh_points, control_polygon_coordinates, axis=0)
            control_point_position.append(
                control_point_position[-1] + n_poles_u * n_poles_v)

            n_faces += 1
            faces_explorer.Next()
        self._control_point_position = control_point_position
        return mesh_points
def parse ( self , filename ) : self . infile = filename self . shape = self . load_shape_from_file ( filename ) # cycle on the faces to get the control points # init some quantities n_faces = 0 control_point_position = [ 0 ] faces_explorer = TopExp_Explorer ( self . shape , TopAbs_FACE ) mesh_points = np . zeros ( shape = ( 0 , 3 ) ) while faces_explorer . More ( ) : # performing some conversions to get the right format (BSplineSurface) face = topods_Face ( faces_explorer . Current ( ) ) nurbs_converter = BRepBuilderAPI_NurbsConvert ( face ) nurbs_converter . Perform ( face ) nurbs_face = nurbs_converter . Shape ( ) brep_face = BRep_Tool . Surface ( topods_Face ( nurbs_face ) ) bspline_face = geomconvert_SurfaceToBSplineSurface ( brep_face ) # openCascade object occ_face = bspline_face # extract the Control Points of each face n_poles_u = occ_face . NbUPoles ( ) n_poles_v = occ_face . NbVPoles ( ) control_polygon_coordinates = np . zeros ( shape = ( n_poles_u * n_poles_v , 3 ) ) # cycle over the poles to get their coordinates i = 0 for pole_u_direction in range ( n_poles_u ) : for pole_v_direction in range ( n_poles_v ) : control_point_coordinates = occ_face . Pole ( pole_u_direction + 1 , pole_v_direction + 1 ) control_polygon_coordinates [ i , : ] = [ control_point_coordinates . X ( ) , control_point_coordinates . Y ( ) , control_point_coordinates . Z ( ) ] i += 1 # pushing the control points coordinates to the mesh_points array # (used for FFD) mesh_points = np . append ( mesh_points , control_polygon_coordinates , axis = 0 ) control_point_position . append ( control_point_position [ - 1 ] + n_poles_u * n_poles_v ) n_faces += 1 faces_explorer . Next ( ) self . _control_point_position = control_point_position return mesh_points