diff --git a/requirements/geovista.yml b/requirements/geovista.yml index dd6eb6fd..d03512b4 100644 --- a/requirements/geovista.yml +++ b/requirements/geovista.yml @@ -18,7 +18,7 @@ dependencies: - pooch - pykdtree - pyproj >=3.3 - - pyvista >=0.40,<0.42.2 + - pyvista >=0.43.1 # pantry dependencies (core) - netcdf4 diff --git a/requirements/pypi-core.txt b/requirements/pypi-core.txt index c78fb475..5093c6df 100644 --- a/requirements/pypi-core.txt +++ b/requirements/pypi-core.txt @@ -8,4 +8,4 @@ platformdirs pooch pykdtree pyproj>=3.3 -pyvista>=0.40,<0.42.2 +pyvista>=0.43.1 diff --git a/src/geovista/common.py b/src/geovista/common.py index 5ff24e0e..4b723775 100644 --- a/src/geovista/common.py +++ b/src/geovista/common.py @@ -604,7 +604,7 @@ def point_cloud(mesh: pv.PolyData) -> bool: .. versionadded:: 0.2.0 """ - return (mesh.n_points == mesh.n_faces) and (mesh.n_lines == 0) + return (mesh.n_points == mesh.n_cells) and (mesh.n_lines == 0) def sanitize_data( diff --git a/src/geovista/core.py b/src/geovista/core.py index 163f5a2d..50678f13 100644 --- a/src/geovista/core.py +++ b/src/geovista/core.py @@ -313,7 +313,7 @@ def add_texture_coords( u_coord = (lons + 180) / 360 v_coord = (lats + 90) / 180 t_coord = np.vstack([u_coord, v_coord]).T - mesh.active_t_coords = t_coord + mesh.active_texture_coordinates = t_coord return mesh @@ -325,10 +325,10 @@ def combine( ) -> pv.PolyData: """Combine two or more meshes into one mesh. - Only meshes with faces will be combined. Support is not yet provided for combining + Only meshes with cells will be combined. Support is not yet provided for combining meshes that consist of only points or lines. - Note that, no check is performed to ensure that mesh faces do not overlap. + Note that, no check is performed to ensure that mesh cells do not overlap. However, meshes may share coincident points. Coincident point data from the first input mesh will overwrite all other mesh data sharing the same coincident point in the resultant mesh. @@ -342,7 +342,7 @@ def combine( the resultant mesh. clean : bool, default=False Specify whether to merge duplicate points, remove unused points, - and/or remove degenerate faces in the resultant mesh. + and/or remove degenerate cells in the resultant mesh. Returns ------- @@ -384,15 +384,15 @@ def combine( if mesh.n_lines: emsg = ( - f"Can only combine meshes with faces, input mesh #{i+1} " + f"Can only combine meshes with cells, input mesh #{i+1} " "contains lines." ) raise TypeError(emsg) - if mesh.n_faces == 0: + if mesh.n_cells == 0: emsg = ( - f"Can only combine meshes with faces, input mesh #{i+1} " - "has no faces." + f"Can only combine meshes with cells, input mesh #{i+1} " + "has no cells." ) raise TypeError(emsg) @@ -413,9 +413,9 @@ def combine( faces[faces_n_offset[:-1]] = faces_n combined_faces.append(faces) - # accumulate running totals of combined mesh points and faces + # accumulate running totals of combined mesh points and cells n_points += mesh.n_points - n_faces += mesh.n_faces + n_faces += mesh.n_cells if data: # perform intersection to determine common names diff --git a/src/geovista/filters.py b/src/geovista/filters.py index 44a11513..4870c967 100644 --- a/src/geovista/filters.py +++ b/src/geovista/filters.py @@ -116,14 +116,18 @@ def remesh( if not triangulated(poly0): poly0.triangulate(inplace=True) + # Ensure to explicitly use default direction=(0, 0, 1) for + # the plane with a post x-axis rotation of 90 degrees. + # See https://github.com/bjlittle/geovista/issues/447 poly1 = pv.Plane( center=(radius / 2, 0, 0), i_resolution=1, j_resolution=1, i_size=radius, j_size=radius * 2, - direction=(0, 1, 0), + direction=(0, 0, 1), ) + poly1.rotate_x(90, inplace=True) poly1.rotate_z(meridian, inplace=True) poly1.triangulate(inplace=True) diff --git a/tests/bridge/test_from_points.py b/tests/bridge/test_from_points.py index 106f34e3..619b8d35 100644 --- a/tests/bridge/test_from_points.py +++ b/tests/bridge/test_from_points.py @@ -22,7 +22,7 @@ def test_defaults(lam_uk_sample, wgs84_wkt): assert result[GV_FIELD_CRS] == wgs84_wkt assert np.isclose(result[GV_FIELD_RADIUS], RADIUS) assert result.n_points == lons.size - assert result.n_points == result.n_faces + assert result.n_points == result.n_cells def test_to_cartesian_kwarg_pass_thru(mocker, lam_uk_sample):