Remove obsolete build and documentation files and clean up commented-out code

This commit is contained in:
Aleksandr Dobkin
2026-03-11 02:47:32 -07:00
parent cf135c6843
commit deb464854a
5 changed files with 11 additions and 562 deletions

View File

@@ -15,49 +15,25 @@ namespace Slic3r {
static void contour_extrusion_entity(LayerRegion *region, const sla::IndexedMesh &mesh, ExtrusionEntity *extr);
// static double lowest_z_within_distance(const Vec3d &normal, double dist) {
// const Vec3d p(0.0, 0.0, 0.0);
// Eigen::Vector3d n_unit = normal.normalized();
// Eigen::Vector3d z_hat(0.0, 0.0, 1.0);
// // Project the negative z-direction into the tangent plane
// Eigen::Vector3d v_dir = -z_hat + (z_hat.dot(n_unit)) * n_unit;
// double norm_v = v_dir.norm();
// if (norm_v == 0.0) {
// // Surface is horizontal, cannot go lower in z within tangent plane
// return p.z();
// }
// Eigen::Vector3d v = dist * v_dir / norm_v;
// Eigen::Vector3d q = p + v;
// return q.z();
// }
static double follow_slope_down(double angle_rad, double dist) {
static double follow_slope_down(double angle_rad, double dist)
{
return -dist * std::sin(angle_rad);
}
static double slope_from_normal(const Eigen::Vector3d& normal) {
static double slope_from_normal(const Eigen::Vector3d& normal)
{
// Ensure the normal is normalized
Eigen::Vector3d n = normal.normalized();
// Compute angle between normal and z-axis
double angle_rad = std::acos(std::abs(n.z())); // angle between normal and vertical
return angle_rad;
// calculate fall over dist
// double dist = 0.2;
// double z_dist = lowest_z(angle_rad, dist);
// printf("fall %f vs %f\n", z_dist, lowest_z_within_distance(normal, dist));
// double angle_deg = angle_rad * 180.0 / M_PI;
// return angle_deg;
}
// const int LINE = 180;
static bool contour_extrusion_path(LayerRegion *region, const sla::IndexedMesh &mesh, ExtrusionPath &path) {
static bool contour_extrusion_path(LayerRegion *region, const sla::IndexedMesh &mesh, ExtrusionPath &path)
{
if (region->region().config().zaa_region_disable) {
return false;
}
@@ -74,19 +50,11 @@ static bool contour_extrusion_path(LayerRegion *region, const sla::IndexedMesh &
double resolution_mm = 0.1;
coordf_t height = layer->height;
// std::cout << "LAYER " << (layer->id()+1) << std::endl;
// std::cout << "PRINT Z " << layer->print_z << std::endl;
// std::cout << "LAYER HEIGHT " << height << std::endl;
// std::cout << "EXTRUSION HEIGHT " << path.height << std::endl;
// std::cout << "EXTRUSION WIDTH " << path.width << std::endl;
// std::cout << "EXTRUSION ROLE: " << ExtrusionEntity::role_to_string(path.role()) << std::endl;
// std::cout << "FIRST POINT: " << path.polyline.first_point() << std::endl;
double minimize_perimeter_height_angle = region->region().config().zaa_minimize_perimeter_height;
Pointf3s contoured_points;
bool was_contoured = false;
// bool is_perimeter = path.role() == erExternalPerimeter || path.role() == erPerimeter || path.role() == erOverhangPerimeter;
for (Points3::const_iterator it = points.begin(); it != points.end()-1; ++it) {
Vec2d p1d(unscale_(it->x()), unscale_(it->y()));
@@ -195,13 +163,15 @@ static void contour_extrusion_loop(LayerRegion *region, const sla::IndexedMesh &
}
}
static void contour_extrusion_entitiy_collection(LayerRegion *region, const sla::IndexedMesh &mesh, ExtrusionEntityCollection &collection) {
static void contour_extrusion_entitiy_collection(LayerRegion *region, const sla::IndexedMesh &mesh, ExtrusionEntityCollection &collection)
{
for (ExtrusionEntity *entity : collection.entities) {
contour_extrusion_entity(region, mesh, entity);
}
}
static void contour_extrusion_entity(LayerRegion *region, const sla::IndexedMesh &mesh, ExtrusionEntity *extr) {
static void contour_extrusion_entity(LayerRegion *region, const sla::IndexedMesh &mesh, ExtrusionEntity *extr)
{
const ExtrusionPathSloped *sloped = dynamic_cast<const ExtrusionPathSloped*>(extr);
if (sloped != nullptr) {
throw RuntimeError("ExtrusionPathSloped not implemented");
@@ -253,81 +223,11 @@ static void handle_extrusion_collection(LayerRegion *region, const sla::IndexedM
}
}
// static void find_point(ExtrusionPath &path, const std::string &path_info) {
// Points3 &points = path.polyline.points;
// size_t i = 0;
// for (Points3::const_iterator it = points.begin(); it != points.end()-1; ++it) {
// if (it->x() == -883971 && it->y() == 979001) {
// std::cout << "FOUND POINT " << ExtrusionEntity::role_to_string(path.role()) << " at path " << path_info << "[" + std::to_string(i) + "]" << std::endl;
// }
// i++;
// }
// }
// static void find_point(ExtrusionLoop &loop, const std::string &path_info) {
// size_t i = 0;
// for (ExtrusionPath &path : loop.paths) {
// find_point(path, path_info + "[" + std::to_string(i) + "]");
// i++;
// }
// }
// static void find_point(ExtrusionEntity &extr, const std::string &path);
// static void find_point(ExtrusionEntityCollection &collection, const std::string &path) {
// size_t i = 0;
// for (ExtrusionEntity *extr : collection.entities) {
// find_point(*extr, path + "[" + std::to_string(i) + "]");
// i++;
// }
// }
// static void find_point(ExtrusionEntity &extr, const std::string &path_info) {
// const ExtrusionPathSloped *sloped = dynamic_cast<const ExtrusionPathSloped*>(&extr);
// if (sloped != nullptr) {
// throw RuntimeError("ExtrusionPathSloped not implemented");
// return;
// }
// ExtrusionPath *path = dynamic_cast<ExtrusionPath*>(&extr);
// if (path != nullptr) {
// find_point(*path, path_info + " as ExtrusionPath " + ExtrusionEntity::role_to_string(extr.role()));
// return;
// }
// ExtrusionLoop *loop = dynamic_cast<ExtrusionLoop*>(&extr);
// if (loop != nullptr) {
// find_point(*loop, path_info + " as ExtrusionLoop " + ExtrusionEntity::role_to_string(extr.role()));
// return;
// }
// const ExtrusionLoopSloped *loop_sloped = dynamic_cast<const ExtrusionLoopSloped*>(&extr);
// if (loop_sloped != nullptr) {
// throw RuntimeError("ExtrusionLoopSloped not implemented");
// return;
// }
// ExtrusionEntityCollection *collection = dynamic_cast<ExtrusionEntityCollection*>(&extr);
// if (collection != nullptr) {
// find_point(*collection, path_info + " as ExtrusionEntityCollection " + ExtrusionEntity::role_to_string(extr.role()));
// return;
// }
// throw RuntimeError("ContourZ: ExtrusionEntity type not implemented");
// return;
// }
void Layer::make_contour_z(const sla::IndexedMesh &mesh)
{
// printf("make_contour_z() called\n");
for (LayerRegion *region : this->regions()) {
// printf("processing layer region %p\n", region);
// find_point(region->fills, "fills");
// find_point(region->perimeters, "perimeters");
handle_extrusion_collection(region, mesh, region->fills, {erTopSolidInfill, erIroning, erExternalPerimeter, erMixed});
handle_extrusion_collection(region, mesh, region->perimeters, {erExternalPerimeter, erMixed});
}
}
} // namespace Slic3r
} // namespace Slic3r