JPH05159036A - Method and device for plotting - Google Patents

Method and device for plotting

Info

Publication number
JPH05159036A
JPH05159036A JP3320330A JP32033091A JPH05159036A JP H05159036 A JPH05159036 A JP H05159036A JP 3320330 A JP3320330 A JP 3320330A JP 32033091 A JP32033091 A JP 32033091A JP H05159036 A JPH05159036 A JP H05159036A
Authority
JP
Japan
Prior art keywords
curve
point
points
sampling
coordinate data
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.)
Withdrawn
Application number
JP3320330A
Other languages
Japanese (ja)
Inventor
Tetsuya Nakamura
哲哉 中村
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.)
Canon Inc
Original Assignee
Canon Inc
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 Canon Inc filed Critical Canon Inc
Priority to JP3320330A priority Critical patent/JPH05159036A/en
Publication of JPH05159036A publication Critical patent/JPH05159036A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To provide a plotting device capable of easily plotting a smooth curve. CONSTITUTION:When coordinate data is inputted from a coordinate input part 11 consisting of a mouse and the like, a sampling part 12 fetches coordinate data inputted at every prescribed time as a representative point. The coordinate of a point which is inputted from a coordinate input device with the representative point and which is near the representative point is obtained, and a vector calculation part 13 obtains the tangent vector of the representative point from coordinate data. Such a processing is executed on two representative points, and the smooth curve connecting two representative points is obtained from the obtained two representative points and tangent vector. The processing is continuously executed on the plural representative points and therefore the curve passing through the sampled representative points can be obtained. When the curve is displayed by a picture, the smooth curve can easily be plotted without being conscious of a slight blur at the time of inputting the coordinate.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、マウスやタブレツト等
の座標入力デバイスにより、表示画面上に曲線を描くこ
とが可能な描画方法及び装置に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a drawing method and apparatus capable of drawing a curve on a display screen with a coordinate input device such as a mouse or a tablet.

【0002】[0002]

【従来の技術】マウスやタブレツト等の座標入力デバイ
スからの入力により画面上のポインタを動かして、フリ
ーハンドで曲線を描くことができる描画装置の場合、ポ
インタの通過した点を連続的につなげることにより、オ
ペレータが入力装置を用いて描いた曲線を画面上に表示
している。
2. Description of the Related Art In the case of a drawing device which can draw a curved line in a freehand by moving a pointer on a screen by inputting from a coordinate input device such as a mouse or a tablet, it is necessary to continuously connect the points passed by the pointer. Thus, the operator draws a curve drawn using the input device on the screen.

【0003】[0003]

【発明が解決しようとしている課題】しかしながら上記
従来例では、ポインタの軌跡をそのまま曲線としている
ため、操作に熟達しないうちは手ブレ等によりギザギザ
な線が描かれてしまい、なめらかな曲線をうまく描くこ
とは難しいという欠点がある。
However, in the above-mentioned conventional example, since the locus of the pointer is a curved line as it is, a jagged line is drawn due to camera shake or the like before the operation is accomplished, and a smooth curve is drawn well. It has the drawback of being difficult.

【0004】また、この欠点に対応するため、3点また
は4点を指定させ、それらの点の位置により一つの曲線
を定義するようなツールを提供する描画装置もあるが、
点を打って曲線を描くというのはフリーハンドの手軽さ
を損なうものであり、また、思いどおりの線を描くのに
熟練を要することには変わりない。
In order to deal with this drawback, there are drawing apparatuses which provide a tool for designating three or four points and defining one curve by the positions of these points.
To draw a curve by hitting a point impairs the ease of freehanding, and it still requires skill to draw the line you want.

【0005】本発明は上記従来例に鑑みてなされたもの
で、なめらかなフリーハンド曲線が簡単に描ける描画装
置を提供することを目的とする。
The present invention has been made in view of the above-mentioned conventional example, and an object of the present invention is to provide a drawing apparatus capable of easily drawing a smooth freehand curve.

【0006】[0006]

【課題を解決するための手段】上記問題点を解決するた
めに本発明の描画装置は次のような構成からなる。
In order to solve the above problems, the drawing apparatus of the present invention has the following structure.

【0007】表示画面上に所望の線を描く描画装置であ
って、座標データを連続的に入力する座標入力手段と、
前記座標入力手段により入力された座標データを、一定
時間おきにサンプリングしてサンプリング点の座標を得
る手段と、前記サンプリング点の間を滑らかに結ぶ曲線
で補間する補間手段とを備えることを特徴とする。
A drawing device for drawing a desired line on a display screen, comprising coordinate input means for continuously inputting coordinate data,
The coordinate data input by the coordinate input means is sampled at regular intervals to obtain coordinates of sampling points, and an interpolation means for interpolating a curve smoothly connecting the sampling points. To do.

【0008】また、本発明の描画方法は次のような構成
からなる。
The drawing method of the present invention has the following configuration.

【0009】表示画面上に所望の線を描く描画方法であ
って、座標データを連続的に入力する座標入力行程と、
前記座標入力手段により入力された座標データを、一定
時間おきにサンプリングしてサンプリング点の座標を得
る行程と、前記サンプリング点の間を滑らかに結ぶ曲線
で補間する補間行程とを備えることを特徴とする。
A drawing method for drawing a desired line on a display screen, comprising a coordinate input step of continuously inputting coordinate data,
The coordinate data input by the coordinate input means is provided with a step of sampling the coordinate data at fixed intervals to obtain coordinates of sampling points, and an interpolation step of interpolating with a curve that smoothly connects the sampling points. To do.

【0010】[0010]

【作用】上記構成により本発明の描画方法及び装置は、
入力される座標データを一定時間おきにサンプリングす
る。更に、サンプリングした点どうしを滑らかな曲線で
補間して、スムーズな曲線を描く。
With the above construction, the drawing method and apparatus of the present invention are
The input coordinate data is sampled at regular intervals. Furthermore, the sampled points are interpolated with a smooth curve to draw a smooth curve.

【0011】[0011]

【実施例】【Example】

(実施例1)本発明の実施例として、エルミート内挿曲
線を応用した、マウスを用いてフリーハンドで描画でき
る描画装置の説明をする。 <構成>図1は本発明の実施例である描画装置の構成を
示すブロック図である。図1において、座標入力部11
から入力された座標データは、サンプリング部12で一
定時間おきにサンプリングされる。ベクトル算出部13
はサンンプリング部12で得られた座標データを基に、
その座標におけるベクトルを算出する。曲線算出部14
は、得られている座標ならびにベクトルを基に補間曲線
を算出し、表示部15で得られた曲線を表示する。
(Embodiment 1) As an embodiment of the present invention, a description will be given of a drawing device to which a Hermite interpolation curve is applied and which can be drawn by a freehand using a mouse. <Structure> FIG. 1 is a block diagram showing the structure of a drawing apparatus according to an embodiment of the present invention. In FIG. 1, the coordinate input unit 11
The coordinate data input from is sampled by the sampling unit 12 at regular intervals. Vector calculator 13
Is based on the coordinate data obtained by the sampling unit 12,
Calculate the vector at that coordinate. Curve calculator 14
Calculates an interpolation curve based on the obtained coordinates and vector, and displays the obtained curve on the display unit 15.

【0012】本実施例の装置の外観は、図2のようなも
のである。図2においてオペレータは、描画された画像
を表示するデイスプレイ1上に表示されているポインタ
2を見ながら、マウス2を用いて自由に線を描く用に座
標データを入力する。入力のために、オペレータはまず
描き始めたい点にポインタを合わせ、マウスのボタンを
押す。その点が曲線の始点となり、ボタンを押したまま
マウスを動かして(ドラッグして)ポインタを動かすと
その軌跡が曲線としてディスプレイ1に表示される。オ
ペレータがマウスのボタンを離すと、その点が終点とな
って、連続した曲線の入力はそこで終わる。マウスをド
ラッグしている間に入力された座標データは、コンピユ
ータ等からなる描画装置3で処理されており、その結果
曲線データが得られる。
The appearance of the apparatus of this embodiment is as shown in FIG. In FIG. 2, the operator inputs coordinate data for freely drawing a line by using the mouse 2 while looking at the pointer 2 displayed on the display 1 displaying the drawn image. For input, the operator first positions the pointer at the point where he wants to draw and presses the mouse button. That point becomes the starting point of the curve, and when the mouse is moved (drag) while the button is pressed and the pointer is moved, the locus is displayed as a curve on the display 1. When the operator releases the mouse button, that point becomes the end point and the continuous curve input ends there. The coordinate data input while dragging the mouse is processed by the drawing device 3 including a computer, and as a result, curve data is obtained.

【0013】以上のように構成され、操作される描画装
置は、CPUやメモリ、その他の周辺機器を組み合わ
せ、CPUでプログラムを実行することで実現すること
もできる。
The drawing device configured and operated as described above can be realized by combining a CPU, a memory, and other peripheral devices and executing a program by the CPU.

【0014】図3はそのための構成を示したブロック図
である。図3において、マウス31が座標入力部であ
り、ディスプレイ35で描かれた画像を表示する。CP
U34は装置全体を制御する処理部であり、メモリ32
に格納されたプログラムを実行する。メモリ33は参照
するデータ等を格納しておくために用いる。メモリ32
とメモリ33はひとつのメモリであっても構わない。こ
れらは、バス36で互いに接続されている。なお、メモ
リ32に格納されているプログラムとしては、マウス制
御プログラム321、ディスプレイ制御プログラム32
2、描画制御プログラム323がある。もちろん、この
他にも各種制御用や応用プログラムが格納されている
が、本発明の実施例としては本質にかかわることはない
ため、それらの説明は省略する。また、メモリ33には
サンプリングした座標データを格納する座標データメモ
リ331、それを基に算出されるベクトルデータメモリ
332、同じく曲線データメモリ333が確保され、そ
のほかに、作業領域334がとられている。これもメモ
リ32と同じく、他にさまざまに用いられているが、そ
れらの説明は省略する。なお、ベクトルデータメモリで
あるが、本実施例では曲線を算出するためにエルミート
内挿曲線を利用しているため、サンプリング点の座標
と、その点における接線のベクトルが必要となり、その
ために設けられている。
FIG. 3 is a block diagram showing a configuration for that purpose. In FIG. 3, the mouse 31 is a coordinate input unit and displays the image drawn on the display 35. CP
U34 is a processing unit that controls the entire apparatus, and includes a memory 32.
Execute the program stored in. The memory 33 is used to store data to be referred to. Memory 32
The memory 33 and the memory 33 may be one memory. These are connected to each other by a bus 36. The programs stored in the memory 32 include a mouse control program 321 and a display control program 32.
2. There is a drawing control program 323. Of course, other various control programs and application programs are also stored therein, but since they are not essential to the essence of the embodiment of the present invention, description thereof will be omitted. A coordinate data memory 331 for storing sampled coordinate data, a vector data memory 332 calculated based on the coordinate data memory 333, and a curve data memory 333 are secured in the memory 33, and a work area 334 is also provided. .. Like the memory 32, this is also used in various other ways, but description thereof will be omitted. Although it is a vector data memory, since the Hermite interpolation curve is used to calculate the curve in the present embodiment, the coordinates of the sampling point and the vector of the tangent line at that point are necessary, and are provided for that purpose. ing.

【0015】メモリ32に格納されているプログラムの
うち、マウス制御プログラム321はマウス31からの
入力を制御するためのものであり、ディスプレイ制御プ
ログラム322は画像データを形成して、ディスプレイ
35に表示する際の制御を行うものである。座標データ
から曲線を算出するのは描画制御プログラム323によ
って実現されるものであり、これは図1のサンプリング
部12・ベクトル算出部13・曲線算出部14を実現す
るものである。 <描画制御のフローチャート>図4は、描画制御プログ
ラム323のアルゴリズムを示すフローチヤートであ
り、CPU34により実行される。
Of the programs stored in the memory 32, the mouse control program 321 is for controlling the input from the mouse 31, and the display control program 322 forms image data and displays it on the display 35. This is to control the situation. The curve is calculated from the coordinate data by the drawing control program 323, which realizes the sampling unit 12, the vector calculation unit 13, and the curve calculation unit 14 in FIG. <Flowchart of Drawing Control> FIG. 4 is a flow chart showing an algorithm of the drawing control program 323, which is executed by the CPU 34.

【0016】オペレータが適当な位置をポインタで指定
すると、まずその座標を始点として座標データを座標デ
ータメモリ331に格納する。(S41)。
When the operator designates an appropriate position with a pointer, first, the coordinate data is stored in the coordinate data memory 331 with the coordinate as a starting point. (S41).

【0017】その後、一定時間経過すると、画面上のポ
インタの座標をサンプリングして(この座標を注目点と
呼ぶ)座標データメモリ331に格納し(S42)、そ
の点における曲線の接線ベクトルを求め、ベクトルデー
タメモリ332に格納する(S43)。こうして得られ
た座標データと接線ベクトルのデータとから、注目点と
その直前の点とをつなぐパラメトリツク曲線を算出する
(S44)。
After a lapse of a certain period of time, the coordinates of the pointer on the screen are sampled (this coordinate is called a point of interest) and stored in the coordinate data memory 331 (S42), and the tangent vector of the curve at that point is obtained. It is stored in the vector data memory 332 (S43). From the coordinate data thus obtained and the tangent vector data, a parametric curve connecting the point of interest and the point immediately before it is calculated (S44).

【0018】こうして2点を結ぶ曲線が得られたなら、
それを基に画像を表示する(S45。
If a curve connecting the two points is obtained in this way,
An image is displayed based on it (S45.

【0019】以上の手順で、始点から次のサンプリング
点までの曲線を描くことができる。この後、終点か否
か、すなわち、マウスのボタンが離されたかテストし
(S46)、離されていれば終了する。離されていなけ
れば、直前のサンプリングから更に一定時間のち、ポイ
ンタの座標をサンプリングし、これを新たな注目点とし
て、直前の注目点との間をつなぐパラメトリツク曲線を
描画する。これを終点に至るまで繰り返す。 <曲線算出処理>さて、本実施例の装置は、マウスボタ
ンが押された点(始点)から、マウスボタンが離された
点(終点)まで、画面上のマウスポインタの軌跡に沿っ
てなめらかな曲線を描くものである。そのために、サン
プリングされた点の座標から曲線を算出するために次の
ような方法を用いている。
With the above procedure, a curve from the starting point to the next sampling point can be drawn. After this, it is tested whether it is the end point, that is, whether the mouse button has been released (S46), and if it has been released, the process ends. If it is not separated, the coordinates of the pointer are sampled after a certain period of time from the immediately preceding sampling, and a parametric curve that connects the immediately preceding attention point is drawn with this as a new attention point. This is repeated until the end point. <Curve Calculation Processing> Now, the apparatus of the present embodiment is smooth along the locus of the mouse pointer on the screen from the point where the mouse button is pressed (start point) to the point where the mouse button is released (end point). It draws a curve. Therefore, the following method is used to calculate the curve from the coordinates of the sampled points.

【0020】本実施例の装置では、一定時間間隔Tでサ
ンプリングされた点列の間をつなぐパラメトリツク曲線
として、エルミート内挿曲線という3次曲線を用いる。
In the apparatus of the present embodiment, a cubic curve called Hermite interpolation curve is used as a parametric curve connecting between the point sequences sampled at a constant time interval T.

【0021】境界条件が4個(2つの点と各点における
接線ベクトル)であるから、未知の係数が4個の3次曲
線により2点間をつなぐのは自然な発想であろう。ま
た、アウトラインフオントの研究などからも、2点間を
つなぐなめらかな曲線としての3次曲線の有用性は確認
されている。
Since there are four boundary conditions (two points and a tangent vector at each point), it would be a natural idea to connect two points with a cubic curve having four unknown coefficients. In addition, studies on outline fonts have confirmed the usefulness of a cubic curve as a smooth curve connecting two points.

【0022】また、エルミート内挿曲線は2点の座標と
それらの点での接線ベクトルとが与えられれば決まるの
で、描画装置の計算能力が十分高ければ、ほぼリアルタ
イムに近い曲線の表示が可能である。エルミート内挿曲
線は以下に示すような計算で求められる。なお、説明中
のサンプリング間隔Tは、実際の装置に最適な値を実験
的に決定したり、ユーザの好みで決定することが考えら
れる。
Since the Hermite interpolation curve is determined by the coordinates of two points and the tangent vector at those points, if the drawing apparatus has a sufficiently high calculation capability, it is possible to display the curve in near real time. is there. The Hermite interpolation curve is calculated by the following calculation. It should be noted that the sampling interval T in the description may be experimentally determined to be an optimum value for an actual device, or may be determined according to user preference.

【0023】図5に示すように、エルミート内挿曲線で
つなごうとする2点の座標を、 P[n]=(x[n],y[n]) P[n+1]=(x[n+1],y[n+1]) とし、両点での接線ベクトルを、 V[n]=(r[n],s[n]) V[n+1]=(r[n+1],s[n+1]) とする。
As shown in FIG. 5, the coordinates of the two points to be connected by the Hermite interpolation curve are: P [n] = (x [n], y [n]) P [n + 1] = (x [n + 1] , Y [n + 1]) and the tangent vectors at both points are V [n] = (r [n], s [n]) V [n + 1] = (r [n + 1], s [n + 1]) ..

【0024】この2点をつなぐエルミート内挿曲線は、
kをパラメータとして次のように表される。
The Hermite interpolation curve connecting these two points is
It is expressed as follows using k as a parameter.

【0025】 C(k)=(f(k),g(k)),0≦k≦1 …(1) (2)式をまとめて、 C(k)=A33 +A22 +A1 k+A0 …(3) と書くことにする。C (k) = (f (k), g (k)), 0 ≦ k ≦ 1 (1) (2) collectively equation to be written as C (k) = A 3 k 3 + A 2 k 2 + A 1 k + A 0 ... (3).

【0026】まず、両端P[n],P[n+1]の条件
から C(0)=A0 =P[n] …(4) C(1)=A3 +A2 +A1 +A0 =P[n+1] …(5) である。
First, from the conditions of both ends P [n] and P [n + 1], C (0) = A 0 = P [n] (4) C (1) = A 3 + A 2 + A 1 + A 0 = P [ n + 1] (5).

【0027】また、曲線上の接線ベクトルは C′(k)=dC/dk=3A32 +2A2 k+A1 …(6) であるから、 C′(0)=A1 =V[n] …(7) C′(1)=3A3 +2A2 +A1 =V[n+1] …(8) となる。The tangent vector on the curve is C '(k) = dC / dk = 3A 3 k 2 + 2A 2 k + A 1 (6), so C' (0) = A 1 = V [n] (7) C ′ (1) = 3A 3 + 2A 2 + A 1 = V [n + 1] (8)

【0028】(4),(5),(7),(8)式を解く
と、 となり、曲線C(k)は、 C(k)=(2P[n]−2P[n+1]+V[n]+V[n+1])k3 +(−3P[n]+3P[n+1]−2V[n]−V[n+1])k2 +V[n]k+P[n],0≦k≦1 …(10) で与えられる。
Solving equations (4), (5), (7) and (8), Next, the curve C (k) is, C (k) = (2P [n] -2P [n + 1] + V [n] + V [n + 1]) k 3 + (- 3P [n] + 3P [n + 1] -2V [n ] −V [n + 1]) k 2 + V [n] k + P [n], 0 ≦ k ≦ 1 (10)

【0029】曲線が通る点P[n](n=0,1,…,
m)は、マウスポインタの座標をサンプリングして記憶
することにより得られる。
A point P [n] (n = 0, 1, ...,
m) is obtained by sampling and storing the coordinates of the mouse pointer.

【0030】一方、点P[n]における接線ベクトル
は、次のようにして求める。
On the other hand, the tangent vector at the point P [n] is obtained as follows.

【0031】図6に示すように、曲線上の点Pをサンプ
リングする時間間隔T(例えば1/10秒)よりはるか
に短い間隔Td(例えば1/100秒)で、点P[n]
の直前、直後のポインタ座標Qb[n],Qa[n]を
サンプリングする。この2点Qb[n],Qa[n]を
結ぶベクトルを、点P[n]における接線ベクトルとす
る。すなわち、 V[n]=(Qa[n]−Qb[n])/(2Td/T) …(11) である。
As shown in FIG. 6, the point P [n] is set at a time interval Td (for example, 1/100 second) much shorter than the time interval T (for example, 1/10 second) for sampling the point P on the curve.
The pointer coordinates Qb [n] and Qa [n] immediately before and immediately after are sampled. The vector connecting these two points Qb [n] and Qa [n] is the tangent vector at the point P [n]. That is, V [n] = (Qa [n] -Qb [n]) / (2Td / T) (11).

【0032】Td→0とした極限が点P[n]における
接線ベクトルの定義そのものであるから、Tdを十分小
さくとれば(11)式の値は真の接線ベクトルに十分近
くなる。
Since the limit of Td → 0 is the definition of the tangent vector at the point P [n] itself, the value of equation (11) becomes sufficiently close to the true tangent vector if Td is made sufficiently small.

【0033】以上により、曲線上の各点と、それらの点
での接線ベクトルが求まり、(10)式によりエルミー
ト内挿曲線を描くことが可能になるが、始点ではQb
[0]、終点ではQa[m]の値が得られないため、曲
線の始点P[0]と終点P[m]での接線ベクトルをど
う定義するか、という問題が残る。
From the above, each point on the curve and the tangent vector at those points can be obtained, and the Hermite interpolation curve can be drawn by the equation (10).
Since the value of Qa [m] cannot be obtained at [0] and the end point, there remains a problem of how to define the tangent vector at the start point P [0] and the end point P [m] of the curve.

【0034】これを解決するために、本実施例では、始
点と終点での曲率を0とする(曲線Cの2次導関数の値
を0とする)という条件を導入する。
In order to solve this, the present embodiment introduces a condition that the curvature at the start point and the end point is 0 (the value of the second derivative of the curve C is 0).

【0035】 C″(k)=dC′/dk=6A3 k+2A2 …(12) であるから、始点P[0]からP[1]までの曲線の場
合、 C(0)=A0 =P[0] …(13) C(1)=A3 +A2 +A1 +A0 =P[1] …(14) C″(0)=2A2 =0 …(15) C′(1)=3A3 +2A2 +A1 =V[1] …(16) より、 となり、P[0]からP[1]までの曲線は C(k)={(P[0]−P[1]+V[1])/2}k3 +{(−3P[0]+3P[1]−V[1])/2}k+P[0] ,0≦k≦1 …(18) で与えられる。
Since C ″ (k) = dC ′ / dk = 6A 3 k + 2A 2 (12), in the case of the curve from the starting point P [0] to P [1], C (0) = A 0 = P [0] (13) C (1) = A 3 + A 2 + A 1 + A 0 = P [1] (14) C ″ (0) = 2 A 2 = 0 (15) C ′ (1) = From 3A 3 + 2A 2 + A 1 = V [1] (16), Next, P [0] is equivalent to curve up P [1] from the C (k) = {(P [0] -P [1] + V [1]) / 2} k 3 + {(- 3P [0] + 3P [1] −V [1]) / 2} k + P [0], 0 ≦ k ≦ 1 (18)

【0036】終点の場合は、やや問題が複雑になる。マ
ウスボタンが離されるタイミングは、その直前のサンプ
リング点から丁度時間T(サンプリング間隔)後である
とは限らないからである。
In the case of the end point, the problem becomes a little complicated. This is because the timing at which the mouse button is released is not necessarily exactly after the time T (sampling interval) from the sampling point immediately before that.

【0037】そこで本実施例では、マウスボタンが離さ
れた時点の直前のサンプリング点を終点P[m]と定義
し、そこでの曲率を0としてP[m−1]からP[m]
までの曲線を描くこととした。
Therefore, in the present embodiment, the sampling point immediately before the time when the mouse button is released is defined as the end point P [m], and the curvature there is set to 0, and P [m-1] to P [m].
I decided to draw a curve up to.

【0038】終点での曲率を0としたのは、上述のよう
にマウスボタンの離されるタイミングが予測不可能であ
るため、終点P[m]から時間Td後の点Qa[m]が
常にサンプリング可能とは限らず、(11)式により接
線ベクトルを求めることができないためである。
The reason why the curvature at the end point is 0 is that the timing at which the mouse button is released is unpredictable as described above, so that the point Qa [m] after the time Td from the end point P [m] is always sampled. This is not always possible, and the tangent vector cannot be obtained by the equation (11).

【0039】さて、P[m−1]からP[m]までの曲
線の場合、 C(0)=A0 =P[m−1] …(19) C(1)=A3 +A2 +A1 +A0 =P[m] …(20) C′(0)=A1 =V[m−1] …(21) C″(1)=6A3 +2A2 =0 …(22) より、 となり、P[m−1]からP[m]までの曲線は C(k)={(P[m−1]−P[m]+V[m−1])/2}k3 +{3(−P[m−1]+P[m]−V[m−1])/2}k2 +V[m−1]k+P[m−1],0≦k≦1 …(24) で与えられる。
[0039] Now, the case of the curve from the P [m-1] to P [m], C (0 ) = A 0 = P [m-1] ... (19) C (1) = A 3 + A 2 + A 1 + A 0 = P [m] (20) C ′ (0) = A 1 = V [m−1] (21) C ″ (1) = 6A 3 + 2A 2 = 0 (22) Next, P is the curve from [m-1] to P [m] C (k) = {(P [m-1] -P [m] + V [m-1]) / 2} k 3 + {3 (-P [m-1] + P [m] -V [m-1]) / 2} k 2 + V [m-1] k + P [m-1], is given by 0 ≦ k ≦ 1 ... (24 ) ..

【0040】以上のようにして、(10)式,(18)
式,(24)式によりマウスポインタの軌跡に沿ったな
めらかな曲線を求め、画面に描画することにより、なめ
らかな曲線が簡単に描ける描画装置が実現できる。
As described above, equations (10) and (18)
By obtaining a smooth curve along the locus of the mouse pointer by the formulas and (24) and drawing it on the screen, it is possible to realize a drawing device that can easily draw a smooth curve.

【0041】なお、座標入力装置はマウス以外でも連続
的に座標入力できるデバイスなら良く、たとえばデジタ
イザやトラッキングボールなどを用いても良い。
The coordinate input device may be any device other than a mouse that can continuously input coordinates, and for example, a digitizer or a tracking ball may be used.

【0042】[0042]

【他の実施例】 (実施例2)実施例2として、特に始点,終点における
接線ベクトルの求め方を工夫し、上記実施例1における
(10)式のみで全曲線を描く描画装置を説明する。
[Other Embodiments] (Embodiment 2) As a second embodiment, a description will be given of a drawing apparatus which devises a method of obtaining a tangent vector at a start point and an end point, and draws all curves only by the expression (10) in the above first embodiment. ..

【0043】まず、始点P[0]での接線ベクトルであ
るが、図7に示すように、サンプリング時間間隔T(例
えば1/10秒)よりはるかに短い時間間隔Td1 (例
えば1/100秒)でP[0]直後のマウスポインタの
座標Qa[0]をサンプリングし、P[0]とQa
[0]を結ぶベクトルを始点での接線ベクトルとする。
すなわち、 V[0]=(Qa[0]−P[0])/(Td1 /T) …(31) である。
First, regarding the tangent vector at the starting point P [0], as shown in FIG. 7, a time interval Td 1 (for example, 1/100 second) that is much shorter than the sampling time interval T (for example, 1/10 second). ), The coordinate Qa [0] of the mouse pointer immediately after P [0] is sampled, and P [0] and Qa
The vector connecting [0] is the tangent vector at the starting point.
That is, V [0] = (Qa [0] −P [0]) / (Td 1 / T) (31).

【0044】次に、終点P[m]における接線ベクトル
を求める。
Next, the tangent vector at the end point P [m] is obtained.

【0045】実施例1と同様に、マウスボタンが離され
た直前のサンプリング点を終点P[m]と定義する。
Similar to the first embodiment, the sampling point immediately before the mouse button is released is defined as the end point P [m].

【0046】始点の場合と同様に、サンプリング時間間
隔T(例えば1/10秒)よりはるかに短い時間間隔T
2 (例えば1/100秒)でP[m]直後のマウスポ
インタの座標Qa[m]をサンプリングし、P[m]と
Qa[m]を結ぶベクトルを終点における接線ベクトル
とする。この様子を図8に示す。
As in the case of the starting point, a time interval T much shorter than the sampling time interval T (for example, 1/10 second).
The coordinate Qa [m] of the mouse pointer immediately after P [m] is sampled at d 2 (for example, 1/100 second), and the vector connecting P [m] and Qa [m] is set as the tangent vector at the end point. This state is shown in FIG.

【0047】すなわち、 V[m]=(Qa[m]−P[m])/(Td2 /T) …(32) である。That is, V [m] = (Qa [m] -P [m]) / (Td 2 / T) (32).

【0048】このとき、丁度点P[m]においてマウス
ボタンが離されたとしても、かまわずポインタの座標を
サンプリングしてQa[m]を得ることにより、終点で
の接線ベクトルを定義する。
At this time, even if the mouse button is just released at the point P [m], the tangent vector at the end point is defined by sampling the coordinates of the pointer to obtain Qa [m].

【0049】以上のように始点,終点での接線ベクトル
を定義することにより、P[0]からP[1]までの曲
線、P[m−1]からP[m]までの曲線を特別に扱う
必要がなくなり、(10)式のみで全曲線を描くことが
可能になる。
By defining the tangent vectors at the start point and the end point as described above, the curves P [0] to P [1] and the curves P [m-1] to P [m] are specially defined. It is not necessary to handle it, and it becomes possible to draw the entire curve only with the equation (10).

【0050】さらに、本実施例では、曲線上の点P
[n]における接線ベクトルについても始点,終点と同
様な求め方を採用することにより、装置の簡略化をはか
つた。つまり、上記実施例1においてP[n]の直前の
点Qb[n]をサンプリングせず、P[n]とQa
[n]を結ぶベクトルを点P[n]における接線ベクト
ルとしたのである。
Further, in this embodiment, the point P on the curve is
For the tangent vector in [n], the device is simplified by adopting the same calculation method as the start point and the end point. That is, in the first embodiment, the point Qb [n] immediately before P [n] is not sampled, and P [n] and Qa are not sampled.
The vector connecting [n] is the tangent vector at the point P [n].

【0051】すなわち、 V[n]=(Qa[n]−P[n])/(Td/T) …(33) である。That is, V [n] = (Qa [n] -P [n]) / (Td / T) (33).

【0052】描こうとするのはなめらかな曲線であるか
ら、Td→0としたときの(11)式と(33)式の値
は一致する。
Since it is a smooth curve to be drawn, the values of the equations (11) and (33) when Td → 0 are the same.

【0053】Tdを十分小さくとれば、(33)式で接
線ベクトルを定義してもかまわないわけである。
If Td is made sufficiently small, the tangent vector may be defined by the equation (33).

【0054】さらに、Td,Td1 ,Td2 の値を同じ
にすることにより、曲線上の全ての点における接線ベク
トルの求め方を統一することができる。
Further, by making the values of Td, Td 1 and Td 2 the same, it is possible to unify the method of obtaining the tangent vector at all points on the curve.

【0055】以上のようにして、全ての点における接線
ベクトルの求め方、点間を結ぶ全ての区間における曲線
の描き方を統一することにより、描画アルゴリズムが簡
単になり、装置を簡略化することができる。
As described above, by unifying the method of obtaining the tangent vector at all points and the method of drawing the curve in all the sections connecting the points, the drawing algorithm is simplified and the apparatus is simplified. You can

【0056】(実施例3)マウスでフリーハンド曲線を
描く場合、マウスボタンが押されてからマウスが動き出
すまで、時間遅れがあることがある。
(Embodiment 3) When drawing a freehand curve with a mouse, there may be a time delay from when the mouse button is pressed until the mouse starts to move.

【0057】上記実施例2において、この時間遅れがT
1 より大きいと、始点での接線ベクトルが0になつて
しまう。また、時間遅れがTd1 より小さくても、始点
での接線ベクトルは実際よりも小さく評価されてしま
う。
In the second embodiment, this time delay is T
If it is larger than d 1 , the tangent vector at the starting point becomes 0. Further, even if the time delay is smaller than Td 1 , the tangent vector at the start point is evaluated smaller than it actually is.

【0058】このように、時間遅れがあると、意図した
のとは違った曲線が描画されてしまうことがある。
As described above, if there is a time delay, a curve different from the intended curve may be drawn.

【0059】サンプリング時間間隔Tが十分小さけれ
ば、この時間遅れによる曲線の変形は画面上で無視でき
るほど小さくなるが、そうでない場合は何らかの対策が
必要となる。
If the sampling time interval T is sufficiently small, the deformation of the curve due to this time delay is so small that it can be ignored on the screen, but if it is not, some measure is required.

【0060】上記実施例2において、この時間遅れの問
題に対応するため、始点を以下のように定義することと
したのが本実施例である。
In the second embodiment, in order to deal with the problem of the time delay, the starting point is defined as follows.

【0061】マウスは、通常2方向(x,y)の移動量
をエンコーダでパルス列に変換して描画装置に送信し、
描画装置はそのパルスの数によつて画面上のポインタを
動かしている。
The mouse normally converts the movement amount in two directions (x, y) into a pulse train by an encoder and transmits the pulse train to the drawing device,
The drawing device moves the pointer on the screen according to the number of the pulses.

【0062】そこで、マウスボタンが押されてから送ら
れてきたパルスの総和が一定値S(例えば5)以上とな
つた点を始点と定義し、そこから曲線の描画を開始する
ことにより、時間遅れの問題を回避することとした。
Therefore, the point at which the total sum of the pulses sent after the mouse button is pressed is a fixed value S (for example, 5) or more is defined as the starting point, and the drawing of the curve is started from that point. I decided to avoid the problem of delay.

【0063】ここで、Sの値は、上述のように定義した
始点と実際にマウスボタンが押された点とが画面上で十
分近くなるように、マウスの解像度(移動距離に対する
パルスの数)等を考慮して適当に定めるものとする。
Here, the value of S is the resolution of the mouse (the number of pulses with respect to the moving distance) so that the start point defined as described above and the point where the mouse button is actually pressed are sufficiently close on the screen. It shall be appropriately determined in consideration of the above.

【0064】以上により、マウスのボタンが押されてか
ら実際に線が描き始められるまでに時間差があっても、
オペレータが意図したとおりの曲線を描ける描画装置が
実現できる。
As described above, even if there is a time lag between when the mouse button is pressed and when the line is actually started,
It is possible to realize a drawing device that can draw a curve as intended by the operator.

【0065】尚、本発明は、複数の機器から構成される
システムに適用しても、1つの機器から成る装置に適用
しても良い。また、本発明はシステム或は装置にプログ
ラムを供給することによつて達成される場合にも適用で
きることは言うまでもない。
The present invention may be applied to a system composed of a plurality of devices or an apparatus composed of a single device. Further, it goes without saying that the present invention can be applied to the case where it is achieved by supplying a program to a system or an apparatus.

【0066】[0066]

【発明の効果】以上説明したように、本発明にかかる描
画方法及び装置は、なめらかなフリーハンド曲線を誰で
も簡単に描くことができるという効果がある。
As described above, the drawing method and apparatus according to the present invention has an effect that anyone can easily draw a smooth freehand curve.

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

【図1】本発明の実施例の描画装置のブロック図であ
る。
FIG. 1 is a block diagram of a drawing apparatus according to an embodiment of the present invention.

【図2】実施例の描画装置の外観図である。FIG. 2 is an external view of a drawing apparatus according to an embodiment.

【図3】実施例の描画装置のブロック図である。FIG. 3 is a block diagram of a drawing apparatus according to an embodiment.

【図4】曲線の描画アルゴリズムを示すフローチヤート
である。
FIG. 4 is a flow chart showing a curve drawing algorithm.

【図5】2点間をつなぐなめらかな3次曲線を示す図面
である。
FIG. 5 is a drawing showing a smooth cubic curve connecting two points.

【図6】実施例1における接線ベクトルの求め方を示す
図である。
FIG. 6 is a diagram showing how to obtain a tangent vector in the first embodiment.

【図7】実施例2における始点の接線ベクトルの求め方
を示す図である。
FIG. 7 is a diagram showing a method of obtaining a tangent vector of a starting point in the second embodiment.

【図8】実施例2における終点の接線ベクトルの求め方
を示す図である。
FIG. 8 is a diagram illustrating a method of obtaining a tangent vector at an end point according to the second embodiment.

───────────────────────────────────────────────────── フロントページの続き (51)Int.Cl.5 識別記号 庁内整理番号 FI 技術表示箇所 G09G 5/20 8121−5G 5/36 8121−5G ─────────────────────────────────────────────────── ─── Continuation of the front page (51) Int.Cl. 5 Identification code Office reference number FI technical display location G09G 5/20 8121-5G 5/36 8121-5G

Claims (7)

【特許請求の範囲】[Claims] 【請求項1】 表示画面上に所望の線を描く描画装置で
あって、 座標データを連続的に入力する座標入力手段と、 前記座標入力手段により入力された座標データを、一定
時間おきにサンプリングしてサンプリング点の座標を得
る手段と、 前記サンプリング点の間を滑らかに結ぶ曲線で補間する
補間手段と、 を備えることを特徴とする描画装置。
1. A drawing apparatus for drawing a desired line on a display screen, wherein coordinate input means for continuously inputting coordinate data, and coordinate data input by the coordinate input means are sampled at regular intervals. And a means for obtaining the coordinates of the sampling points, and an interpolating means for interpolating with a curve smoothly connecting the sampling points.
【請求項2】 前記補間手段は、前記サンプリング点に
おける接線ベクトルを算出する算出手段を備え、 前記サンプリング点の座標データと前記接線ベクトルと
に基づいてエルミート内挿曲線を求めて、その曲線で補
間することを特徴とする請求項1記載の描画装置。
2. The interpolation means comprises calculation means for calculating a tangent vector at the sampling point, obtains a Hermitian interpolation curve based on the coordinate data of the sampling point and the tangent vector, and interpolates with the curve. The drawing apparatus according to claim 1, wherein:
【請求項3】 前記算出手段は、前記サンプリング点の
直前の点と直後の点の2点の座標データを得、前記2点
を結ぶベクトルを接線ベクトルとすることを特徴とする
請求項2記載の描画装置。
3. The calculation means obtains coordinate data of two points, a point immediately before and a point immediately after the sampling point, and sets a vector connecting the two points as a tangent vector. Drawing device.
【請求項4】 前記算出手段は、前記サンプリング点の
直後の点の座標データを得、前記サンプリング点と前記
直後の点との2点を結ぶベクトルを接線ベクトルとする
ことを特徴とする請求項2記載の描画装置。
4. The calculating means obtains coordinate data of a point immediately after the sampling point, and sets a vector connecting two points of the sampling point and the point immediately after as a tangent vector. 2. The drawing device according to 2.
【請求項5】 連続して描かれた線の最初のサンプリン
グ点と最後のサンプリング点においては、共に曲率をゼ
ロとみなして補間を行うことを特徴とする請求項2記載
の描画装置。
5. The drawing apparatus according to claim 2, wherein at the first sampling point and the last sampling point of continuously drawn lines, the curvature is regarded as zero and interpolation is performed.
【請求項6】 表示画面上に所望の線を描く描画方法で
あって、 座標データを連続的に入力する座標入力行程と、 前記座標入力手段により入力された座標データを、一定
時間おきにサンプリングしてサンプリング点の座標を得
る行程と、 前記サンプリング点の間を滑らかに結ぶ曲線で補間する
補間行程と、 を備えることを特徴とする描画方法。
6. A drawing method for drawing a desired line on a display screen, comprising: a coordinate input step of continuously inputting coordinate data; and sampling of coordinate data input by the coordinate input means at regular intervals. And a step of obtaining the coordinates of the sampling points, and an interpolation step of interpolating with a curve that smoothly connects the sampling points.
【請求項7】 前記補間行程は、前記サンプリング点に
おける接線ベクトルを算出する算出行程を備え、 前記サンプリング点の座標データと前記接線ベクトルと
に基づいてエルミート内挿曲線を求めて、その曲線で補
間することを特徴とする請求項6記載の描画方法。
7. The interpolation step includes a calculation step for calculating a tangent vector at the sampling point, a Hermite interpolation curve is obtained based on the coordinate data of the sampling point and the tangent vector, and the curve is interpolated. The drawing method according to claim 6, further comprising:
JP3320330A 1991-12-04 1991-12-04 Method and device for plotting Withdrawn JPH05159036A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3320330A JPH05159036A (en) 1991-12-04 1991-12-04 Method and device for plotting

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3320330A JPH05159036A (en) 1991-12-04 1991-12-04 Method and device for plotting

Publications (1)

Publication Number Publication Date
JPH05159036A true JPH05159036A (en) 1993-06-25

Family

ID=18120279

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3320330A Withdrawn JPH05159036A (en) 1991-12-04 1991-12-04 Method and device for plotting

Country Status (1)

Country Link
JP (1) JPH05159036A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0762265A2 (en) * 1995-08-31 1997-03-12 Canon Kabushiki Kaisha Coordinate input device and method
US5995081A (en) * 1996-01-12 1999-11-30 Nec Corporation Handwriting type input display device
JP2003316331A (en) * 2002-04-25 2003-11-07 Sanyo Electric Co Ltd Display device
JP2008084110A (en) * 2006-09-28 2008-04-10 Toshiba Corp Information display device, information display method and information display program
JP2011018228A (en) * 2009-07-09 2011-01-27 Casio Computer Co Ltd Information processing terminal and program
CN112529890A (en) * 2020-12-21 2021-03-19 北京百度网讯科技有限公司 Method and device for processing track, road side equipment and cloud control platform

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0762265A2 (en) * 1995-08-31 1997-03-12 Canon Kabushiki Kaisha Coordinate input device and method
EP0762265A3 (en) * 1995-08-31 1997-06-11 Canon Kk Coordinate input device and method
US5995081A (en) * 1996-01-12 1999-11-30 Nec Corporation Handwriting type input display device
JP2003316331A (en) * 2002-04-25 2003-11-07 Sanyo Electric Co Ltd Display device
JP2008084110A (en) * 2006-09-28 2008-04-10 Toshiba Corp Information display device, information display method and information display program
JP2011018228A (en) * 2009-07-09 2011-01-27 Casio Computer Co Ltd Information processing terminal and program
CN112529890A (en) * 2020-12-21 2021-03-19 北京百度网讯科技有限公司 Method and device for processing track, road side equipment and cloud control platform
JP2022020672A (en) * 2020-12-21 2022-02-01 阿波▲羅▼智▲聯▼(北京)科技有限公司 Method and apparatus for processing trajectory, roadside device, cloud control platform, and computer program

Similar Documents

Publication Publication Date Title
TWI427553B (en) Generation of cubic bezier control points in computer graphics systems
JPH0668758B2 (en) Cursor control method and three-dimensional graphic display device
JPH076232A (en) System and method for execution of hybrid forward diffrence process so as to describe bezier spline
JPH06110992A (en) Shape deformation input operation method in cad system
JPH08101922A (en) Picture editing and forming device and picture editing and forming method
JPH05159036A (en) Method and device for plotting
JPH0612493A (en) Gesture recognizing method and user interface method
JP2703032B2 (en) How to make a video
JP3250841B2 (en) Graphic data processing method and apparatus
JPH08137608A (en) Three-dimension coordinate input device
JP6893349B2 (en) Animation production system, animation production method, and program
CN114116109A (en) Equipment layout processing method, system, device and storage medium
JP3464874B2 (en) Method and apparatus for tracing point sequence by Bezier curve
JPH05101150A (en) Analytic result data display system
JP2004013545A (en) Information processing device
JP2684609B2 (en) Graphic display method in graphic data processing device
US11099845B2 (en) Image edit apparatus for creating synthesized images, and image edit method and recording medium
JP2616443B2 (en) Graphic drawing device
JP3451292B2 (en) Figure transformation device
JP4834642B2 (en) Graphic change device, graphic change method, computer program, and recording medium
JP4986835B2 (en) Collective display image output device, collective display image output method, computer program, and recording medium
CN112506348A (en) Configuration method and device of visual parameters of immersive flow field
JPH0816803A (en) Graphic processor and graphic processing method
JPH0736606A (en) Waveform data analysis system
JPH0519952A (en) Handwritten character input and display device

Legal Events

Date Code Title Description
A300 Application deemed to be withdrawn because no request for examination was validly filed

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19990311