Skip to content

Commit

Permalink
make nonrigid subbassemblys work when they hold subassemblys themself
Browse files Browse the repository at this point in the history
  • Loading branch information
ickby committed Dec 22, 2013
1 parent 5b6f681 commit 05523d5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Mod/Assembly/App/ItemAssembly.cpp
Expand Up @@ -247,7 +247,7 @@ void ItemAssembly::initSolver(boost::shared_ptr<Solver> 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
Expand All @@ -256,9 +256,12 @@ void ItemAssembly::initSolver(boost::shared_ptr<Solver> 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<App::DocumentObject*>::const_iterator iter;
const std::vector<App::DocumentObject*>& vector = Items.getValues();
Expand Down Expand Up @@ -304,7 +307,7 @@ void ItemAssembly::finish(boost::shared_ptr<Solver> subsystem) {

//assert(subsystem == m_solver);
Base::Placement p = m_solver->getTransformation<Base::Placement>();
this->Placement.setValue(p);
this->Placement.setValue(m_downstream_placement.inverse()*p);
};

} //assembly

0 comments on commit 05523d5

Please sign in to comment.