mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 00:52:04 +00:00
Fix z-offset handling for ZAA
This commit is contained in:
@@ -30,8 +30,6 @@ static double slope_from_normal(const Eigen::Vector3d& normal)
|
||||
return angle_rad;
|
||||
}
|
||||
|
||||
// const int LINE = 180;
|
||||
|
||||
static bool contour_extrusion_path(LayerRegion *region, const sla::IndexedMesh &mesh, ExtrusionPath &path)
|
||||
{
|
||||
if (region->region().config().zaa_region_disable) {
|
||||
@@ -213,14 +211,13 @@ static void contour_extrusion_entity(LayerRegion *region, const sla::IndexedMesh
|
||||
}
|
||||
|
||||
static void handle_extrusion_collection(LayerRegion *region, const sla::IndexedMesh &mesh, ExtrusionEntityCollection &collection, std::initializer_list<ExtrusionRole> roles) {
|
||||
for (ExtrusionEntity *extr : collection.entities) {
|
||||
// printf("handling extrusion collection %p %p\n", &collection, extr);
|
||||
if (!contains(roles, extr->role())) {
|
||||
for (ExtrusionEntity* extr : collection.entities) {
|
||||
if (!contains(roles, extr->role())) {
|
||||
continue;
|
||||
}
|
||||
|
||||
contour_extrusion_entity(region, mesh, extr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Layer::make_contour_z(const sla::IndexedMesh &mesh)
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include <float.h>
|
||||
#include <iterator>
|
||||
#include <mutex>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
#include <oneapi/tbb/blocked_range.h>
|
||||
#include <oneapi/tbb/concurrent_vector.h>
|
||||
@@ -731,13 +730,15 @@ void PrintObject::contour_z()
|
||||
}
|
||||
|
||||
ModelInstance *inst = m_model_object->instances.front();
|
||||
Point center_offset = this->center_offset();
|
||||
Point center_offset = this->center_offset();
|
||||
Geometry::Transformation trans = inst->get_transformation();
|
||||
double z = trans.get_offset().z() - unscale<double>(this->height()) / 2;
|
||||
trans.set_offset(Vec3d(-unscale<double>(center_offset.x()), -unscale<double>(center_offset.y()), 0));
|
||||
|
||||
mesh.transform(trans.get_matrix());
|
||||
|
||||
sla::IndexedMesh imesh(mesh);
|
||||
imesh.ground_level_offset(-z);
|
||||
|
||||
std::mutex mtx;
|
||||
size_t completed = 0;
|
||||
tbb::parallel_for(
|
||||
|
||||
Reference in New Issue
Block a user