Re: Wrong sweepangles and arc starts in DXF.
Started by ArtFenerty at 11-11-2007 10:59. Topic has 8 replies.
|
|
11-11-2007, 10:59
|
ArtFenerty
Joined on 04-13-2007
Posts 33
|
|
|
Hi:
The included DXF fails in enumeration as the arc segements are all misplaced. The segments use a large radius, and it seems impossible to compute the actual start and end positions of the arcs in relation to each other. Is there some other way to get an arc than just a sweepangle and start angle,
or are the values being reported incorrectly? I suspect its a problem where there isnt enough decimals precision to get an accurate start and end position calcuated fromt he information provided in the enumeration.. Is there any solution to this? Im using LeadTools v15.
Thanks
Art
fenerty@artofcnc.ca
|
|
|
|
|
Report
|
|
|
|
11-12-2007, 22:26
|
ArtFenerty
Joined on 04-13-2007
Posts 33
|
Re: Wrong sweepangles and arc starts in DXF.
|
 
 
|
|
|
Hi :
Im enumerating in my own code. It when the object is reported to me as an arc object, what
Im fed is the startangle, endangle, and sweepangle, but they dont compute to the proper endpoints. Ill disolve the drawing down and resubmit this one to show the error. I have no doubt your viewer display properly, but I dont use it, I only use the enumeration rouines, and the data passed is wrong..
Thanks
Art
|
|
|
|
|
Report
|
|
|
|
11-12-2007, 22:51
|
ArtFenerty
Joined on 04-13-2007
Posts 33
|
|
|
Hi:
Here it is pared down. The trouble is, while Acad, and other cad programs open this, when its enumerated it comes in as a few lines, and several arcs. The arcs have a radius in the order of 11,720 and when applied to the start and end angles and sweepangles , the result is a line in which the start end endpoints do not match, they are quite far off each other. I cant find any rational in how to recompute the end points. I suspect its an error in the bulge factor of this "polyline?" entity. Ive narrowed the drawging to this one polyline, but as a collection of lines and arcs sent to me in enumeration, they will not match start and end points. I suspect the radius is so large that a calculation breaks down internally somewhere, for example, the start angle on the arc is set to 276 degrees? with a sweep of -.03887687687 degrees. Ok, but iof I compute that to start and end points, they dont match the lines sent in the line enumeration. Since its a polyline, all the start and end points shoudl form a line, but they dont.
So if Im not useing your display code, its impossible to reconstruct the objects in this dxf to a polyline..
Thanks
Art
|
|
|
|
|
Report
|
|
|
|
11-12-2007, 22:53
|
ArtFenerty
Joined on 04-13-2007
Posts 33
|
Re: Wrong sweepangles and arc starts in DXF.
Attachment: trouble.jpg
|
 
 
|
|
|
Heres a snapshot of the resultant line when calcuated, as you can see they dont computer to a polyline, bulged or not..
Art
|
|
|
|
|
Report
|
|
|
|
11-14-2007, 7:12
|
Qasem Lubani

Joined on 08-13-2006
Posts 1,187
|
Re: Wrong sweepangles and arc starts in DXF.
|
 
 
|
|
|
Can you give me all
the coordinate numbers of the object you suspect is incorrect, so that I can
inspect that object here?
Qasem Al-Lubani LEAD Technical Support www.leadtools.com
|
|
|
|
|
Report
|
|
|
|
11-14-2007, 13:15
|
ArtFenerty
Joined on 04-13-2007
Posts 33
|
Re: Wrong sweepangles and arc starts in DXF.
|
 
 
|
|
|
Hi:
Well, lets just look at the first 3 entities in this polyline.. Here they are as reported by the enumeration of the vector objects..
Start of object
1)
Vector_arc:
radius: 11709.905773810398
startangle: 276.08711409853908
sweep: -.038258181462521017
center: -1025.0222608022084 , 11723.197041138523
computes to: startx,starty = 216.70130739240949, 79.313848160840280
endx, endy = 208.92604667588921, 78.487306413915576
2)
Vector_arc:
radius: 406.92081461923357
startangle: 276.01999582464191
sweep: -0.22931992340708959
center: 188.04322532625247 , 485.51013825845047
computes to: startx,starty = 230.71926470385580, 80.833347432213543
endx, endy = 229.09925380092147, 80.665783109131610
3)
vector_line:
startx: 229.88320599999972
starty: 80.749159000000006
endx: 228.96563100000000
endy: 90.755679999999998
As you can see, then line starting on item 3, does not start at the X,Y end of entitiy #2. This is a polyline though, so they must, the end of one entity must begin the next entity. Im using as high a precision as is possibel to compute the start and end points from the sweep angle and start angle.. as in
ent->endy = ent->centery + (sin( (endangle * 3.1415926535897932)/180)* ent->radius);
ent->endx = ent->centerx + (cos( (endangle * 3.1415926535897932)/180) * ent->radius);
Thanks
Art
|
|
|
|
|
Report
|
|
|
|
12-23-2007, 9:15
|
Qasem Lubani

Joined on 08-13-2006
Posts 1,187
|
Re: Wrong sweepangles and arc starts in DXF.
|
 
 
|
|
|
This is in regards to incident number 6381AMN. Our engineers have updated the status on the incident and marked it as fixed in the latest build of LEADTOOLS 15. Please send an email to support@leadtools.com containing your serial number for patches download instructions.
Qasem Al-Lubani LEAD Technical Support www.leadtools.com
|
|
|
|
|
Report
|
|
|
|
|
LEAD Support Fo... » Developer » Vector » Re: Wrong sweepangles and arc starts in DXF.
|
|
Copyright LEAD Technologies, Inc. 2008
