From bf8d5e7aa92f839ce4ba61fa876c899c7e5bc51d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tr=C3=B6ger?= Date: Sun, 4 Aug 2013 15:56:43 +0000 Subject: [PATCH] fix subassembly transformation bug --- src/Mod/Assembly/App/ItemAssembly.cpp | 1 + src/Mod/Assembly/App/ItemPart.cpp | 6 +----- src/Mod/Assembly/App/opendcm/module3d/clustermath.hpp | 8 +++++++- src/Mod/Assembly/App/opendcm/modulePart/module.hpp | 4 ++-- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Mod/Assembly/App/ItemAssembly.cpp b/src/Mod/Assembly/App/ItemAssembly.cpp index c1ff95d23..44e95c995 100644 --- a/src/Mod/Assembly/App/ItemAssembly.cpp +++ b/src/Mod/Assembly/App/ItemAssembly.cpp @@ -56,6 +56,7 @@ short ItemAssembly::mustExecute() const { App::DocumentObjectExecReturn* ItemAssembly::execute(void) { try { + //create a solver and init all child assemblys with subsolvers m_solver = boost::shared_ptr(new Solver); init(boost::shared_ptr()); diff --git a/src/Mod/Assembly/App/ItemPart.cpp b/src/Mod/Assembly/App/ItemPart.cpp index 097b9dd2e..f138668e6 100644 --- a/src/Mod/Assembly/App/ItemPart.cpp +++ b/src/Mod/Assembly/App/ItemPart.cpp @@ -174,11 +174,7 @@ boost::shared_ptr< Geometry3D > ItemPart::getGeometry3D(const char* Type) return boost::shared_ptr< Geometry3D >(); } }; -/* - std::stringstream s; - s<m_global; - Base::Console().Message("Added geom: %s, %s\n", Type, s.str().c_str()); -*/ + return geometry; } diff --git a/src/Mod/Assembly/App/opendcm/module3d/clustermath.hpp b/src/Mod/Assembly/App/opendcm/module3d/clustermath.hpp index 989ad3e0c..97592cc00 100644 --- a/src/Mod/Assembly/App/opendcm/module3d/clustermath.hpp +++ b/src/Mod/Assembly/App/opendcm/module3d/clustermath.hpp @@ -29,6 +29,8 @@ #include #include "defines.hpp" +#include "Base/Console.h" + #define MAXFAKTOR 1.2 //the maximal distance allowd by a point normed to the cluster size #define MINFAKTOR 0.8 //the minimal distance allowd by a point normed to the cluster size #define SKALEFAKTOR 1. //the faktor by which the biggest size is multiplied to get the scale value @@ -436,7 +438,11 @@ void ClusterMath::map_downstream::operator()(Geom g) { template void ClusterMath::map_downstream::operator()(boost::shared_ptr c) { - m_transform *= c->template getClusterProperty().getTransform().inverse(); + //we transform the GLOBAL geometries to local ones in the subcluster! therefore + //we are not interested in the successive transformations, we only transform the + //global geometries with the cluster transform we want them to be local in, and thats + //the one supplied in the constructor + //m_transform *= c->template getClusterProperty().getTransform().inverse(); }; diff --git a/src/Mod/Assembly/App/opendcm/modulePart/module.hpp b/src/Mod/Assembly/App/opendcm/modulePart/module.hpp index 8334c2c8a..3e13ec294 100644 --- a/src/Mod/Assembly/App/opendcm/modulePart/module.hpp +++ b/src/Mod/Assembly/App/opendcm/modulePart/module.hpp @@ -314,8 +314,8 @@ ModulePart::type::Part_base::addGeometry3D(const T& geom, Coo //we need to collect all transforms up to this part! Transform t; transform_traverse(t, m_cluster); - - g->transform(t); + + g->transform(t); } fusion::vector res = m_cluster->addVertex();