几何尺寸与公差论坛------致力于产品几何量公差标准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)
-   -   【转帖】drawing spline curves (http://www.dimcax.com/hust/showthread.php?t=15796)

yang686526 2009-05-04 08:10 PM

【转帖】drawing spline curves
 
drawing spline curves
drawing spline curves
i need to implement functionality that will draw a spline curve, and i am having difficulty figuring out how to generate a list of points to draw on the screen. i can get the control points, knots, etc. it seems like there ought to be a method in odªgeªnurbªcurve3d that would handle this, but if there is, i can't figure out which one it is. the documentation and sample code have not been too helpful with this, unfortunately, and my experimentation has not yielded good results.
thanks.
why don't you use the rendering classes embedded in dwgdirect - they are very powerful - you'll receive there any curve "exploded" to line segments?
or use the method getsamplepoints of the gecurve3d object to get a set of points on the spline?
regards
chudomir
thanks for the information. the getsamplepoints method is what i was looking for. i guess that i did not look far enough back up the class hierarchy from odgenurbcurve3d.
by the way, do you need to draw acdbspline entity or just a geometry object?
if so, how do you convert from acdbspline to the geometry object?
thanks.
obtaining odgenurbcurve3d from oddbspline
quote:
originally posted by chudo
by the way, do you need to draw acdbspline entity or just a geometry object?
if so, how do you convert from acdbspline to the geometry object?
thanks.
conversion from oddbspline to odgenurbcurve3d can be done through oddbspline::worlddraw() passing as parameter instantiation of odgiworlddraw interface (that should return pointers to instantiations of odgiworldgeometry, odgisubentitytraits, etc interfaces). odgenurbcurve3d object can be received through odgiworldgeometry::nurbs method. this method is more optimal then copying data (degree, knots, control points, etc).
sincerely yours,
george udov


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