mirror of
https://github.com/FULU-Foundation/OrcaSlicer-bambulab.git
synced 2026-07-28 04:14:27 +03:00
Changing the internal representation of Point / Pointf / Point3 / Pointf3 to Eigen Matrix types, first step
This commit is contained in:
@@ -1352,8 +1352,8 @@ namespace Slic3r {
|
||||
double angle_z = (rotation.axis() == Eigen::Vector3d::UnitZ()) ? rotation.angle() : -rotation.angle();
|
||||
#endif
|
||||
|
||||
instance.offset.x = offset_x;
|
||||
instance.offset.y = offset_y;
|
||||
instance.offset.x() = offset_x;
|
||||
instance.offset.y() = offset_y;
|
||||
instance.scaling_factor = sx;
|
||||
instance.rotation = angle_z;
|
||||
}
|
||||
@@ -1801,7 +1801,7 @@ namespace Slic3r {
|
||||
}
|
||||
|
||||
Eigen::Affine3f transform;
|
||||
transform = Eigen::Translation3f((float)instance->offset.x, (float)instance->offset.y, 0.0f) * Eigen::AngleAxisf((float)instance->rotation, Eigen::Vector3f::UnitZ()) * Eigen::Scaling((float)instance->scaling_factor);
|
||||
transform = Eigen::Translation3f((float)instance->offset.x(), (float)instance->offset.y(), 0.0f) * Eigen::AngleAxisf((float)instance->rotation, Eigen::Vector3f::UnitZ()) * Eigen::Scaling((float)instance->scaling_factor);
|
||||
build_items.emplace_back(instance_id, transform.matrix());
|
||||
|
||||
stream << " </" << OBJECT_TAG << ">\n";
|
||||
|
||||
@@ -496,8 +496,8 @@ void AMFParserContext::endDocument()
|
||||
for (const Instance &instance : object.second.instances)
|
||||
if (instance.deltax_set && instance.deltay_set) {
|
||||
ModelInstance *mi = m_model.objects[object.second.idx]->add_instance();
|
||||
mi->offset.x = instance.deltax;
|
||||
mi->offset.y = instance.deltay;
|
||||
mi->offset.x() = instance.deltax;
|
||||
mi->offset.y() = instance.deltay;
|
||||
mi->rotation = instance.rz_set ? instance.rz : 0.f;
|
||||
mi->scaling_factor = instance.scale_set ? instance.scale : 1.f;
|
||||
}
|
||||
@@ -829,8 +829,8 @@ bool store_amf(const char *path, Model *model, Print* print, bool export_print_c
|
||||
" <scale>%lf</scale>\n"
|
||||
" </instance>\n",
|
||||
object_id,
|
||||
instance->offset.x,
|
||||
instance->offset.y,
|
||||
instance->offset.x(),
|
||||
instance->offset.y(),
|
||||
instance->rotation,
|
||||
instance->scaling_factor);
|
||||
//FIXME missing instance->scaling_factor
|
||||
|
||||
@@ -207,8 +207,8 @@ bool load_prus(const char *path, Model *model)
|
||||
for (size_t c = 0; c < 3; ++ c)
|
||||
trafo[r][c] += mat_trafo(r, c);
|
||||
}
|
||||
instance_offset.x = position[0] - zero[0];
|
||||
instance_offset.y = position[1] - zero[1];
|
||||
instance_offset.x() = position[0] - zero[0];
|
||||
instance_offset.y() = position[1] - zero[1];
|
||||
trafo[2][3] = position[2] / instance_scaling_factor;
|
||||
trafo_set = true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user