@@ -29,7 +29,7 @@ def write_bounding_box(parameters, outfile, write_deformed=True):
2929 aux_x = np .linspace (0 , parameters .lenght_box_x , parameters .n_control_points [0 ])
3030 aux_y = np .linspace (0 , parameters .lenght_box_y , parameters .n_control_points [1 ])
3131 aux_z = np .linspace (0 , parameters .lenght_box_z , parameters .n_control_points [2 ])
32- lattice_z_coords , lattice_y_coords , lattice_x_coords = np .meshgrid (aux_z , aux_y , aux_x )
32+ lattice_y_coords , lattice_x_coords , lattice_z_coords = np .meshgrid (aux_y , aux_x , aux_z )
3333
3434 if write_deformed :
3535 box_points = np .array ([lattice_x_coords .ravel () + parameters .array_mu_x .ravel () * parameters .lenght_box_x ,\
@@ -43,8 +43,16 @@ def write_bounding_box(parameters, outfile, write_deformed=True):
4343
4444 box_points = np .dot (parameters .rotation_matrix , box_points ) + \
4545 np .transpose (np .tile (parameters .origin_box , (n_rows , 1 )))
46+
47+ # step necessary to set the correct order to the box points for vtkStructuredGrid:
48+ # Data in vtkStructuredGrid are ordered with x increasing fastest, then y, then z
49+ dims = lattice_y_coords .shape
50+ aux_xx = box_points [0 ,:].reshape (dims ).ravel (order = 'f' )
51+ aux_yy = box_points [1 ,:].reshape (dims ).ravel (order = 'f' )
52+ aux_zz = box_points [2 ,:].reshape (dims ).ravel (order = 'f' )
53+ reordered_box_points = np .array ((aux_xx , aux_yy , aux_zz ))
4654
47- _write_vtk_box (box_points , outfile , parameters .n_control_points )
55+ _write_vtk_box (reordered_box_points , outfile , parameters .n_control_points )
4856
4957
5058def _write_vtk_box (box_points , filename , dimensions ):
@@ -54,6 +62,11 @@ def _write_vtk_box(box_points, filename, dimensions):
5462 :param numpy.ndarray box_points: coordinates of the FFD control points.
5563 :param string filename: name of the output file.
5664 :param list dimensions: dimension of the lattice in (x, y, z) directions.
65+
66+ .. warning::
67+ If you want to visualize in paraview the inner points,
68+ you have to slice the lattice because paraview does not visualize them automatically
69+ even in the wireframe visualization.
5770 """
5871 # setup points and vertices
5972 points = vtk .vtkPoints ()
0 commit comments