使用UF函数可以获取圆弧边或圆弧线中心点和半径:
1.使用 UF_CURVE_ask_arc_data:
theUf.Curve.AskArcData(edge.Tag, out UFCurve.Arc arc);
theUf.Curve.CreateArc(ref arc, out Tag arc_tag);
double[] matrix_values = new double[9];
double[] vec_product = new double[3];
theUf.Csys.AskMatrixValues(arc.matrix_tag, matrix_values);
theUf.Mtx3.VecMultiply(arc.arc_center, matrix_values, vec_product);
2.使用 UF_EVAL_ask_arc:
uf.Eval.Initialize(iEdge.Tag, out var evaluator);
uf.Eval.IsArc(evaluator, out var isArc);
if (isArc)
{
uf.Eval.AskArc(evaluator, out var arc);
center = arc.center.ToPoint3d();
radius = arc.radius;
}
else
{
uf.Eval.AskEllipse(evaluator, out var ellipse);
center = ellipse.center.ToPoint3d();
radius = ellipse.minor;
}