diff --git a/src/Mod/Assembly/App/ItemAssembly.cpp b/src/Mod/Assembly/App/ItemAssembly.cpp index 08d57d52..1893c934 100644 --- a/src/Mod/Assembly/App/ItemAssembly.cpp +++ b/src/Mod/Assembly/App/ItemAssembly.cpp @@ -247,7 +247,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 @@ -256,9 +256,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(); @@ -304,7 +307,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