JPH08297747A - Method and device for plotting - Google Patents

Method and device for plotting

Info

Publication number
JPH08297747A
JPH08297747A JP9931295A JP9931295A JPH08297747A JP H08297747 A JPH08297747 A JP H08297747A JP 9931295 A JP9931295 A JP 9931295A JP 9931295 A JP9931295 A JP 9931295A JP H08297747 A JPH08297747 A JP H08297747A
Authority
JP
Japan
Prior art keywords
dividing
curve
angle
arc
drawn
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
JP9931295A
Other languages
Japanese (ja)
Other versions
JP3647080B2 (en
Inventor
Naohiro Yoshikawa
直廣 吉川
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 JP9931295A priority Critical patent/JP3647080B2/en
Publication of JPH08297747A publication Critical patent/JPH08297747A/en
Application granted granted Critical
Publication of JP3647080B2 publication Critical patent/JP3647080B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Image Generation (AREA)

Abstract

PURPOSE: To smoothly connect an approximated curve and its tangent without reducing the processing speed. CONSTITUTION: In steps S301 to S303, a circular arc is divided into N parts based on inputted information of this circular arc, and a central angle α corresponding to each divided circular arc (segment) is selected. In a step S304, the central angle α is divided into two to calculate a central angle β. In steps S306 to S310, the given circular arc is approximated with segments of the length corresponding to the central angle β in accordance with a parameter (i) indicating the number of a plotted segment in the case of i=0 or i=N-1 (at the time of plotting the end points of the circular arc) and is approximated with segments of the length corresponding to the central angle α in the case of 0<i<N-1.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は描画装置および描画方法
に係り、特に曲線を微小直線をもって近似して描画する
描画装置および描画方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a drawing apparatus and a drawing method, and more particularly to a drawing apparatus and a drawing method for approximating a curved line with a minute straight line.

【0002】[0002]

【従来の技術】従来、ドットマトリクスよって近似的に
曲線等を描画する描画装置においては、以下のような手
法を用いていた。即ち、例えば円弧を描画する際に、演
算処理量を軽減し処理を高速化するため、近似された円
弧が視覚的に十分な滑らかさを有するにたる一定長の線
分の集合をもって近似する手法を用いていた。以下、こ
の一定長の線分をセグメントという。なお、実際の描画
処理に際しては、各線分は当然に一定の太さを有するが
故に、各セグメントの中心線を持って隣接するセグメン
トの接続点となした場合には、その接続点において亀裂
状の隙間を生じる。
2. Description of the Related Art Conventionally, the following method has been used in a drawing apparatus which draws a curve or the like by a dot matrix. That is, for example, when drawing a circular arc, a method of approximating with a set of line segments of a certain length so that the approximated circular arc has sufficient visual smoothness in order to reduce the calculation processing amount and speed up the processing. Was used. Hereinafter, this fixed length line segment is referred to as a segment. In the actual drawing process, since each line segment naturally has a constant thickness, if the center line of each segment is used as the connection point of the adjacent segment, cracks will form at the connection point. Creates a gap.

【0003】図9は、従来例における円弧の近似の一例
を示す図である。900は近似する対象となる円弧であ
る。921乃至923は、それぞれ描画に際して円弧9
00を近似するセグメントであり、その中心線911乃
至913は、円弧900上の点941および942にお
いて接続される。各セグメントは、実際には長方形であ
り、接続部において亀裂状の隙間(以下、単に隙間とい
う)を生じるため、その隙間を補間する必要がある。9
31は、セグメント921および922の接続部におけ
る隙間を補間する補間部である。同様に、932は、セ
グメント922および923の接続部における隙間を補
間する補間部である。
FIG. 9 is a diagram showing an example of approximation of a circular arc in a conventional example. 900 is an arc to be approximated. 921 to 923 are circular arcs 9 at the time of drawing.
00, whose center lines 911 to 913 are connected at points 941 and 942 on the arc 900. Each segment is actually a rectangle, and a crack-like gap (hereinafter, simply referred to as a gap) is generated at the connection portion, so that the gap needs to be interpolated. 9
Reference numeral 31 is an interpolating unit that interpolates a gap in the connecting portion of the segments 921 and 922. Similarly, 932 is an interpolating unit that interpolates a gap in the connecting portion of the segments 922 and 923.

【0004】なお、円弧900に関して実際に描画する
図形は、セグメント921乃至923、補間部931、
932のみであり、円弧900等は説明のために記した
に過ぎない。
The figures actually drawn with respect to the arc 900 are the segments 921 to 923, the interpolation section 931,
932 only, and the arc 900 and the like are shown only for explanation.

【0005】[0005]

【発明が解決しようとしている課題】しかしながら、上
記従来例においては、円弧900の端点943において
接続される接線(円弧900を含む円の端点943にお
ける接線)950を個別に描画した場合、セグメント9
23と直線951の方向が一致しないために、当然に隙
間933を生じてしまう。これは、円弧の端点において
その円弧の接線を接続した線図を描画する際に、接点に
おいて両者が滑らかに接続されないことを意味してい
る。
However, in the above conventional example, when the tangent line 950 (the tangent line at the end point 943 of the circle including the arc 900) connected at the end point 943 of the arc 900 is individually drawn, the segment 9
Since the direction of 23 and the direction of the straight line 951 do not coincide with each other, the gap 933 naturally occurs. This means that when drawing a diagram in which the tangents of the arc are connected at the end points of the arc, the two are not connected smoothly at the contact points.

【0006】本発明は上記問題点に鑑みてなされたもの
であって、処理速度の低下を招くことなく、近似した曲
線とその接線方向をなす他の線とを滑らかに接続可能な
らしめることを目的とする。
The present invention has been made in view of the above problems, and it is possible to smoothly connect an approximated curve and another line forming a tangent to the approximated curve without lowering the processing speed. To aim.

【0007】[0007]

【課題を解決するための手段】および[Means for Solving the Problems] and

【作用】上記問題点を解決するため、本発明に係る描画
装置は、曲線を微小直線をもって近似して図形を描画す
る描画装置であって、前記曲線を、その接線方向をなす
他の線と接する接点の付近の領域については細かく、そ
の他の領域については荒く分割する分割手段と、分割し
た各曲線を直線によって近似する直線近似手段と、近似
した曲線を含む図形を描画する描画手段とを具備するこ
とを特徴とし、処理速度の低下を招くことなく、近似し
た曲線とその接線方向をなす他の線とを滑らかに接続す
ることができる。
In order to solve the above-mentioned problems, the drawing apparatus according to the present invention is a drawing apparatus which draws a figure by approximating a curved line with a minute straight line, and the curve is defined as another line tangential to the curved line. A dividing means for finely dividing the area in the vicinity of the contact points and roughly dividing the other areas, a linear approximation means for approximating each divided curve with a straight line, and a drawing means for drawing a figure including the approximated curve are provided. The approximated curve can be smoothly connected to other lines forming the tangential direction thereof without lowering the processing speed.

【0008】また、本発明に係る描画方法は、曲線を微
小直線をもって近似して図形を描画する描画方法であっ
て、前記曲線を、その接線方向をなす他の線と接する接
点の付近の領域については細かく、その他の領域につい
ては荒く分割する分割工程と、分割した各曲線を直線に
よって近似する直線近似工程と、近似した曲線を含む図
形を描画する描画工程とを具備することを特徴とし、処
理速度の低下を招くことなく、近似した曲線とその接線
方向をなす他の線とを滑らかに接続することができる。
The drawing method according to the present invention is a drawing method in which a curve is approximated by a minute straight line to draw a figure, and the curve is a region in the vicinity of a contact point in contact with another line forming a tangential direction of the curve. Is fine, for other areas is roughly divided, a dividing step, a linear approximation step of approximating each divided curve by a straight line, and a drawing step of drawing a figure including the approximated curve, It is possible to smoothly connect the approximated curve and the other line forming the tangent to the approximated curve without lowering the processing speed.

【0009】[0009]

【実施例】【Example】

〔第1の実施例〕以下、本発明に係る好適な第1の実施
例について説明する。図1は本実施例に係る印刷装置の
構成の一例を示すブロック図である。制御部102は、
印刷装置100全体の制御を司るブロックであり、後述
するフローチャートに係るプログラム等の制御プログラ
ムを格納したROM、ワークメモリ、制御プログラムを
実行するCPU等を備えている。インターフェース10
3は、ホストコンピュータ101等の外部装置とのデー
タ通信を行うインターフェースである。印刷コマンド解
析部104は、インタフェース103を介してホストコ
ンピュータ101より入力された印刷コマンドを記憶す
る受信バッファを含み、印刷データを解析するブロック
である。描画部105は、ページメモリを含み、解析し
た印刷コマンドに従って描画処理を行い、印刷データを
ページメモリにビットマップ展開する。出力部106
は、ページメモリに展開したビットマップデータを記録
紙に永久可視画像化するインクジェット・プリンタ、レ
ーザビーム・プリンタ等のプリンタである。
[First Embodiment] A preferred first embodiment according to the present invention will be described below. FIG. 1 is a block diagram showing an example of the arrangement of a printing apparatus according to this embodiment. The control unit 102
A block that controls the entire printing apparatus 100, and includes a ROM that stores a control program such as a program according to a flowchart described below, a work memory, and a CPU that executes the control program. Interface 10
An interface 3 performs data communication with an external device such as the host computer 101. The print command analysis unit 104 is a block that includes a reception buffer that stores a print command input from the host computer 101 via the interface 103 and that analyzes print data. The drawing unit 105 includes a page memory, performs drawing processing according to the analyzed print command, and expands the print data into a bitmap in the page memory. Output unit 106
Is a printer such as an ink jet printer, a laser beam printer, or the like, which makes the bitmap data expanded in the page memory a permanent visible image on a recording paper.

【0010】以下、印刷装置100の動作をフローチャ
ートを用いて説明する。図2は印刷装置100の全体の
処理の流れを説明するフローチャートである。ステップ
S201において、インターフェース103を介して外
部装置から印刷コマンドを受信すると、次のステップS
202でその印刷コマンドを解析する。ステップS20
3では、解析した印刷コマンドが排紙を促す排紙コマン
ドであるか否かを判定し、排紙コマンドでない場合は、
ステップS204に進み、排紙コマンドである場合は、
ステップS207に進み、不図示のページメモリ上に印
刷データをビットマップ展開し、出力部106によって
記録紙に永久可視画像化する。
The operation of the printing apparatus 100 will be described below with reference to the flowchart. FIG. 2 is a flowchart for explaining the overall processing flow of the printing apparatus 100. When a print command is received from the external device via the interface 103 in step S201, the next step S201 is performed.
At 202, the print command is analyzed. Step S20
In 3, it is determined whether or not the analyzed print command is a paper discharge command that prompts paper discharge. If it is not the paper discharge command,
In step S204, if the command is a paper discharge command,
In step S207, the print data is expanded into a bitmap on a page memory (not shown), and the output unit 106 forms a permanent visible image on the recording paper.

【0011】ステップS204では、解析した印刷コマ
ンドが円弧の描画を促す円弧描画命令であるか否かを判
定する。その結果、円弧描画命令である場合には、ステ
ップS205に進み、所定の処理を施して再びステップ
S201に戻り、排紙コマンドを受信するまで一連の処
理を繰り返す。また、ステップS204において、解析
した印刷コマンドが円弧描画命令以外であると判定した
場合には、ステップS206に進み、対応する処理を経
た後、ステップS201に戻り、排紙コマンドを受信す
るまで一連の処理を繰り返す。なお、以上の処理は制御
部102によって制御される。
In step S204, it is determined whether or not the analyzed print command is an arc drawing command that prompts drawing of an arc. As a result, in the case of the arc drawing command, the process proceeds to step S205, a predetermined process is performed, the process returns to step S201 again, and a series of processes is repeated until the paper discharge command is received. If it is determined in step S204 that the analyzed print command is other than the circular arc drawing command, the process proceeds to step S206, the corresponding process is performed, and then the process returns to step S201 to perform a series of operations until the paper discharge command is received. Repeat the process. The above processing is controlled by the control unit 102.

【0012】次に円弧線描画処理(S205)の処理の
流れを説明する。この処理は描画部105においてなさ
れる。図3は、描画処理部105において実行される円
弧線描画処理の流れを示すフローチャートである。円弧
線描画処理においては、描画部105には、描画する円
弧の中心位置情報、半径、開始角度、終了角度、線幅が
入力されるものとする。本実施例においては、開始、終
了角度は360度未満の角度に正規化して与えらるもの
とし、(開始角度)<(終了角度)となっているものと
する。
Next, the flow of the arc line drawing process (S205) will be described. This processing is performed in the drawing unit 105. FIG. 3 is a flowchart showing the flow of the arc line drawing processing executed in the drawing processing unit 105. In the arc line drawing process, it is assumed that the drawing unit 105 is input with center position information, radius, start angle, end angle, and line width of the drawn arc. In this embodiment, the start and end angles are given as normalized to an angle of less than 360 degrees, and (start angle) <(end angle).

【0013】ステップS301において、描画部105
に描画すべき円弧の中心位置情報、半径、円弧の開始角
度、円弧の終了角度、線幅が入力される。ステップS3
02では、入力された円弧の半径、開始角度、終了角度
から、所望の円弧を前述のセグメントの集合によって近
似する際の等分分割数N(所望の円弧をN個のセグメン
トを用いて近似する)を決定する。Nの値を大きく設定
すると近似した円弧は当然に滑らかなものとなるが、一
方で、処理時間が長大になる。従って、近似した円弧が
滑らかに表現される範囲で最小の値とすることが望まし
い。ステップS303では、終了角度と開始角度の差分
を等分分割数Nで分割してセグメントの長さに対応する
中心角度αを算出する。
In step S301, the drawing unit 105
The center position information of the arc to be drawn, the radius, the arc start angle, the arc end angle, and the line width are input. Step S3
In 02, from the input radius, start angle, and end angle of the input arc, the number N of equal divisions for approximating the desired arc by the set of the segments described above (the desired arc is approximated using N segments). ) Is determined. When the value of N is set to a large value, the approximated arc naturally becomes smooth, but on the other hand, the processing time becomes long. Therefore, it is desirable to set the minimum value in the range in which the approximated arc is smoothly expressed. In step S303, the difference between the end angle and the start angle is divided by the number N of equal divisions to calculate the central angle α corresponding to the length of the segment.

【0014】ここまでの処理(Nの値を決定する処理)
は前述の従来例と同様であるが、以下の処理を施すこと
によって、円弧の端点におけるその接線との接続を滑ら
かにする。ステップS304において、中心角度αを1
/2に分割したβを算出する。
Processing up to this point (processing for determining the value of N)
Is similar to the above-mentioned conventional example, but the following processing is performed to smooth the connection with the tangent line at the end point of the arc. In step S304, the central angle α is set to 1
Calculate β divided into / 2.

【0015】ステップS305以降は実際に円弧を描く
(セグメントによって近似する)処理である。先ずステ
ップS305において、描画したセグメントの数を示す
パラメータiを初期化する。そして、ステップS306
およびS311において、パラメータiの値に従って描
画処理の場合別けを行う。即ち、i=0の場合は、ステ
ップS307およびS308を実行しステップS309
に進み、i=N−1の場合には、ステップ312および
S313を実行してステップS309に進み、それ以外
の場合には、ステップS314を実行してステップS3
09に進む。ステップS309では、パラメータiをイ
ンクリメントし、ステップS310においてパラメータ
iの値が、等分分割数Nに等しくなったら、即ち、円弧
の近似を終えたら一連の処理を終了し、一方、パラメー
タiの値が等分分割数Nと等しくない場合にはステップ
S306に戻って一連の処理を繰り返す。
The process from step S305 is a process of actually drawing an arc (approximate by a segment). First, in step S305, a parameter i indicating the number of drawn segments is initialized. Then, step S306
In S311 and S311, the case of the drawing process is determined according to the value of the parameter i. That is, when i = 0, steps S307 and S308 are executed and step S309 is executed.
And if i = N−1, execute steps 312 and S313 and proceed to step S309. Otherwise, execute step S314 and perform step S3.
Go to 09. In step S309, the parameter i is incremented, and when the value of the parameter i becomes equal to the number N of equal divisions in step S310, that is, when the approximation of the circular arc is finished, the series of processes is ended, while the value of the parameter i is set. If is not equal to the number N of equal divisions, the process returns to step S306 to repeat the series of processes.

【0016】i=0の場合には、先ず、ステップS30
7において、円弧の開始角度をセグメントの始点を示す
角度(以下、始点角度という)とし、始点角度に中心角
度βを加算した角度をセグメントの終点を示す角度(以
下、終点角度という)として、中心角度βに対応するセ
グメントを前述のページメモリに描画する。次にステッ
プS308において、直前の描画における終点角度を始
点角度とし、更新した始点角度に中心角度βを加算した
角度を終点角度として、中心角度βに対応するセグメン
トを不図示のページメモリに描画する。
If i = 0, first, step S30
In 7, the arc start angle is the angle indicating the start point of the segment (hereinafter referred to as the start point angle), and the angle obtained by adding the center angle β to the start point angle is the angle indicating the end point of the segment (hereinafter referred to as the end point angle). The segment corresponding to the angle β is drawn in the page memory. Next, in step S308, the segment angle corresponding to the center angle β is rendered in a page memory (not shown) with the end point angle in the immediately preceding rendering as the start point angle, and the angle obtained by adding the central angle β to the updated start point angle as the end point angle. .

【0017】0<i<N−1の場合には、ステップS3
14において直前の描画における終点角度を始点角度と
し、更新した始点角度に中心角度αを加算した角度を終
点角度として、中心角度αに対応するセグメントを前述
のページメモリに描画する。
If 0 <i <N-1, step S3
In 14, the segment corresponding to the center angle α is drawn in the page memory with the end point angle in the immediately preceding drawing as the start point angle, and the angle obtained by adding the center angle α to the updated start point angle as the end point angle.

【0018】i=N−1の場合には、先ず、ステップS
312において、直前の描画における終点角度を始点角
度とし、更新した始点角度に中心角度βを加算した角度
を終点角度として、中心角度βに対応するセグメントを
前述のページメモリに描画する。また、ステップS31
3においても同様にして、中心角度βに対応するセグメ
ントを前述のページメモリに描画する。なお、iの値が
いずれの場合にも、隙間を補間する処理を行うものとす
る。
In the case of i = N-1, first, step S
At 312, the segment corresponding to the center angle β is drawn in the page memory using the end point angle in the immediately preceding drawing as the start point angle, and the angle obtained by adding the center angle β to the updated start point angle as the end point angle. In addition, step S31
Similarly in 3, the segment corresponding to the central angle β is drawn in the page memory. It should be noted that the process of interpolating the gap is performed regardless of the value of i.

【0019】以上の説明から明らかなように、近似する
円弧の端点の付近においては、中心角度β(α/2)に
対応するセグメントをもって円弧を近似し、他の部分は
中心角度αに対応するセグメントをもって近似すること
によって、従来例における近似処理と同等の処理速度を
維持しつつ、端点における近似の精度が向上(端点にお
けるセグメントの方向を接線の方向に近づける)し、接
線との接続を滑らかに行えるようになる。
As is clear from the above description, in the vicinity of the end points of the approximated arc, the arc is approximated by the segment corresponding to the central angle β (α / 2), and the other parts correspond to the central angle α. By approximating with segments, while maintaining the same processing speed as the approximation processing in the conventional example, the accuracy of approximation at the end points is improved (the direction of the segment at the end points is made closer to the tangent direction), and the connection with the tangent line is smooth. You will be able to.

【0020】図4は、上記の近似処理を適用した結果を
説明する図である。400は近似する対象となる円弧で
あり、401はこれを包含する円の中心点、402は端
点である。450は端点402における円弧400の接
線である。411および412は中心角度αに対応する
セグメント(0<i<N−1)、413および414は
中心角度βに対応するセグメント(i=0)である。4
51は描画する接線である。
FIG. 4 is a diagram for explaining the result of applying the above approximation processing. Reference numeral 400 is an arc to be approximated, 401 is a center point of a circle including the same, and 402 is an end point. 450 is a tangent to the arc 400 at the end point 402. 411 and 412 are segments (0 <i <N−1) corresponding to the central angle α, and 413 and 414 are segments (i = 0) corresponding to the central angle β. Four
Reference numeral 51 is a tangent line to be drawn.

【0021】セグメント414に係る中心角度を小さく
することによって端点付近の近似の精度が向上するた
め、接線をなす直線451と滑らかに接続されているこ
とがわかる。
By reducing the central angle of the segment 414, the accuracy of the approximation in the vicinity of the end points is improved, and it can be seen that the segment 414 is smoothly connected to the tangent straight line 451.

【0022】なお、上記の近似処理においては、端点付
近のセグメントに係る中心角度を、他の部分のセグメン
トの1/2としているが、本発明はこれに限定されるも
のではなく、端点付近の円弧を精度良く近似するもので
あればよい。
In the above approximation process, the central angle of the segment near the end point is set to 1/2 of the segment of the other part, but the present invention is not limited to this, and the center angle near the end point is not limited to this. Anything can be used as long as it accurately approximates the arc.

【0023】また、上記実施例においては、円弧の近似
処理について説明しているが、本発明はこれに限定され
るものではなく、例えば楕円等の曲線についても広く適
用可能なことは論じるまでもない。
Further, although the above-described embodiment describes the arc approximation processing, the present invention is not limited to this, and it is needless to say that it is widely applicable to curves such as ellipses. Absent.

【0024】また、上記実施例においては、円弧の端点
におけるその円弧の接線(その接点においてその接線と
同一方向となる曲線を含む)との接続を滑らかにする一
例を示しているが、本発明は、円弧等の任意の点におけ
る接線を描画する際にも適用可能である。これは例え
ば、その任意の点において円弧を分割して(その任意の
点を分割した円弧の端点とする)、分割した各円弧につ
いて、上記の円弧描画処理を適用することによって実現
することができる。 [第2の実施例]以下、本発明に係る好適な第2の実施
例について説明する。図5は本実施例に係る情報処理装
置の構成を示すブロック図である。制御部502は、情
報処理装置500全体の制御や情報処理を司るブロック
であり、制御プログラム等を格納したROM、ワークメ
モリ、制御プログラムを実行するCPU等を備えてい
る。VRAM503は、描画すべき画像を格納するビデ
オメモリである。504は、画像を表示するディスプレ
イであり、ディスプレイ・インターフェース505を介
してバス506に接続される。キーボード508は、各
種入力を行うためのキーボードであり、キーボード・イ
ンターフェース507を介してバス506に接続され
る。
Further, in the above embodiment, an example is shown in which the connection between the end point of the arc and the tangent line of the arc (including the curve in the same direction as the tangent line at the contact point) is smoothed. Can also be applied when drawing a tangent line at an arbitrary point such as an arc. This can be realized, for example, by dividing the arc at the arbitrary point (using the arbitrary point as the end point of the divided arc) and applying the above-described arc drawing processing to each of the divided arcs. . [Second Embodiment] A preferred second embodiment according to the present invention will be described below. FIG. 5 is a block diagram showing the configuration of the information processing apparatus according to this embodiment. The control unit 502 is a block that controls the entire information processing apparatus 500 and controls information processing, and includes a ROM that stores a control program and the like, a work memory, a CPU that executes the control program, and the like. The VRAM 503 is a video memory that stores an image to be drawn. A display 504 displays an image, and is connected to the bus 506 via the display interface 505. The keyboard 508 is a keyboard for performing various inputs, and is connected to the bus 506 via the keyboard interface 507.

【0025】次に、制御部502によって所望の円弧を
ディスプレイ504に表示する動作をフローチャートを
参照しながら説明する。なお、本実施例においては、説
明の便宜のため、円弧の描画は中心座標、半径、開始角
度、終了角度、線幅をキーボード508から数値にて指
定するものとするが、それらのデータは不図示のインタ
ーフェースを介して受信してもよいし、前述のROMに
格納された各種プログラムに基づいて演算した結果であ
ってもよい。
Next, the operation of displaying a desired arc on the display 504 by the control unit 502 will be described with reference to the flowchart. In the present embodiment, for convenience of description, it is assumed that the drawing of the arc specifies the center coordinates, the radius, the start angle, the end angle, and the line width numerically from the keyboard 508, but these data are not available. It may be received via the interface shown, or may be the result of calculation based on various programs stored in the ROM.

【0026】図6は、キーボード508を介して円弧の
情報を与えディスプレイ604に表示する処理の流れを
説明するフローチャートである。先ず、ステップS60
1において、キーボード508を介して、描画すべき円
弧の中心座標、半径、開始角度、終了角度、線幅が入力
される。ステップS602では、制御部502は入力さ
れた円弧の情報を解析して、その円弧のビットマップイ
メージをVRAM503上に生成する。続いて、ステッ
プ603において、一定の間隔でVRAM503をスキ
ャンしているディスプレイ・インタフェース505によ
ってディスプレイ504に表示する。
FIG. 6 is a flow chart for explaining the flow of processing for giving arc information through the keyboard 508 and displaying it on the display 604. First, step S60
1, the center coordinates, radius, start angle, end angle, and line width of an arc to be drawn are input via the keyboard 508. In step S602, the control unit 502 analyzes the input arc information and generates a bitmap image of the arc on the VRAM 503. Then, in step 603, the VRAM 503 is displayed on the display 504 by the display interface 505 scanning the VRAM 503 at regular intervals.

【0027】図7は円弧線描画処理の流れを示すフロー
チャートである。なお、制御部502には、描画する円
弧の中心位置情報、半径、開始角度、終了角度、線幅が
入力されるものとする。本実施例においては、開始角
度、終了角度は360度未満の角度に正規化して与えら
るものとし、(開始角度)<(終了角度)となっている
ものとする。円弧を描画する色は黒、背景色は白と予め
設定されているものとする。また、ディスプレイ504
上に黒または白で描画する処理は、VRAM503上の
該当する位置のビットをセットまたはリセットする行為
と等価である。以下、これらの処理を単に「黒または白
で描画する」と表現する。
FIG. 7 is a flow chart showing the flow of the arc line drawing process. It is assumed that the control unit 502 is input with the center position information of the arc to be drawn, the radius, the start angle, the end angle, and the line width. In this embodiment, the start angle and the end angle are normalized to an angle less than 360 degrees, and (start angle) <(end angle). It is assumed that the color for drawing the arc is black and the background color is white. Also, the display 504
The process of drawing black or white on top is equivalent to the act of setting or resetting the bit at the corresponding position on the VRAM 503. Hereinafter, these processes will be simply referred to as “drawing in black or white”.

【0028】ステップS701において、制御部502
に描画すべき円弧を含む円の中心位置情報、半径、開始
角度、終了角度、線幅が入力される。ステップS702
では、入力された円弧の半径、開始角度、終了角度か
ら、所望の円弧を前述のセグメントの集合によって近似
する際の等分分割数N(所望の円弧をN個のセグメント
を用いて近似する)を決定する。前述のように、Nの値
を大きく設定すると近似した円弧は当然に滑らかなもの
となるが、一方で、処理時間が長大になる。従って、近
似した円弧が滑らかに表現される範囲で最小の値とする
ことが望ましい。ステップS703では、終了角度と開
始角度の差分を等分分割数Nで分割してセグメントの長
さに対応する中心角度αを算出し、ステップS704で
は、中心角度αを1/2に分割したβを算出する。ステ
ップS705において、開始角度から中心角度βを減じ
たγを算出する。
In step S701, the control unit 502.
The center position information of the circle including the arc to be drawn, the radius, the start angle, the end angle, and the line width are input. Step S702
Then, based on the radius, start angle, and end angle of the input arc, the number N of equal divisions when approximating the desired arc with the set of the above-mentioned segments (the desired arc is approximated using N segments) To decide. As described above, when the value of N is set to be large, the approximated arc naturally becomes smooth, but on the other hand, the processing time becomes long. Therefore, it is desirable to set the minimum value in the range in which the approximated arc is smoothly expressed. In step S703, the difference between the end angle and the start angle is divided by the number N of equal divisions to calculate the central angle α corresponding to the length of the segment, and in step S704, the central angle α is divided into ½ β. To calculate. In step S705, γ is calculated by subtracting the central angle β from the start angle.

【0029】以下、図8を参照しながら説明する。図8
において、800は近似すべき円弧であり、801はそ
の円弧を含む円の中心である。ステップS706では、
始点角度をγ、終点角度をγ+αとして、各角度に対応
する円弧上の点811および点812で与えられるセグ
メントを黒で描画する。ステップS707では、始点角
度をγ、終点角度をγ+β(円弧の開始角度)として、
始点角度に対応する点811と、終点角度に対応し中心
からの距離が(半径)×cosβである点813で与え
られるセグメントを白で描画する。そして点813を近
似した円弧の端点とする。以上のようにして黒で描画し
たセグメントの余分な部分を白で再度描画することによ
って消去する。
Hereinafter, description will be made with reference to FIG. FIG.
In, 800 is an arc to be approximated, and 801 is the center of a circle including the arc. In step S706,
With the starting point angle of γ and the ending point angle of γ + α, the segments given by points 811 and 812 on the arc corresponding to each angle are drawn in black. In step S707, the starting point angle is γ and the ending point angle is γ + β (starting angle of arc),
A segment given by a point 811 corresponding to the start point angle and a point 813 corresponding to the end point angle and having a distance from the center of (radius) × cos β is drawn in white. Then, the point 813 is set as the end point of the approximated arc. As described above, the extra portion of the segment drawn in black is erased by redrawing in white.

【0030】ステップS709では、描画したセグメン
トの数を示すパラメータiを初期化する。ステップS7
09において、直前の黒のセグメントの終点角度を始点
角度(i=0のときには開始角度+β)とし、更新した
始点角度に中心角度αを加算した角度を終点角度とし
て、各角度に対応する円弧上の点を結ぶセグメントを黒
で描画する。そしてステップS710でパラメータiを
インクリメントし、ステップS711で、パラメータi
が等分分割数Nに達したか否かを判定し、等分分割数N
に達していない場合には、ステップS709に戻り、処
理を繰り返す。なお、iの値がいずれの場合にも、隙間
を補間する処理を行うものとする。
In step S709, a parameter i indicating the number of drawn segments is initialized. Step S7
At 09, the end point angle of the previous black segment is set as the start point angle (start angle + β when i = 0), and the angle obtained by adding the central angle α to the updated start point angle is set as the end point angle. Draw the segment connecting the points in black. The parameter i is incremented in step S710, and the parameter i is incremented in step S711.
Determines whether or not the equal number of divisions N has been reached, and the equal number of divisions N
If not, the process returns to step S709 to repeat the process. It should be noted that the process of interpolating the gap is performed regardless of the value of i.

【0031】パラメータiの値が等分分割数Nと一致し
た時点で、終点角度は円弧の終了角度を中心角β分超え
ている。そこで、ステップS712において、最後(i
=N−1のとき)に描画したセグメントの内、円弧の終
了角度を超えている部分を消去する。即ち、直前の終点
角度を始点角度とし、円弧の終了角度を終点角度とし
て、円弧上の始点角度に対応する点と、終点角度に対応
し中心からの距離が(半径)×cosβである点を結ぶ
セグメントを白で描画する。
When the value of the parameter i coincides with the equal division number N, the end point angle exceeds the end angle of the arc by the central angle β. Therefore, in step S712, the last (i
= N-1), erase the part that exceeds the end angle of the arc among the segments drawn. That is, with the end point angle immediately before as the start point angle and the end angle of the arc as the end point angle, a point corresponding to the start point angle on the arc and a point corresponding to the end point angle and having a distance from the center of (radius) × cos β Draw the connecting segment in white.

【0032】以上のようにして、端点におけるセグメン
トを接線方向にすることによって、近似した円弧とその
接線を滑らかに接続することができる。
As described above, by making the segments at the end points tangential to each other, the approximated arc and its tangent can be smoothly connected.

【0033】なお、上記の近似処理においては、端点付
近のセグメントに係る中心角度を、結果として他の部分
のセグメントの1/2としているが、本発明はこれに限
定されるものではなく、端点付近の円弧を精度良く近似
するものであればよい。また、上記実施例においては、
円弧の近似処理について説明しているが、本発明がこれ
に限定されるものではなく、例えば楕円等の曲線につい
ても広く適用可能なことは論じるまでもない。
In the above approximation process, the central angle of the segment near the end point is set to 1/2 of the segment of the other part as a result. However, the present invention is not limited to this, and the end point is not limited to this. It is sufficient if the arcs in the vicinity are accurately approximated. In the above embodiment,
Although the approximation processing of a circular arc has been described, it is needless to say that the present invention is not limited to this and is widely applicable to, for example, a curve such as an ellipse.

【0034】なお、本発明は、複数の機器から構成され
るシステムに適用しても、1つの機器から成る装置に適
用しても良い。また、本発明はシステム或は装置にプロ
グラムを供給することによって達成される場合にも適用
できることは言うまでもない。
The present invention may be applied to a system including a plurality of devices or an apparatus including 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.

【0035】[0035]

【発明の効果】以上説明したように本発明によれば、処
理速度の低下を招くことなく、近似した曲線とその接線
方向をなす他の線とを滑らかに接続することが可能にな
る。
As described above, according to the present invention, it is possible to smoothly connect an approximated curve and another line forming a tangent to the approximated curve without lowering the processing speed.

【0036】[0036]

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

【図1】第1の実施例に係る印刷装置の構成の一例を示
すブロック図である。
FIG. 1 is a block diagram illustrating an example of a configuration of a printing apparatus according to a first embodiment.

【図2】印刷装置100の全体の処理の流れを説明する
フローチャートである。
FIG. 2 is a flowchart illustrating an overall processing flow of the printing apparatus 100.

【図3】描画処理部105において実行される円弧線描
画処理の流れを示すフローチャートである。
FIG. 3 is a flowchart showing a flow of arc line drawing processing executed in a drawing processing unit 105.

【図4】第1の実施例を適用した結果を説明する図であ
る。
FIG. 4 is a diagram illustrating a result of applying the first embodiment.

【図5】第2の実施例に係る情報処理装置の構成を示す
ブロック図である。
FIG. 5 is a block diagram showing a configuration of an information processing device according to a second embodiment.

【図6】情報処理装置500の全体の処理の流れを説明
するフローチャートである。
FIG. 6 is a flowchart illustrating the overall processing flow of information processing apparatus 500.

【図7】円弧線描画処理の流れを示すフローチャートで
ある。
FIG. 7 is a flowchart showing a flow of arc line drawing processing.

【図8】第2の実施例に係る円弧線描画処理を説明する
図である。
FIG. 8 is a diagram illustrating arc line drawing processing according to the second embodiment.

【図9】従来例に係る円弧線の近似の一例を示す図であ
る。
FIG. 9 is a diagram showing an example of approximation of arc lines according to a conventional example.

【符号の説明】[Explanation of symbols]

400 円弧 401 円弧の中心 402 円弧の端点 411,412,413,414 セグメント 451 接線 800 円弧 801 円弧の中心 900 円弧 911,912,913 セグメントの中心線 921,922,923 セグメント 931,932 隙間の補間部分 400 circular arc 401 circular arc center 402 circular arc end point 411,412,413,414 segment 451 tangent line 800 circular arc 801 circular arc center 900 circular arc 911,912,913 segment center line 921,922,923 segment 931,932 gap interpolation part

Claims (14)

【特許請求の範囲】[Claims] 【請求項1】 曲線を微小直線をもって近似して図形を
描画する描画装置であって、 前記曲線を、その接線方向をなす他の線と接する接点の
付近の領域については細かく、その他の領域については
荒く分割する分割手段と、 分割した各曲線を直線によって近似する直線近似手段
と、 近似した曲線を含む図形を描画する描画手段と、 を具備することを特徴とする描画装置。
1. A drawing device for approximating a curve with a minute straight line to draw a figure, wherein the curve is fine about a region near a contact point which is in contact with another line forming a tangential direction of the curve, and about other regions. A drawing apparatus comprising: a dividing unit that roughly divides, a linear approximation unit that approximates each divided curve by a straight line, and a drawing unit that draws a figure including the approximated curve.
【請求項2】 前記分割手段は、 前記曲線を所定数に等分割する等分割手段と、 等分割した曲線のうち前記接点を含む曲線を更に分割す
る再分割手段と、 を具備することを特徴とする請求項1記載の描画装置。
2. The dividing means comprises: an equal dividing means for dividing the curve into a predetermined number of equal parts; and a re-dividing means for further dividing a curve including the contact points among the equally divided curves. The drawing apparatus according to claim 1.
【請求項3】 前記曲線は円または楕円若しくはそれら
の一部であり、前記等分割手段は、その円または楕円の
中心角をもって等分割する手段であることを特徴とする
請求項2記載の描画装置。
3. The drawing according to claim 2, wherein the curve is a circle or an ellipse or a part thereof, and the equal dividing means is a means for equally dividing at a central angle of the circle or ellipse. apparatus.
【請求項4】 前記直線近似手段は分割した直線のうち
前記接点を含む曲線を近似するときに前記接線方向と同
一方向の直線をもって近似する手段であることを特徴と
する請求項1記載の描画装置。
4. The drawing according to claim 1, wherein the straight line approximating means is means for approximating a curved line including the contact point among the divided straight lines with a straight line in the same direction as the tangential direction. apparatus.
【請求項5】 描画した図形を出力する出力手段を更に
具備することを特徴とする請求項1乃至請求項4のいず
れか1項に記載の描画装置。
5. The drawing apparatus according to claim 1, further comprising output means for outputting the drawn figure.
【請求項6】 前記出力手段は、描画した図形を印刷す
る印刷手段であることを特徴とする請求項5記載の描画
装置。
6. The drawing apparatus according to claim 5, wherein the output unit is a printing unit that prints a drawn figure.
【請求項7】 前記出力手段は、描画した図形を表示す
る表示手段であることを特徴とする請求項5記載の描画
装置。
7. The drawing apparatus according to claim 5, wherein the output means is a display means for displaying a drawn figure.
【請求項8】 曲線を微小直線をもって近似して図形を
描画する描画方法であって、 前記曲線を、その接線方向をなす他の線と接する接点の
付近の領域については細かく、その他の領域については
荒く分割する分割工程と、 分割した各曲線を直線によって近似する直線近似工程
と、 近似した曲線を含む図形を描画する描画工程と、 を具備することを特徴とする描画方法。
8. A drawing method for drawing a figure by approximating a curved line with a minute straight line, wherein the curved line is fine for a region near a contact point which is in contact with another line forming the tangential direction, and for the other region. The drawing method is characterized by comprising a dividing step of roughly dividing, a linear approximation step of approximating each divided curve by a straight line, and a drawing step of drawing a figure including the approximated curve.
【請求項9】 前記分割工程は、 前記曲線を所定数に等分割する等分割工程と、 等分割した曲線のうち前記接点を含む曲線を更に分割す
る再分割工程と、 を具備することを特徴とする請求項8記載の描画方法。
9. The dividing step comprises: an equal dividing step of equally dividing the curve into a predetermined number; and a re-dividing step of further dividing a curve including the contact point among the equally divided curves. The drawing method according to claim 8.
【請求項10】 前記曲線は円または楕円若しくはそれ
らの一部であり、前記等分割工程は、その円または楕円
の中心角をもって等分割する工程であることを特徴とす
る請求項9記載の描画方法。
10. The drawing according to claim 9, wherein the curve is a circle or an ellipse or a part thereof, and the step of equally dividing is a step of equally dividing at a central angle of the circle or ellipse. Method.
【請求項11】 前記直線近似工程は分割した直線のう
ち前記接点を含む曲線を近似するときに前記接線方向と
同一方向の直線をもって近似する工程であることを特徴
とする請求項8記載の描画方法。
11. The drawing according to claim 8, wherein the straight line approximating step is a step of approximating a curved line including the contact point among the divided straight lines with a straight line in the same direction as the tangential direction. Method.
【請求項12】 描画した図形を出力する出力工程を更
に具備することを特徴とする請求項8乃至請求項11の
いずれか1項に記載の描画方法。
12. The drawing method according to claim 8, further comprising an output step of outputting the drawn figure.
【請求項13】 前記出力工程は、描画した図形を印刷
する印刷工程であることを特徴とする請求項12記載の
描画方法。
13. The drawing method according to claim 12, wherein the output step is a printing step of printing a drawn figure.
【請求項14】 前記出力工程は、描画した図形を表示
する表示工程であることを特徴とする請求項12記載の
描画方法。
14. The drawing method according to claim 12, wherein the output step is a display step of displaying a drawn figure.
JP9931295A 1995-04-25 1995-04-25 Drawing apparatus and drawing method Expired - Fee Related JP3647080B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP9931295A JP3647080B2 (en) 1995-04-25 1995-04-25 Drawing apparatus and drawing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP9931295A JP3647080B2 (en) 1995-04-25 1995-04-25 Drawing apparatus and drawing method

Publications (2)

Publication Number Publication Date
JPH08297747A true JPH08297747A (en) 1996-11-12
JP3647080B2 JP3647080B2 (en) 2005-05-11

Family

ID=14244128

Family Applications (1)

Application Number Title Priority Date Filing Date
JP9931295A Expired - Fee Related JP3647080B2 (en) 1995-04-25 1995-04-25 Drawing apparatus and drawing method

Country Status (1)

Country Link
JP (1) JP3647080B2 (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008040775A (en) * 2006-08-07 2008-02-21 Hitachi Software Eng Co Ltd Management/generation method of linear structure shape data
CN109035424A (en) * 2018-06-29 2018-12-18 陕西心像信息科技有限公司 Three dimensional design platform device interrupts method
JP2020060761A (en) * 2018-10-09 2020-04-16 ドクトル・ヨハネス・ハイデンハイン・ゲゼルシヤフト・ミツト・ベシユレンクテル・ハフツングDr. Johannes Heidenhain Gesellschaft Mit Beschrankter Haftung Grating structure for diffractive optic
CN113706658A (en) * 2021-08-18 2021-11-26 江苏红豆工业互联网有限公司 Discretization parameter drawing method based on clothing arc curve

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008040775A (en) * 2006-08-07 2008-02-21 Hitachi Software Eng Co Ltd Management/generation method of linear structure shape data
CN109035424A (en) * 2018-06-29 2018-12-18 陕西心像信息科技有限公司 Three dimensional design platform device interrupts method
CN109035424B (en) * 2018-06-29 2022-10-28 陕西心像信息科技有限公司 Three-dimensional design platform equipment breaking method
JP2020060761A (en) * 2018-10-09 2020-04-16 ドクトル・ヨハネス・ハイデンハイン・ゲゼルシヤフト・ミツト・ベシユレンクテル・ハフツングDr. Johannes Heidenhain Gesellschaft Mit Beschrankter Haftung Grating structure for diffractive optic
CN113706658A (en) * 2021-08-18 2021-11-26 江苏红豆工业互联网有限公司 Discretization parameter drawing method based on clothing arc curve
CN113706658B (en) * 2021-08-18 2023-09-05 江苏红豆工业互联网有限公司 Discretization parameter drawing method based on clothing circular arc curve

Also Published As

Publication number Publication date
JP3647080B2 (en) 2005-05-11

Similar Documents

Publication Publication Date Title
JP2585515B2 (en) Drawing method
KR970008546B1 (en) Character or graphic processing method
US5870107A (en) Character and symbol pattern generator based on skeleton data including thickness calculation
JPH08297747A (en) Method and device for plotting
JP3422634B2 (en) Handwritten character recognition method and apparatus
JPH0729021A (en) Picture output device
JPH0877324A (en) Electronic filing device
JPH06175638A (en) Method and device for character generation
JP3350325B2 (en) Character output device
JPH0863148A (en) Information processor
JP3143503B2 (en) Image processing method and apparatus
JPH04369717A (en) Information processing method and its device
JPH01281963A (en) Document processing device
JPH09277616A (en) Printer and control method therefor
JPH05135034A (en) Document processing method
JP3260390B2 (en) Document editing device
JPH11242472A (en) Outline font developing device
JP2700124B2 (en) Graphic display method and apparatus for implementing the same
JPH08287265A (en) Segment display method
JPH06286221A (en) Printing method and its device
JPH05274095A (en) Printer controller
JPH05143053A (en) Word processor provided with enlarging and smoothing function
JPH11316851A (en) Broken line plotting device, its method and storage medium
JPH0612413A (en) Method and device for processing document
JPH07129145A (en) Font forming method and device

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041013

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041022

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041215

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20050124

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20050208

R150 Certificate of patent (=grant) or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20080218

Year of fee payment: 3

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

Free format text: PAYMENT UNTIL: 20090218

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20100218

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20100218

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20110218

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20120218

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20130218

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20140218

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees