0

I managed to read DXF arcs and render them into a 3D Canvas I made. See attached image.

To render the 2D arcs I "cut" them into small linear segments (small lines) and then I draw them on my canvas.

I wonder if there is a way to use the Java QuadCurve2D awt object in order to graphically represent the Arcs on a Canvas. Any help will be really appreciated.

On the attached image you can see the data I have for each arc Start Point, Center Point, End Point, Stat Angle, End Angle, Width and Height

enter image description here

Nikos
  • 67
  • 5
  • I do not code in JAVA but most gfx api has some form of elliptic arc primitive you could use that ... I am converting 2D DXF into SVG and for arces I use elliptic arc ... Yes you can use `QuadCurve2D` to emulate circular arc too but you have to compute the control point or coefficient so it matches ... – Spektre Jun 15 '22 at 09:29
  • The control point is my main problem... I cannot figure out a way to generate it.... – Nikos Jun 15 '22 at 14:25
  • I do not code in JAVA so I can only guess its BEZIER so you have to write the Bernstein polynomials then convert to circle equation form and after that extract the control points that will convert BEZIER control points into specific circle ... there are also direct equations to represent circle as set of BEZIERs however they are IIRC cubic BEZIERs ... from a quick search see https://stackoverflow.com/q/1734745/2521214 – Spektre Jun 15 '22 at 14:54

0 Answers0