PartDesign: change feature DressUp behavior when used for pattern

Repurpose DressUp.SupportTransform property to define the following
behavior,

* When disabled (default), only the dressing will be used for patterning.

* When enabled, the additive/subtractive shape of the dressed base
  feature will be used for patterning. Any dressing that is not applied
  to the based feature will be ignored.

* If the dressing is applied to non-additive/subtractive feature, then
  only the dressing will be used for patterning.

New API FreatureAddSub::getAddSubShape() is added to account for the
fact that a dressing (e.g. a fillet) can be either additive or
subtractive, which means that a DressUP feature may contain both
additive and subtractive shapes.

FeatureTransformed is modified to perform both fusion and cut if
required.
This commit is contained in:
Zheng, Lei
2020-03-21 15:22:48 +08:00
committed by wmayer
parent 8b23d814f8
commit a045f58a85
6 changed files with 162 additions and 99 deletions

View File

@@ -195,16 +195,17 @@ void ViewProviderTransformed::recomputeFeature(bool recompute)
for (PartDesign::Transformed::rejectedMap::const_iterator o = rejected_trsf.begin(); o != rejected_trsf.end(); o++) {
if (o->second.empty()) continue;
TopoDS_Shape shape;
Part::TopoShape fuseShape;
Part::TopoShape cutShape;
if ((o->first)->getTypeId().isDerivedFrom(PartDesign::FeatureAddSub::getClassTypeId())) {
PartDesign::FeatureAddSub* feature = static_cast<PartDesign::FeatureAddSub*>(o->first);
shape = feature->AddSubShape.getShape().getShape();
feature->getAddSubShape(fuseShape, cutShape);
}
if (shape.IsNull()) continue;
if (fuseShape.isNull()) continue;
// Display the rejected transformations in red
TopoDS_Shape cShape(shape);
TopoDS_Shape cShape(fuseShape.getShape());
try {
// calculating the deflection value