JPH0778260A - Continuous curve generator - Google Patents

Continuous curve generator

Info

Publication number
JPH0778260A
JPH0778260A JP5246024A JP24602493A JPH0778260A JP H0778260 A JPH0778260 A JP H0778260A JP 5246024 A JP5246024 A JP 5246024A JP 24602493 A JP24602493 A JP 24602493A JP H0778260 A JPH0778260 A JP H0778260A
Authority
JP
Japan
Prior art keywords
input coordinate
point
length
points
dist
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP5246024A
Other languages
Japanese (ja)
Other versions
JP3214185B2 (en
Inventor
Shin Mikuni
伸 三国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Casio Computer Co Ltd
Original Assignee
Casio Computer Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Casio Computer Co Ltd filed Critical Casio Computer Co Ltd
Priority to JP24602493A priority Critical patent/JP3214185B2/en
Publication of JPH0778260A publication Critical patent/JPH0778260A/en
Application granted granted Critical
Publication of JP3214185B2 publication Critical patent/JP3214185B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Abstract

PURPOSE:To effectively suppress the overshoot of a Bezier curve when the distance between input coordinate points is long and the distance between the other adjacent input coordinate points is extremely short when the Bezier curve is generated between the input coordinate points. CONSTITUTION:A length calculation part 6-2A calculates respective lengths up to input coordinate points which is located back and forth each input coordinate point from each input coordinate point within a coordinate column buffer 6-1. A length comparison part 6-2B compares the calculated lengths. As a result, if the rear and front lengths are different from each other by an amt. more than a prescribed rate, a coordinate calculation part 6-2C moves a control point to the location near the corresponding input coordinate point according to the length of a shorter side. Based on the control point obtained by this, a Bezier plotting part 7 plots a continuous curve by connecting each input coordinate point with a cubic Bezier curve.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】この発明は、ワードプロセッサや
パーソナルコンピュータ等において、任意の図形を描画
する際に、入力された座標列データに基づいて各入力座
標点間をそれぞれ3次のベジェール曲線で結ぶことによ
り連続曲線を発生する連続曲線発生装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention, when drawing an arbitrary figure in a word processor, a personal computer or the like, connects each input coordinate point with a cubic Bezier curve based on input coordinate sequence data. The present invention relates to a continuous curve generator that generates a continuous curve.

【0002】[0002]

【従来の技術】従来、ワードプロセッサにおいては、任
意の図形を描画する際に、カーソルキーを操作して座標
点を順次入力すると、入力された各座標点間をベジェー
ル曲線で連続的に結ぶことにより連続曲線を発生する連
続曲線発生装置が搭載されている。この種の連続曲線発
生装置は次の如く動作する。いま、入力された座標列デ
ータに基づいて1本のベジェール曲線を発生する過程を
図8を参照して説明する。
2. Description of the Related Art Conventionally, in a word processor, when a cursor key is operated to sequentially input coordinate points when drawing an arbitrary figure, the input coordinate points are continuously connected by Bezier curves. A continuous curve generator for generating a continuous curve is installed. This type of continuous curve generator operates as follows. Now, the process of generating one Bezier curve based on the input coordinate sequence data will be described with reference to FIG.

【0003】図8において、(A)は入力された4つの
入力座標点a、b、c、dを示し、この各入力座標点の
うち点b、cを結ぶ3次のベジェール曲線を発生させる
ものとする。なお、一般に3次のベジェール曲線は4つ
の座標点、つまり、開始点、終了点および2つの制御点
によって描画されるもので、図8の(B)は入力座標点
b、c間に第1制御点をどのようにして設定するかを説
明する為の図、図8の(C)は入力座標点b、c間に第
2制御点をどのようにして指定するかを説明する為の図
であり、更に、図8の(D)は入力座標点b、c間にベ
ジェール曲線を描画した状態を示した図である。
In FIG. 8, (A) shows four input coordinate points a, b, c and d, and a cubic Bezier curve connecting points b and c among these input coordinate points is generated. I shall. Generally, a cubic Bezier curve is drawn by four coordinate points, that is, a start point, an end point, and two control points. FIG. 8B shows the first coordinate point between the input coordinate points b and c. FIG. 8C is a diagram for explaining how to set a control point, and FIG. 8C is a diagram for explaining how to specify a second control point between input coordinate points b and c. Further, FIG. 8D is a diagram showing a state in which a Bezier curve is drawn between the input coordinate points b and c.

【0004】先ず、入力座標点b、c間に第1制御点P
1を設定する場合には、図8の(B)に示す様に、第1
制御点P1の設定位置は入力座標点a、cを結ぶ直線に
対して平行で、かつ入力座標点bから次の入力座標点c
の方向に向かう直線上にあり、入力座標点bからの距離
は入力座標点a、c間の長さに比例乗数をかけたものと
なる。これを式で表わすと、図示の如く、P1=(c−
a)×k1+bとなり、a〜cは入力座標点a、cの座
標値を持つベクトル量であり、また、k1は比例乗数
(例えば1/2)である。このようにして入力座標点
b、c間に第1制御点P1を設定したら、次に第2制御
点P2を設定する。この第2制御点P2の設定位置は図
8の(C)に示す様に、入力座標点b、dを結ぶ直線に
対して平行で、かつ入力座標点cから前の入力座標点b
の方向に向かう直線上にあり、入力座標点cからの距離
は入力座標点b、d間の長さに比例乗数をかけたものと
なる。これを式で表わすと、図示の如く、P2=(b−
d)×k2+cとなり、d〜bは入力座標点d、bの座
標値を持つベクトル量であり、また、k2は比例乗数
(一般的にはk1=k2であるが、“0”でない正の数
であれば少々異なっていてもよい)である。このように
して求めた第1制御点P1、第2制御点P2と、入力座
標点bをベジェール開始点、入力座標点cをベジェール
終了点とする3次のベジェール曲線を描画すると、図8
の(D)に示す如くとなる。
First, the first control point P is placed between the input coordinate points b and c.
When 1 is set, as shown in FIG.
The set position of the control point P1 is parallel to the straight line connecting the input coordinate points a and c, and the next input coordinate point c from the input coordinate point b.
The distance from the input coordinate point b is obtained by multiplying the length between the input coordinate points a and c by a proportional multiplier. If this is expressed by an equation, as shown in the figure, P1 = (c-
a) × k1 + b, a to c are vector quantities having the coordinate values of the input coordinate points a and c, and k1 is a proportional multiplier (for example, 1/2). After the first control point P1 is set between the input coordinate points b and c in this way, the second control point P2 is set next. As shown in FIG. 8C, the set position of the second control point P2 is parallel to the straight line connecting the input coordinate points b and d, and the input coordinate point b before the input coordinate point c is located.
The distance from the input coordinate point c is obtained by multiplying the length between the input coordinate points b and d by a proportional multiplier. If this is expressed by an equation, as shown in the figure, P2 = (b-
d) × k2 + c, d to b are vector quantities having the coordinate values of the input coordinate points d and b, and k2 is a proportional multiplier (generally k1 = k2, but a positive value other than “0”). The numbers may be slightly different). Drawing the first control point P1 and the second control point P2 thus obtained, and a cubic Bezier curve with the input coordinate point b as the Bezier start point and the input coordinate point c as the Bezier end point are shown in FIG.
(D).

【0005】図9は上述の様にして各入力座標点間に1
本ずつベジェール曲線をそれぞれ描画してそれを結ぶこ
とによって描画された連続曲線を示している。ここで、
図中、a、b、c、d、e、fは入力座標点を示し、ま
た、各入力座標点間のb1、c1、d1、e1は第1の
制御点、b2、c2、d2、e2は第2の制御点を示し
ている。なお、a1、f2は図示省略したが、この第1
制御点a1は入力座標点aとなり、第2制御点f2は入
力座標点fとなる。つまり、連続曲線の開始点aと第1
制御点a1が等しくなり、連続曲線の終了点fと第2制
御点f2が等しくなる。このように各入力座標点に隣り
合う制御点は、入力座標点を通る直線上にあり、入力座
標点と第1制御点を結ぶ直線はベジェール曲線の開始方
向、また入力座標点と第2の制御点を結ぶ直線はベジェ
ール曲線の終了方向を表わすものであるというベジェー
ル曲線の性質から隣り合うベジェール曲線を滑らかに接
続させることが可能となる。
FIG. 9 shows that there is 1 between each input coordinate point as described above.
It shows a continuous curve drawn by drawing bezier curves for each book and connecting them. here,
In the figure, a, b, c, d, e, f indicate input coordinate points, and b1, c1, d1, e1 between the input coordinate points are first control points, and b2, c2, d2, e2. Indicates the second control point. Although not shown in the figure, a1 and f2
The control point a1 becomes the input coordinate point a, and the second control point f2 becomes the input coordinate point f. That is, the starting point a of the continuous curve and the first point
The control points a1 become equal, and the end point f of the continuous curve becomes equal to the second control point f2. In this way, the control points adjacent to each input coordinate point are on a straight line passing through the input coordinate points, and the straight line connecting the input coordinate points and the first control points is the start direction of the Bezier curve or the input coordinate points and the second control points. Since the straight line connecting the control points represents the ending direction of the Bezier curve, it is possible to smoothly connect the adjacent Bezier curves.

【0006】[0006]

【発明が解決しようとする課題】このようにして各入力
座標点間をベジェール曲線で結ぶことによって滑らかな
連続曲線を得ることができるが、例えば、図10に示す
様に、入力座標点b、c間の距離が長く、入力座標点
b、a間、あるいは入力座標点c、d間の距離が極端に
短い様な場合、距離が短い入力座標点間のベジェール曲
線にオーバーシュートが現われてしまう。つまり、カー
ソルキーを操作してカーソル位置を1ドットずつ移動さ
せる過程において、図示の入力座標点b、a間、あるい
は入力座標点c、d間の様にその距離が極端に短いと、
鋭角状に膨らんだベジェール曲線が生成される。これ
は、入力座標点bあるいは入力座標点cを通る直線上の
制御点(外側の制御点)が入力座標点bや入力座標点c
から遠く離れた位置に設定されることに起因する。この
ように長い曲線と短い曲線とを組み合せた図形を描画す
る場合、オーバーシュートによって所望する図形を得る
ことができないという欠点があり、また、入力座標点を
次々に指定してゆく際に、1つの点を確定してから次の
点を指定する為に1ドットカーソルを移動すると、いき
なり意図しない大きなオーバーシュートが現われてしま
い、操作者に不快感を与えたり、迷わせる等、作図作業
を著しく困難なものとしていた。この発明の課題は、入
力座標点間にベジェール曲線を生成する際に、ある入力
座標点間の距離が長く、それに隣り合う他の入力座標点
間の距離が極端に短い場合における、ベジェール曲線の
オーバーシュートを効果的に抑制できるようにすること
である。
A smooth continuous curve can be obtained by connecting the input coordinate points with the Bezier curve in this way. For example, as shown in FIG. When the distance between c is long and the distance between the input coordinate points b and a, or the distance between the input coordinate points c and d is extremely short, an overshoot appears on the Bezier curve between the input coordinate points with a short distance. . That is, in the process of operating the cursor key to move the cursor position dot by dot, if the distance is extremely short, such as between the illustrated input coordinate points b and a or between the illustrated input coordinate points c and d,
A bezier curve bulging in an acute angle is generated. This is because the control point (outer control point) on the straight line passing through the input coordinate point b or the input coordinate point c is the input coordinate point b or the input coordinate point c.
It is caused by being set at a position far away from. When drawing a figure in which a long curve and a short curve are combined in this way, there is a drawback in that a desired figure cannot be obtained due to overshooting. In addition, when input coordinate points are successively specified, 1 If you move the 1-dot cursor to specify the next point after confirming one point, a sudden unintended large overshoot will appear, which will make the operator uncomfortable or hesitate. It was difficult. An object of the present invention is to generate a Bezier curve between input coordinate points when the distance between certain input coordinate points is long and the distance between other input coordinate points adjacent thereto is extremely short. It is to be able to effectively suppress overshoot.

【0007】[0007]

【課題を解決するための手段】この発明の手段は次の通
りである。入力された各入力座標点に順次着目し、その
前後に位置する座標点の位置から各入力座標点間に新た
な2つの制御点を生成して各入力座標点間を3次のベジ
ェール曲線で結ぶことにより、連続曲線を発生する連続
曲線発生装置において、 (1)、長さ検出手段は各入力座標点からその前後に位
置する入力座標点までの長さをそれぞれ検出する。 (2)、長さ比較手段はこの長さ検出手段によって検出
された前後の長さを比較する。 (3)、制御点設定手段はこの長さ比較手段によって前
後の長さが所定の比率以上の開きがあることが検出され
た場合に、短い方の長さに応じて前記制御点を対応する
入力座標点に近い位置に設定する。
The means of the present invention are as follows. Focusing on each input coordinate point sequentially, generate two new control points between each input coordinate point from the positions of the coordinate points located before and after that, and use a cubic Bezier curve between each input coordinate point. In the continuous curve generating device that generates a continuous curve by tying, (1), the length detecting means detects the length from each input coordinate point to the input coordinate points located before and after it. (2) The length comparing means compares the lengths before and after detected by the length detecting means. (3) The control point setting means corresponds to the control point according to the shorter length when the length comparing means detects that the front and rear lengths have a difference of a predetermined ratio or more. Set to a position close to the input coordinate point.

【0008】[0008]

【作用】この発明の手段の作用は次の通りである。い
ま、入力された各入力座標点の前後に位置する座標点の
値から入力座標点間に新たな2つの制御点を生成する際
に、各入力座標点からその前後に位置する入力座標点ま
での長さがそれぞれ検出される。そして、検出された前
後の長さが比較され、所定の比率以上の開きがあれば、
短い方の長さに応じて制御点が対応する入力座標点に近
い位置に設定される。したがって、入力座標点間にベジ
ェール曲線を生成する際に、ある入力座標点間の距離が
長く、それに隣り合う他の入力座標点間の距離が極端に
短い場合における、ベジェール曲線のオーバーシュート
を効果的に抑制することができる。
The operation of the means of the present invention is as follows. Now, when generating two new control points between the input coordinate points based on the values of the coordinate points located before and after each input coordinate point, from each input coordinate point to the input coordinate points located before and after it. The length of each is detected. Then, the detected front and back lengths are compared, and if there is a difference of a predetermined ratio or more,
The control point is set at a position close to the corresponding input coordinate point according to the shorter length. Therefore, when generating a Bezier curve between input coordinate points, when the distance between certain input coordinate points is long and the distance between other input coordinate points adjacent to it is extremely short, the overshoot of the Bezier curve is effective. Can be suppressed.

【0009】[0009]

【実施例】以下、図1〜図7を参照して一実施例を説明
する。図1は連続曲線発生装置を搭載したワードプロセ
ッサを示したブロック構成図である。主制御部1は各種
プログラムにしたがってこのワードプロセッサの全体動
作を制御するもので、キー操作部2から作図用の座標列
データが入力されると、主制御部1はこれを取り込んで
文書メモリ3に格納する。なお、主制御部1はこの文書
メモリ3の内容をキー操作部2からの保存指令に応答し
て外部記憶制御部4に与え、外部記憶装置5に登録させ
る。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment will be described below with reference to FIGS. FIG. 1 is a block diagram showing a word processor equipped with a continuous curve generator. The main control unit 1 controls the whole operation of this word processor according to various programs. When the coordinate sequence data for drawing is input from the key operation unit 2, the main control unit 1 fetches this and stores it in the document memory 3. Store. The main control unit 1 gives the content of the document memory 3 to the external storage control unit 4 in response to the save command from the key operation unit 2, and causes the external storage device 5 to register the contents.

【0010】連続曲線発生装置6は文書メモリ3に格納
されている入力座標列に基づいてそれを連続するベジェ
ール曲線に変換するもので、文書メモリ3からの入力座
標列を一時記憶する座標列バッファ6−1と、この座標
列バッファ6−1の内容に基づいてベジェール曲線描画
用の座標列として開始点、終了点と共に制御点を発生す
る制御点発生部6−2と、この制御点発生部6−2によ
って発生されたベジェール曲線描画用の座標列データを
一時記憶するベジェールバッファ6−3とを有してい
る。特に、本実施例において、制御点発生部6−2には
更に、入力座標点間の距離を算出する長さ算出部6−2
Aと、長さ算出部6−2Aによって算出された各距離を
比較する長さ比較部6−2Bと、この長さ比較部6−2
Bの比較結果に基づいて制御点の設定位置を算出する座
標計算部6−2Cとを有している。この場合、座標計算
部6−2Cは2点間座標をベクトルとしてスカラー積お
よび加算などの演算を行う。
The continuous curve generator 6 converts the input coordinate sequence stored in the document memory 3 into a continuous Bezier curve, and a coordinate sequence buffer for temporarily storing the input coordinate sequence from the document memory 3. 6-1 and a control point generation unit 6-2 that generates a control point together with a start point and an end point as a coordinate sequence for drawing a Bezier curve based on the contents of the coordinate sequence buffer 6-1; and this control point generation unit. 6-2 has a bezier buffer 6-3 for temporarily storing the coordinate sequence data for drawing the bezier curve. In particular, in this embodiment, the control point generator 6-2 further includes a length calculator 6-2 for calculating the distance between the input coordinate points.
A, a length comparison unit 6-2B that compares each distance calculated by the length calculation unit 6-2A, and this length comparison unit 6-2
The coordinate calculation unit 6-2C that calculates the set position of the control point based on the comparison result of B is included. In this case, the coordinate calculation unit 6-2C performs calculations such as scalar product and addition using the coordinates between two points as a vector.

【0011】ベジェール描画部7は連続曲線発生装置6
から出力されるベジェール曲線描画用の座標列に基づい
て3次のベジェール曲線を描画するもので、このベジェ
ール曲線を表示制御部8に与えて表示装置9から表示出
力させたり、印刷制御部10に与えて印刷装置11から
印字出力させる。
The bezier drawing unit 7 is a continuous curve generator 6
A cubic Bezier curve is drawn based on a coordinate sequence for drawing a Bezier curve that is output from the display control unit 8 and is output from the display device 9 or is output to the print control unit 10. It is given and printed out from the printer 11.

【0012】次に、本実施例の動作を図2〜図7を参照
して説明する。先ず、本実施例の動作原理を簡単に説明
しておく。図2の入力座標点bにおいて、その制御点を
求める場合には入力座標点a、b間の距離dist
と、入力座標点b、c間の距離dist Sと、入力座
標点a、c間の距離dist Lを求め、この距離dis
Rまたはdist Sが距離dist Lに比べて
かなり短い場合には、上述の図8(B)、(C)で示し
た制御点を求める為の比例乗数k1、k2の値を、距離
dist R、dist Sのうち短い方の距離に比例
させて小さくするようにしている。これによって、例え
ば、入力座標点aとbとが近づくにつれて制御点も入力
座標点bの位置に近づくように制御点の移動が可能とな
る。このようなアルゴリズムによって連続曲線発生装置
6は座標列バッファ6−1内の入力座標列をベジェール
曲線描画用の座標列に変換してベジェールバッファ6−
3に展開してゆくが、その時の連続曲線発生装置6の動
作をフローチャートを用いて表わしたのが図3であり、
その中で最も特徴となる第1制御点移動処理、第2制御
点移動処理を示したのが、図4、図5のフローチャート
である。
Next, the operation of this embodiment will be described with reference to FIGS.
And explain. First, the operating principle of this embodiment will be briefly described.
I'll do it. At the input coordinate point b in FIG.
When obtaining, the distance dist between the input coordinate points a and b R
And the distance dist between the input coordinate points b and c S and input seat
Distance dist between gauge points a and c Find L and find this distance dis
t R or dist S is the distance dist Compared to L
When it is considerably short, it is shown in FIG. 8 (B) and (C) above.
The values of the proportional multipliers k1 and k2 for determining the control point
dist R, dist Proportional to the shorter of S
I try to make it smaller. By this,
For example, as the input coordinate points a and b get closer, the control point is also input.
It is possible to move the control point so that it approaches the position of coordinate point b.
It Continuous curve generator with such an algorithm
6 is the input coordinate sequence in the coordinate sequence buffer 6-1.
Bezier buffer 6-
The continuous curve generator 6 moves at that time.
Figure 3 shows the work using a flow chart.
Among them, the most characteristic first control point movement processing, second control
The point movement processing is shown in the flowcharts of FIGS. 4 and 5.
Is.

【0013】連続曲線発生装置6は文書メモリ3からの
入力座標列が座標列バッファ6−1に格納されると、図
3のフローチャートにしたがった動作を実行する。先
ず、連続曲線発生装置6は座標列バッファ6−1をアク
セスする現在点ptに初期アドレスをセットする(ステ
ップS1)。この場合、座標列バッファ6−1に格納さ
れている各入力座標点のうち最初の入力座標点を示すX
Y座標を読み出す為のアドレスが初期アドレスとして現
在点ptにセットされる。次に、この現在点ptの値に
したがって座標列バッファ6−1から最初の入力座標点
を示すデータ[PT]をベジェール開始点として読み出
すと共に現在点ptの内容に「1」を加算した値にした
がって座標列バッファ6−1から2番目の入力座標点を
示すデータ[PT+1]をベジェール終了点として読み
出す(ステップS2)。
When the input coordinate sequence from the document memory 3 is stored in the coordinate sequence buffer 6-1, the continuous curve generator 6 executes the operation according to the flowchart of FIG. First, the continuous curve generator 6 sets an initial address at the current point pt for accessing the coordinate sequence buffer 6-1 (step S1). In this case, X indicating the first input coordinate point among the input coordinate points stored in the coordinate sequence buffer 6-1.
An address for reading the Y coordinate is set at the current point pt as an initial address. Next, according to the value of the current point pt, the data [PT] indicating the first input coordinate point is read from the coordinate string buffer 6-1 as the Bezier start point, and the value obtained by adding “1” to the content of the current point pt is set. Therefore, the data [PT + 1] indicating the second input coordinate point is read from the coordinate sequence buffer 6-1 as the bezier end point (step S2).

【0014】次に、長さ算出部6−2Aはこの[P
T]、[PT+1]のデータに基づいてベジェール開始
点とベジェール終了点の間の長さdist Sを求める
(ステップS3)。即ち、長さ算出部6−2Aはdis
S=|[PT+1]−[PT]|の演算を行う。な
お、演算| |は2点間の長さを求めることを表わし、
結果はスカラー量である。この2点間の長さdist
Sは後述する第1および第2制御点移動処理で用いられ
るので、その前処理として求めておく。
Next, the length calculation unit 6-2A uses this [P
The length dist between the bezier start point and the bezier end point based on the data of T] and [PT + 1]. S is obtained (step S3). That is, the length calculation unit 6-2A is dis
t The calculation of S = | [PT + 1]-[PT] | is performed. Note that the operation || represents that the length between two points is calculated,
The result is a scalar quantity. Length dist between these two points
Since S is used in the first and second control point movement processing, which will be described later, S is obtained as a preprocessing thereof.

【0015】次に、第1制御点のデフォルト値としてベ
ジェール開始点を設定しておく(ステップS4)。そし
て、次のステップS5に進み、座標列ポインタptの値
で示された入力座標点の1つ前に入力座標点が存在する
かをチェックするが、いま、座標列ポインタptの値で
示された入力座標点は最初の点であり、前の点は存在し
ないので、ステップS6(第1制御点移動処理)はスキ
ップされてステップS7に移る。つまり、最初の入力座
標点であれば第1制御点=開始点のまま第2制御点の計
算に移る。ここで、第2制御点のデフォルト値はベジェ
ール終了点となり、その値が先ず、第2制御点として設
定される(ステップS7)。そして、ステップS8に進
み、次の次の入力座標点が座標列バッファ6−1内に存
在するか否かをチェックするが、いま、入力座標点が3
点以上の場合には最初の入力座標点から数えて次の次の
入力座標点は存在する為、図5に示す第2制御点移動処
理が実行される(ステップS9)。なお、入力座標点が
最初の点と2番目の点のみ、つまり、2点だけしか入力
されていない時点では、最初の入力座標点が第1の制御
点、2番目の入力座標点が第2の制御点のままとなる
が、3点以上の入力があった時点で第2制御点の移動処
理が行われる。
Next, the bezier starting point is set as the default value of the first control point (step S4). Then, the process proceeds to the next step S5, and it is checked whether or not the input coordinate point exists immediately before the input coordinate point indicated by the value of the coordinate sequence pointer pt. Now, it is indicated by the value of the coordinate sequence pointer pt. Since the input coordinate point is the first point and there is no previous point, step S6 (first control point moving process) is skipped and the process proceeds to step S7. That is, if it is the first input coordinate point, the first control point = start point is left and the calculation of the second control point is started. Here, the default value of the second control point is the Bezier end point, and that value is first set as the second control point (step S7). Then, the process proceeds to step S8, and it is checked whether or not the next next input coordinate point exists in the coordinate sequence buffer 6-1.
If the number of points is equal to or more than the points, there is a next input coordinate point after counting from the first input coordinate point, and therefore the second control point moving process shown in FIG. 5 is executed (step S9). Note that when the input coordinate points are only the first point and the second point, that is, when only two points are input, the first input coordinate point is the first control point, and the second input coordinate point is the second point. However, the moving process of the second control point is performed when three or more points are input.

【0016】先ず、図5のフローが起動されると、長さ
算出部6−2Aは現在の入力座標点と次の次の入力座標
点を結ぶ線の距離dist Lを求めると共に、次の区
間(現在に対して次の入力座標点と次の次の入力座標点
間の長さ)dist Rを求める(ステップS9−
1)。即ち、図6(A)において、現在点を[pt]、
次の点を[pt+1]、次の次の点を[pt+2]とす
ると、接線距離dist Lをdist L=|[pt]
−[pt+2]|によって求め、次の区間をdist
R=|[pt+1]−[pt+2]|によって求める。
そして、長さ比較部6−2Bはこのようにして求めたd
ist Lとdist Rとの長さ関係を比較すると共
に、dist Lまたはdist Rと先に求めたdi
st Sとを比較し、dist Rまたはdist
がdist Lに比べてかなり短いか否かを判断する。
この判断結果に基づいて第2制御点を入力座標点からど
れだけ移動させるかを示す第2制御点の移動式選択処理
が行われる(ステップS9−2)。
First, when the flow of FIG. 5 is started, the length
The calculation unit 6-2A calculates the current input coordinate point and the next next input coordinate.
Distance dist of line connecting points While seeking L, the next ward
Between (the next input coordinate point and the next next input coordinate point with respect to the present
Distance between) dist Find R (step S9-
1). That is, in FIG. 6A, the current point is [pt],
Let the next point be [pt + 1] and the next next point be [pt + 2].
Then, the tangential distance dist L is dist L = | [pt]
-[Pt + 2] |
R = | [pt + 1]-[pt + 2] |
Then, the length comparison unit 6-2B calculates d in this way.
ist L and dist Comparing the length relationship with R
On, dist L or dist R and di previously obtained
st Compare with S, dist R or dist S
Is dist Judge whether it is considerably shorter than L.
Based on this judgment result, the second control point is moved from the input coordinate point
Movable selection process of the second control point indicating how much to move
Is performed (step S9-2).

【0017】図7はこの判断基準およびそれに応じてど
のような移動式が選択されるかを示した図で、図7の
(A)は第1制御点、(B)は第2制御点に対応してい
る。ここで、図中(1)、(2)、(3)、(4)は図
6の(B)で示した(1)、(2)、(3)、(4)に
対応し付られており、dist Rとdist Sとの
長さ関係を表わしている。また、図中、判別式およびこ
の判別式の判別結果(YES)および(NO)に対応す
る移動式内において、「n」、「ks」、「k」の値は
実験によって決められた特定値であり、実験によれば、
「n」=2/3、「kn」=1/(dist L×
3)、「k」=1/2で良好な結果を得ることができ
た。いま、第2制御点の移動式を選択する場合、dis
Rまたはdist Sのどちらかが短いに応じて図
7の(B)に示す判別式にしたがった判別を行い、その
結果、dist Lとの長さ関係が所定比率以上の開き
があることが判別されると、その判別結果に基づいて移
動式の選択を行う。即ち、図6(B)の(3)に示す様
にdist Rの方が短ければ、判別式dist R×
n<dist L?にしたがってdist Lとの長さ関
係を判別し、その結果、「NO」であれば、移動式
([pt]−[pt+2])×kが選択されるが、di
st Rがdist Lに比べかなり短く「YES」と
判別されれば、移動式([pt]−[pt+2])×d
ist R×ksが選択される。一方、図6(B)の
(4)に示す様にdist Sの方が短ければ、判別式
dist S×n<dist L?にしたがってdist
Lとの長さ関係が判別され、その結果、「NO」であ
れば、移動式([pt]−[pt+2])×kが選択さ
れるが、dist Sがdist Lに比べかなり短く
「YES」と判別されれば、移動式([pt]−[pt
+2])×dist S×ksが選択される。
FIG. 7 shows this criterion and the corresponding criteria.
7 is a diagram showing whether a mobile type such as
(A) corresponds to the first control point, (B) corresponds to the second control point
It Here, (1), (2), (3), and (4) are figures
In (1), (2), (3), and (4) shown in (B) of 6,
Corresponding and attached, dist R and dist With S
It represents the length relationship. Also, in the figure,
Corresponding to the discrimination result (YES) and (NO) of the discriminant of
The values of "n", "ks", and "k" are
It is a specific value determined by the experiment, and according to the experiment,
“N” = 2/3, “kn” = 1 / (dist L ×
3), good results can be obtained with "k" = 1/2
It was Now, when selecting the moving type of the second control point,
t R or dist Figure depending on which one of S is short
Discrimination according to the discriminant shown in FIG.
Result, dist The length relationship with L is more than a certain ratio
If it is determined that there is a
Make a dynamic choice. That is, as shown in (3) of FIG.
To dist If R is shorter, discriminant dist R x
n <dist L? According to dist Length relation with L
If it is "NO" as a result, the mobile type
([Pt] − [pt + 2]) × k is selected, but di
st R is dist It is considerably shorter than L and "YES"
If it is determined, it is a moving type ([pt] − [pt + 2]) × d
ist R × ks is selected. On the other hand, in FIG.
As shown in (4), dist If S is shorter, the discriminant
dist S × n <dist L? According to dist
The length relationship with L is determined, and as a result, "NO"
Then, the moving formula ([pt] − [pt + 2]) × k is selected.
But dist S is dist Considerably shorter than L
If it is determined to be "YES", the moving type ([pt]-[pt]
+2]) × dist S × ks is selected.

【0018】このようにして選択された移動式に基づい
て座標計算部6−2Cは第2制御点の設定位置を算出す
る。即ち、選択された移動式によって第2制御点をずら
す量を決定し、これを上述のデフォルト値に加算する。
この値が現在点と次の次の点を結ぶ線に対して平行な線
上において、現在点からの距離となり、これによって第
2制御点の移動位置が決定される(ステップS9−
3)。このように判別結果YESに対応する移動式に基
づいて第2制御点をずらす量が決定される結果、第2制
御点は現在点の座標位置に近づいた位置に設定されるこ
とになる。
The coordinate calculation unit 6-2C calculates the set position of the second control point based on the movement formula selected in this way. That is, the amount by which the second control point is shifted is determined according to the selected movement formula, and this is added to the above default value.
This value is the distance from the current point on the line parallel to the line connecting the current point and the next next point, and the moving position of the second control point is determined by this (step S9-
3). As described above, as a result of determining the shift amount of the second control point based on the movement formula corresponding to the determination result YES, the second control point is set to a position close to the coordinate position of the current point.

【0019】これによって1本のベジェール曲線を描画
するに必要な4点(開始点、終了点および第1制御点、
第2制御点)が揃うと、制御点発生部6−2はこれをベ
ジェールバッファ6−3に書き込む(図3のステップS
10)。そして、座標列ポインタptの値を更新し、次
の入力座標点を指定する(ステップS11)。この座標
列ポインタptの更新によって座標列ポインタptの値
が座標列バッファ6−1に格納されている最終入力座標
点をアクセスするアドレスを越えたか否かに基づいて全
線の描画終了を検出し(ステップS12)、越えていな
ければ、ステップS2に戻り、以下、上述の動作を繰り
返す。この結果、次の2番目の入力座標点が指定される
が、この場合、その前に入力座標点が有ることがステッ
プS5で検出されるので、ステップS6に進み、図4の
フローチャートにしたがって第1制御点移動処理が行わ
れる。
As a result, four points (start point, end point and first control point, which are necessary to draw one Bezier curve,
When the second control points) are complete, the control point generator 6-2 writes them in the bezier buffer 6-3 (step S in FIG. 3).
10). Then, the value of the coordinate sequence pointer pt is updated to specify the next input coordinate point (step S11). The completion of drawing all lines is detected based on whether or not the value of the coordinate sequence pointer pt exceeds the address for accessing the final input coordinate point stored in the coordinate sequence buffer 6-1 by updating the coordinate sequence pointer pt ( If not exceeded in step S12), the process returns to step S2, and the above operation is repeated. As a result, the next second input coordinate point is designated, but in this case, it is detected in step S5 that there is an input coordinate point before that, so the flow proceeds to step S6, and the second input coordinate point is set according to the flowchart of FIG. One control point moving process is performed.

【0020】即ち、現在点に対してその前後の点を結ぶ
線の距離dist Lを求めると共に、前の区間(現在
点と前の点との長さ)dist Rを求める(ステップ
S6−1)。即ち、図6(A)において現在点を[p
t]に対してその前の点を[pt−1]とすると、接線
距離dist Lをdist L=|[pt+1]−
[pt−1]|によって求め、前の区間dist Rを
dist R=|[pt]−[pt−1]|によって求
める。そして、これらの長さを比較し、第1制御点の移
動式選択処理を行う(ステップS6−2)。即ち、図6
(B)の(1)に示す様に、dist Rの方が短けれ
ば、判別式dist R×n<dist L?にしたが
ってdist Lとの長さ関係を判別し、その結果、
「NO」であれば、([pt+1]−[pt−1])×
nの移動式が選択されるが、「YES」であれば、
([pt+1]−[pt−1])×dist R×ks
の移動式が選択される。同様に、図6(B)の(2)に
示す様にdist Sの方が短ければ、判別式dist
S×n<dist L?にしたがってdist Lと
の長さ関係を判別し、その結果、「NO」であれば、
([pt+1]−[pt−1])×nの移動式が選択さ
れるが、「YES」であれば、([pt+1]−[pt
−1])×dist S×ksの移動式が選択される。
これによって選択された移動式によって第1制御点をず
らす量を決定し、これを上述のデフォルト値に加算する
ことによって、この値が現在点と次の点を結ぶ線に対し
て平行な線上において、現在点からの距離となり、この
位置に第1制御点が移動される(ステップS6−3)。
That is, the distance dist of the line connecting the points before and after the current point While obtaining L, the previous section (the length between the current point and the previous point) dist R is calculated (step S6-1). That is, the current point is [p
If the point before [t] is [pt-1], then the tangential distance dist L is dist L = | [pt + 1]-
[Pt-1] | R is dist R = | [pt]-[pt-1] | Then, these lengths are compared with each other, and the moving type selection process of the first control point is performed (step S6-2). That is, FIG.
As shown in (1) of (B), dist If R is shorter, discriminant dist R × n <dist L? According to dist The length relationship with L is determined, and as a result,
If “NO”, ([pt + 1]-[pt-1]) ×
n mobile type is selected, but if "YES",
([Pt + 1]-[pt-1]) * dist R × ks
The mobile type is selected. Similarly, as shown in (2) of FIG. If S is shorter, discriminant dist
S × n <dist L? According to dist The length relationship with L is determined, and if the result is "NO",
A moving expression of ([pt + 1] − [pt−1]) × n is selected, but if “YES”, then ([pt + 1] − [pt]
−1]) × dist A mobile type of S × ks is selected.
The amount of displacement of the first control point is determined by the selected movement formula, and this value is added to the default value described above, so that this value is on a line parallel to the line connecting the current point and the next point. , The distance from the current point is reached, and the first control point is moved to this position (step S6-3).

【0021】以下、図2にしたがって動作を全線終了ま
で繰り返すことによって各入力座標点間を3次のベジェ
ール曲線で順次連結した連続曲線を得ることが可能とな
る。ここで、図2に示す様に、入力座標点b、a間ある
いは入力座標点c、d間が極めて接近していいても入力
座標点bあるいは入力座標点cを通る直線上の制御点は
それに応じて入力座標点bあるいは入力座標点cに近づ
く位置に指定される為、図10で示した様なオーバーシ
ュートを効果的に抑制することが可能となり、自然な膨
らみをもった意図した通りのベジェール曲線を描画する
ことができる。
By repeating the operation according to FIG. 2 until the end of the whole line, it is possible to obtain a continuous curve in which the input coordinate points are sequentially connected by a cubic Bezier curve. Here, as shown in FIG. 2, even if the input coordinate points b and a or the input coordinate points c and d are extremely close to each other, the control point on the straight line passing through the input coordinate point b or the input coordinate point c is Accordingly, since the position is designated to approach the input coordinate point b or the input coordinate point c, the overshoot as shown in FIG. 10 can be effectively suppressed, and the desired swelling with natural swelling can be achieved. Bezier curves can be drawn.

【0022】なお、上記実施例は、dist R、di
st S、dist Lを検出してそれらの長さ関係を
比較するようにしたが、dist Lとの長さ関係を考
慮せず、単にdist R、dist Sとの長さ関係
に基づいて制御点の移動式を選択するようにしてもよ
い。
In the above embodiment, the dist R, di
st S, dist I tried to detect L and compare their length relations. Without considering the length relationship with L, simply dist R, dist The moving type of the control point may be selected based on the length relationship with S.

【0023】[0023]

【発明の効果】この発明によれば、入力座標点間にベジ
ェール曲線を生成する際に、ある入力座標点間の距離が
長く、それに隣り合う他の入力座標点間の距離が極端に
短い場合における、ベジェール曲線のオーバーシュート
を効果的に抑制することができるので、自然な膨らみを
持った意図した通りのベジェール曲線を得ることが可能
となり、連続曲線による作図を正確かつ容易に行うこと
ができる。
According to the present invention, when a Bezier curve is generated between input coordinate points, the distance between certain input coordinate points is long and the distance between other adjacent input coordinate points is extremely short. Since the overshoot of the Bezier curve in can be effectively suppressed, it is possible to obtain the intended Bezier curve with a natural bulge, and it is possible to accurately and easily draw a continuous curve. .

【図面の簡単な説明】[Brief description of drawings]

【図1】実施例に係る連続曲線発生装置を搭載したワー
ドプロセッサのブロック構成図。
FIG. 1 is a block diagram of a word processor equipped with a continuous curve generator according to an embodiment.

【図2】オーバーシュートを抑制した連続曲線の描画状
態を具体的に示した図。
FIG. 2 is a diagram specifically showing a drawn state of a continuous curve in which overshoot is suppressed.

【図3】連続曲線発生装置6の動作を示したフローチャ
ート。
FIG. 3 is a flowchart showing the operation of the continuous curve generator 6.

【図4】図3のステップS6(第1制御点移動処理)を
詳細に示したフローチャート。
FIG. 4 is a flowchart showing in detail step S6 (first control point movement processing) of FIG.

【図5】図3のステップS9(第2制御点移動処理)を
詳細に示したフローチャート。
5 is a flowchart showing in detail step S9 (second control point movement processing) of FIG.

【図6】第1および第2制御点移動処理において、di
st S、dist R、dist Lとの長さ関係を
判別する際にその長さ関係を説明する為の図。
FIG. 6 shows di in the first and second control point movement processing.
st S, dist R, dist The figure for demonstrating the length relation at the time of discriminating the length relation with L.

【図7】第1および第2制御点移動処理において、di
st S、dist R、dist Lとの長さ関係に
基づいてその長さ関係を判別する際の基準となる判別式
およびその判別結果に基づいて選択される移動式を示し
たもので、(A)は第1制御点、(B)は第2制御点に
対応付けた図。
FIG. 7 shows di in the first and second control point movement processing.
st S, dist R, dist The discriminant that serves as a reference for discriminating the length relation based on the length relation with L and the moving formula selected based on the discrimination result are shown. (A) is a first control point, FIG. 6B is a diagram associated with the second control point.

【図8】従来例を説明する為の図で、ベジェール曲線の
生成過程を示した図。
FIG. 8 is a diagram for explaining a conventional example, showing a process of generating a Bezier curve.

【図9】従来例を説明する為の図で、各入力座標点間を
ベジェール曲線で結ぶことにより生成された連続曲線を
示した図。
FIG. 9 is a diagram for explaining a conventional example, showing a continuous curve generated by connecting input coordinate points with a Bezier curve.

【図10】従来例を説明する為の図で、オーバーシュー
トが表われた場合の連続曲線を示した図。
FIG. 10 is a diagram for explaining a conventional example and is a diagram showing a continuous curve when an overshoot appears.

【符号の説明】 1 主制御部 2 キー操作部 3 文書メモリ 6 連続曲線発生装置 6−1 座標列バッファ 6−2 制御点発生部 6−3 ベジェールバッファ 6−2A 長さ算出部 6−2B 長さ比較部 6−2C 座標計算部 7 ベジェール描画部 8 表示制御部 9 表示装置[Explanation of Codes] 1 main control unit 2 key operation unit 3 document memory 6 continuous curve generator 6-1 coordinate sequence buffer 6-2 control point generator 6-3 bezier buffer 6-2A length calculator 6-2B Length comparison unit 6-2C Coordinate calculation unit 7 Bezier drawing unit 8 Display control unit 9 Display device

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】入力された各入力座標点に順次着目し、そ
の前後に位置する座標点の位置から各入力座標点間に新
たな2つの制御点を生成して各入力座標点間を3次のベ
ジェール曲線で結ぶことにより、連続曲線を発生する連
続曲線発生装置において、 各入力座標点からその前後に位置する入力座標点までの
長さをそれぞれ検出する長さ検出手段と、 この長さ検出手段によって検出された前後の長さを比較
する長さ比較手段と、 この長さ比較手段によって前後の長さが所定の比率以上
の開きがあることが検出された場合に、短い方の長さに
応じて前記制御点を対応する入力座標点に近い位置に設
定する制御点設定手段とを具備したことを特徴とする連
続曲線発生装置。
1. Focusing on each input coordinate point in sequence, two new control points are generated between each input coordinate point from the positions of the coordinate points located before and after the input coordinate point, and the distance between each input coordinate point is set to 3. In a continuous curve generator that generates a continuous curve by connecting the following Bezier curves, length detection means for detecting the length from each input coordinate point to the input coordinate points located before and after it, and this length The length comparison means for comparing the front and rear lengths detected by the detection means, and the shorter length when the front and rear lengths are detected to have a difference of a predetermined ratio or more by the length comparison means. And a control point setting means for setting the control point at a position close to a corresponding input coordinate point according to the height.
JP24602493A 1993-09-08 1993-09-08 Continuous curve generator Expired - Fee Related JP3214185B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP24602493A JP3214185B2 (en) 1993-09-08 1993-09-08 Continuous curve generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP24602493A JP3214185B2 (en) 1993-09-08 1993-09-08 Continuous curve generator

Publications (2)

Publication Number Publication Date
JPH0778260A true JPH0778260A (en) 1995-03-20
JP3214185B2 JP3214185B2 (en) 2001-10-02

Family

ID=17142317

Family Applications (1)

Application Number Title Priority Date Filing Date
JP24602493A Expired - Fee Related JP3214185B2 (en) 1993-09-08 1993-09-08 Continuous curve generator

Country Status (1)

Country Link
JP (1) JP3214185B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008084534A1 (en) * 2007-01-10 2008-07-17 Fujitsu Limited Design support system, method and program
JPWO2008084516A1 (en) * 2007-01-10 2010-04-30 富士通株式会社 Design support system, method, and program

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2008084534A1 (en) * 2007-01-10 2008-07-17 Fujitsu Limited Design support system, method and program
WO2008084516A1 (en) * 2007-01-10 2008-07-17 Fujitsu Limited Design support system, method and program
JPWO2008084516A1 (en) * 2007-01-10 2010-04-30 富士通株式会社 Design support system, method, and program
US8150661B2 (en) 2007-01-10 2012-04-03 Fujitsu Limited Design support system, method and storage medium for a route design for a deformable linear structure

Also Published As

Publication number Publication date
JP3214185B2 (en) 2001-10-02

Similar Documents

Publication Publication Date Title
US5850206A (en) System for retrieving and displaying attribute information of an object based on importance degree of the object
JPH09282080A (en) Information input method/device
US20020085003A1 (en) Image processing method and an apparatus therefor
JP3214185B2 (en) Continuous curve generator
JPH0612177A (en) Information inputting method and device therefor
JP2616353B2 (en) Input indicating device
CN100354807C (en) Method of providing a display for a graphical user interface
JP2662539B2 (en) 3D graphics processor
US20030052881A1 (en) Graphical value display program, graphical value display method and recording medium
JPH03269717A (en) Method and device for selection of data
JP2662540B2 (en) 3D distance measuring device
JPS61243517A (en) Information processor with help function
US5229958A (en) Data input device having arithmetical function
JPH07105362A (en) Generator for sampling point of curve
JP3111596B2 (en) Spreadsheet processing method and device
JPS60262694A (en) Graph forming machine having scale-up function
JP3845137B2 (en) Automatic polygon record creation method around reference line and polygon record automatic creation device around reference line
JP3003579B2 (en) Graphic processing method
JPH1049691A (en) Method and device for tracing dot sequence with bezier curve
JPH09237147A (en) Information processor
JPH0743751B2 (en) Spreadsheet automatic identification method
JP3978879B2 (en) COMPUTER DEVICE AND RECORDING MEDIUM CONTAINING COMPUTER PROCESSING PROGRAM
JPS61250688A (en) Curve generation system
JPH0577111B2 (en)
JPH08166948A (en) Table processor

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080727

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090727

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090727

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100727

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110727

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110727

Year of fee payment: 10

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120727

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120727

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130727

Year of fee payment: 12

LAPS Cancellation because of no payment of annual fees