[TD]fix centerline rotation

This commit is contained in:
wandererfan
2023-09-23 12:16:17 -04:00
committed by WandererFan
parent a51c54e7f0
commit 084b33d3e4
5 changed files with 161 additions and 50 deletions

View File

@@ -353,3 +353,17 @@ TopoDS_Shape ShapeUtils::centerShapeXY(const TopoDS_Shape& inShape, const gp_Ax2
Base::Vector3d centroid = DrawUtil::toVector3d(inputCenter);
return ShapeUtils::moveShape(inShape, centroid * -1.0);
}
std::pair<Base::Vector3d, Base::Vector3d> ShapeUtils::getEdgeEnds(TopoDS_Edge edge)
{
std::pair<Base::Vector3d, Base::Vector3d> result;
TopoDS_Vertex tvFirst, tvLast;
TopExp::Vertices(edge, tvFirst, tvLast);
gp_Pnt gpFirst = BRep_Tool::Pnt(tvFirst);
gp_Pnt gpLast = BRep_Tool::Pnt(tvLast);
result.first = DU::toVector3d(gpFirst);
result.second = DU::toVector3d(gpLast);
return result;
}