Is there a bezierDDA API? 
Author Message
 Is there a bezierDDA API?

Hi all,

I was wondering if there is a kind of "BezierDDA" API, which will enumerate
all points in a bezier curve, just like LineDDA. If it exists I cannot find
it. Any clues? Any alternatives maybe?

TIA
Aristotelis



Sun, 01 May 2005 01:54:02 GMT  
 Is there a bezierDDA API?

Quote:
> I was wondering if there is a kind of "BezierDDA" API, which will
enumerate
> all points in a bezier curve, just like LineDDA. If it exists I cannot
find
> it. Any clues? Any alternatives maybe?

Not really, the DDA algorithm works by exploiting the symmetrical and
(Excuse me for pointing out the obvious) linear properties of a line which
of course don't work in the same way for a curve.  You can however use a
cubic function to extrapolate points from the curve and run a LineDDA on
each segment.
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/




Sun, 01 May 2005 00:33:58 GMT  
 Is there a bezierDDA API?
Sorry If I did not make myself clear; I was hoping to avoid the math stuff!

 I dont want to draw the curve myself, I just want the points of the curve
with a "callback" function, so that after, say, 100 points I would connect
the two ends with a straight line. The smaller the interval, the better the
approximation. The points would be "connected" in a DXF file that I have to
create. Something like the Bresenham algorithm but for a bezier curve.

I am sure that this API exists. Maybe it is not documented, but if there is
an API for the drawing of these curves, then there must be an api that
enumerates the points.

TIA,
Aristotelis



Quote:
> > I was wondering if there is a kind of "BezierDDA" API, which will
> enumerate
> > all points in a bezier curve, just like LineDDA. If it exists I cannot
> find
> > it. Any clues? Any alternatives maybe?

> Not really, the DDA algorithm works by exploiting the symmetrical and
> (Excuse me for pointing out the obvious) linear properties of a line which
> of course don't work in the same way for a curve.  You can however use a
> cubic function to extrapolate points from the curve and run a LineDDA on
> each segment.
> Hope this helps,

>     Mike

>  -- EDais --

>  - Microsoft Visual Basic MVP -
> WWW: Http://EDais.earlsoft.co.uk/





Mon, 02 May 2005 03:40:36 GMT  
 Is there a bezierDDA API?
Quote:
> Sorry If I did not make myself clear; I was hoping to avoid the math

stuff!

It's not too difficult to find the code online and convert it to VB - Most
mathematics stays pretty much the same between the two languages.

Quote:
>  I dont want to draw the curve myself, I just want the points of the curve
> with a "callback" function, so that after, say, 100 points I would connect
> the two ends with a straight line. The smaller the interval, the better
the
> approximation. The points would be "connected" in a DXF file that I have
to
> create. Something like the Bresenham algorithm but for a bezier curve.

The curve is most likely drawn as a series of line segment each in turn draw
with a Bresenham or similar routine.

Quote:
> I am sure that this API exists. Maybe it is not documented, but if there
is
> an API for the drawing of these curves, then there must be an api that
> enumerates the points.

Have a look at GDI32.dll in the dependency walker, you'll see that the only
*DDA function is LineDDA().
What you can do though is convert the output of the PolyBezier() API to a
path then get the line segments from that.  I did some digging and found
this article which you may find useful:
<watch for wrap>
http://msdn.microsoft.com/library/en-us/dngdi/html/msdn_hittest2.asp
</watch for wrap>
Hope this helps,

    Mike

 -- EDais --

 - Microsoft Visual Basic MVP -
WWW: Http://EDais.earlsoft.co.uk/




Mon, 02 May 2005 03:45:24 GMT  
 Is there a bezierDDA API?
Interesting article, I think it will do. Thanx mike!

Aristotelis



Quote:
> > Sorry If I did not make myself clear; I was hoping to avoid the math
> stuff!

> It's not too difficult to find the code online and convert it to VB - Most
> mathematics stays pretty much the same between the two languages.

> >  I dont want to draw the curve myself, I just want the points of the
curve
> > with a "callback" function, so that after, say, 100 points I would
connect
> > the two ends with a straight line. The smaller the interval, the better
> the
> > approximation. The points would be "connected" in a DXF file that I have
> to
> > create. Something like the Bresenham algorithm but for a bezier curve.

> The curve is most likely drawn as a series of line segment each in turn
draw
> with a Bresenham or similar routine.

> > I am sure that this API exists. Maybe it is not documented, but if there
> is
> > an API for the drawing of these curves, then there must be an api that
> > enumerates the points.

> Have a look at GDI32.dll in the dependency walker, you'll see that the
only
> *DDA function is LineDDA().
> What you can do though is convert the output of the PolyBezier() API to a
> path then get the line segments from that.  I did some digging and found
> this article which you may find useful:
> <watch for wrap>
> http://msdn.microsoft.com/library/en-us/dngdi/html/msdn_hittest2.asp
> </watch for wrap>
> Hope this helps,

>     Mike

>  -- EDais --

>  - Microsoft Visual Basic MVP -
> WWW: Http://EDais.earlsoft.co.uk/





Mon, 02 May 2005 16:42:07 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. CreateFile - API, Am I a Pudding?

2. Help with API Calls please.........I am at wits end :(

3. FAQ NEEDED: I am looking for API faq

4. What am I doing wrong ? (Win32 API - GetActiveWindow)

5. What am I doing wrong ? (Win32 API - GetActiveWindow)

6. What am I missing in the API call?

7. I am using the GetVersionEx API call

8. What am I doing wrong ? (Win32 API - GetActiveWindow)

9. I am trying to update a record, i am not using data control

10. I am learning VB.NET and am wondering....

11. I am trying to update a record, i am not using data control

12. When is 5:00 AM not 5:00 AM? When it's 5:00 AM.

 

 
Powered by phpBB® Forum Software