Skip to content
Discussion options

You must be logged in to vote

@fdarling We added convenience functions for points, segments, polygons, and the buffer variant. In-place and copy-returning forms both exist. For polygons:

#include <trueform/trueform.hpp>

tf::polygons_buffer<int, float, 3, 3> mesh = /* ... */;

// In-place translation
tf::translate(mesh.polygons(), tf::make_vector(1.f, 0.f, 0.f));

// Copy that is translated
auto shifted = tf::translated(mesh.polygons(), tf::make_vector(1.f, 0.f, 0.f));

// In-place affine
tf::transform(mesh.polygons(), tf::make_rotation(tf::deg(45.f), tf::axis<2>));

// Copy that is transformed
auto rotated = tf::transformed(mesh.polygons(), some_transformation);

Is this what you had in mind?

Docs: https://trueform.po…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ZigaSajovic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants