When attempting to write Arc.StartAngle using the Rhino API, consistently returns zero. Is this the expected behavior?"
We are using the following code and getting startAngle value always zero.
if (geometry is ArcCurve)
{
ArcCurve arcCurve = geometry as ArcCurve;
Point3d center = arcCurve.Arc.Center * scale;
Point3d startPoint = arcCurve.Arc.StartPoint * scale;
Vector3d radiusVector = new Vector3d(startPoint - center);
Vector3d normalVector = arcCurve.Arc.Plane.Normal * scale;
double startAngle = arcCurve.Arc.StartAngle;
double endAngle = arcCurve.Arc.EndAngle;
}
Hi @Shital_Naphade,
In Rhino, an arc consists of:
In most cases the starting angle (Interval.Min
) is 0.0, which indicates that the arc begins at a point on the plane’s x-axis at the specified radius from the plane’s origin.
Hope this helps.
– Dale
Is there any Rhino API available for writing an arc using the center, start point, and angle?
Hi @Shital_Naphade,
You might start with Arc constructor that has this signature:
Arc(Plane plane, double radius, double angleRadians)
An arc’s start point falls on it’s plane’s x-axis. Thus, the input plane should be oriented in this manner. The center point of an arc is it’s plane’s origin. The remaining parameters should be obvious.
Does this help?
– Dale
Thanks for the suggestion.
I have one more query: Even if we pass the angle in radians, such as 1.57, in which direction will the arc be created? (Clockwise or counterclockwise?)
Counterclockwise if the value is positive, clockwise if the angle is negative.
Check the orientation of your plane’s Z axis…. It’s probably the inverse of what you think.
Thanks for your help, the problem is resolved.