Commit 89957184 authored by Philip Trettner's avatar Philip Trettner
Browse files

docs second commit

parent 291990b6
# PolyMesh
A lightweight half-edge data structure.
Best used with glm and glow.
## Function parameter order guide
The following types of parameters exist:
* M (`Mesh const& m` or `Mesh& m`) reference to mesh (depending on topology is modified)
* RO-A (`attribute<T> const&`) read-only attributes such as position
* RW-A (`attribute<T>&`) read-write attributes
* OPT-A (`attribute<T>* = nullptr` or `attribute<T> const* = nullptr`) optional attributes
* H (`handle h`) handle
* M-P: other mandatory parameters
* OPT-P: other optional parameters
* OUT-P: output parameters (that don't fit in the return value)
Free functions that perform mesh-related algorithms follow these rules for their parameters:
* Mesh (M) or handle (H) is first parameter ("what does this function operates on?")
* Followed by all required RO-A such as `position`
* Followed by all mandatory parameters M-P
* Followed by all additional outputs RW-A and OUT-P
* Finalized by all optional parameters OPT-A and OPT-P (least frequently used parameter should be last)
## TODO
* Properties
* Algorithms
* Tests
* std::less and std::hash for _index (and maybe _handle)
* Debug: store compactify generation in handles to check for invalidation
* Debug: insert is_removed assertions into handle access
* Test self-adjacent faces
* smart ranges: filter, map
* vector, set, map -> range
* opposite edges (from vertex)
* cotangents weights etc.
* smoothing
* _copy versions of topological operations that copy attributes
* vertex split?
* half-edge collapse
* normal, tangent, bitangent computation
* primitive sort functions, better remap function, cache optimization
* lowlevel API that allows direct half-edge manipulation and does not fix boundaries (but also mirrors high level one)
* primitive collection sort and sort_by functions
* paired_with function for smart range
* operator +-*/ for attributes (similar to valarray)
* dual mesh construction
* cast<>, reinterpret<> function
* surface tracing
\ No newline at end of file
# polymesh
A C++17 easy-to-use high-performance half-edge data structure with strong functional features.
```cpp
#include <polymesh/pm.hh>
#include <typed-geometry/tg-lean.hh> // some math library
// declare mesh with single attribute
pm::Mesh m;
auto pos = pm::vertex_attribute<tg::pos3>(m);
// load from file
pm::load("/path/to/mesh.ext", m, pos);
// single iteration smoothing
auto smoothed_pos = pm::vertex_attribute<tg::pos3>(m);
for (auto v : m.vertices())
smoothed_pos[v] = v.adjacent_vertices().avg(pos);
```
## Documentation
for now the sphinx documentation must be built manually:
```
cd docs
make html
open _build/html/index.html
```
TODO: link to hosted version
## Features
- high-performance half-edge data structure
- external `vector<T>`-like attributes
- highly readable code via smart handles
- encourages functional programming via smart ranges
- many built-in geometry processing algorithms
## Installation
Install `polymesh` by running:
install project
## Requirements and Dependencies
- C++17
- CMake 3.8+
- msvc, gcc, or clang
The following math libraries are supported as optional dependencies:
- `typed-geometry` (recommended)
- `glm`
- `Eigen`
TODO: links
## Contribute
* Issue Tracker: github.com/TODO/issues
* Source Code: github.com/TODO
If you are having issues, please let us know.
TODO: link to contribution guide
## License
The project is licensed under the MIT license.
.wy-side-nav-search {
background-color: #F44336 !important;
}
\ No newline at end of file
......@@ -31,6 +31,9 @@ release = '0.9.0'
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'recommonmark',
'sphinx.ext.todo',
'sphinx.ext.githubpages',
]
# Add any paths that contain templates here, relative to this directory.
......@@ -41,15 +44,29 @@ templates_path = ['_templates']
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# global default domain
primary_domain = "cpp"
highlight_language = "cpp"
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'alabaster'
html_theme = 'sphinx_rtd_theme'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
\ No newline at end of file
html_static_path = ['_static']
# These paths are either relative to html_static_path
# or fully qualified paths (eg. https://...)
html_css_files = [
'css/custom.css',
]
# html_style = 'css/custom.css'
Contributing
============
Function parameter order guide
------------------------------
The following types of parameters exist:
* M (``Mesh const& m`` or ``Mesh& m``) reference to mesh (depending on topology is modified)
* RO-A (``attribute<T> const&``) read-only attributes such as position
* RW-A (``attribute<T>&``) read-write attributes
* OPT-A (``attribute<T>* = nullptr`` or ``attribute<T> const* = nullptr``) optional attributes
* H (``handle h``) handle
* M-P: other mandatory parameters
* OPT-P: other optional parameters
* OUT-P: output parameters (that don't fit in the return value)
Free functions that perform mesh-related algorithms follow these rules for their parameters:
#. Mesh (M) or handle (H) is first parameter ("what does this function operate on?")
#. Followed by all required RO-A such as ``position``
#. Followed by all mandatory parameters M-P
#. Followed by all additional outputs RW-A and OUT-P
#. Finalized by all optional parameters OPT-A and OPT-P (least frequently used parameter should be last)
\ No newline at end of file
Polymesh Cookbook
=================
Loading a mesh from a file
--------------------------
::
pm::Mesh m;
auto pos = m.vertices().make_attribute<tg::pos3>();
load("/path/to/file.ext", m, pos);
......@@ -3,13 +3,15 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to polymesh's documentation!
Welcome
====================================
.. toctree::
:maxdepth: 2
:caption: Contents:
cookbook/cookbook.rst
contributing
Indices and tables
......
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# Build documentation with MkDocs
#mkdocs:
# configuration: mkdocs.yml
# Optionally build your docs in additional formats such as PDF and ePub
formats: all
# Optionally set the version of Python and requirements required to build your docs
python:
version: 3.7
install:
- requirements: docs/requirements.txt
recommonmark
sphinx_rtd_theme
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment