Skip to content

Lagrange Release v6.0.0

Compare
Choose a tag to compare
@jdumas jdumas released this 06 Apr 20:52
· 50 commits to main since this release

Highlights

  • Generic mesh API that works in 2D, 3D, triangles/quad/hybrid mesh using the same mesh type.
  • Simple API based on std::span<> (assumes continuous memory buffers)
  • Generic copy-on-write attributes (per vertex, facet, edge, etc.)
  • Separate views.h provides Eigen "views" over mesh buffers.
  • Mesh header only pulls STL headers (, <string_view>, and -- last one can be avoided easily).
  • Efficient memory storage: regular meshes only need 2 buffers (vertex pos, facet indices), while hybrid meshes uses an additional offset buffer.
  • Use PIMPL idiom to hide internal mesh attribute manager.
  • Mesh attribute can wrap external buffers (including const buffers). Policies determine write/growth behavior.
  • Efficient buffer growth via std::vector<>.
  • Use explicit template instantiation to enforce strict separation of declaration/definition (faster compile times)
  • Use X macros to facilitate explicit template instantiation of predetermined types
  • Export attributes into shared_ptr for lifetime management.
  • Full Doxygen documentation.
  • Zero compiler warnings with much stricter warning flags than before.
  • C++17 is now the minimum required standard.

Features

Attributes

  • Generic attribute class, templated only by scalar type.
  • Versatile, low-level but safe interface based on std::span<>.
  • Use explicit template instantiation to separate .cpp and .h
  • Support wrapping external buffers (const and non-const). A policy controls write behavior to const buffers.
  • Support wrapping external buffers with larger capacity. A policy controls growth behavior of external buffers.
  • Support various attribute usage tags. VertexIndex, FacetIndex, etc. will remap indices accordingly when resizing/reordering.
  • Indexed attributes as a pair of (indices, value) attributes
  • Set default value used for attribute growth (e.g. invalid index, -1, etc.).
  • Unit tests with 100% coverage

Mesh

  • Copy-on-write allows the new mesh class to have efficient "pass-by-value" semantic (a mesh can be copied/moved efficiently).
  • Generic mesh API supporting arbitrary dimension & arbitrary polygonal facets.
  • Dynamic mesh supporting insertion & deletion of vertices/facets.
    • Add vertices/facets extend existing attribute buffers.
    • Efficient batch element removal (using either a list/mask of elements to remote).
    • Efficient in-place reordering/reindexing after element removal.
    • Methods to clear vertices/facets
  • Mesh attributes
    • Access attributes via names (<string_view>) or attribute ids (avoid a hash map lookup).
    • Easy read/write references to mesh vertices and facets indices.
    • Prevent creation of reserved attribute names (starting with "$").
    • Export attribute buffer into a shared_ptr.
  • Mesh edges
    • Initialize mesh edges using user-given ordering.
    • Additional connectivity attribute for navigation.
    • Preserve attributes when resizing/reindexing mesh elements
  • Mesh IO for .obj files
    • Basic mesh IO for positions + indices
    • Extended mesh IO with uv and normals

Views

  • Convenient "Eigen" map views over mesh attributes: compatible with libigl functions (V, F).
  • Convenient views for mesh vertices/facets + generic views for custom attributes.

Visitors

  • Provide foreach_attribute methods to visit all mesh attributes.
  • Sequential and parallel iteration.
  • BitField for iterating over attributes of a certain type.
  • Filter indexed and non-indexed attributes via if constexpr or template args.
  • foreach_xxx_around visitors use function_ref<> rather than templated functions.