1.获取模型的轮廓
ThkOutline ClassName::GetCompOutLine(ThkAsmcomppath tPath)
{
//if ( tComp.IsEmpty())
//{
// return;
//}
ThkSolid tSld = tPath.GetMdl();
if (tSld.IsEmpty())
{
return ThkOutline();
}
Pro3dPnt points[2];
tSld.GetOutline(points);
ThkMatrix tMtx;
tMtx.InitByPath(tPath);
tMtx.GetGlobalPnt(points[0], points[0]);
tMtx.GetGlobalPnt(points[1], points[1]);
if (points[1][0] < points[0][0])
{
swap(points[0][0], points[1][0]);
}
if (points[1][1] < points[0][1])
{
swap(points[0][1], points[1][1]);
}
if (points[1][2] < points[0][2])
{
swap(points[0][2], points[1][2]);
}
ThkOutline tOutLine(points[0], points[1]);
return tOutLine;
}
2.判断模型直接是否干涉
bool ThkPipWeldDesignMng::DtmInterfere(ThkOutline tOutline1, ThkOutline tOutline2)
{
if (tOutline1.IsEmpty()&&tOutline2.IsEmpty())
{
return false;
}
if (!tOutline1.IsIntersection(tOutline2)