- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone.
I'm a bit riddled by how conversion between the two types should work and whether it is what should be done. As I trace boundary of a 2d figure ( editor.TraceBoundary( ... ) ) I get a collection with - say - one Polyline object.
When I want to extract an arc segment from the polyline, I am using (polyline.GetArcSegment2dAt( ... )). The object I get is of type CircularArc2d.
If I save this object somewhere and pull it back later, how can I have it drawn? So far I tried to convert CircularArc2d to Arc:
CircularArc2d carc = ... Arc aarc = new Arc( Convertor.ToPoint3d(carc.Center), carc.Radius, carc.StartAngle, carc.EndAngle );
But that didn't turn out well. The circular arc seems to determine its start by the start point, having start angle = 0, while the arc understands this zero as "start from polar zero radians, as seen from the center". I tried to set a start point to the arc:
Arc aarc = new Arc(); aarc.StartPoint = Convertor.ToPoint3d(carc.StartPoint); aarc.EndPoint = Convertor.ToPoint3d(carc.EndPoint); aarc.Center = Convertor.ToPoint3d(carc.Center);
But that produces exception saying that setting start point isn't implemented for the Arc type.
I can go for calculating the start/end angle for Arc, but something tells me there must be a more elegant and more precise way to trace arcs, save them externally and use them later. I could use a hand with this one.
Thanks!
Solved! Go to Solution.

