Welcome to LEAD Support Forum Login | Register | Faq  

    LEAD Support Forum
  Resource to find answers and post technical questions about LEAD products.
Search    
   

VECTOR_ELLIPTICALARC enumerating wrong angles.
Started by ArtFenerty at 02-14-2008 12:08. Topic has 13 replies.

Print Search « Previous Thread Next Thread »
  02-14-2008, 12:08
ArtFenerty is not online. Last active: 10/14/2007 3:05:32 PM ArtFenerty

Top 50 Posts
Joined on 04-13-2007
Posts 33
VECTOR_ELLIPTICALARC enumerating wrong angles.

Attachment: Amach3Cannon1.zip
Reply Quote
Hi:

The VECTOR_ELLIPTICALARC is enumeration wrong start and end angles. Here is a file with only one elliptical arc in it, other cad programs report start and end angles of 150.66 and 243.831 or almost 93 degrees of arc, with 270 degrees of rotation, enumeration of the VECTOR_ELLIPTICALARC structure reports all good numbers except start angle of 69.4822 and sweep of 74.1823 , so a 74 degree sweep. This makes it impossible to use an elliptical arc in enumeration. This is latest leadtools V15.

Thanks
Art
   Report 
  02-14-2008, 15:29
GregR is not online. Last active: 8/29/2008 2:25:56 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,542
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
Which other CAD programs are you using to load the file and check the properties? 

Could you send a screenshot of the image properly displayed the properties of the arc as reported by the CAD application?

Greg Ross
LEADTOOLS Technical Support
   Report 
  02-16-2008, 10:22
ArtFenerty is not online. Last active: 10/14/2007 3:05:32 PM ArtFenerty

Top 50 Posts
Joined on 04-13-2007
Posts 33
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.

Attachment: acanon.jpg
Reply Quote
Hi:

QCad again. BUT leadtools displays the elliptical arc fine, it just doesnt enumerate to angles that agree. QCad's properties shows the angles as explained, but enumeration doesnt agree at all..

Art


   Report 
  02-18-2008, 11:19
GregR is not online. Last active: 8/29/2008 2:25:56 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,542
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
I have reproduced this problem and have reported it with the incident number 6682IDT.  This incident will be reviewed and prioritized by our engineering department.  I will contact you when I get more information from our developers.
 
If you have any more questions, please let me know.

Greg Ross
LEADTOOLS Technical Support
   Report 
  02-28-2008, 16:12
GregR is not online. Last active: 8/29/2008 2:25:56 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,542
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.

Attachment: eccentric_anamoly.jpg
Reply Quote
The developers working on your incident, 6682IDT, have let me know that it is not a bug.  This is just a difference in how the arc is calculated.

AutoCAD uses what is known as eccentric anomaly:

http://en.wikipedia.org/wiki/Eccentric_anomaly
http://mathworld.wolfram.com/EccentricAnomaly.html

To let you understand me more, I attached an image showing the difference between eccentric anomaly angle (which AutoCAD use) and the normal angle (which we use).

Anyway, to convert from eccentric anomaly to normal angle you can use the following formula:

start = atan2(ratio*sin(startEcc), cos(startEcc));
end = atan2(ratio*sin(endEcc), cos(endEcc));

Where:
startEcc, endEcc: the start and end angles measured in eccentric anomaly.
start, end: the start and end angles measured normally.
ratio: The ratio of minor axis to major axis.


Greg Ross
LEADTOOLS Technical Support
   Report 
  02-28-2008, 20:43
ArtFenerty is not online. Last active: 10/14/2007 3:05:32 PM ArtFenerty

Top 50 Posts
Joined on 04-13-2007
Posts 33
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
Thanks,
Art

   Report 
  02-29-2008, 10:58
ArtFenerty is not online. Last active: 10/14/2007 3:05:32 PM ArtFenerty

Top 50 Posts
Joined on 04-13-2007
Posts 33
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
Hi:

So is the enumerated data from VECTOR_ELLIPTICALARC in terms of startangle and sweepangle reporting the angles as ECC or as normals already converted by the above equation?

Thanks
Art

   Report 
  03-03-2008, 8:50
GregR is not online. Last active: 8/29/2008 2:25:56 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,542
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
LEADTOOLS' enumerated data is in terms of normals.

Greg Ross
LEADTOOLS Technical Support
   Report 
  03-03-2008, 21:09
ArtFenerty is not online. Last active: 10/14/2007 3:05:32 PM ArtFenerty

Top 50 Posts
Joined on 04-13-2007
Posts 33
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
But in the dxf starting this thread, the start angle is listed as 150.6617 (2.629596 Rads) , but leadtools enumberates that angle to StartAngle = 69.4822 with a sweep of 74.1823496 , where if I use the formulas above on the DXF data, I get
StartAngle of 159.4436 which sounds right ( with the reported ratio of .6672080154..). I cant seem to find any way the leadtools reported numbers come out right..
Would that be due to rotation or something, file reports a 270 degree rotation on that entity..?
But I dont "think" that would resolve to start angle of 60.4822 which is what LeadTools enumerates.. Its almost as if the value is 90 degrees out of position.. Can you show me how the start angle goes from a startP of 2.629596 in the DXF with a minor/major ratio of .667208154 to a startangle of 69.48 in the enumeration.. ( Sorry to be a pain , but I just cant figure a way to get the values needed to draw the eliptical arc ..)


Art


Art


   Report 
  03-04-2008, 10:19
GregR is not online. Last active: 8/29/2008 2:25:56 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,542
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
I could not resolve this either.  I've reopened the incident to get more details from the developer and make sure his equation is correct.  I'll contact you when I get more information.

Greg Ross
LEADTOOLS Technical Support
   Report 
  03-04-2008, 21:49
ArtFenerty is not online. Last active: 10/14/2007 3:05:32 PM ArtFenerty

Top 50 Posts
Joined on 04-13-2007
Posts 33
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
Greg:

Thx, I know its a complex issue to derive an answer to.. of all the support queries I do, its the strange ones like this one that take the longest to trace through. Takes hours to make sure Im not wasting your time with my own errors. :)

Art

   Report 
  03-05-2008, 9:54
GregR is not online. Last active: 8/29/2008 2:25:56 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,542
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
Thanks for asking questions, and it's not a waste of time.  It is possible for problems to exist or for mistakes to be made, and things like this will improve our product down the road.

Greg Ross
LEADTOOLS Technical Support
   Report 
  03-17-2008, 10:46
GregR is not online. Last active: 8/29/2008 2:25:56 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,542
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
I believe that the reason the final start angle reported in LEAD is rotated is because we are reporting the angles relative to the major axis.  Since the major axis in that file is vertical, then the -90 or 270 degree rotation gives the angle which we display.

I'm not 100% sure that this is the reason and I'm still waiting to hear back from the developer positively regarding it.

Greg Ross
LEADTOOLS Technical Support
   Report 
  04-07-2008, 9:21
GregR is not online. Last active: 8/29/2008 2:25:56 PM GregR



Top 10 Posts
Joined on 05-31-2006
In House
Posts 1,542
Re: VECTOR_ELLIPTICALARC enumerating wrong angles.
Reply Quote
The developer has gotten back to me and confirmed that they "rotate" the values based on wherever the major axis is. 

Here's the basic math going on underneath:

startEccDeg = 150.66;
endEccDeg = 243.831;
ratio = 0.667208;

startEccRad = startEccDeg * (Math.PI / 180); // 2.6295130510546567   
endEccRad = endEccDeg * (Math.PI / 180); // 4.2556537684302933   

startRad = Math.Atan2(ratio * Math.Sin(startEccRad), Math.Cos(startEccRad)); // 2.7827935832851476
endRad = Math.Atan2(ratio * Math.Sin(endEccRad), Math.Cos(endEccRad)); // -2.205592008474476

startDeg = startRad * (180 / Math.PI); // 159.44232757832611
endDeg = endRad * (180 / Math.PI); // -126.37111341336997 = 233.62888658663003

Then you just have to determine where the major axis is and rotate the values based on that.  Since this particular file has a major axis rotation of 270 degrees, your start and end angles are:

429.442327578232611 = 69.442327578232611
503.62888658663003 = 143.62888658663003

making the sweep 74.186559008397419.


Greg Ross
LEADTOOLS Technical Support
   Report 
Post
LEAD Support Fo... » Developer » Vector » VECTOR_ELLIPTICALARC enumerating wrong angles.

Powered by Community Server, by Telligent Systems