pyvista / pyvista-support

[moved] Please head over to the Discussions tab of the PyVista repository
https://github.com/pyvista/pyvista/discussions
60 stars 4 forks source link

Extracting lines from the data #383

Open zhen-dong-zhang opened 3 years ago

zhen-dong-zhang commented 3 years ago

Hi, I'm trying to extract some boundaries from a density map. I tried to use extract_edges but got the edges of the mesh. Is there any subroutine that can extract some boundaries based on the value of plotting? For example, I want to extract the dashed line from the figure. The dashed line is the boundary of red and black. Screen Shot 2021-03-16 at 11 10 54 PM Thanks a lot for your time. Zhendong

zhen-dong-zhang commented 3 years ago

I tried geodesic pick but got errors: WARNING:root:Encountered issue in callback (most recent call last): File "/usr/local/anaconda3/envs/pygmt/lib/python3.9/site-packages/pyvista/plotting/picking.py", line 453, in _the_callback self.picked_geodesic = self.picked_geodesic + surface.geodesic(start_idx, end_idx) File "/usr/local/anaconda3/envs/pygmt/lib/python3.9/site-packages/pyvista/core/filters.py", line 4014, in geodesic output["vtkOriginalPointIds"] = original_ids File "/usr/local/anaconda3/envs/pygmt/lib/python3.9/site-packages/pyvista/core/dataset.py", line 649, in setitem raise_not_matching(scalars, self) File "/usr/local/anaconda3/envs/pygmt/lib/python3.9/site-packages/pyvista/utilities/helpers.py", line 722, in raise_not_matching raise ValueError(f'Number of scalars ({scalars.size}) ' ValueError: Number of scalars (1) must match either the number of points (0) or the number of cells (0).