JPH0453318B2 - - Google Patents

Info

Publication number
JPH0453318B2
JPH0453318B2 JP59239232A JP23923284A JPH0453318B2 JP H0453318 B2 JPH0453318 B2 JP H0453318B2 JP 59239232 A JP59239232 A JP 59239232A JP 23923284 A JP23923284 A JP 23923284A JP H0453318 B2 JPH0453318 B2 JP H0453318B2
Authority
JP
Japan
Prior art keywords
equation
line segment
satisfies
displacement
starting point
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.)
Expired
Application number
JP59239232A
Other languages
Japanese (ja)
Other versions
JPS61117596A (en
Inventor
Naoki Sano
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.)
Yokogawa Electric Corp
Original Assignee
Yokogawa Electric Corp
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 Yokogawa Electric Corp filed Critical Yokogawa Electric Corp
Priority to JP59239232A priority Critical patent/JPS61117596A/en
Publication of JPS61117596A publication Critical patent/JPS61117596A/en
Publication of JPH0453318B2 publication Critical patent/JPH0453318B2/ja
Granted legal-status Critical Current

Links

Description

【発明の詳細な説明】 (産業上の利用分野) 本発明はデイジタル線分発生器に関し、更に詳
しくは始点が直線上にないデイジタル線分を高速
に発生させることができるデイジタル線分発生器
に関する。
Detailed Description of the Invention (Field of Industrial Application) The present invention relates to a digital line segment generator, and more particularly to a digital line segment generator that can rapidly generate digital line segments whose starting points are not on a straight line. .

(従来の技術) グラフイツクデイスプレイ装置や数値制御工作
機械(NCマシン)等の分野では、デイジタル線
分やデイジタル円弧等の線図形を高速、高精度で
発生する必要がある。このため、これまで各種の
図形発生アルゴリズムが開発され、このアルゴリ
ズムをハードウエア化した線図形発生器が考案さ
れている。
(Prior Art) In fields such as graphic display devices and numerically controlled machine tools (NC machines), it is necessary to generate line figures such as digital line segments and digital arcs at high speed and with high precision. For this reason, various graphic generation algorithms have been developed, and line graphic generators have been devised that incorporate these algorithms into hardware.

デイジタル線分の発生法の一つとして、直線を
含む高精度の2次曲線図形が統一的に発生できる
変位比較法が用いられている。変位比較法は、発
生すべき直線の方程式を f(x,y)=ax−by+c=0 (1) とした時、始点を含む既に選択したドツトの次に
選択すべきドツトを IF MIN|f(Pi)|=|f(Pj)| THEN TAKE Pj (2) (但しi,j〓I,I=1,2……8) なるアルゴリズムに基づいて生成する方法であ
る。ここで、(1)式のa,b,cは定数である。
As one method for generating digital line segments, a displacement comparison method is used that can uniformly generate highly accurate quadratic curve figures including straight lines. In the displacement comparison method, when the equation of the straight line to be generated is f (x, y) = ax - by + c = 0 (1), the dot to be selected next to the already selected dot including the starting point is IF MIN | f (Pi)|=|f(Pj)|THEN TAKE Pj (2) (where i, j〓I, I=1, 2...8). Here, a, b, and c in equation (1) are constants.

第8図は前述した候補ドツトの方向選択を説明
するための図である。P0乃至P8は、xy平面内の
ドツト位置を示す。P0は前回選択したドツトを、
P1〜P8は今回選択すべき候補ドツトをそれぞれ
示している。候補ドツトP0〜P8のうち、P1〜P4
は4画素連結表示時の候補ドツト、P1〜P8は8
画素連結表示時の候補ドツトである。第(2)式のI
はドツトP1〜P8の番号を示し、f(Pi)は特定平
面φからドツトPiにおける変位(詳細後述)を表
わしている。
FIG. 8 is a diagram for explaining the aforementioned direction selection of candidate dots. P 0 to P 8 indicate dot positions in the xy plane. P 0 is the previously selected dot,
P 1 to P 8 respectively indicate candidate dots to be selected this time. Among candidate dots P 0 to P 8 , P 1 to P 4
is a candidate dot for 4-pixel connected display, P 1 to P 8 is 8
These are candidate dots when displaying pixel connections. I in formula (2)
indicates the numbers of dots P1 to P8 , and f(Pi) indicates the displacement of dot Pi from the specific plane φ (details will be described later).

第(1)式は、次式 φ:Z=f(x,y)=ax−by+c (3) で表わされる平面φとxy平面(z=0の面)と
の交線と考えることができる。第9図は、特定平
面φとxyz3次元空間内のxy平面との交わりを示
す図、第10図は特定平面φの断面図である。第
9図のLが平面φとxy平面との交線である。xy
平面上の点P0(第8図のP0に同じ)から垂直に伸
ばした垂線が特定平面φと交わる場合、P0から
交点A0までの距離を|f(P0)|又は|Z0|で表
わし、f(P0)を平面φからドツトP0における変
位と定義する。
Equation (1) can be thought of as the line of intersection between the plane φ and the xy plane (z=0 plane), which is expressed by the following equation: φ:Z=f(x,y)=ax−by+c (3) . FIG. 9 is a diagram showing the intersection of the specific plane φ and the xy plane in the xyz three-dimensional space, and FIG. 10 is a sectional view of the specific plane φ. L in FIG. 9 is the intersection line between the plane φ and the xy plane. xy
When a perpendicular line extending perpendicularly from a point P 0 on a plane (same as P 0 in Figure 8) intersects a specific plane φ, the distance from P 0 to the intersection A 0 is |f(P 0 )| or |Z 0 |, and f(P 0 ) is defined as the displacement at the dot P 0 from the plane φ.

変位比較法は前回選択したP0点の次のドツト
を選択するのに、第8図P1〜P8に示す候補点の
うちからその変位f(Pi)(i=1〜8)が最小に
なる点を選ぶものである。即ち、(2)式で変位の絶
対値を比較し、最小の変位を有する候補ドツトを
次の選択ドツトとして選択するものである。
The displacement comparison method is used to select the next dot after the previously selected point P0 , but only if its displacement f(Pi) (i = 1 to 8) is the smallest among the candidate points shown in Figure 8, P1 to P8 . The point is to choose the point that becomes . That is, the absolute values of displacements are compared using equation (2), and the candidate dot with the smallest displacement is selected as the next selected dot.

(発明が解決しようとする問題点) 前述した変位比較法を用いて、単純な加減算機
能のみでデイジタル線分を発生するためには、始
点Ps(xs,ys)が(1)式で表わされる直線上に存在
すること、即ち、始点における変位Zsが0、つま
り Zs=f(Ps)=axs−bys+c=0 (4) であることが前提になつている。しかしながら、
発生すべき直線の方程式(1)式に対して、x座標又
はy座標の何れか一方の座標をパラメータとして xs≦x≦xe (5) 又は、 ys≦y≦ye (6) を満足する範囲でデイジタル線分を発生させる場
合には、始点Ps(xs,ys)の座標及び始点Psにお
ける変位Zsを求める必要がある。従来方法によれ
ば、始点Ps(xs,ys)の座標及びPsにおける変位
Zsを求めるのに乗除算機能が必要となる。
(Problem to be Solved by the Invention) In order to generate a digital line segment using only a simple addition and subtraction function using the displacement comparison method described above, the starting point P s (x s , y s ) must be determined by formula (1). It is assumed that the displacement Z s at the starting point is 0, that is, Z s = f (P s ) = ax s −by s + c = 0 (4). . however,
For the equation (1) of the straight line to be generated, use either the x or y coordinate as a parameter: x s ≦x≦x e (5) or y s ≦y≦y e (6) When generating a digital line segment within a range that satisfies the following, it is necessary to find the coordinates of the starting point P s (x s , y s ) and the displacement Z s at the starting point P s . According to the conventional method, the coordinates of the starting point P s (x s , y s ) and the displacement at P s
Multiplication and division functions are required to find Z s .

即ち、xsが与えられる時にはy=(axs+c)/
bより最も真値に近いデイジタル値をys,一方ys
が与えられる時にはx=(bys−c)/aより最も
真値に近いデイジタル値をxsとして求め、算出し
たxs又はysの値を用いて、始点Ps(xs,ys)にお
ける変位Zs=axs−bys+cを計算しなければなら
なかつた。
That is, when x s is given, y = (ax s + c)/
The digital value closest to the true value than b is y s , while y s
is given, find the digital value closest to the true value from x=(by s - c)/a as x s , and use the calculated value of x s or y s to find the starting point P s (x s , y s ) had to be calculated: Z s =ax s −by s +c.

本発明はこのような点に鑑みてなされたもので
あつて、その目的は、方程式f(x,y)=ax−
by+c=0で記述され、xs≦x≦xe又はys≦y≦
yeを満足するデイジタル線分を、変位比較法を用
いて単純な加減算機能のみで高速かつ高精度で発
生できる簡単な構成のデイジタル線分発生器を実
現することにある。
The present invention has been made in view of these points, and its purpose is to solve the equation f(x,y)=ax−
Written by + c = 0, x s ≦x≦x e or y s ≦y≦
The object of the present invention is to realize a digital line segment generator with a simple configuration that can generate digital line segments satisfying y e at high speed and with high precision using only simple addition and subtraction functions using a displacement comparison method.

(問題点を解決するための手段) 前記した問題点を解決する本発明は、x,yを
変数、a,b,cを既知の定数とする方程式 f(x,y)=ax−by+c=0 で記述され、xs≦x≦xe又はys≦y≦yeの範囲を
満足するデイジル線分を発生する場合に、 パラメータxs,xeが与えられる場合には、y,
uを変数、−bを係数、cを定数とする方程式 f1(y,u)=−by+c−u=0 を、パラメータys,yeが与えられる場合には、
x,vを変数、aを係数、cを定数とする方程式 f2(x,v)=ax+c−v=0 をそれぞれ定義し、 これら方程式より、f1(y,u)=0の近傍点で
u=0を満足するy軸上の最も真値に近いデイジ
タル値ye1、又はf2(x,v)=0の近傍点でv=
0を満足するx軸上の最も真値に近いデイジタル
値xe2を、 方程式f1(y,u)=0の場合にはf1(y,u)=
0を満足する点Qs1(0,c)を、方程式f2(x,
v)=0の場合にはf2(x,v)=0を満足する点
Qs2(0,C)をそれぞれ始点として与え、変位比
較法を適用することにより単純に加減算機能のみ
で算出し、 次に、方程式f(x,y)=0において、Ps1
(0,ye1)又はPs2(xe2,0)を始点、これらye1
又はxe2を算出する時に得られた既知のf1(ye1
0)またはf2(xe2,0)をそれぞれの場合の始点
の初期変位として与え、これらの値を基にして再
度変位比較法を用いることにより、xs≦x≦xe
はys≦y≦yeの範囲のデイジタル線分を、単純に
加減算機能のみで発生させるようにしたことを特
徴とするものである。
(Means for Solving the Problems) The present invention for solving the above-mentioned problems uses an equation in which x and y are variables and a, b, and c are known constants f(x, y)=ax-by+c= 0 and satisfies the range of x s ≦ x ≦ x e or y s ≦ y ≦ y e , and when the parameters x s and x e are given, y,
If the equation f 1 (y, u) = -by + c - u = 0 where u is a variable, -b is a coefficient, and c is a constant is given parameters y s and y e , then
Define the equation f 2 (x, v) = ax + c - v = 0 where x and v are variables, a is a coefficient, and c is a constant, and from these equations, the neighboring points of f 1 (y, u) = 0 are defined. The digital value y e1 closest to the true value on the y-axis that satisfies u=0, or v= at a point near f 2 (x, v)=0.
The digital value x e2 that is closest to the true value on the x-axis that satisfies 0, and when the equation f 1 (y, u) = 0, f 1 (y, u) =
The point Q s1 (0, c) that satisfies 0 is defined by the equation f 2 (x,
When v)=0, the point that satisfies f 2 (x, v)=0
Given Q s2 (0, C) as the starting point, it is calculated simply by adding and subtracting functions by applying the displacement comparison method. Next, in the equation f(x, y) = 0, P s1
(0, y e1 ) or P s2 (x e2 , 0) as the starting point, these y e1
Or the known f 1 ( y e1 ,
0) or f 2 (x e2 , 0) as the initial displacement of the starting point in each case, and by using the displacement comparison method again based on these values, x s ≦x≦x e or y s ≦ The present invention is characterized in that digital line segments in the range y≦y e are generated simply by addition and subtraction functions.

(実施例) 以下、図面を参照して本発明の実施例を詳細に
説明する。
(Example) Hereinafter, an example of the present invention will be described in detail with reference to the drawings.

第1図は、本発明の一実施例を示す構成ブロツ
ク図である。図に示す装置は、マイクロプログラ
ム制御方式を採用し、入力制御部10、出力部2
0、レジスタ演算部30及びマイクロプログラム
制御部40の4つの主要部分より構成されてい
る。入力制御部10とレジスタ演算部30は、内
部バスUBによつて相互に連結されている。10
は、システムバスSBを経由して上位の計算機等
からコマンドを入力・解読し、初期値設定を制御
する入力制御部で、入力レジスタ11及びバス制
御部12とから構成されている。20は画像メモ
リ等の外部表示装置(図示せず)にx,y座標値
を出力する出力部で、内部バスUBを介して送ら
れてくる座標データを取込むxレジスタ21及び
yレジスタ22とから構成されている。これらレ
ジスタ21,22には内部バスUBを経由してそ
れぞれの値がセツトされる。
FIG. 1 is a block diagram showing an embodiment of the present invention. The device shown in the figure adopts a microprogram control system, and includes an input control section 10 and an output section 2.
0, a register operation section 30, and a microprogram control section 40. The input control section 10 and the register calculation section 30 are interconnected by an internal bus UB. 10
1 is an input control section that inputs and decodes commands from a host computer or the like via the system bus SB and controls initial value setting, and is composed of an input register 11 and a bus control section 12. Reference numeral 20 denotes an output unit that outputs x and y coordinate values to an external display device (not shown) such as an image memory, and includes an x register 21 and a y register 22 that receive coordinate data sent via the internal bus UB. It consists of Respective values are set in these registers 21 and 22 via an internal bus UB.

30は数値演算を行うレジスタ演算部で、レジ
スタアンドアリスメテイツク・ロジカルユニツト
(以下RALUと略す)31を中心に構成されてい
る。RALU31は複数個の内部レジスタより構
成されるレジスタ群32を有し、内部レジスタ間
で、例えば加減算、論理積、論理和演算等の算術
演算を行うことができるようになつている。更
に、RALU31での演算結果における各種ステ
イタスは、マイクロプログラム制御部40内のマ
ルチプレクサへの入力となつている。40は全体
の制御及び線分発生のアルゴリズムを実行するマ
イクロプログラム制御部で、マルチプレクサ4
1、アドレスシーケンサ42、マイクロプログラ
ムメモリ43及びパイプラインレジスタ44とか
ら構成されている。パイプラインレジスタ44
は、マイクロプログラムメモリ43からの出力を
保持し、前述の入力制御部10、出力部20及び
レジスタ演算部30の各部分へのマイクロ命令を
供給する。マイクロプログラムでの条件付分岐
は、マルチプレクサ41において、レジスタ演算
部30からの各種ステイタスを含む入力の内、一
つを選択しアドレスシーケンサ42で判定するこ
とによつて行われるようになつている。このよう
に構成された回路の動作を説明すれば以下のとお
りである。
Reference numeral 30 denotes a register operation section for performing numerical operations, which is mainly composed of a register and arithmetic logical unit (hereinafter abbreviated as RALU) 31. The RALU 31 has a register group 32 composed of a plurality of internal registers, and can perform arithmetic operations such as addition/subtraction, logical product, and logical sum operation between the internal registers. Further, various statuses in the calculation results in the RALU 31 are input to a multiplexer in the microprogram control unit 40. 40 is a microprogram control unit that executes the overall control and line segment generation algorithm;
1, an address sequencer 42, a microprogram memory 43, and a pipeline register 44. Pipeline register 44
holds the output from the microprogram memory 43 and supplies microinstructions to each part of the input control section 10, output section 20, and register operation section 30 described above. Conditional branching in a microprogram is performed by selecting one of the inputs including various statuses from the register calculation unit 30 in the multiplexer 41 and making a determination in the address sequencer 42. The operation of the circuit configured as described above will be explained as follows.

ここでは、a,b,cを既知の定数として、方
程式 f(x,y)=ax−by+c=0 で記述され、xs≦x≦xe又はys≦y≦yeの範囲を
満足するデイジタル線分として、第2図に示すよ
うに線分がxy平面の第1象限に存在する場合を
例にとつて説明する。第2図において、イはxs
x≦xeの場合を、ロはys≦y≦yeの場合をそれぞ
れ示していてる。イのPs1(0,ye1)、ロのPs2
(xe2,0)はそれぞれ直線の発生始点を、Lは線
分を示す。
Here, it is described by the equation f(x,y)=ax-by+c=0, with a, b, and c as known constants, and satisfies the range of x s ≦x≦x e or y s ≦y≦y e . As an example of a digital line segment, a case where the line segment exists in the first quadrant of the xy plane as shown in FIG. 2 will be explained. In Figure 2, a is x s
B indicates the case where x≦x e , and y s ≦y≦y e . A's P s1 (0, y e1 ), B's P s2
(x e2 , 0) indicates the starting point of each straight line, and L indicates a line segment.

上位の計算機等よりシステムバスSBを経由し
て、線分のパラメータa,b,c及びxの可変パ
ラメータxs,xe又はyの可変パラメータys,ye
入力制御部10内の入力レジスタ11にセツト
し、上位計算機等から入力制御部10に対してス
タート起動をかける。スタート起動がかかると、
マイクロプログラム制御部40では、可変パラメ
ータがxの場合には入力レジスタ11内のパラメ
ータ、a,b,c,xs,xeを、可変パラメータが
yの場合にはパラメータa,b,c,ys,yeを内
部バスUBを経由してレジスタ演算部30内のレ
ジスタ群32に格納する。
Input variable parameters x s , x e of line segment parameters a, b, c, and x or variable parameters y s , y e of y from a host computer, etc. via system bus SB into the control unit 10 It is set in the register 11, and a start activation is applied to the input control unit 10 from a host computer or the like. When the start starts,
The microprogram control unit 40 sets the parameters a, b, c, x s , x e in the input register 11 when the variable parameter is x, and sets the parameters a, b, c, x e when the variable parameter is y. y s and y e are stored in the register group 32 in the register calculation unit 30 via the internal bus UB.

可変パラメータがx,y何れの場合も以下、同
様な手順となるので、ここでは可変パラメータが
x、即ちxがxs≦x≦xeを満足する範囲でデイジ
タル線分を発生する手順について説明する。この
場合は、第1図に示すようにレジスタ演算部30
内のレジスタ群32に、上のレジスタから順にパ
ラメータa,b,c,xs,xeが格納される。
The following procedure is the same regardless of whether the variable parameter is x or y, so here we will explain the procedure for generating a digital line segment in the range where the variable parameter is x, that is, x satisfies x s ≦ x ≦ x e . do. In this case, as shown in FIG.
Parameters a, b, c, x s , and x e are stored in the register group 32 in order from the top register.

先ず、第2図イに示すように、y軸上の点で直
線L(L:ax−by+c=0)に最も近接するドツ
トPs1(0,ye1)及びPs1の変位Zs1=f(0,ye1
を求める。そのためにy,uを変数、−bを係数、
cを定数とする方程式 f1(y,u)=−by+c−u=0 (7) を新たに定義する。そして、f1(y,u)=0を満
足する点Qs1(0,c)を始点として、変位比較法
により始点Qs1より順次1ドツトずつ、最適ドツ
トをu=0となるまで線分L1(L1:−by+c−u
=0)を発生させる。
First, as shown in FIG. 2A, the dot P s1 (0, y e1 ) closest to the straight line L (L: ax-by+c=0) at the point on the y-axis and the displacement of P s1 Z s1 = f (0,y e1 )
seek. For that purpose, y and u are variables, -b is a coefficient,
The equation f 1 (y, u)=-by+c-u=0 (7) where c is a constant is newly defined. Then, starting from the point Q s1 (0, c) that satisfies f 1 (y, u) = 0, by using the displacement comparison method, the optimal dot is converted into a line segment one dot at a time from the starting point Q s1 until u = 0. L 1 (L 1 :-by+c-u
=0).

第3図イは、線分L1の発生を示す図である。
横軸はyを、縦軸はuをそれぞれ示しいる。L1
は(7)式で定義される線分、Qs1は始点であり、Qs1
から順次変位比較法によりドツトを発生させ、線
分L1を発生させている。u=0となつた時点で
線分L1の発生を停止し、その時のy座標をye1
終点Qe1(ye1,0)の変位Ze1=f1(ye1,0)を再
びレジスタ群32に格納する。
FIG. 3A is a diagram showing the generation of line segment L1 .
The horizontal axis shows y, and the vertical axis shows u. L 1
is the line segment defined by equation (7), Q s1 is the starting point, and Q s1
Then, dots are sequentially generated using the displacement comparison method, and a line segment L1 is generated. When u=0, the generation of line segment L 1 is stopped, and the y coordinate at that time is y e1 ,
The displacement Z e1 =f 1 (y e1 , 0) of the end point Q e1 (y e1 , 0) is stored in the register group 32 again.

第3図イについて説明した操作によりye1が求
めると、第2図イに示す始点Ps1(0,ye1)及び
Ps1の変位Zs1=f(0,ye1)が求まる。そこで、
ye1、変位Ze1より始点をPs1(0,ye1)、始点Ps1
変位Zs1=f(0,ye1)=Ze1とし、ここで再度、
変位比較法を用いて始点Ps1より1ドツトずつ最
適ドツトをx=xsとなるまで発生させる。
When y e1 is determined by the operation explained in Figure 3 A, the starting point P s1 (0, y e1 ) and
The displacement Z s1 = f (0, y e1 ) of P s1 is found. Therefore,
y e1 , the displacement Z e1 , the starting point is P s1 (0, y e1 ), the displacement of the starting point P s1 Z s1 = f (0, y e1 ) = Z e1 , and here again,
Using the displacement comparison method, optimal dots are generated one dot at a time from the starting point Ps1 until x= xs .

x=xsとなつた時点より、続けて最適ドツトを
発生させると同時に、最適ドツトのx,y座標値
を内部バスUBを介して出力部20のx,yレジ
スタ21,22にセツトする。この結果、デイジ
タル線分Lが例えばCRT上に表示される。上述
の動作は線分Lのx座標上限値(最終到達点)xe
になるまで繰返される。第4図は、上述の動作を
示すフローチヤートである。
From the time when x= xs , optimal dots are continuously generated and, at the same time, the x, y coordinate values of the optimal dots are set in the x, y registers 21, 22 of the output section 20 via the internal bus UB. As a result, the digital line segment L is displayed on, for example, a CRT. The above operation is based on the x-coordinate upper limit value (final arrival point) of line segment L x e
is repeated until . FIG. 4 is a flowchart showing the above-described operation.

このように、本発明によれば、方程式 f(x,y)=ax−by+c=0 で記述され、xs≦x≦xeを満足するデイジタル線
分を単純な加減算機能のみで高速かつ高精度に発
生させることができる。以上、可変パラメータが
xの場合を例にとつて説明したが、この間の事情
は可変パラメータがyの場合についても全く同様
である。
As described above, according to the present invention, a digital line segment described by the equation f(x,y)=ax−by+c=0 and satisfying x s ≦x≦x e can be generated at high speed and with high efficiency using only simple addition and subtraction functions. Can be generated with precision. The above description has been made taking the case where the variable parameter is x as an example, but the situation is exactly the same when the variable parameter is y.

即ち、第2図ロに示すように、x軸上の点で直
線L(L:ax−by+c=0)に最も近接するドツ
トPs2(xe2,0)及びPs2の変位Zs2=f(xe2,0)
を求める。そのために、x,vを変数、aを係
数、cを定数とする方程式 f2(x,v)=ax+c−v=0 (8) を新たに定義する。そして、f2(x,v)=0を満
足する点Qs2(0,c)を始点として、変位比較法
により始点Qs2より順次1ドツトずつ、最適ドツ
トをv=0となるまで線分L2(L2:ax+c−v=
0)を発生させる。
That is, as shown in FIG . (x e2 ,0)
seek. For this purpose, a new equation f 2 (x, v)=ax+c−v=0 (8) is defined in which x and v are variables, a is a coefficient, and c is a constant. Then, starting from the point Q s2 (0, c) that satisfies f 2 (x, v) = 0, by using the displacement comparison method, the optimal dot is converted into a line segment one dot at a time from the starting point Q s2 until v = 0. L 2 (L 2 :ax+c−v=
0) is generated.

第3図ロは、線分L2の発生を示す図である。
横軸はyを、縦軸はvをそれぞれ示している。
L2は(8)式で定義される線分、Qs2は始点であ
り、Qs2から順次変位比較法によりドツトを発生
させ、線分L2を発生させている。以下の動作に
ついてはxが可変パラメータの場合と同様である
ので説明は省略する。
FIG. 3B is a diagram showing the generation of line segment L2 .
The horizontal axis shows y, and the vertical axis shows v.
L2 is a line segment defined by equation (8), Qs2 is a starting point, and dots are sequentially generated from Qs2 by the displacement comparison method to generate line segment L2 . The following operation is the same as in the case where x is a variable parameter, so the explanation will be omitted.

第6図は、a=2,b=3,c=5,xs=3,
xe=9の場合におけるデイジタル線分発生例を示
す図である。イはQs1及びその変位Ze1算出時の線
分発生を示しており、ロは目的とする実際の線分
の発生例を示している。イ,ロ何れの図形も、
( )内の数値はその点における変位を示してい
る。
Figure 6 shows a=2, b=3, c=5, x s =3,
FIG. 7 is a diagram showing an example of digital line segment generation in the case of x e =9. A shows the occurrence of a line segment when calculating Q s1 and its displacement Z e1 , and B shows an example of the actual occurrence of the intended line segment. Both shapes A and B are
The value in parentheses indicates the displacement at that point.

上述の説明においては、デイジタル線分がxy
平面の第1象限に存在する場合について説明し
た。しかしながら、本発明は、第1象限に限るも
のではなく、第7図イに示すように線分が第2,
3,4象限に存在する場合にも、同様の手順によ
りデイジタル線分を発生させることができる。但
し、xs,xe<0又はys,ye<0の場合には、第4
図、第5図のフローチヤートにおいて、xsとxe
ysとyeの関係を入れ替え、x=xeからx=xsの方
向へ、又はy=yeからy=ysの方向へ線分を発生
させる。
In the above explanation, the digital line segment is xy
The case where it exists in the first quadrant of the plane has been explained. However, the present invention is not limited to the first quadrant, and as shown in FIG.
Digital line segments can be generated using the same procedure even when the line segments exist in the third and fourth quadrants. However, if x s , x e <0 or y s , y e <0, the fourth
In the flowchart of Fig. 5, x s and x e ,
The relationship between y s and y e is swapped, and a line segment is generated from x = x e in the direction of x = x s or from y = y e in the direction of y = y s .

又、線分が第7図ロに示すように2つ以上の象
限にまたがつて存在する場合には、x=0又はy
=0を中心に左右又は上下方向へ、即ちx=0か
らx=xsの方向と、x=0からx=xeの方向へ、
y=0からy=ysの方向と、y=0からy=ye
方向へそれぞれ2つに分けて線分を発生させれば
よい。尚、第7図に線分の発生方向を矢印で示
す。
In addition, if the line segment exists across two or more quadrants as shown in Figure 7B, x=0 or y
=0 as the center in the horizontal or vertical direction, that is, in the direction from x = 0 to x = x s , and from x = 0 in the direction of x = x e ,
It is sufficient to generate line segments by dividing into two, one in the direction from y=0 to y= ys , and the other in the direction from y=0 to y= ye . Incidentally, in FIG. 7, the direction in which the line segment is generated is indicated by an arrow.

(発明の効果) 以上詳細に説明したように、本発明によれば f(x,y)=ax−by+c=0 で表わされ、xs≦x≦xe又はys≦y≦yeなる範囲
を満足するデイジタル線分を発生させる場合にそ
れぞれ f1(y,u)=−by+c−u=0又は f2(x,v)=ax+c−v=0 で定義される方程式より始点のy座標ye1又はx
座標xe2を算出して始点を求めた後、変位比較法
で線分を発生させるようにすることにより、単純
加算機能のみでデイジタル線分を高速かつ高精度
に発生させることができる。
(Effects of the Invention) As explained in detail above, according to the present invention, f(x, y)=ax−by+c=0, where x s ≦x≦x e or y s ≦y≦y e When generating a digital line segment that satisfies the range of y coordinate y e1 or x
By calculating the coordinates x e2 and finding the starting point, and then generating line segments using the displacement comparison method, digital line segments can be generated quickly and with high accuracy using only the simple addition function.

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

第1図は本発明の一実施例を示す構成ブロツク
図、第2図はデイジタル線分の発生例を示す図、
第3図はye1又はxe2の算出の説明図、第4図、第
5図は本発明の動作を示すフローチヤート、第6
図はデイジタル線分の具体的な発生例を示す図、
第7図はデイジタル線分発生例を示す図、第8図
は候補ドツトの方向を示す図、第9図、第10図
は変位比較法の説明図である。 10……入力制御部、11……入力レジスタ、
12……バス制御部、20……出力部、21……
xレジスタ、22……yレジスタ、30……レジ
スタ演算部、31……RALU、32……レジス
タ群、40……マイクロプログラム制御部、41
……マルチプレクサ、42……アドレスシーケン
サ、43……マイクロプログラムメモリ、44…
…パイプラインレジスタ、SB……システムバス、
UB……内部バス。
FIG. 1 is a configuration block diagram showing one embodiment of the present invention, FIG. 2 is a diagram showing an example of the generation of digital line segments,
Fig. 3 is an explanatory diagram of calculation of y e1 or x e2 , Figs. 4 and 5 are flowcharts showing the operation of the present invention, and Fig. 6
The figure shows a specific example of the generation of digital line segments.
FIG. 7 is a diagram showing an example of digital line segment generation, FIG. 8 is a diagram showing the direction of candidate dots, and FIGS. 9 and 10 are diagrams explaining the displacement comparison method. 10...Input control unit, 11...Input register,
12... Bus control section, 20... Output section, 21...
x register, 22...y register, 30...register operation unit, 31...RALU, 32...register group, 40...microprogram control unit, 41
...Multiplexer, 42...Address sequencer, 43...Micro program memory, 44...
...pipeline register, SB...system bus,
UB...Internal bus.

Claims (1)

【特許請求の範囲】 1 x,yを変数、a,b,cを既知の定数とす
る方程式 f(x,y)=ax−by+c=0 で記述され、xs≦x≦xe又はys≦y≦yeの範囲を
満足するデイジル線分を発生する場合に、 パラメータxs,xeが与えられる場合には、y,
uを変数、−bを係数、cを定数とする方程式 f1(y,u)=−by+c−u=0 を、パラメータys,yeが与えられる場合には、
x,vを変数、aを係数、cを定数とする方程式 f2(x,v)=ax+c−v=0 をそれぞれ定義し、 これら方程式より、f1(y,u)=0の近傍点で
u=0を満足するy軸上の最も真値に近いデイジ
タル値ye1、又はf2(x,v)=0の近傍点でv=
0を満足するx軸上の最も真値に近いデイジタル
値xe2を、 方程式f1(y,u)=0の場合にはf1(y,u)=
0を満足する点Qs1(0,c)を、方程式f2(x,
v)=0の場合にはf2(x,v)=0を満足する点
Qs2(0,C)をそれぞれ始点として与え、変位比
較法を適用することにより単純に加減算機能のみ
で算出し、 次に、方程式f(x,y)=0において、Ps1
(0,ye1)又はPs2(xe2,0)を始点、これらye1
又はxe2を算出する時に得られた既知のf1(ye1
0)又はf2(xe2,0)をそれぞれの場合の始点の
初期変位として与え、これらの値を基にして再度
変位比較法を用いることにより、xs≦x≦xeまた
はys≦y≦yeの範囲のデイジタル線分を、単純に
加減算機能のみで発生させるようにしたことを特
徴とするデイジタル線分発生器。
[Claims] 1. Described by the equation f(x, y)=ax-by+c=0, where x, y are variables and a, b, c are known constants, and x s ≦x≦x e or y When generating a Daisy line segment that satisfies the range s ≦y≦y e , if the parameters x s and x e are given, then y,
If the equation f 1 (y, u) = -by + c - u = 0 where u is a variable, -b is a coefficient, and c is a constant is given parameters y s and y e , then
Define the equation f 2 (x, v) = ax + c - v = 0 where x and v are variables, a is a coefficient, and c is a constant, and from these equations, the neighboring points of f 1 (y, u) = 0 are defined. The digital value y e1 closest to the true value on the y-axis that satisfies u=0, or v= at a point near f 2 (x, v)=0.
The digital value x e2 that is closest to the true value on the x-axis that satisfies 0, and when the equation f 1 (y, u) = 0, f 1 (y, u) =
The point Q s1 (0, c) that satisfies 0 is defined by the equation f 2 (x,
When v)=0, the point that satisfies f 2 (x, v)=0
Given Q s2 (0, C) as the starting point, it is calculated simply by adding and subtracting functions by applying the displacement comparison method. Next, in the equation f(x, y) = 0, P s1
(0, y e1 ) or P s2 (x e2 , 0) as the starting point, these y e1
Or the known f 1 ( y e1 ,
0) or f 2 (x e2 , 0) as the initial displacement of the starting point in each case, and by using the displacement comparison method again based on these values, x s ≦x≦x e or y s ≦ A digital line segment generator characterized in that digital line segments in the range y≦y e are generated simply by addition and subtraction functions.
JP59239232A 1984-11-13 1984-11-13 Digital segment generator Granted JPS61117596A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP59239232A JPS61117596A (en) 1984-11-13 1984-11-13 Digital segment generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP59239232A JPS61117596A (en) 1984-11-13 1984-11-13 Digital segment generator

Publications (2)

Publication Number Publication Date
JPS61117596A JPS61117596A (en) 1986-06-04
JPH0453318B2 true JPH0453318B2 (en) 1992-08-26

Family

ID=17041710

Family Applications (1)

Application Number Title Priority Date Filing Date
JP59239232A Granted JPS61117596A (en) 1984-11-13 1984-11-13 Digital segment generator

Country Status (1)

Country Link
JP (1) JPS61117596A (en)

Also Published As

Publication number Publication date
JPS61117596A (en) 1986-06-04

Similar Documents

Publication Publication Date Title
JPH0214714B2 (en)
JPH0453318B2 (en)
JPS61261779A (en) Generation of curve of second order signal
JP3464874B2 (en) Method and apparatus for tracing point sequence by Bezier curve
JPH0766309B2 (en) How to display points on a three-dimensional figure
JP2538645B2 (en) Curved line approximation device
JP2684609B2 (en) Graphic display method in graphic data processing device
JP2734649B2 (en) Intersection calculation method between curved surface and straight line
JPS60222975A (en) Picture drawing device
JPH0587869B2 (en)
JPH0368086A (en) Linear interpolating circuit
JP2995812B2 (en) Tool path generation method by numerical controller
JPS61256483A (en) Painting out circuit of sector graphic
JPH04168581A (en) Approximate curve generating method for hyperellipse
KR0160623B1 (en) Circular arc discribing method of wire graphic
JP2734644B2 (en) Intersection calculation method between free-form surfaces
JPH0896158A (en) Method and device for graphic information processing
JPS61128377A (en) Digital graphic processor
JPS6120002B2 (en)
JPH0640349B2 (en) Digital figure processing method
JPS6286466A (en) Curved face forming method
JPS6231481A (en) Vector clipping system
JPS636685A (en) Vector drawing system
JPH08329268A (en) Method and device for graphic processing
JP2000293549A (en) Method for compressing data for operation simulation