Avatar of Member_2_2394978
Member_2_2394978
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Drawing 'linked' circles

Hi All,

At the moment I am using http://www.mathworks.com/matlabcentral/fileexchange/2876 to draw many circles on one figure. The circles belong to many different classes, lets say 5, so i'm drawing each circle in a colour defining which class it comes from (see image before, just two classes here, so two colours).
What I want to do is some how link where they overlap, such like in image after. So where they overlap to remove the overlapping bits, but not if overlapped! Hopefully this will simply by, at current, very complicated plot!

Any suggestions?
Cheers
James
before.png
after.png
Programming Languages-OtherMath / ScienceProgramming

Avatar of undefined
Last Comment
Member_2_2394978

8/22/2022 - Mon
yuk99

Your question description and figures are confusing a little. As I understand from figures, you want to get circles of one class (let's say black ones) and remove segments where they intersect. Then do the same for another class (red) independently of the first class (in your case red circles do not intersect, so you don't remove anything for them). Am I correct?

If you are using the CIRCLE function to draw the circles, I suppose you still have variables like radius, centers coordinates, axes handles, right? Please confirm and I will send you  a code.
DanRollins

It seems to me that you could use
   CreateEllipticRgn
   http://msdn.microsoft.com/en-us/library/dd183496(VS.85).aspx
for each circle, then use Region API functions as CombineRgn
   Region Functions
   http://msdn.microsoft.com/en-us/library/dd162915(VS.85).aspx
or GDI+ Region functions such as Region::Intersect
    Region Class
    http://msdn.microsoft.com/en-us/library/ms534501(VS.85).aspx
to do the heavy lifting.
ASKER CERTIFIED SOLUTION
yuk99

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
yuk99

Original file names were with underscores, not dashes. It get changed after upload. EE bug? Rename dashes to upderscores, especially for the function file.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Member_2_2394978

ASKER
Thanks, I shall have a look at all suggestions and get back to you today :)
Member_2_2394978

ASKER
Wonderful thank you.