From 894249473b79abb672a31731e886115c36e1e9d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Tr=C3=B6ger?= Date: Sun, 22 Dec 2013 20:31:35 +0100 Subject: [PATCH] make nonrigid subbassemblys work when they hold subassemblys themself --- src/Mod/Assembly/App/ItemAssembly.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Mod/Assembly/App/ItemAssembly.cpp b/src/Mod/Assembly/App/ItemAssembly.cpp index 13be0c59a..fa39a2728 100644 --- a/src/Mod/Assembly/App/ItemAssembly.cpp +++ b/src/Mod/Assembly/App/ItemAssembly.cpp @@ -248,7 +248,7 @@ void ItemAssembly::initSolver(boost::shared_ptr parent, Base::Placement& if(parent) { if(Rigid.getValue() || stopped) { m_solver = parent->createSubsystem(); - m_solver->setTransformation(this->Placement.getValue()); + m_solver->setTransformation(PL_downstream*this->Placement.getValue()); stopped = true; //all below belongs to this rigid group //connect the recalculated signal in case we need to update the placement @@ -257,9 +257,12 @@ void ItemAssembly::initSolver(boost::shared_ptr parent, Base::Placement& else { m_solver = parent; PL_downstream *= this->Placement.getValue(); - m_downstream_placement = PL_downstream; } } + + //we always need to store the downstream placement as we may be a subassembly in a + //non-rigid subassembly + m_downstream_placement = PL_downstream; typedef std::vector::const_iterator iter; const std::vector& vector = Items.getValues(); @@ -305,7 +308,7 @@ void ItemAssembly::finish(boost::shared_ptr subsystem) { //assert(subsystem == m_solver); Base::Placement p = m_solver->getTransformation(); - this->Placement.setValue(p); + this->Placement.setValue(m_downstream_placement.inverse()*p); }; } //assembly