Skip to content
Snippets Groups Projects
Commit 23c4e2a5 authored by Zain Selman's avatar Zain Selman :speech_balloon:
Browse files

assume triangles as given. should not serve as a complete working example

parent 31fccb3e
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment