Giovanni Gallo
Giovanni Gallo

Reputation: 5

Retrieve start and end point of an arc using NetDxf for c#

I need to retrieve the start and end point of an Arc entity using NetDxf to analyze my .Dxf file. So far i was only able to retrieve the center and the angle of the arc. Is there a way to retrieve the start and the end point using NetDxf library for c#?

Upvotes: 0

Views: 1279

Answers (1)

Lee Mac
Lee Mac

Reputation: 16025

In a DXF file, an arc is defined by the following properties:

  • Center (DXF 10)
  • Radius (DXF 40)
  • Start Angle (DXF 50)
  • End Angle (DXF 51)

Where the start/end angles are always measured counter-clockwise from the x-axis of the object-coordinate-system (OCS) plane in which the arc resides.

From these properties, you can easily obtain the start & end points by calculating points at an angle equal to either the start or end angle from the center point, at a distance equal to the radius, i.e.:

Start Point = Center + (Radius*cos(StartAngle), Radius*sin(StartAngle))

Upvotes: 3

Related Questions