NEWS.md
quadmesh now imports the ‘textures’ package and uses it for mesh machinery: quad vertex and index generation (‘quad_vertex()’, ‘quad_index()’) and the discrete mesh expansion (‘break_mesh()’). Mesh content is unchanged, quads remain in raster cell order with the historical corner order (see ‘qm_as_raster(index = )’).
The ‘texture’ argument to ‘quadmesh()’ and ‘triangmesh()’ may now be a path to a PNG file (#43). The image is draped over the raster extent with extent-normalized texture coordinates, in the manner of ‘textures::quad_texture()’, with no reprojection and no intermediate PNG write.
‘dquadmesh()’ with a texture now expands texture coordinates along with the vertices (previously ‘texcoords’ were left unexpanded, mismatching the broken mesh).
‘dquadmesh(x, na.rm = TRUE)’ no longer errors, per-cell z values are aligned to the retained quads.
The ‘z’ argument is now honoured by ‘dquadmesh()’ and ‘triangmesh()’, previously the values of ‘x’ were used regardless. ‘dtriangmesh()’ honoured a raster ‘z’ but fell back to an empty template for matrix, ‘SpatRaster’, or numeric ‘z’, these now work. A constant numeric ‘z’ now works for ‘quadmesh()’ and ‘triangmesh()’ as documented.
‘triangmesh(x, na.rm = TRUE)’ now correctly drops triangles that reference a missing cell (the triangle index was previously subset by a cell-length logical, silently recycling when triangle count and cell count differed).
‘mesh_plot()’ now correctly drops primitives that reference non-finite reprojected vertices (previously the per-vertex flag was applied as a primitive index), and colours stay aligned with the retained primitives.
Removed dependency on the ‘sp’ package (plain coordinate matrices are used with raster extraction and ‘raster::xyFromCell()’).
Fix use of ‘.Names’ by old dput code: ‘Replacing special names “.Names” is deprecated’.
Now importing terra, and supporting ‘SpatRaster’ objects.
‘mesh_plot’ gains a ‘maxcell’ argument to provide a default reduced resolution, can be set to ‘NULL’ to use native resolution.
Removed link to rgl package that we do not use.
Fixed import of viridis package which caused CRAN problems.
Moved large examples/ folder from inst/ to data-raw/ to avoid it being installed.
Remove failing test comparing unimportant differences in geocentric transformation.
quadmesh now works with upcoming release of reproj (> 0.4.0).
Fixed failing CRAN test by internalizing use of hcl.colors().
mesh_plot() now has a method for mesh3d. Intention is to use mesh3d as the common basis for mesh_plot().
WIP new use_crs() facility to set the projection in use when setting up a mesh_plot. Subsequent calls to mesh_plot(, add = TRUE) will automatically project to the coordinate system in use. use_crs() will set or get the PROJ string.
mesh_plot() now has a method for mesh3d. Intention is to use mesh3d as the common basis for mesh_plot(). Now using palr package for colour handling.
WIP new use_crs() facility to set the projection in use when setting up a mesh_plot. Subsequent calls to mesh_plot(, add = TRUE) will automatically project to the coordinate system in use. use_crs() will set or get the PROJ string.
New feature in quadmesh() to auto-expand a palette raster to the required RGB brick for the texture argument. Motivated by https://gis.stackexchange.com/questions/324552/creating-3d-image-from-hgt-files.
Simplified use of reproj() by relying on upcoming new version.
Function mesh_plot() now handles stars objects, only plotting the first x-y slice.
mesh3d creation, partial naming of material$color caused various problems.Function mesh_plot gains zlim and passes ... to base::plot() (for aspect ratios with wildly disparate dwide/high grids).
Now using the reproj package for coordinate transformations.
New mesh_plot() method for TRI objects from silicate/anglr.
New function dquadmesh to provide the discrete interpretation of a grid.
New function bary_index to provide a basis for interpolation of a regular grid from triangles.
New functions triangmesh() and dtriangmesh to provide the triangle-interpretation of a raster (bound to centre coordinates).
quadmesh() is now generic with a new method for ‘matrix’.
Some fixes and additional features for mesh_plot() to allow plotting with curvilinear coords.
New function qm_as_raster to round-trip to a RasterLayer.
The z argument of quadmesh() may now have a different coordinate system to the input data x. The mesh coordinates of x are silently reprojected if needed and used to extract values in the native coordinate system of z.
A new qsc function to return a very simple six quad rendition of the Quadrilateralized Spherical Cube projection family.
The mesh_plot function gains true curvilinear grid support by allowing input of coords, a two-layer raster of longitude and latitude values for the cell geography. This aligns with the approach used in the angstroms package.
The quadmesh function gains a new argument ‘texture_filename’ to control the output PNG file.
The quadmesh functions gains a texture argument, to map on a 3-layer RGB raster (in 0-255) via a temporary PNG file.
New function mesh_plot for basic vectorized raster plot with optional near near-lossless projection transformation.
Index arrays are now created with integer mode.
Added triangulate_quads function to convert quad index to pairs of triangle index.
Added supporting information to package.
Internal function llh2xyz is now exported to transform from longitude latitude coordinates to geocentric xyz coordinates.