Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there I can't figure out how to use the arc constructor to create arc between two points
public static Arc CreateArcFromCenterAndTwoPoints(Point3d center, Point3d startPoint, Point3d endPoint)
{
var referenceVector = new Vector3d(0, -1, 0);
var startAngle = (startPoint - center).GetAngleTo(referenceVector, Vector3d.ZAxis);
var endAngle = (endPoint - center).GetAngleTo(referenceVector, Vector3d.ZAxis);
var arc = new Arc(center, center.DistanceTo(startPoint), startAngle, endAngle);
return arc;
}
When I draw arc in autocad the reference vector points straight down and angle is counted counter-clockwise from there, when I try to code this nothing works I get random arcs in random places with random lengths.
Solved! Go to Solution.