From ab969c98e8238657c4376deae854af1a3b09a53a Mon Sep 17 00:00:00 2001 From: Philip Trettner <Philip.Trettner@rwth-aachen.de> Date: Tue, 28 Apr 2020 15:31:22 +0200 Subject: [PATCH] updated docs a bit --- Readme.md | 2 +- docs/conf.py | 2 +- docs/cookbook.rst | 3 +++ docs/properties.rst | 41 +++++++++++++++++++++++++++++++++++++++++ docs/roadmap.rst | 1 - 5 files changed, 46 insertions(+), 3 deletions(-) diff --git a/Readme.md b/Readme.md index 2839a13..1065572 100644 --- a/Readme.md +++ b/Readme.md @@ -25,7 +25,7 @@ for now the sphinx documentation must be built manually: ``` cd docs -pip install -r requirements.txt +pip3 install -r requirements.txt doxygen make html open _build/html/index.html diff --git a/docs/conf.py b/docs/conf.py index 4488b18..9ed8b52 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ # -- Project information ----------------------------------------------------- project = 'polymesh' -copyright = '2019, Philip Trettner' +copyright = '2020, Philip Trettner' author = 'Philip Trettner' # The full version, including alpha/beta/rc tags diff --git a/docs/cookbook.rst b/docs/cookbook.rst index e5e4701..53b44d2 100644 --- a/docs/cookbook.rst +++ b/docs/cookbook.rst @@ -1,6 +1,9 @@ Polymesh Cookbook ================= +This chapter collects various simple recipes and samples that answer common "How do I do XYZ?" questions. +`Typed Geometry <https://graphics.rwth-aachen.de:9000/ptrettner/typed-geometry>`_ is used as math library. + Loading a Mesh from a File -------------------------- diff --git a/docs/properties.rst b/docs/properties.rst index 5aec52e..028e69a 100644 --- a/docs/properties.rst +++ b/docs/properties.rst @@ -2,5 +2,46 @@ Properties ========== Properties are the commonly used free functions found in ``<polymesh/properties.hh>``. +They are helpers for answering simple topological questions or computing basic geometric properties. +When they use geometric :doc:`attributes`, they are written using generic :doc:`vector-math` to transparently support different math libraries. +The properties interact well with :doc:`smart-ranges` and are commonly used together. +Some properties transform complete attributes, like ``pm::vertex_normals_by_area`` which computes vertex normals for the whole mesh. + +Property functions live in the ``polymesh::`` namespace and can thus often be found via `argument-dependent lookup <https://en.cppreference.com/w/cpp/language/adl>`_. +For example, ``valence(v)`` is the same as ``pm::valence(v)`` for ``pm::vertex_handle v``. + +Motivating example: :: + + #include <polymesh/properties.hh> + + // load some mesh + pm::Mesh m; + auto pos = m.vertices().make_attribute<tg::pos3>(); + load("/path/to/some/file.obj", m, pos); + + // number of triangles + auto tri_count = m.faces().count(pm::is_triangle); + + // remove isolated vertices + for (auto v : m.vertices()) + if (is_isolated(v)) + m.vertices().remove(v); + + // compute total mesh area + // (requires a lambda because face_area needs to know which position attribute to use) + auto mesh_area = m.faces().sum([&](auto f) { return face_area(f, pos); }); + + // get vertex normals with uniform weighting + auto vnormals = vertex_normals_uniform(pos); + + +Topological Properties +---------------------- + +TODO + + +Geometric Properties +-------------------- TODO diff --git a/docs/roadmap.rst b/docs/roadmap.rst index bccc5b2..6a57f06 100644 --- a/docs/roadmap.rst +++ b/docs/roadmap.rst @@ -6,7 +6,6 @@ TODO Refactorings ------------ -* simplify ``make_attribute`` variants and remove the one that is achieved via ``map`` * provide a ``span`` type * remove ``std`` dependencies where appropriate to reduce compile times -- GitLab