Repository navigation
transforming a tf::polygons_buffer<> #18
|
Is there a straightforward way to either in-place apply a transform to, or generate a copy that is transformed from, a I saw that you can "tag" it when passing it as an argument to a boolean operation, but for my purposes I need to translate it and "bake it in" since I will be manually processing the vertices/faces afterward for conversion to another data structure. |
Answered by
ZigaSajovic
May 16, 2026
Replies: 1 comment
|
@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.polydera.com/cpp/modules/core#transforming-and-translating-forms |
0 replies
Answer selected by
ZigaSajovic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@fdarling We added convenience functions for points, segments, polygons, and the buffer variant. In-place and copy-returning forms both exist. For polygons:
Is this what you had in mind?
Docs: https://trueform.po…