mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 02:55:54 +08:00
Fix transformation of new created volume by angle and distance
This commit is contained in:
parent
233ea5e0d8
commit
7f73a0e73d
@ -138,13 +138,26 @@ void EmbossCreateJob::process(Ctl &ctl) {
|
|||||||
Transform3d::TranslationType tt(offset.x(), offset.y(), offset.z());
|
Transform3d::TranslationType tt(offset.x(), offset.y(), offset.z());
|
||||||
m_transformation = Transform3d(tt);
|
m_transformation = Transform3d(tt);
|
||||||
} else {
|
} else {
|
||||||
// TODO: Disable apply common transformation after draggig
|
//m_transformation = Emboss::create_transformation_onto_surface(hit->position, hit->normal);
|
||||||
// Call after is used for apply transformation after common dragging to rewrite it
|
assert(m_input->hit_vol_tr.has_value());
|
||||||
m_transformation = Emboss::create_transformation_onto_surface(hit->position, hit->normal);
|
|
||||||
if (m_input->hit_vol_tr.has_value()) {
|
if (m_input->hit_vol_tr.has_value()) {
|
||||||
Transform3d object_trmat = m_input->raycast_manager->get_transformation(hit->tr_key);
|
Transform3d object_trmat = m_input->raycast_manager->get_transformation(hit->tr_key);
|
||||||
m_transformation = m_input->hit_vol_tr->inverse() * object_trmat * m_transformation;
|
|
||||||
|
const FontProp &font_prop = m_input->text_configuration.font_item.prop;
|
||||||
|
if (font_prop.angle.has_value()) {
|
||||||
|
double angle_z = *font_prop.angle;
|
||||||
|
object_trmat *= Eigen::AngleAxisd(angle_z, Vec3d::UnitZ());
|
||||||
|
}
|
||||||
|
if (font_prop.distance.has_value()) {
|
||||||
|
Vec3d translate = Vec3d::UnitZ() * (*font_prop.distance);
|
||||||
|
object_trmat.translate(translate);
|
||||||
|
}
|
||||||
|
|
||||||
|
Transform3d surface_trmat = Emboss::create_transformation_onto_surface(hit->position, hit->normal);
|
||||||
|
m_transformation = m_input->hit_vol_tr->inverse() * object_trmat * surface_trmat;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user