startAngle in Arc ctor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm programmatically transferring the Alignment Object from Autocad 2016 Civil3D to Revit.
The Alignment object has several properties, however, due to the limited number of constrcutors on the Arc class, only 1 Arc constructor is of interest:
public static Arc Create(
Plane plane,
double radius,
double startAngle,
double endAngle
)
Unfortunately the vector from which the startAngle is measured is not defined.
I have the following inforrmation from Autocad:
XYZ StartPoint = new XYZ(533.9217456, 144.1244247, 10);
XYZ CenterPoint = new XYZ(673.141807, -63.52377422, 10);
double Radius = 250;
XYZ EndPoint = new XYZ(760.14143, 170.849999, 10);
from these I can determine the following:
XYZ refVec = CenterPoint - XYZ.Zero;
XYZ xVec = (CenterPoint - StartPoint).Normalize();
XYZ yVec = (CenterPoint - EndPoint).Normalize();
XYZ normal = xVec.CrossProduct(yVec);
using the vectors from origin to CenterPoint and origin to StartPoint, I can determine the startAngle:
double DeflectedAngle = refVec.AngleTo(xVec);
With
double Delta = 0.94606029451277518;
this yields:
Plane plane = app.Create.NewPlane(normal, CenterPoint);
Arc arc = Arc.Create(plane, Radius, DeflectedAngle, DeflectedAngle + Delta);
However there is a small unexpected offset between the vector CenterPoint to StartPoint and the start of the arc, see attachment.
So my question is: from which vector is the startAngle measured?