Open pvanhauw opened 2 years ago
Hi and welcome! Thanks for posting your first issue in the PyVista project! Someone from @pyvista/developers will chime in before too long. If your question is support related, it may be automatically transferred to Discussions.
changing
mesh_sliced = mesh.slice(normal=[0, 1, 0])
into :
mesh_sliced = mesh.slice(normal=[0, 1, 0]).strip()
did the job.
It sounds like a good idea to document that in compute_arc_length Anyway, that issue can be solved with some pre-processing
reopening because cell data cannot be recovered correctly.
For exemple the cell_data below is of dimension 1 ( and contained as "field data" instead of "cell_data"), whatever "join" is set to True of False.
#!/bin/python
import pyvista as pv
mesh = pv.Sphere()
mesh = mesh.compute_cell_sizes()
print(mesh.field_data)
print(mesh.cell_data)
mesh_sliced = mesh.slice(normal=[0, 1, 0]).strip(join=True, pass_cell_data=True)
print(mesh_sliced.field_data)
print(mesh_sliced.cell_data)
mesh_sliced = mesh.slice(normal=[0, 1, 0]).strip(join=False, pass_cell_data=True)
print(mesh_sliced.field_data)
print(mesh_sliced.cell_data)
pyvista DataSetAttributes
Association : NONE
Contains arrays : None
pyvista DataSetAttributes
Association : CELL
Active Scalars : None
Active Vectors : None
Active Texture : None
Active Normals : None
Contains arrays :
Length float64 (1680,)
Area float64 (1680,)
Volume float64 (1680,)
pyvista DataSetAttributes
Association : NONE
Contains arrays :
Length float64 (1,)
Area float64 (1,)
Volume float64 (1,)
pyvista DataSetAttributes
Association : CELL
Active Scalars : None
Active Vectors : None
Active Texture : None
Active Normals : None
Contains arrays : None
pyvista DataSetAttributes
Association : NONE
Contains arrays :
Length float64 (1,)
Area float64 (1,)
Volume float64 (1,)
pyvista DataSetAttributes
Association : CELL
Active Scalars : None
Active Vectors : None
Active Texture : None
Active Normals : None
Contains arrays : None
[[59 0 1 2 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
52 53 54 55 56 57 5 3 4 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17
16 15 14 13 12 11 10 9 8 7 6 0]]
compute_arc_length when applied to a slice does not provide a continuous output. It seems like the algorithm does not account for the fact that the line are not ordered.
To Reproduce
Screenshots