From 2c5729946b0e5861be7d7d537d7d085c9d5eed43 Mon Sep 17 00:00:00 2001 From: mckay Date: Mon, 25 Aug 2025 20:20:11 +0800 Subject: [PATCH] Revert "fix: enhance logging in apply_transform for scale and translation operations" This reverts commit 82ade709c79af1b254f57af906fecec71a785432. --- application/main.cpp | 6 ++---- primitive_process/src/base/subface.cpp | 15 --------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/application/main.cpp b/application/main.cpp index e632165..46f8593 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -36,10 +36,8 @@ int main() auto sphere1 = create_primitive(primitive_data_center, PRIMITIVE_TYPE_SPHERE); // auto sphere2 = create_primitive(primitive_data_center, PRIMITIVE_TYPE_SPHERE); auto cylinder = create_primitive(primitive_data_center, PRIMITIVE_TYPE_CYLINDER); - //primitive_apply_translation(sphere1, {0.5, 0.0, 0.0}); - primitive_apply_translation(cylinder, {0.5, 0.0, 0.0}); - //primitive_apply_scale(cylinder, {1, 1, 2}); - //primitive_apply_scale(sphere1, {1, 1, 2}); + //primitive_apply_translation(sphere1, {.0, 0.0, 0.0}); + primitive_apply_scale(cylinder, {1, 1, 2}); std::cout << "primitive created..." << std::endl; auto runtime_blobtree = create_blobtree(); diff --git a/primitive_process/src/base/subface.cpp b/primitive_process/src/base/subface.cpp index dbe93cc..18a4a17 100644 --- a/primitive_process/src/base/subface.cpp +++ b/primitive_process/src/base/subface.cpp @@ -19,20 +19,11 @@ Eigen::Matrix3d subface::trans_world_to_local_linear() const { return model_matr std::pair subface::apply_transform(internal::transform_type type, Eigen::Vector4d param) { - std::cout << "Applying transform: " << param.head<3>() << std::endl; auto temp = *model_matrices; switch (type) { case internal::transform_type::scale: { - std::cout << "Before scale:" << std::endl; - std::cout << "local_to_world.linear():\n" << temp.local_to_world.linear() << std::endl; - std::cout << "world_to_local.linear():\n" << temp.world_to_local.linear() << std::endl; - temp.local_to_world.linear() = param.head<3>().asDiagonal() * temp.local_to_world.linear(); temp.world_to_local.linear() = temp.world_to_local.linear() * param.head<3>().cwiseInverse().asDiagonal(); - - std::cout << "After scale:" << std::endl; - std::cout << "local_to_world.linear():\n" << temp.local_to_world.linear() << std::endl; - std::cout << "world_to_local.linear():\n" << temp.world_to_local.linear() << std::endl; } break; case internal::transform_type::rotation: { auto rotation_matrix = Eigen::Quaterniond(param).toRotationMatrix(); @@ -40,14 +31,8 @@ std::pair subface::apply_transform(intern temp.world_to_local.linear() = temp.world_to_local.linear() * rotation_matrix.transpose(); } break; case internal::transform_type::translation: { - std::cout << "Before translation: " << std::endl; - std::cout << "Local to world: " << temp.local_to_world.translation() << std::endl; - std::cout << "World to local: " << temp.world_to_local.translation() << std::endl; temp.local_to_world.translation() += param.head<3>(); temp.world_to_local.translation() -= param.head<3>(); - std::cout << "After translation: " << std::endl; - std::cout << "Local to world: " << temp.local_to_world.translation() << std::endl; - std::cout << "World to local: " << temp.world_to_local.translation() << std::endl; } break; default: throw std::invalid_argument("Invalid transform type"); }