mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -06:00
Added helper functions to generate 3d transforms
This commit is contained in:
parent
0bc99f3f65
commit
aa0c3bf2e3
5 changed files with 46 additions and 33 deletions
|
@ -1166,4 +1166,21 @@ MedialAxis::retrieve_endpoint(const VD::cell_type* cell) const
|
|||
}
|
||||
}
|
||||
|
||||
void assemble_transform(Transform3d& transform, const Vec3d& translation, const Vec3d& rotation, const Vec3d& scale)
|
||||
{
|
||||
transform = Transform3d::Identity();
|
||||
transform.translate(translation);
|
||||
transform.rotate(Eigen::AngleAxisd(rotation(2), Vec3d::UnitZ()));
|
||||
transform.rotate(Eigen::AngleAxisd(rotation(1), Vec3d::UnitY()));
|
||||
transform.rotate(Eigen::AngleAxisd(rotation(0), Vec3d::UnitX()));
|
||||
transform.scale(scale);
|
||||
}
|
||||
|
||||
Transform3d assemble_transform(const Vec3d& translation, const Vec3d& rotation, const Vec3d& scale)
|
||||
{
|
||||
Transform3d transform;
|
||||
assemble_transform(transform, translation, rotation, scale);
|
||||
return transform;
|
||||
}
|
||||
|
||||
} }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue