PDFsharp & MigraDoc Foundation
https://forum.pdfsharp.net/

Draw two simple arcs
https://forum.pdfsharp.net/viewtopic.php?f=2&t=4392
Page 1 of 1

Author:  tia [ Fri Sep 16, 2022 7:54 am ]
Post subject:  Draw two simple arcs

Good morning to every one, i have found a problem to draw two easy arcs. In detail here the two arc added to the var path = new XGraphicPath():

path.AddArc(new XPoint(45,25), new XPoint(5,25), new XSize(20, 20), 0, false, true);
path.AddArc(new XPoint(5,25), new XPoint(45,25), new XSize(20, 20), 0, false, true);

The right result should be a perfect circle (see right circle picture attached) but the result i have obtained is two arcs on top of each other. (see wrong circle picture attached)

Can some one help me about it? is it a bug or am i missing something? Thanks a lot for your time.

Attachments:
File comment: wrong circle
wrongCircle.PNG
wrongCircle.PNG [ 2.39 KiB | Viewed 2492 times ]
File comment: right circle
rightCircle.PNG
rightCircle.PNG [ 6.87 KiB | Viewed 2492 times ]

Author:  TH-Soft [ Fri Sep 16, 2022 8:27 am ]
Post subject:  Re: Draw two simple arcs

Hi!
Not my area of expertise.
Maybe this post can help:
https://stackoverflow.com/q/59566021/162529

rotationAngle is 0 for both arcs and direction is also the same. Have you tried different angles and/or different directions?

See also:
http://forum.pdfsharp.net/viewtopic.php?f=2&t=832

Author:  tia [ Wed Sep 28, 2022 7:55 pm ]
Post subject:  Re: Draw two simple arcs

the problem appears with the nuget pdfsharp library using wpf. I need to achieve the "right circle" result with the following two lines.

path.AddArc(new XPoint(45,25), new XPoint(5,25), new XSize(20, 20), 0, false, true);
path.AddArc(new XPoint(5,25), new XPoint(45,25), new XSize(20, 20), 0, false, true);

To test these two lines I have tried the same input with the ArcSegment WPF class and it works.

It seems a bug in pdfsharp, i have tried also to modified the path.AddArc start and end points without using start-end points aligned in x or y axis and it works.

Thanks again if help me to understand the problem.

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/