Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Philip Trettner
polymesh
Commits
23c4e2a5
Commit
23c4e2a5
authored
Mar 04, 2020
by
Zain Selman
💬
Browse files
assume triangles as given. should not serve as a complete working example
parent
31fccb3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/cookbook.rst
View file @
23c4e2a5
...
...
@@ -47,21 +47,12 @@ Add Triangle Faces to Mesh
::
// given:
// std::vector<tg::triangle3> tris;
pm::Mesh m;
auto pos = pm::vertex_attribute<tg::pos3>(m);
const auto n = 10;
std::vector<tg::triangle3> tris;
tris.reserve(n);
// some box to sample random positions
const auto box = tg::box3(tg::aabb3({-n, -n, -n}, {n, n, n}));
tg::rng rng;
// create random triangles
for (auto i = 0u; i < n; ++i)
tris.emplace_back(tg::triangle3(tg::uniform(rng, box), tg::uniform(rng, box), tg::uniform(rng, box)));
for (auto const& tri : tris)
{
/// add vertices to topology
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment