Readme.md 1.93 KB
Newer Older
Philip Trettner's avatar
Philip Trettner committed
1
2
# PolyMesh

Philip Trettner's avatar
Philip Trettner committed
3
A lightweight half-edge data structure.
Philip Trettner's avatar
Philip Trettner committed
4
5
6

Best used with glm and glow.

Philip Trettner's avatar
Philip Trettner committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29

## 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)


Philip Trettner's avatar
Philip Trettner committed
30
31
32
33
34
35
## TODO

* Properties
* Algorithms
* Tests
* std::less and std::hash for _index (and maybe _handle)
Philip Trettner's avatar
Philip Trettner committed
36
* Debug: store compactify generation in handles to check for invalidation
37
38
* Debug: insert is_removed assertions into handle access
* Test self-adjacent faces
Philip Trettner's avatar
Philip Trettner committed
39
* smart ranges: filter, map
40
* vector, set, map -> range
41
* opposite edges (from vertex)
Philip Trettner's avatar
Philip Trettner committed
42
* cotangents weights etc.
43
* smoothing
Philip Trettner's avatar
Philip Trettner committed
44
45
* _copy versions of topological operations that copy attributes
* vertex split?
46
* half-edge collapse
Philip Trettner's avatar
Philip Trettner committed
47
* normal, tangent, bitangent computation
48
* primitive sort functions, better remap function, cache optimization
Philip Trettner's avatar
Philip Trettner committed
49
* lowlevel API that allows direct half-edge manipulation and does not fix boundaries (but also mirrors high level one)
Philip Trettner's avatar
Philip Trettner committed
50
* primitive collection sort and sort_by functions
Philip Trettner's avatar
Philip Trettner committed
51
* paired_with function for smart range
Philip Trettner's avatar
Philip Trettner committed
52
53
* operator +-*/ for attributes (similar to valarray)
* dual mesh construction
Philip Trettner's avatar
Philip Trettner committed
54
* cast<>, reinterpret<> function
55
* surface tracing