I want to attempt fixing shapebinder placement bug, reported here: https://forum.freecadweb.org/viewtopic.php?f=20&t=33794
I noticed, there is fusion going on under the hood, and it doesn't seem right to me. Shapebinder is only used for linking, and fusion is a great way to mess up the indexing. So I'd like to change it to a compound, but that might break some older projects (probably, very few).
The code:
https://github.com/FreeCAD/FreeCAD/blob ... r.cpp#L160
Code: Select all
Part::TopoShape ShapeBinder::buildShapeFromReferences( Part::Feature* obj, std::vector< std::string > subs) {
if (!obj)
return TopoDS_Shape();
if (subs.empty())
return obj->Shape.getShape();
//if we use multiple subshapes we build a shape from them by fusing them together
Part::TopoShape base;
std::vector<TopoDS_Shape> operators;
for (std::string sub : subs) {
if (base.isNull())
base = obj->Shape.getShape().getSubShape(sub.c_str());
else
operators.push_back(obj->Shape.getShape().getSubShape(sub.c_str()));
}
try {
if (!operators.empty() && !base.isNull())
return base.fuse(operators); // <---- !!!!!!!!!!
}
catch (...) {
return base;
}
return base;
}
Any objections for changing fusion to compounding?