No, I don't think this is a bug. This should do it:
Arc convertArc2Arc( CircularArc3d arc )
{
Vector3d refVec = arc.ReferenceVector;
Plane plane = new Plane(arc.Center, arc.Normal);
double ang = refVec.AngleOnPlane(plane);
return new Arc(arc.Center, arc.Normal, arc.Radius,arc.StartAngle + ang,
arc.EndAngle + ang );
}
Albert
wrote in message news:4897476@discussion.autodesk.com...
I want to get an arc passing through three given points.I use the
CircularArc3d class to get the center,radius,startAngle and endAngle of the
arc.But the arc does not pass through the three points.
static public void test() // This method can have any name
{
// Put your command code here
Point3d pt1=new Point3d(0,0,0);
Point3d pt2=new Point3d(10,10,0);
Point3d pt3=new Point3d(10,20,0);
CircularArc3d cirArc=new circularArc3d(pt1,pt2,pt3);
Arc arc=new
Arc(cirArc.Center,cirArc.Radius,cirArc.StartAngle,cirArc.EndAngle);
Database db=Application.DocumentManager.MdiActiveDocument.Database;
DBTransMan tm=db.TransactionManager;
using(Transaction trans=tm.StartTransaction())
{
BlockTable bt=(BlockTable)tm.GetObject(db.BlockTableId,OpenMode.ForRead);
BlockTableRecord
btr=(BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace],OpenMode.ForWrite);
btr.AppendEntity(arc);
tm.AddNewlyCreatedDBObject(arc,true);
trans.Commit();
}
}