Skip to main content
Known Participant
August 24, 2017
Question

How To Distinguish Line,circle and Arcs in Current Document

  • August 24, 2017
  • 1 reply
  • 3367 views

Dear Friends,

     I am having path Arts in the current document.

     I read all the Path Arts by the Following code.

ASErr error=kNoErr;

AIArtSet artSet = NULL;

AIArtSet SelectartSet=NULL;

AIArtSpec specs[1] = {{kPathArt,0,0}};

error = sAIArtSet->NewArtSet(&artSet);

error = sAIArtSet->MatchingArtSet(specs, 1, artSet);

size_t numArts = 0;

sAIArtSet->CountArtSet(artSet, &numArts);

      Is It possible to find the Art is Circle or Line or Arc?.

      if it is Possible,give me your suggestions.

Thank you Friends,

Nathan

This topic has been closed for replies.

1 reply

A. Patterson
Inspiring
August 25, 2017

No, there's no help for you there I'm afraid. You'd have to do the math to determine what you're looking at -- which is not something I'd recommend frankly The best you can usually do is to iterate over the points and see if any of them are bezier or not (i.e. are thei n & out points the same as p?) -- that at least lets you rule our circle or arc.


But no, there's no classification. The AIPathSegment design encompasses all and does not try to classify; frankly, it would be very difficult to do it (personally, I don't think it's feasible).

Inspiring
August 27, 2017

Cumon, mister President Patterson, it's as easy as 1 2 3 :-)

Line - 2 points, zero area; circle - check the relation between length and area(you know, 2pi*r, pi*r*r); arc - 2 points, the same, boring.

I'm playing now with sine curves,this is a real pain in the back fun.

Known Participant
August 28, 2017

Dear Friend,

   Thank you For your Suggestion.

    please explain more about how to calculate the Area(If Circle means Area= pi*r*r,How to find r here), And How to distinguish between Line And Arc.

 

Thank you friend,

Nathan.