几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量

几何尺寸与公差论坛------致力于产品几何量公差标准GD&T (GDT:ASME)|New GPS(ISO)研究/CAD设计/CAM加工/CMM测量 (http://www.dimcax.com/hust/index.php)
-   DirectDWG (http://www.dimcax.com/hust/forumdisplay.php?f=89)
-   -   【转帖】reading an arc (http://www.dimcax.com/hust/showthread.php?t=18344)

yang686526 2009-05-07 12:30 PM

【转帖】reading an arc
 
reading an arc
reading an arc
i am trying to read in a simple arc.
from the sample files, the entity appears to be read as a oddb2dpolyline with 4 verticies. some vertex information matches up nicely, other information is ???
i tried creating an oddbarc extension but it did not use it.
in odmfcapp it displays properly - nice little arc.
i am not sure what class to use to access the information and where that information is likely to be. i do know the arc is a 2d arc.
what possible classes should i try to access the line/arc information?
how do i get the arc information?
bill

if you see arc in odamfcapp, it doesn't mean you should use oddbarc entity to access data.
this entity can be oddb2dpolyline (with bulges), oddbpolyline, oddbellipse, oddbspline, et cetera.
the correct way reading entities is one that used in odreadex sample - to use protocol extensions for all entities. or you can try to cast oddbentityptr(using, e.g., oddbpolyline::cast() method) to pointer to some particular entity.
sincerely yours,
george udov
trying again - more basic help
i'll try to state my problem more clearly:
i know i have a line of some kind that goes from 3000,0 to 2000,1000. it sweeps from right to left with a radius of 1000 and a center point at 2000,0.
visually this creates a simple arc going from 3000,0 to 2000,1000. (top left quad of a circle with radius 1000)
both odmfcapp and odreadex tell me the entity is an oddb2dpolyline with 4 verticies.
vertex 1: 3000,0,0
vertex 2: 3000, 4.54747e-13, 0 with a double value of 0.414214
vertex 3: 2000,1000,0
vertex 4: 2000,1000,0
how do i tell there is a curve here and what its parameters are?
i do recognize the double value could be some variant of the chord length or the external ordinate of the curve. ??? i am just not familiar with dwg entities and how they are structured.

oddb2dpolyline is container of oddb2dvertex. oddb2dvertex has position (oddb2dvertex:osition()), but it also can have sart and end widths (oddb2dvertex::startwidth(), oddb2dvertex::endwidth()), bulge (oddb2dvertex::bulge()), et cetera.
bulge is tangent of quarter of arc's angle. default value for bulge is 0, it means arc's angle is infinity - corresponding oddb2dpolyline's segment is line segment.
in your example
vertex 1: 3000,0,0
vertex 2: 3000, 4.54747e-13, 0 with a double value of 0.414214
vertex 3: 2000,1000,0
vertex 4: 2000,1000,0
double value must be bulge, it means the curve from vertex1 to vertex2 is circular arc with angle atan(0.414214*4).
sincerely yours,
george udov
thanks again
thanks for the help again.


所有的时间均为北京时间。 现在的时间是 02:24 AM.