[TD]fix extension hole thread re scale/rotate
This commit is contained in:
@@ -1505,7 +1505,6 @@ void execExtendShortenLine(Gui::Command* cmd, bool extend)
|
||||
isCenterLine = true;
|
||||
centerEdge = objFeat->getCenterLine(uniTag);
|
||||
}
|
||||
// double scale = objFeat->getScale();
|
||||
Base::Vector3d direction = (P1 - P0).Normalize();
|
||||
Base::Vector3d delta = direction * activeDimAttributes.getLineStretch();
|
||||
Base::Vector3d startPt, endPt;
|
||||
@@ -2093,7 +2092,6 @@ void _createThreadLines(std::vector<std::string> SubNames, TechDraw::DrawViewPar
|
||||
float factor)
|
||||
{
|
||||
// create symbolizing lines of a thread from the side seen
|
||||
double scale = objFeat->getScale();
|
||||
std::string GeoType0 = TechDraw::DrawUtil::getGeomTypeFromName(SubNames[0]);
|
||||
std::string GeoType1 = TechDraw::DrawUtil::getGeomTypeFromName(SubNames[1]);
|
||||
if ((GeoType0 == "Edge") && (GeoType1 == "Edge")) {
|
||||
@@ -2109,10 +2107,22 @@ void _createThreadLines(std::vector<std::string> SubNames, TechDraw::DrawViewPar
|
||||
|
||||
TechDraw::GenericPtr line0 = std::static_pointer_cast<TechDraw::Generic>(geom0);
|
||||
TechDraw::GenericPtr line1 = std::static_pointer_cast<TechDraw::Generic>(geom1);
|
||||
Base::Vector3d start0 = line0->points.at(0);
|
||||
Base::Vector3d end0 = line0->points.at(1);
|
||||
Base::Vector3d start1 = line1->points.at(0);
|
||||
Base::Vector3d end1 = line1->points.at(1);
|
||||
// start and end points are scaled and rotated. invert the points
|
||||
// so the canonicalPoint math works correctly.
|
||||
Base::Vector3d start0 = DU::invertY(line0->getStartPoint());
|
||||
Base::Vector3d end0 = DU::invertY(line0->getEndPoint());
|
||||
Base::Vector3d start1 = DU::invertY(line1->getStartPoint());
|
||||
Base::Vector3d end1 = DU::invertY(line1->getEndPoint());
|
||||
// convert start and end to unscaled, unrotated.
|
||||
start0 = CosmeticVertex::makeCanonicalPoint(objFeat, start0);
|
||||
start1 = CosmeticVertex::makeCanonicalPoint(objFeat, start1);
|
||||
end0 = CosmeticVertex::makeCanonicalPoint(objFeat, end0);
|
||||
end1 = CosmeticVertex::makeCanonicalPoint(objFeat, end1);
|
||||
// put the points back into weird Qt coord system.
|
||||
start0 = DU::invertY(start0);
|
||||
start1 = DU::invertY(start1);
|
||||
end0 = DU::invertY(end0);
|
||||
end1 = DU::invertY(end1);
|
||||
if (DrawUtil::circulation(start0, end0, start1)
|
||||
!= DrawUtil::circulation(end0, end1, start1)) {
|
||||
Base::Vector3d help1 = start1;
|
||||
@@ -2120,17 +2130,13 @@ void _createThreadLines(std::vector<std::string> SubNames, TechDraw::DrawViewPar
|
||||
start1 = help2;
|
||||
end1 = help1;
|
||||
}
|
||||
start0.y = -start0.y;
|
||||
end0.y = -end0.y;
|
||||
start1.y = -start1.y;
|
||||
end1.y = -end1.y;
|
||||
float kernelDiam = (start1 - start0).Length();
|
||||
float kernelFactor = (kernelDiam * factor - kernelDiam) / 2;
|
||||
Base::Vector3d delta = (start1 - start0).Normalize() * kernelFactor;
|
||||
std::string line0Tag =
|
||||
objFeat->addCosmeticEdge((start0 - delta) / scale, (end0 - delta) / scale);
|
||||
objFeat->addCosmeticEdge(start0 - delta, end0 - delta);
|
||||
std::string line1Tag =
|
||||
objFeat->addCosmeticEdge((start1 + delta) / scale, (end1 + delta) / scale);
|
||||
objFeat->addCosmeticEdge(start1 + delta, end1 + delta);
|
||||
TechDraw::CosmeticEdge* cosTag0 = objFeat->getCosmeticEdge(line0Tag);
|
||||
TechDraw::CosmeticEdge* cosTag1 = objFeat->getCosmeticEdge(line1Tag);
|
||||
_setLineAttributes(cosTag0);
|
||||
|
||||
Reference in New Issue
Block a user