@@ -31,23 +31,25 @@ def write_bounding_box(parameters, outfile, write_deformed=True):
3131 aux_z = np .linspace (0 , parameters .lenght_box_z , parameters .n_control_points [2 ])
3232 lattice_z_coords , lattice_y_coords , lattice_x_coords = np .meshgrid (aux_z , aux_y , aux_x )
3333
34- if write_deformed == False :
35- box_points = np .array ([lattice_x_coords .ravel (), lattice_y_coords .ravel (), lattice_z_coords .ravel ()])
36- if write_deformed == True :
37- box_points = np .array ([lattice_x_coords .ravel () + parameters .array_mu_x .ravel ()* parameters .lenght_box_x , \
38- lattice_y_coords .ravel () + parameters .array_mu_y .ravel ()* parameters .lenght_box_y , \
39- lattice_z_coords .ravel () + parameters .array_mu_z .ravel ()* parameters .lenght_box_z ])
34+ if write_deformed :
35+ box_points = np .array ([lattice_x_coords .ravel () + parameters .array_mu_x .ravel () * parameters .lenght_box_x ,\
36+ lattice_y_coords .ravel () + parameters .array_mu_y .ravel () * parameters .lenght_box_y , \
37+ lattice_z_coords .ravel () + parameters .array_mu_z .ravel () * parameters .lenght_box_z ])
38+ else :
39+ box_points = np .array ([lattice_x_coords .ravel (), lattice_y_coords .ravel (), \
40+ lattice_z_coords .ravel ()])
4041
4142 n_rows = box_points .shape [1 ]
4243
43- box_points = np .dot (parameters .rotation_matrix ,box_points ) + np .transpose (np .tile (parameters .origin_box , (n_rows ,1 )))
44+ box_points = np .dot (parameters .rotation_matrix , box_points ) + \
45+ np .transpose (np .tile (parameters .origin_box , (n_rows , 1 )))
4446
4547 _write_vtk_box (box_points , outfile , parameters .n_control_points )
4648
4749
4850def _write_vtk_box (box_points , filename , dimensions ):
4951 """
50- Method that writes a vtk file containing FFD control points.
52+ Private method that writes a vtk file containing FFD control points.
5153
5254 :param numpy.ndarray box_points: coordinates of the FFD control points.
5355 :param string filename: name of the output file.
@@ -57,7 +59,7 @@ def _write_vtk_box(box_points, filename, dimensions):
5759 points = vtk .vtkPoints ()
5860
5961 for index in range (0 , box_points .shape [1 ]):
60- id = points .InsertNextPoint (box_points [0 , index ], box_points [1 , index ], box_points [2 , index ])
62+ ind = points .InsertNextPoint (box_points [0 , index ], box_points [1 , index ], box_points [2 , index ])
6163
6264 grid = vtk .vtkStructuredGrid ()
6365
0 commit comments