(self, mesh_points, filename, write_bin=False)
Writes a stl file, called filename, copying all the lines from
        self.filename but the coordinates. mesh_points is a matrix that contains
        the new coordinates to write in the stl file.

        :param numpy.ndarray mesh_points: it is a `n_points`-by-3 matrix
            containing the coordinates of the points of the mesh.
        :param string filename: name of the output file.
        :param boolean write_bin: flag to write in the binary format. Default is
            False.
Writes a stl file, called filename, copying all the lines from
        self.filename but the coordinates. mesh_points is a matrix that contains
        the new coordinates to write in the stl file.
Writes a stl file called filename copying all the lines from self . filename but the coordinates . mesh_points is a matrix that contains the new coordinates to write in the stl file .
def write(self, mesh_points, filename, write_bin=False):
        """
        Writes a stl file, called filename, copying all the lines from
        self.filename but the coordinates. mesh_points is a matrix that contains
        the new coordinates to write in the stl file.

        :param numpy.ndarray mesh_points: it is a `n_points`-by-3 matrix
            containing the coordinates of the points of the mesh.
        :param string filename: name of the output file.
        :param boolean write_bin: flag to write in the binary format. Default is
            False.
        """
        self._check_filename_type(filename)
        self._check_extension(filename)
        self._check_infile_instantiation()

        self.outfile = filename

        reader = vtk.vtkSTLReader()
        reader.SetFileName(self.infile)
        reader.Update()
        data = reader.GetOutput()

        points = vtk.vtkPoints()

        for i in range(data.GetNumberOfPoints()):
            points.InsertNextPoint(mesh_points[i, :])

        data.SetPoints(points)

        writer = vtk.vtkSTLWriter()
        writer.SetFileName(self.outfile)

        writer.SetInputData(data)

        if write_bin:
            writer.SetFileTypeToBinary()
        else:
            writer.SetFileTypeToASCII()

        writer.Write()
def write ( self , mesh_points , filename , write_bin = False ) : self . _check_filename_type ( filename ) self . _check_extension ( filename ) self . _check_infile_instantiation ( ) self . outfile = filename reader = vtk . vtkSTLReader ( ) reader . SetFileName ( self . infile ) reader . Update ( ) data = reader . GetOutput ( ) points = vtk . vtkPoints ( ) for i in range ( data . GetNumberOfPoints ( ) ) : points . InsertNextPoint ( mesh_points [ i , : ] ) data . SetPoints ( points ) writer = vtk . vtkSTLWriter ( ) writer . SetFileName ( self . outfile ) writer . SetInputData ( data ) if write_bin : writer . SetFileTypeToBinary ( ) else : writer . SetFileTypeToASCII ( ) writer . Write ( )