Discussion:
Bezier curves
Jim Hurley
2004-05-01 11:51:24 UTC
Permalink
Greetings all,

An earlier thread on Bezier Curves peaked my interest; in particular,
how do you program the multi-point bezier curve? Alejandro Tejada
showed us how to draw the basic bezier unit, a bezier line with two
end points each with its own tangent control.

It turns out that the multi-point bezier line can be made up of a
combination of these basic units. Since only nearest neighbors
interact on a bezier line, all that is needed is to allow nearest
neighbors of these basic units to talk to one another--gossip over
the fence.

Draw the basic shape in RR using the polygon tool. The plug-in then
uses that graphic as a template for the bezier curve, replacing the
polygon points with bezier handles and the intervening straight line
with a bezier line.

It allows for both corner points and continuous tangent points.

And, because it interests me, I have included a little bit about the
underlying mathematics in a substack.

If you have need of bezier lines you will find this plug-in at:

http://home.infostations.net/jhurley/

and look for Bezier Line under Utilities.

Jim
Alejandro Tejada
2004-05-02 04:26:26 UTC
Permalink
on Sat, 1 May 2004
Jim Hurley wrote:

[snip]
Post by Jim Hurley
If you have need of bezier lines you will find this
http://home.infostations.net/jhurley/
and look for Bezier Line under Utilities.
Excellent!!!
Thanks a lot for sharing this work, Jim.

It could be enlightening that you explain
to the list how did work the code of this grouped
object.

The size of the uncompressed stack is huge!... Why?

Does this works in MetaCard too or contains Rev
specific code? Could I link from my website to your
page?

Thanks in advance!

al

=====
Visit my site:
http://www.geocities.com/capellan2000/
Search the mail list:
http://mindlube.com/cgi-bin/search-use-rev.cgi




__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover
Jim Hurley
2004-05-02 20:55:38 UTC
Permalink
Message: 9
Date: Sat, 1 May 2004 21:26:26 -0700 (PDT)
Subject: Re: Bezier curves
Content-Type: text/plain; charset=us-ascii
on Sat, 1 May 2004
[snip]
Post by Jim Hurley
If you have need of bezier lines you will find this
http://home.infostations.net/jhurley/
and look for Bezier Line under Utilities.
Excellent!!!
Thanks a lot for sharing this work, Jim.
It could be enlightening that you explain
to the list how did work the code of this grouped
object.
Al,

I didn't protect the stack. But I can't say that the code is self
explanatory. I'm terrible at commenting my scripts.

It is mostly a matter of sending messages to the adjacent line and
tangent controls as well as to the bezier line. The tangent controls
set the values of r2 and r3 as custom properties of the bezier
graphic line. There are a lot a little details I ran into in getting
this to work properly, particularly in forcing the slopes of the two
adjacent tangent controls to be equal (when operating in the
continuous tangent mode).

In the dragging of the entire bezer line, it is necessary to get the
loc of all the groups and the displacement between the current mouse
loc and the group locs. In this way all the groups move together with
the mouse.

The code for drawing the bezier line is stored in the line itself and
is pretty straight forward; it is similar to yours:

on DrawBezierLine
--The four control vectors are r1, r2, r3, and r4. They are custom
properties of the bezier grc.
put the r1 of me into pt1
put the r2 of me into pt2
put the r3 of me into pt3
put the r4 of me into pt4
repeat with i = 0 to 50 -- 0 to 50 is probably sufficient
put i/50 into t
put 1-t into s
repeat with j = 1 to 2
put round(s*s*s*item j of pt1 + 3*s*s*t*item j of pt2 + \
3*s*t*t*item j of pt3 + t*t*t*item j of pt4) into item j of thePt
end repeat
put thePt & return after tPoints
end repeat
--"The owner of me" is the group that the bezier line belongs to.
--There are as many bezier line segments as there are line controls,
each line in its own group
set the points of grc "BezierLine" of the owner of me to tPoints
end DrawBezierLine
The size of the uncompressed stack is huge!... Why?
Yes, that bothered me as well. But most of the size is in the help
substack. As you will see in that substack, you can reduce the size
of the potential plug-in by deleting or decoupling the help stack. In
this way, the size of the bezier plug-in itself is reduced to 116K. I
think you may enjoy the discussion of the math in that stack.
Does this works in MetaCard too or contains Rev
specific code? Could I link from my website to your
page?
I can't say if it would work in MC. Probably. I don't think there is
any RR specific code.

Yes, by all means link us up.
Thanks in advance!
al
Bill
2004-05-04 21:25:12 UTC
Permalink
I found so me good info on using RevDB at this link:

http://groups.yahoo.co.jp/group/Runtime_Revolution_Users_Japan/messages/1602
?viscount=-15&expand=1

It looks like quit a bit of information and examples of accessing mysql and
setting up the links to send data from a RunRev form to mysql but it is
mostly in Japanese.
Klaus Major
2004-05-04 21:53:15 UTC
Permalink
Hi Bill,
Post by Bill
http://groups.yahoo.co.jp/group/Runtime_Revolution_Users_Japan/
messages/1602
?viscount=-15&expand=1
It looks like quit a bit of information and examples of accessing mysql and
setting up the links to send data from a RunRev form to mysql but it is
mostly in Japanese.
Cool URL, but definitively NOT for us regular gaijins :-)

Sayonara

Klaus Major
***@major-k.de
www.major-k.de

Loading...