[TD]Fix section of section

This commit is contained in:
wandererfan
2023-08-20 09:25:33 -04:00
committed by WandererFan
parent a51e46775f
commit 44c40067b2
3 changed files with 8 additions and 4 deletions

View File

@@ -579,7 +579,7 @@ TopoDS_Shape DrawUtil::shapeVectorToCompound(std::vector<TopoDS_Shape> vecIn, bo
}
}
if (invert) {
return TechDraw::mirrorShape(compOut);
return ShapeUtils::mirrorShape(compOut);
}
return compOut;
}

View File

@@ -278,7 +278,7 @@ TopoDS_Shape DrawViewSection::getShapeToCut()
TopoDS_Shape shapeToCut;
if (base->getTypeId().isDerivedFrom(TechDraw::DrawViewSection::getClassTypeId())) {
dvs = static_cast<TechDraw::DrawViewSection *>(base);
shapeToCut = dvs->getCutShape();
shapeToCut = dvs->getCutShapeRaw();
} else if (base->getTypeId().isDerivedFrom(TechDraw::DrawViewDetail::getClassTypeId())) {
dvd = static_cast<TechDraw::DrawViewDetail *>(base);
shapeToCut = dvd->getDetailShape();
@@ -463,7 +463,8 @@ void DrawViewSection::makeSectionCut(const TopoDS_Shape& baseShape)
waitingForCut(false);
}
//position, scale and rotate shape for buildGeometryObject
//! position, scale and rotate shape for buildGeometryObject
//! save the cut shape for further processing
TopoDS_Shape DrawViewSection::prepareShape(const TopoDS_Shape& rawShape, double shapeSize)
{
// Base::Console().Message("DVS::prepareShape - %s - rawShape.IsNull: %d shapeSize: %.3f\n",
@@ -479,6 +480,7 @@ TopoDS_Shape DrawViewSection::prepareShape(const TopoDS_Shape& rawShape, double
inputCenter = ShapeUtils::findCentroid(rawShape, m_projectionCS);
Base::Vector3d centroid(inputCenter.X(), inputCenter.Y(), inputCenter.Z());
m_cutShapeRaw = rawShape;
preparedShape = ShapeUtils::moveShape(rawShape, centroid * -1.0);
m_cutShape = preparedShape;
m_saveCentroid = centroid;

View File

@@ -153,6 +153,7 @@ public:
std::vector<PATLineSpec> getDecodedSpecsFromFile(std::string fileSpec, std::string myPattern);
TopoDS_Shape getCutShape() const { return m_cutShape; }
TopoDS_Shape getCutShapeRaw() const { return m_cutShapeRaw; }
TopoDS_Shape getShapeForDetail() const override;
@@ -182,7 +183,8 @@ protected:
int prefCutSurface() const;
bool trimAfterCut() const;
TopoDS_Shape m_cutShape;
TopoDS_Shape m_cutShape; // centered, scaled, rotated result of cut
TopoDS_Shape m_cutShapeRaw; // raw result of cut w/o center/scale/rotate
void onDocumentRestored() override;
void setupObject() override;