PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Mon Dec 05, 2022 7:23 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Draw two simple arcs
PostPosted: Fri Sep 16, 2022 7:54 am 
Offline

Joined: Fri Sep 16, 2022 7:37 am
Posts: 3
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 257 times ]
File comment: right circle
rightCircle.PNG
rightCircle.PNG [ 6.87 KiB | Viewed 257 times ]
Top
 Profile  
Reply with quote  
 Post subject: Re: Draw two simple arcs
PostPosted: Fri Sep 16, 2022 8:27 am 
Offline
PDFsharp Expert
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 747
Location: CCAA
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

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
 Post subject: Re: Draw two simple arcs
PostPosted: Wed Sep 28, 2022 7:55 pm 
Offline

Joined: Fri Sep 16, 2022 7:37 am
Posts: 3
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group