PartDesign: Apply pattern transform in Feature not VP
This is followup for https://github.com/FreeCAD/FreeCAD/pull/26563 which fixed previews for a given file but broke it for others. This approach should be more robust as it is applied in the Feature itself and not on view provider level which should give us more precise control and per feature transform ability.
This commit is contained in:
committed by
Chris Hennes
parent
800990bacd
commit
4fae2b83f8
@@ -104,19 +104,6 @@ void ViewProviderTransformed::updatePreview()
|
||||
|
||||
try {
|
||||
if (auto feature = getObject<PartDesign::Transformed>()) {
|
||||
const Part::Feature* supportFeature = feature->getBaseObject();
|
||||
const Part::TopoShape& supportShape = supportFeature->Shape.getShape();
|
||||
|
||||
if (supportShape.isNull()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Base::Matrix4D invertedSupportMatrix;
|
||||
Part::TopoShape::convertToMatrix(
|
||||
supportShape.getShape().Location().Transformation().Inverted(),
|
||||
invertedSupportMatrix
|
||||
);
|
||||
|
||||
auto originals = feature->getOriginals();
|
||||
auto transforms = feature->getTransformations(originals);
|
||||
|
||||
@@ -133,7 +120,7 @@ void ViewProviderTransformed::updatePreview()
|
||||
auto sep = new SoSeparator;
|
||||
|
||||
auto transformNode = new SoTransform;
|
||||
transformNode->setMatrix(convert(transformMatrix * invertedSupportMatrix));
|
||||
transformNode->setMatrix(convert(transformMatrix));
|
||||
|
||||
sep->addChild(transformNode);
|
||||
sep->addChild(pcPreviewShape);
|
||||
|
||||
Reference in New Issue
Block a user