library(anglr)

The anglr package is about data structures and 3D visualization.

Key aspects of data structures are:

  • mesh-topology with a common vertex-pool for connected shapes.
  • line segments.
  • path-based geometry.
  • triangulated surfaces.
  • high-quality triangulations, meshes.
  • relational vs. structural forms.

All of these aspects are related to ease of visualization and flexibility. The anglr package extends the core silicate data structures SC, SC0, PATH, PATH0, TRI, and TRI0 with models DEL, DEL0 and QUAD. DEL() and DEL0() provide high-quality Delaunay-constrained edge-based triangulations for a wide variety of inputs. Polygon layers can be triangulated into mesh structures while maintaining all internal shape consistency and attribute metadata. QUAD() provides an efficient representation of raster data, it is quite experimental and only works within a limited set of workflows in anglr.

There is no single best data structure for all applications, and so as much as possible the models (SC, SC0, PATH, PATH0, TRI, TRI0, ARC, DEL, DEL0, and QUAD) are interoperable and will endeavour to maintain the input information and simply interpret it in terms of the desired format. Not all pathways are possible or sensible, but it depends on the required application and the form of the input data, so the key feature is flexibility and control.

As well as the data structure models, anglr includes the following visualization functions.

  • [mesh_plot()] this is a 2D graphics plot of a mesh structure (an example being a curvilinear raster, but simple polygon layers are also supported)
  • [shade3d()] 3D surface plot from mesh
  • [persp3d()] 3D surface plot from mesh
  • [wire3d()] 3D line plot from mesh
  • [dot3d()] 3D point plot from mesh
  • [plot3d()] general 3D plot

Each of these will attempt to convert any given input to an appropriate type, not all are sensible but we have attempted to err on the side of convenience.

Plot 3D

The 3D plot functions are very flexible.

wire3d(mesh1)

#rgl::snapshot3d("wire.png")

wire 3d