Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
polymesh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Zain Selman
polymesh
Commits
9c176da4
Commit
9c176da4
authored
5 years ago
by
Philip Trettner
Browse files
Options
Downloads
Patches
Plain Diff
improving doc
parent
cbf5366f
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/attributes.rst
+32
-1
32 additions, 1 deletion
docs/attributes.rst
docs/mesh-topology.rst
+23
-0
23 additions, 0 deletions
docs/mesh-topology.rst
with
55 additions
and
1 deletion
docs/attributes.rst
+
32
−
1
View file @
9c176da4
Attributes
==========
TODO
:class:`polymesh::Mesh` stores pure topology, no positions, no normals, no other attributes.
All data associated with mesh primitives are stored in so-called external attributes.
Motivating example: ::
// create empty mesh
pm::Mesh m;
// create position as external vertex attribute
auto pos = pm::vertex_attribute<tg::pos3>(m);
// create a vertex (pos is automatically resized as well)
auto v = m.vertices().add();
// assign position
pos[v] = {1, 2, 3};
// compute face normals (functional style)
auto f_normals = m.faces().map([&](pm::face_handle f) { return pm::face_normal(f, pos); };
// compute vertex normals (imperative style)
auto v_normals = m.vertices().make_attribute<tg::vec3>();
for (auto v : m.vertices())
{
auto n = v.faces().sum(f_normals);
v_normals[v] = normalize(n);
}
External Attributes
-------------------
Integrating Mesh and Attributes
-------------------------------
...
...
This diff is collapsed.
Click to expand it.
docs/mesh-topology.rst
+
23
−
0
View file @
9c176da4
Mesh and Topology
=================
Motivating example: ::
// creates an empty mesh
pm::Mesh m;
// add some vertices
pm::vertex_handle v0 = m.vertices().add();
pm::vertex_handle v1 = m.vertices().add();
pm::vertex_handle v2 = m.vertices().add();
// add a face
pm::face_handle f = m.faces().add(v0, v1, v2);
// iterate over edges
for (pm::edges_handle e : m.edge())
std::cout << "v" << int(e.vertexA()) << " -> v" << int(e.vertexB()) << std::endl;
// split face
pm::vertex_handle v = m.faces().split(f);
// navigate the mesh
v = v.any_outgoing_halfedge().next().vertex_to();
Mesh Class
-------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment