JP2807251B2 - Graphic data smoothing processing device - Google Patents

Graphic data smoothing processing device

Info

Publication number
JP2807251B2
JP2807251B2 JP4688689A JP4688689A JP2807251B2 JP 2807251 B2 JP2807251 B2 JP 2807251B2 JP 4688689 A JP4688689 A JP 4688689A JP 4688689 A JP4688689 A JP 4688689A JP 2807251 B2 JP2807251 B2 JP 2807251B2
Authority
JP
Japan
Prior art keywords
approximation
approximate
line
unit
arc
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 - Fee Related
Application number
JP4688689A
Other languages
Japanese (ja)
Other versions
JPH02270002A (en
Inventor
章広 中山
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.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP4688689A priority Critical patent/JP2807251B2/en
Publication of JPH02270002A publication Critical patent/JPH02270002A/en
Application granted granted Critical
Publication of JP2807251B2 publication Critical patent/JP2807251B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

【発明の詳細な説明】 〔産業上の利用分野〕 この発明は、スキヤナ等の高解像度入力装置によつて
入力した画素データの追跡により、単位ベクトル群によ
つて表現される図形データから、数値制御工作機械の制
御に用いる数値データを生成するための図形データのス
ムージング処理方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Industrial Application Field] The present invention relates to a method of tracking pixel data input by a high-resolution input device such as a scanner to obtain numerical values from graphic data represented by a unit vector group. The present invention relates to a smoothing processing method of graphic data for generating numerical data used for controlling a control machine tool.

〔従来の技術〕[Conventional technology]

近年、各種の製造分野において、数値制御工作機械を
使用して原材料を所望の形状に切断あるいは切削する等
の加工を自動的に行なうようになつている。
In recent years, in various manufacturing fields, processing such as cutting or cutting a raw material into a desired shape using a numerically controlled machine tool has been automatically performed.

そのために加工データとして数値データを必要とする
が、従来はそれを所定の数値制御用プログラム言語によ
つて加工形状を定義するか、あるいは加工形状のモデル
を作成して、それを工具でトレースさせてその位置を直
接入力させるなどの方法がとられていた。
For this purpose, numerical data is required as machining data.Conventionally, a machining shape is defined using a predetermined numerical control programming language, or a machining shape model is created and traced with a tool. And inputting the position directly.

しかしながら、このような方法で加工用数値データを
作成するには、多大な労力と費用を要していた。
However, creating the numerical data for machining by such a method requires a great deal of labor and cost.

そこで、最近では加工形状(工具軌跡)の原図を作成
して、それをスキヤナ等の高解像度入力装置によつて入
力し、その図形データから数値制御工作機械の制御に用
いる数値データを生成する方法がとられるようになつて
きた。
Therefore, recently, a method of creating an original drawing of a machining shape (tool trajectory), inputting the original drawing with a high-resolution input device such as a scanner, and generating numerical data to be used for controlling a numerically controlled machine tool from the graphic data. Has come to be taken.

その場合、入力した図形データは画素データの追跡に
より単位ベクトル群によつて表現されるので、そのまま
数値データとして出力して数値制御工作機械による加工
を行なうと、切削あるいは切断面が鋭くなり、またデー
タが多いため工具寿命を短くすることになる。
In this case, since the input graphic data is represented by a unit vector group by tracking pixel data, if it is output as it is as numerical data and processed by a numerically controlled machine tool, the cut or cut surface becomes sharp, and Since there is much data, the tool life is shortened.

そのため、読み込んだ図形(単位ベクトル群によつて
始点から終点まで閉じた形状を表わす)データに対して
近似線を求め、原図に近い滑らかなデータに変換するス
ムージング処理が行なわれている。
For this reason, a smoothing process is performed in which an approximate line is determined for the read graphic data (representing a shape closed from the start point to the end point by a unit vector group) and converted into smooth data close to the original drawing.

このような従来の図形データのスムージング処理方法
としては、例えば次のような方法がとられていた。
As such a conventional smoothing processing method for graphic data, for example, the following method has been adopted.

まず、読み込んだ図形の始点を1番目の頂点とし、そ
こから数えて3番目の頂点とを結ぶ直線を引いて近似直
線の候補とする。そして、この直線と2番目の頂点との
距離を求め、予め設定した誤差と比較して近似直線とし
て妥当であるか否かを判断する。
First, the starting point of the read graphic is set as the first vertex, and a straight line connecting from the first vertex to the third vertex is drawn as an approximate straight line candidate. Then, the distance between the straight line and the second vertex is obtained, and it is compared with a preset error to determine whether the straight line is appropriate as an approximate straight line.

比較結果が誤差範囲内なら、次に1番目の頂点と4番
目の頂点を結ぶ直線を引いて近似直線の候補とし、この
直線と2番目の頂点との距離及び3番目の頂点との距離
を求め、それぞれ設定誤差と比較する。
If the comparison result is within the error range, a straight line connecting the first vertex and the fourth vertex is then drawn as an approximate straight line candidate, and the distance between this straight line and the second vertex and the distance between the third vertex are calculated. Then, each is compared with the setting error.

ここで双方とも誤差範囲内なら、1番目の頂点とさら
に次の頂点を結ぶ直線を近似直線の候補にして同様な作
業を行なうが、ここで1つでも設定誤差を越えるものが
あつたら、近似直線の候補を延長する作業を止めて1つ
前の候補を近似直線に決定する。
Here, if both are within the error range, the same operation is performed using the straight line connecting the first vertex and the next vertex as an approximate straight line candidate, but if any one exceeds the set error, the approximation is performed. The operation of extending the straight line candidate is stopped, and the immediately preceding candidate is determined as the approximate straight line.

つまり、ここでは1番目の頂点と3番目の頂点を結ぶ
直線が第1の近似直線となる。
That is, here, a straight line connecting the first vertex and the third vertex is the first approximate straight line.

次に、第2の近似直線は3番目の頂点から上記の作業
を始めて決定する。
Next, the second approximate straight line is determined by starting the above operation from the third vertex.

こうして、近似直線の候補と頂点間の距離の比較を行
なつて順次近似直線を決定し、この近似直線を次々と繋
げるようにして図形の始点位置に戻るまで処理を行な
う。
In this way, the approximate straight line is sequentially determined by comparing the distance between the approximate straight line candidate and the vertex, and processing is performed until the approximate straight line is connected to the starting point of the figure.

また、このようなスムージング処理を円弧近似によつ
て行なう方法もある。
There is also a method of performing such smoothing processing by arc approximation.

〔発明が解決しようとする課題〕[Problems to be solved by the invention]

しかしながら、このような従来のスムージング処理方
法では、直線で近似する場合はその接続点が滑らかにな
らず図形の曲線部分を忠実に表わすことができなかつ
た。
However, in such a conventional smoothing processing method, when a straight line is approximated, the connection point is not smooth, and the curved portion of the figure cannot be faithfully represented.

そして、図形の頂点間を結んで近似直線とするため、
近似した頂点間の図形の変化をかなり平均化してしまう
ので、原図の図形と異なる部分ができてしまうという問
題があつた。
Then, to connect the vertices of the figure to an approximate straight line,
Since the change of the figure between the approximated vertices is considerably averaged, there is a problem that a part different from the figure of the original drawing is formed.

また、円弧で近似する場合でも、やはり図形の頂点間
で近似するため、近似した頂点間の図形の変化も捉えた
原図に忠実なスムージングにはならなかつた。
In addition, even when approximation is performed using arcs, since approximation is also performed between vertices of a figure, smoothing faithful to the original drawing, which captures a change in the figure between the approximated vertices, is not achieved.

この発明は上記の点に鑑みてなされたものであり、数
値制御工作機械の制御用数値データを作成するために読
み取つた図形データを、原図に忠実な形状にスムージン
グ処理することを目的とする。
The present invention has been made in view of the above points, and has as its object to perform smoothing processing on graphic data read to create numerical data for control of a numerically controlled machine tool into a shape faithful to the original drawing.

〔課題を解決するための手段〕[Means for solving the problem]

この発明は上記の目的を達成するため、始点と単位ベ
クトルの繋がりで表わされる閉じた図形の入力データに
対して、上記始点を開始点とする辺から順次隣接する辺
の単位ベクトルの延長線に対する次の頂点の位置をチェ
ックし、上記延長線に対する頂点の位置が2回連続して
右側あるいは左側の一方に位置する変化パターンを検出
したとき、その2つの頂点のうち先に現れた頂点を近似
区間を区切る位置に決定し、その近似区間を区切る位置
に基づいて上記入力データの近似区間を決定する近似区
間決定部と、その近似区間決定部によつて決定された近
似区間内の全ての隣り合う頂点間の中点の座標を求める
中点算出部と、その中点算出部で求められた各中点に基
づいて、近似区間毎に最小2乗法により近似直線又は近
似円弧を求める直線・円弧近似部と、その直線・円弧近
似部で求められた近似直線又は近似円弧を予め設定した
条件で評価して、その条件を満たす場合は近似線として
決定し、満たさない場合は近似区間を短縮した区間につ
いて上記中点算出部及び上記直線・円弧近似部による処
理を繰り返して、設定した条件を満たす近似線を決定す
る近似線評価部と、その近似線評価部で決定された近似
線と隣り合う近似区間の近似線との交点の座標を求める
交点・円弧要素算出部と、その円弧要素算出部で求めら
れた交点の座標と上記近似線評価部で決定された近似線
のデータを記録するデータ書込部とからなる図形データ
スムージング処理装置を提供する。
In order to achieve the above object, the present invention provides a method for input data of a closed figure represented by a connection between a start point and a unit vector. When the position of the next vertex is checked and a change pattern in which the position of the vertex with respect to the above-mentioned extended line is located on the right side or the left side twice consecutively is detected, the vertex that appears first of the two vertices is approximated. An approximate section determining section that determines an approximate section of the input data based on the position that separates the approximate section, and all adjacent sections in the approximate section determined by the approximate section determining section; A midpoint calculation unit for obtaining coordinates of a midpoint between matching vertices, and a straight line for obtaining an approximate straight line or an approximate arc by the least squares method for each approximate section based on each midpoint obtained by the midpoint calculation unit The arc approximation unit and the approximation straight line or approximation arc obtained by the straight line / arc approximation unit are evaluated under preset conditions.If the conditions are satisfied, the approximation line is determined.If not, the approximation interval is shortened. An approximate line evaluation unit that determines the approximate line that satisfies the set condition by repeating the processing by the midpoint calculation unit and the straight line / arc approximation unit for the section that has been set, and an approximate line determined by the approximate line evaluation unit An intersection / arc element calculation unit for obtaining the coordinates of the intersection with the approximation line of the matching approximation section, and the coordinates of the intersection obtained by the arc element calculation unit and the data of the approximation line determined by the approximation line evaluation unit are recorded. A graphic data smoothing processing device including a data writing unit is provided.

また、始点と単位ベクトルの繋がりで表わされる閉じ
た図形の入力データに対して、上記始点を開始点とする
辺から順次隣接する辺の単位ベクトルの延長線に対する
次の頂点の位置をチェックし、上記延長線に対する頂点
の位置が2回連続して右側あるいは左側の一方に位置す
る変化パターンを検出したとき、その2つの頂点のうち
先に現れた頂点を近似区間を区切る位置に決定し、その
近似区間を区切る位置に基づいて上記入力データの近似
区間を決定する近似区間決定部と、その近似区間決定部
によつて決定された近似区間内の全ての隣り合う頂点間
の中点の座標を求める中点算出部と、その中点算出部で
求められた各中点に基づいて、近似区間毎に最小2乗法
により近似直線と近似円弧を求める直線・円弧近似部
と、その直線・円弧近似部で求められた近似直線と近似
円弧を予め設定した条件で評価し、その条件を満たす方
を近似線として決定し、双方とも条件を満たさない場合
は近似区間を短縮した区間について上記中点算出部及び
上記直線・円弧近似部による処理を繰り返して、設定し
た条件を満たす近似線を決定する近似線評価部と、その
近似線評価部で決定された近似線と隣り合う近似区間の
近似線との交点の座標を求める交点・円弧要素算出部
と、その交点・円弧要素算出部で求められた交点の座標
と上記近似線評価部で決定された近似線のデータを記録
するデータ書込部とからなる図形データスムージング処
理装置にするとよい。
Also, for input data of a closed figure represented by the connection of the start point and the unit vector, the position of the next vertex with respect to the extension line of the unit vector of the adjacent side is sequentially checked from the side having the start point as the start point, When a change pattern in which the position of the vertex with respect to the extension line is located on the right side or the left side twice consecutively is detected, the vertex appearing first of the two vertices is determined as a position separating the approximate section. An approximate section determining unit that determines an approximate section of the input data based on a position separating the approximate section; and coordinates of a midpoint between all adjacent vertices in the approximate section determined by the approximate section determining unit. A midpoint calculating section to be obtained, a straight line / arc approximating section for obtaining an approximate straight line and an approximate arc by the least squares method for each approximation section based on each midpoint obtained by the midpoint calculating section; The approximate straight line and the approximate arc obtained by the section are evaluated under preset conditions, and the one that satisfies the conditions is determined as the approximate line. An approximation line evaluation unit that determines an approximation line that satisfies the set conditions by repeating the processing by the unit and the straight line / arc approximation unit, and an approximation line of an approximation section adjacent to the approximation line determined by the approximation line evaluation unit. An intersection / arc element calculation unit for obtaining the coordinates of the intersection of the data, and a data writing unit for recording the coordinates of the intersection determined by the intersection / arc element calculation unit and the data of the approximate line determined by the approximate line evaluation unit. And a graphic data smoothing processing device comprising:

さらに、上述のような図形データスムージング処理装
置において、上記近似線評価部で決定された近似線が近
似円弧である場合には、上記データ書込部で交点の座標
と共に近似線のデータとして始角,終角,半径,及び回
転方向等の円弧要素データを記録するようにするとよ
い。
Further, in the graphic data smoothing processing device as described above, when the approximate line determined by the approximate line evaluation unit is an approximate arc, the data writing unit sets the starting angle as the approximate line data together with the coordinates of the intersection. It is preferable to record the arc element data such as, the end angle, the radius, and the rotation direction.

〔作 用〕(Operation)

この発明の図形データスムージング処理装置によれ
ば、始点と単位ベクトルの繋がりで表わされる閉じた図
形の入力データを読み込み、その始点を開始点とする辺
から順次隣接する辺の単位ベクトルの延長線に対する次
の頂点の位置をチェックし、延長線に対する頂点の位置
が2回連続して右側あるいは左側の一方に位置する変化
パターンを検出したとき、その2つの頂点のうち先に現
れた頂点を近似区間を区切る位置に決定し、その近似区
間を区切る位置に基づいて入力データの近似区間を決定
する。
According to the graphic data smoothing processing device of the present invention, input data of a closed graphic represented by a connection between a start point and a unit vector is read, and an extension line of a unit vector of an adjacent side is sequentially read from the side starting from the start point. When the position of the next vertex is checked and a change pattern in which the position of the vertex with respect to the extension line is located on the right side or the left side twice consecutively is detected, the vertex that appears first of the two vertices is approximated as an approximate section. Is determined, and an approximate section of the input data is determined based on the position dividing the approximate section.

その後、近似区間内の全ての隣り合う頂点間の中点を
求め、その各中点に基づいて最小2乗法により近似直線
あるいは近似円弧の近似線を求め、予め設定した条件を
満たさない場合には、近似区間を短縮して上記の処理を
繰り返すことにより設定条件を満たす近似線を決定し
て、隣接する近似区間の近似線との交点の座標と共にそ
の近似線データを記録するので、図形の頂点間が平均化
されてしまうことなく、原図に忠実なスムージング処理
を施すことができる。
Then, the midpoint between all adjacent vertices in the approximation section is obtained, and an approximation line or an approximation line of an approximation arc is obtained by the least squares method based on each midpoint. The approximate line that satisfies the set conditions is determined by shortening the approximate section and repeating the above processing, and the approximate line data is recorded together with the coordinates of the intersection with the approximate line of the adjacent approximate section. A smoothing process faithful to the original drawing can be performed without averaging the intervals.

また、各近似区間の近似線として近似直線と近似円弧
の両方を求め、そのうちの予め設定した条件を満たす方
を近似線として決定するようにすれば図形の直線部分と
曲線部分をより忠実に表わすことができる。
Also, if both the approximate straight line and the approximate arc are obtained as the approximate line of each approximate section, and the one that satisfies the preset condition is determined as the approximate line, the straight line portion and the curved portion of the figure are represented more faithfully. be able to.

近似線が近似円弧である場合には、そのデータとして
始角,終角,半径,及び回転方向等の円弧要素データを
記録すれば、最少限のデータで近似円弧を正確に記憶す
ることができる。
When the approximation line is an approximation arc, if the arc element data such as the start angle, the end angle, the radius, and the rotation direction is recorded as the data, the approximation arc can be accurately stored with the minimum data. .

〔実 施 例〕〔Example〕

以下、この発明の実施例を図面に基づいて具体的に説
明する。
Hereinafter, embodiments of the present invention will be specifically described with reference to the drawings.

第1図は、この発明の図形データスムージング処理装
置の一実施例であるマイクロコンピュータの機能構成を
示すブロック図である。
FIG. 1 is a block diagram showing a functional configuration of a microcomputer which is an embodiment of the graphic data smoothing processing device of the present invention.

このマイクロコンピユータの機能は、入力データ読込
部1,近似区間決定部2,中間算出部3,直線・円弧近似部4,
近似線評価部5,交点・円弧要素算出部6,データ書込部7
で構成されている。
The functions of this microcomputer are: an input data reading unit 1, an approximate section determination unit 2, an intermediate calculation unit 3, a straight line / arc approximation unit 4,
Approximate line evaluation unit 5, intersection / arc element calculation unit 6, data writing unit 7
It is composed of

入力データ読込部1は、入力フアイルに格納されてい
る図形データ(図形の形状を始点位置とその始点位置を
出発点とした単位ベクトル群で表わしたデータ)を読み
込む。
The input data reading unit 1 reads graphic data (data in which a shape of a graphic is represented by a unit vector group having a starting point position and the starting point position as a starting point) stored in an input file.

近似区間決定部2は、入力データ読込部1で読み込ん
だデータの始点位置を開始点として、単位ベクトルの延
長線に対する次の頂点位置を調べ、そのパターンによつ
て近似区間を決定する。
The approximate section determination unit 2 checks the next vertex position with respect to the extension line of the unit vector with the start point position of the data read by the input data reading unit 1 as a start point, and determines the approximate section based on the pattern.

中点算出部3は、近似区間決定部2で決定した各近似
区間について、近似区間内の全ての隣り合う頂点間の中
点の座標を求める。
The midpoint calculator 3 obtains the coordinates of the midpoint between all adjacent vertices in the approximate section for each approximate section determined by the approximate section determiner 2.

直線・円弧近似部4は、中点算出部3で求めた各中点
群に基づいて最小2乗法で各近似区間ごとの近似直線及
び近似円弧を求める。
The straight line / arc approximating unit 4 calculates an approximate straight line and an approximate arc for each approximate section by the least squares method based on each midpoint group obtained by the midpoint calculating unit 3.

近似線評価部5は、近似区間内の頂点と直線・円弧近
似部4で求めた近似直線との距離及び近似円弧との距離
を求め、予め設定した条件すなわち許容誤差と比較し、
誤差範囲内にある方を近似線として決定する。
The approximate line evaluation unit 5 calculates the distance between the vertex in the approximate section and the approximate straight line calculated by the straight line / arc approximation unit 4 and the distance between the approximate arc and compares them with a preset condition, that is, an allowable error.
The one within the error range is determined as an approximate line.

また、この近似直線と近似円弧のいずれも誤差範囲内
になければ、誤差範囲内にある近似線が現れるまで近似
区間を短縮し、近似直線か近似円弧のいずれか一方を近
似線として決定する。
If neither the approximate straight line nor the approximate arc is within the error range, the approximate section is shortened until an approximate line within the error range appears, and one of the approximate straight line and the approximate arc is determined as the approximate line.

交点・円弧要素算出部6は、近似線評価部5において
決定した近似区間の近似線と隣り合う近似区間の近似線
との交点の座標を求め、その交叉する近似線の少なくと
も一方が近似円弧である場合にはその近似円弧の円弧要
素として始角,終角,半径,及び回転方向も求める。
The intersection / arc element calculation unit 6 obtains the coordinates of the intersection between the approximation line of the approximation section determined by the approximation line evaluation unit 5 and the approximation line of the adjacent approximation section, and at least one of the intersecting approximation lines is an approximation arc. In some cases, the starting angle, the ending angle, the radius, and the rotation direction are also obtained as arc elements of the approximate arc.

データ書込部7は、交点・円弧要素算出部6で求めた
交点の座標と近似線に近似円弧がある場合はその円弧要
素のデータを記録する。
The data writing unit 7 records the data of the arc element when the coordinates of the intersection obtained by the intersection / arc element calculation unit 6 and the approximate line have an approximate arc.

次に、第2図以降を用いて、この実施例のマイクロコ
ンピュータによる図形のスムージング処理についてさら
に詳細に説明する。
Next, the smoothing processing of a figure by the microcomputer of this embodiment will be described in more detail with reference to FIGS.

第2図は、単位ベクトルの説明図である。 FIG. 2 is an explanatory diagram of a unit vector.

入力データ読込部1で読み込む図形は、始点位置と単
位ベクトルの繋がりで表わされているが、この単位ベク
トルとは第2図(A)に示すように、3行3列のマトリ
クスの第2行2列目を中心とし同図(B)に示すように
45゜間隔で8方向の位置を表わす基本単位であり、上下
左右方向のベクトルの場合の長さは一定の単位長、斜め
45゜のベクトルの場合はその単位長の の長さである。
A figure read by the input data reading unit 1 is represented by a connection between a starting point position and a unit vector. The unit vector is, as shown in FIG. Centering on the second row, as shown in FIG.
A basic unit that represents positions in eight directions at 45 ° intervals. The length of a vector in the vertical and horizontal directions is a fixed unit length,
For a 45 ゜ vector, its unit length Is the length of

その単位ベクトルは、0から7までの数値で表わさ
れ、第1行1列目から3列目までの位置はそれぞれ「0:
左上向」,「1:上向」,「2:右上向」、第2行1列目と
3列目は「3;左向」と「4:右向」、第3行1列目から3
列目まではそれぞれ「5:左下向」,「6:下向」,「7:右
下向」である。
The unit vector is represented by a numerical value from 0 to 7, and the position from the first row to the first column to the third column is “0:
Upward left ”,“ 1: Upward ”,“ 2: Upper right ”, 2nd row, 1st and 3rd columns are“ 3; Leftward ”and“ 4: Rightward ”, from 3rd row, 1st column 3
Up to the column, "5: left down", "6: down", and "7: right down", respectively.

つまり、読み込む図形データは、図形の外周の始点位
置とその始点位置から繋がる単位ベクトルを上述の数値
の並びで表わしたものである。
In other words, the graphic data to be read is obtained by expressing the starting point position of the outer periphery of the figure and the unit vector connected from the starting point position in the above-described arrangement of numerical values.

第3図は、図形データの一例を示した図である。 FIG. 3 is a diagram showing an example of graphic data.

この図形データは、格納領域の最初の4バイトに始点
のx座標「12」が、次の4バイトに始点のy座標「3」
が格納され、この始点から繋がる順に単位ベクトルを示
す数値が「4」,「4」,「2」,…,「7」と格納さ
れている。
In this graphic data, the x coordinate “12” of the starting point is in the first 4 bytes of the storage area, and the y coordinate “3” of the starting point is in the next 4 bytes.
Are stored, and numerical values indicating the unit vectors in the order of connection from the starting point are stored as “4”, “4”, “2”,..., “7”.

第4図は、第3図の図形データを基に図形の軌跡を2
次元の座標系に表わした図である。
FIG. 4 shows the trajectory of the figure based on the figure data of FIG.
FIG. 3 is a diagram represented in a dimensional coordinate system.

この座標系は、左下の角を原点として右方向にX軸,
上方向にY軸を取り、原点から右方及び上方にそれぞれ
23単位のエリア(23×23)を持つ座標系で、点A(x,
y)=(12,3)の位置を始点として、第3図の図形デー
タの単位ベクトルを繋いでいくと、第4図に示すA,B,C,
……,Z,Aの各点を直線で結んだ閉じた図形が描かれる。
この図中のAからZまでの点は、単位ベクトルの方向が
変化した位置であり、図形の頂点を示し、以下の説明の
都合上始点位置をAとして反時計回りでアルフアベツト
順に付してある。
This coordinate system has the origin at the lower left corner, the X axis to the right,
Take the Y axis in the upward direction, and move to the right and upward from the origin, respectively.
In a coordinate system with an area of 23 units (23 × 23), point A (x,
y) = (12,3) as a starting point, connecting the unit vectors of the graphic data in FIG. 3 to A, B, C,
……, a closed figure that connects each point of Z and A with a straight line is drawn.
Points A to Z in the figure are positions where the direction of the unit vector has changed and indicate vertices of the figure. For convenience of the following description, the starting point position is set to A and is added counterclockwise in alphabetical order. .

このように、スムージング処理を行なわない図形は凹
凸の多い軌跡となる。
As described above, a graphic on which the smoothing process is not performed has a locus having many irregularities.

次に、この第4図の図形データに対してマイクロコン
ピュータがスムージング処理を行なう手順を、(1)近
似区間の決定,(2)中点の算出,(3)近似線の算
出,(4)近似線の評価及び決定,(5)交点及び円弧
情報の算出の順に説明する。
Next, the procedure in which the microcomputer performs the smoothing process on the graphic data shown in FIG. 4 includes (1) determination of an approximate section, (2) calculation of a middle point, (3) calculation of an approximate line, and (4). Evaluation and determination of the approximate line, and (5) calculation of intersection and arc information will be described in this order.

(1)近似区間の決定 まず、第5図に拡大して示すように、辺ABを頂点Bの
方向に延長した直線に対する頂点Cの位置を調べると、
この直線の延長方向に対して頂点Cは左側に位置する。
次に辺BCと頂点Dとについて同様に調べると、今度は頂
点Dが右側に位置する。
(1) Determination of Approximate Section First, as shown in an enlarged manner in FIG. 5, the position of vertex C with respect to a straight line extending side AB in the direction of vertex B is examined.
The vertex C is located on the left side with respect to the extension direction of this straight line.
Next, when the side BC and the vertex D are similarly examined, the vertex D is located on the right side.

上記のように、辺ABと頂点C,辺BCと頂点Dのように順
次隣接する辺の単位ベクトルの延長線に対する次の頂点
の位置をチエツクしていくと、延長線に対する頂点の位
置が2回連続して右側あるいは左側の一方に位置する時
がある。このパターンが現れたら、2つの頂点のうち先
に現れた頂点を近似区間の区切る位置に決定する。
As described above, when the position of the next vertex with respect to the extension line of the unit vector of the adjacent side such as the side AB and the vertex C and the side BC and the vertex D is checked, the position of the vertex with respect to the extension line becomes 2 There are times when it is located on either the right or left side successively. When this pattern appears, the first vertex of the two vertices is determined as a position separating the approximate section.

したがつて、第4図の例では辺EFに対する頂点G及び
辺FGに対する頂点Hがそれぞれ連続して左側に位置する
から、頂点Gを最初に近似区間を区切る点として、頂点
Aと頂点Gの区間を1番目の近似区間に決定する。
Therefore, in the example of FIG. 4, since the vertex G with respect to the side EF and the vertex H with respect to the side FG are continuously located on the left side, the vertex G is assumed to be the first point dividing the approximate section, and The section is determined as the first approximate section.

2番目の近似区間は、1番目に区切つた頂点の1つ手
前の頂点Fから始めて、上述の延長線に対して頂点位置
が2回連続して同じ側にあるパターンを見つけ、その2
つの頂点のうち先に現れた方を区切り位置とする。
The second approximation section starts from the vertex F immediately before the first divided vertex, and finds a pattern in which the vertex position is on the same side twice consecutively with respect to the above-mentioned extended line.
The first one of the vertices is defined as the break position.

こうして、第4図に示した例では頂点A〜Gを1番目
の近似区間とし、頂点F〜H,頂点G〜M,頂点L〜N,頂点
M〜Q,頂点P〜R,頂点Q〜Y,頂点X〜Bまでの8つの近
似区間を順次決定する。
Thus, in the example shown in FIG. 4, the vertices A to G are the first approximated sections, and the vertices F to H, GM, L to N, M to Q, P to R, and Q to Eight approximate sections from Y to vertices X to B are sequentially determined.

(2)中点の算出 次に、近似区間内の全ての隣り合う頂点間すなわち同
一方向ベクトルごとに中点を求める。
(2) Calculation of Midpoint Next, a midpoint is obtained between all adjacent vertices in the approximate section, that is, for each same direction vector.

例えば、第5図に示す1番目の近似区間である頂点A
〜Gの間には同一方向ベクトルの区間はAB,BC,CD,DE,E
F,FGの6つあるから、それらの各中点をa,b,c,d,e,fと
すると、その各中点の座標を算出して求めると、a(1
3,3),b(14.5,3.5),c(15.5,4),d(16.5,4.5),e(1
8,5),f(20,6)となる。
For example, vertex A, which is the first approximate section shown in FIG.
~ G, the section of the same direction vector is AB, BC, CD, DE, E
Since there are six F and FG, if the respective midpoints are a, b, c, d, e, and f, the coordinates of the respective midpoints are calculated and obtained as a (1
3,3), b (14.5,3.5), c (15.5,4), d (16.5,4.5), e (1
8,5), f (20,6).

(3)近似線の算出 次に、(2)で求めた各中点の座標データを用いて最
小2乗法により各近似区間を近似した近似直線及び近似
円弧を求める。
(3) Calculation of approximation line Next, using the coordinate data of each midpoint obtained in (2), an approximation straight line and an approximation arc are obtained by approximating each approximation section by the least squares method.

例えば、近似区間AGについて、その中点a,b,c,d,e,f
から最小2乗法で近似線を求めると、近似直線について
は直線の方程式、 (Al1)x+(Bl1)y+(Cl1)=0 … を満たす係数Al1,Bl1,Cl1(このA,B,C及び以下の式にお
けるA,B,Cは、頂点の符号A,B,Cとは無関係である)を算
出する。
For example, for the approximate section AG, its midpoints a, b, c, d, e, f
When obtaining an approximate line by the least square method from the equation of the straight line for the approximate straight line, (Al 1) x + ( Bl 1) y + (Cl 1) = 0 ... coefficient Al 1 satisfying, Bl 1, Cl 1 (the A , B, C and A, B, C in the following equation are independent of the vertices A, B, C).

また、近似円弧については円の方程式、 x2+y2+(Aa1)x+(Ba1)y +(Ca1)=0 … を満たす係数Aa1,Ba1,Ca1を算出する。For the approximate arc, coefficients Aa 1 , Ba 1 , and Ca 1 satisfying the equation of a circle, x 2 + y 2 + (Aa 1 ) x + (Ba 1 ) y + (Ca 1 ) = 0.

なお、近似区間内の中点が全て一直線上にある場合は
近似線は明らかに直線だから近似円弧は求めない。
When all the midpoints in the approximation section are on a straight line, the approximation arc is not determined because the approximation line is clearly a straight line.

(4)近似線の評価及び決定 次に、近似区間を近似した近似直線及び近似円弧と該
当する近似区間内の各頂点との距離を算出する。例え
ば、近似区間AGについては近似区間内の各頂点座標を
(XQ,YQ)で表わすと、近似直線との距離Llは前述の
式を基にした次式によつて算出する。
(4) Evaluation and Determination of Approximation Line Next, the distance between the approximation straight line and the approximation arc approximating the approximation section and each vertex in the corresponding approximation section is calculated. For example, when the coordinates of each vertex in the approximate section AG are represented by (XQ, YQ), the distance L1 to the approximate straight line is calculated by the following equation based on the above equation.

また、各頂点座標(XQ,YQ)と近似円弧との距離La
は前述式の変形式、 (x+(Aa1)/2)+(y+(Ba1)/2) =(Aa12/4+(Ba12/4−(Ca1) … を基にした次式によつて算出する。
The distance La between each vertex coordinate (XQ, YQ) and the approximate arc is
Above formula variant expression a ... (x + (Aa 1) / 2) 2 + (y + (Ba 1) / 2) 2 = (Aa 1) 2/4 + (Ba 1) 2 / 4- (Ca 1) It is calculated by the following formula based on the above.

こうして、近似区間内の各頂点と近似直線との距離Ll
と近似円弧との距離Laを、予め設定した誤差Llimitと1
つ1つ大小関係を比較していく。
Thus, the distance Ll between each vertex in the approximation section and the approximation straight line
The distance La between the distance and the approximate arc is set to a predetermined error Llimit and 1
We will compare the magnitude relation one by one.

すると、次に示す4つの評価のいずれかに該当する。 Then, it corresponds to one of the following four evaluations.

イ)全てのLlがLl≦Llimitを満たし、1つでもLlimitを
越えるLaがある場合。
B) When all Ll satisfies Ll ≦ Llimit, and at least one La exceeds Llimit.

ロ)全てのLaがLa≦Llimitを満たし、1つでもLlimitを
越えるLlがある場合。
B) When all Las satisfy La ≦ Llimit and at least one Ll exceeds Llimit.

ハ)Ll,La共にLlimitを越えるものがある場合。C) When both Ll and La exceed Llimit.

ニ)Ll,La全てがLlimit以内の場合。D) When Ll and La are all within Llimit.

ここで、イ)の場合なら近似直線の方を近似線として
決定し、ロ)の場合なら近似円弧の方を近似線として決
定する。
Here, in the case of a), the approximate straight line is determined as the approximate line, and in the case of b), the approximate arc is determined as the approximate line.

また、ニ)の場合なら更にLlの総和ΣLlとLaの総和Σ
Laを算出し、その大小を比較して小さい方を近似線に決
定する。
In the case of d), the sum of LlΣthe sum of Ll and LaΣ
La is calculated, and its magnitude is compared, and the smaller one is determined as an approximate line.

そして、ハ)の場合はこのままでは近似線を決定でき
ないので、近似区間を短縮して改めて上述の各処理を行
って近似直線及び近似円弧を求め、上記の比較をする。
In case (c), since the approximate line cannot be determined as it is, the approximate section is shortened and the above-described processing is performed again to obtain the approximate straight line and the approximate arc, and the above comparison is performed.

例えば、近似区間AGでこの場合に該当したとすると、
この近似区間AGを区間AFと区間EGに分けて短縮する。
For example, if this case is satisfied in the approximate section AG,
This approximate section AG is shortened by dividing it into a section AF and a section EG.

その後、第5図に示す中点aからeを基に区間AFの近
似直線と近似円弧を求め、中点eとfから区間EG内の近
似直線と近似円弧を求めて、それぞれの区間についてLl
imitと比較して近似線を決定する。
Thereafter, an approximate straight line and an approximate arc of the section AF are obtained based on the middle points a to e shown in FIG. 5, and an approximate straight line and an approximate arc in the section EG are obtained from the middle points e and f.
Determine the approximate line by comparing with imit.

なお、再び上記ハ)の場合に該当したら、上記イ),
ロ)又はニ)のいずれかにあてはまるまで、順次近似区
間を短縮して近似線を求める。もし、最終的に2点の近
似直線がLl≦Llimitの条件を満たさない時は、数値デー
タとして頂点座標も記録する。
If the above case (c) is met again,
Until the case of (b) or (d) is satisfied, the approximation section is sequentially shortened to obtain an approximate line. If the two approximated lines do not satisfy the condition of Ll ≦ Llimit, the vertex coordinates are also recorded as numerical data.

(5)交点及び円弧情報の算出 次に、(4)で決定した隣り合う近似区間の近似線同
士の交点の座標を求める。
(5) Calculation of Intersection and Arc Information Next, the coordinates of the intersection of the approximate lines of the adjacent approximate sections determined in (4) are determined.

この計算で、2つの解が算出される場合があるが、そ
の時には2つの近似区間の両方に属する線分の中点に近
い位置にある方を交点とする。
In this calculation, two solutions may be calculated. At this time, the intersection located at a position closer to the midpoint of the line segment belonging to both of the two approximate sections is set as the intersection.

例えば、近似区間AGと近似区間FHの2区間に関する近
似円弧の交点を求めた場合、中点fに近い方を解として
採用する。
For example, when the intersection of the approximate arcs in the two sections, the approximate section AG and the approximate section FH, is obtained, the one closer to the midpoint f is adopted as the solution.

また、近似円弧の交点を求めた場合は、この円弧を描
くための円弧要素データとして、始角,終角,半径,回
転方向も算出する。
When the intersection of the approximate arcs is obtained, the start angle, the end angle, the radius, and the rotation direction are also calculated as the arc element data for drawing the arc.

ここで、始角及び終角とはそれぞれ円弧の始点及び終
点と中心とを結ぶ直線の基準線(例えば、X軸)とのな
す角度であり、回転方向とはその角度を測る方向であ
る。
Here, the start angle and the end angle are angles formed by a reference line (for example, X axis) of a straight line connecting the start point and the end point of the arc with the center, and the rotation direction is a direction in which the angles are measured.

こうして、求めた交点の座標と円弧要素のデータを図
形データとして記録する。
The coordinates of the intersection and the data of the arc element thus obtained are recorded as graphic data.

第6図は、第4図に示した図形をスムージング処理し
て求めた図形データの記録状態及び記録形式を示してい
る。
FIG. 6 shows a recording state and a recording format of graphic data obtained by performing a smoothing process on the graphic shown in FIG.

この一覧表で、イ)からチ)までの欄は交点座標を示
し、14番目の欄には図形を閉じるために1番目の欄と同
じ交点座標を記録する。
In this table, the columns from a) to h) show the coordinates of the intersection, and the fourteenth column records the same intersection coordinates as the first column to close the figure.

また、例えば交点ロとハの間は円弧だから、ロ)の欄
とハ)の欄の間の欄は、円弧要素である始角,終角,半
径,及び回転方向が記録されている。
For example, since the arc between the intersections B and C is a circular arc, the columns between the columns B) and C) record the starting angle, the end angle, the radius, and the rotation direction, which are the arc elements.

このスムージング処理を施した図形データを用いて描
いた図形は第7図に示すようになり、第4図の図形に比
べデータ量が少なく滑らかな軌跡を描いている。
FIG. 7 shows a graphic drawn by using the graphic data subjected to the smoothing process, and the data has a smaller amount of data than the graphic of FIG. 4, and a smooth locus is drawn.

次に、第8図のフロー図に従つてこのマイクロコンピ
ュータにおける他のスムージング処理の手順を説明す
る。
Next, the procedure of another smoothing process in this microcomputer will be described with reference to the flowchart of FIG.

始めに、ステツプ1からステツプ3において、図形の
始点位置から順番に単位ベクトルを読み込み、前述した
近似区間の決定方法によつて最初の近似区間を求める。
最初の近似区間が決定したら、この近似区間についてス
テツプ4とステツプ5で近似直線と近似円弧を求める。
First, in steps 1 to 3, the unit vectors are read in order from the starting point of the figure, and the first approximate section is determined by the above-described method of determining the approximate section.
When the first approximation section is determined, an approximation straight line and an approximation arc are obtained in steps 4 and 5 for this approximation section.

さらに、ステツプ4とステツプ5で近似区間内の各頂
点と近似直線及び近似円弧との距離を算出し、ステツプ
6乃至ステツプ9で設定誤差との比較を行ない、誤差範
囲内にある近似線を決定する。
Further, in Steps 4 and 5, the distances between the respective vertices in the approximation section and the approximation straight line and the approximation arc are calculated, and in Steps 6 to 9, comparisons are made with the set errors, and the approximation lines within the error range are determined. I do.

ここで、まずステツプ6で近似直線,近似円弧の双方
とも該当せず、ステツプ7で近似直線の方が該当すると
判断されたら、この近似区間の近似線は近似直線として
決定してステツプ10に進む。
Here, if it is determined in step 6 that neither the approximate straight line nor the approximate arc is applicable, and in step 7 it is determined that the approximate straight line is more appropriate, the approximate line of this approximate section is determined as an approximate straight line and the process proceeds to step 10. .

ステツプ7で該当せず、ステツプ8で近似円弧の方が
該当したなら、この近似線を近似円弧に決定してステツ
プ17に進む。
If the condition is not satisfied in step 7 and the approximate arc is better in step 8, this approximate line is determined as an approximate arc and the process proceeds to step 17.

ステツプ8で両方とも該当しないと判断されたら、こ
のままでは近似線を決定できないので、ステツプ16にお
いて近似区間を短縮し、ステツプ4及びステツプ5に戻
つて近似直線及び近似円弧を求め直し、再びステツプ6
乃至ステツプ9の判断を行なう。
If it is determined in step 8 that both are not applicable, the approximation line cannot be determined as it is. Therefore, the approximation section is shortened in step 16, and the process returns to steps 4 and 5 to find the approximation straight line and the approximation arc again.
Then, the determination in step 9 is performed.

ステツプ6で両方とも該当すると判断されたら、ステ
ツプ9に進み、さらに近似直線と頂点との距離の総和と
近似円弧と頂点との距離の総和の大小を比較し、小さい
方を近似線として決定する。
If it is determined in step 6 that both of the conditions are satisfied, the process proceeds to step 9, where the sum of the distance between the approximate straight line and the vertex is compared with the sum of the distance between the approximate arc and the vertex, and the smaller one is determined as the approximate line. .

ここで、近似直線に決定したらステツプ10に進み、近
似円弧に決定したらステツプ17に進む。
If the approximate straight line is determined, the process proceeds to step 10, and if the approximate arc is determined, the process proceeds to step 17.

ステツプ10では、決定した近似直線が最初の近似区間
のものであるか否かを判断し、最初ならステツプ15でこ
の近似線のデータを一時記録する。
At step 10, it is determined whether or not the determined approximate line is that of the first approximate section. If it is the first time, at step 15, the data of this approximate line is temporarily recorded.

2番目以降の近似区間であれば、ステツプ11で既に一
時記録している隣接する近似区間の近似線との交点を求
める。
If it is the second or later approximate section, the intersection with the approximate line of the adjacent approximate section that has already been temporarily recorded is determined in step 11.

そして、ステツプ12でこの近似線が近似円弧と判断さ
れたステツプ13で円弧要素を算出し、交点と円弧要素の
データを、また近似円弧でなければ交点データのみをス
テツプ14において記録する。その後、ステツプ15で近似
直線のデータを一時記録する。
Then, at step 12, when the approximate line is determined to be an approximate arc, an arc element is calculated at step 13, and data of the intersection and the arc element are recorded. At step 14, only the intersection data is recorded if it is not an approximate arc. Thereafter, in step 15, data of the approximate straight line is temporarily recorded.

ステツプ8またはステツプ9で近似円弧に決定された
ら、ステツプ17でその近似円弧が最初の近似区間のもの
であるか否かを判断し、最初ならステツプ21に進んでこ
の近似円弧のデータを一時記録する。
When the approximate arc is determined in step 8 or step 9, it is determined in step 17 whether or not the approximate arc is that of the first approximate section. If the approximate arc is the first approximate section, the process proceeds to step 21 to temporarily record the approximate arc data. I do.

2番目以降の近似区間であれば、ステツプ18で既に一
時記録してある隣接する近似区間の近似線との交点を算
出し、ステツプ19で円弧要素を算出した後ステツプ20に
おいて交点と円弧要素のデータを記録する。
In the case of the second and subsequent approximate sections, the intersection with the approximate line of the adjacent approximate section that has already been temporarily recorded is calculated in step 18, the arc element is calculated in step 19, and the intersection and the arc element are calculated in step 20. Record the data.

そして、ステツプ21で近似円弧のデータを一時記録す
る。
Then, in step 21, the approximate arc data is temporarily recorded.

ステツプ21もしくはステツプ17の処理を終えるとステ
ツプ22に進み、最初に決定した近似区間が全て終了した
か否かを判断する。ここで、ステツプ16において近似区
間を短縮した時の残りの区間があつたなら、ステツプ4
に戻り近似線を決定する処理を繰り返す。
When the processing of step 21 or step 17 is completed, the process proceeds to step 22, and it is determined whether or not all of the initially determined approximate sections have been completed. Here, if there is any remaining section when the approximate section is shortened in step 16, step 4
And the process of determining the approximate line is repeated.

もし、残りの区間がなければ1つの近似区間の近似が
終了したので、ステツプ1に戻り次の近似区間を求め、
上述した処理を行ない近似線のデータを記録していく。
If there is no remaining section, the approximation of one approximation section has been completed, so the process returns to step 1 to find the next approximation section.
The above processing is performed, and data of the approximate line is recorded.

こうして、最後の近似区間の近似線のデータを記録し
た後、ステツプ1に戻つて図形の単位ベクトルを読み込
んでも読み込むデータが無いから、ステツプ2からステ
ツプ23に進む。
After recording the data of the approximation line of the last approximation section in this manner, the process returns to step 1 and reads the unit vector of the figure. However, since there is no data to be read, the process proceeds from step 2 to step 23.

ステツプ23では、1番目の近似区間の近似線と最後の
近似区間の近似線との交点の座標を算出する。
In step 23, the coordinates of the intersection of the approximate line of the first approximate section and the approximate line of the last approximate section are calculated.

その後、ステツプ24で1番目の近似区間が近似円弧と
判断されたら、ステツプ25で円弧要素を算出して交点の
座標と円弧要素のデータを、また近似直線なら交点の座
標データのみをステツプ26で記録して処理を終了する。
Thereafter, if it is determined in step 24 that the first approximation section is an approximate arc, an arc element is calculated in step 25 to obtain the coordinates of the intersection and the data of the arc element. Record and end the process.

なお、この実施例では、各近似区間の近似線として近
似直線と近似円弧を求めそのうち誤差の少ない方を選択
して近似線として決定するようにしたが、近似線として
近似直線又は近似円弧のいずれか一方のみを求めて決定
するようにしても各頂点間の中点に基づいてそれを行う
ことにより、従来より原図に忠実なスムージング処理を
施すことができる。
In this embodiment, an approximation straight line and an approximation arc are obtained as approximation lines of each approximation section, and the one having a smaller error is selected and determined as the approximation line. Even if only one of them is determined, it is determined based on the midpoint between the vertices, so that a smoothing process more faithful to the original drawing can be performed.

〔発明の効果〕〔The invention's effect〕

以上説明したようにこの発明の図形データスムージン
グ処理装置によれば、前述したような従来のスムージン
グ処理方法に比べ、処理後の図形データにバラツキが無
く、原図に忠実な図形データを提供できる。
As described above, according to the graphic data smoothing processing apparatus of the present invention, compared with the above-described conventional smoothing processing method, there is no variation in processed graphic data, and graphic data faithful to the original drawing can be provided.

そして、この発明の図形データスムージング処理装置
によつてスムージング処理を施した図形データを数値デ
ータとして用いて、数値制御工作機械による加工を行な
うと、設計した形状により近い形状に加工することがで
きる。
Then, when the graphic data smoothed by the graphic data smoothing processing apparatus of the present invention is used as numerical data and processed by a numerically controlled machine tool, it can be processed into a shape closer to the designed shape.

また、このスムージング処理によりデータが少なくな
るため、数値制御工作機械にかける負担が減り、工具等
の寿命も延ばすことができる。
Further, since the data is reduced by the smoothing process, the load on the numerically controlled machine tool is reduced, and the life of the tool and the like can be extended.

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

第1図はこの発明の図形データスムージング処理装置の
一実施例であるマイクロコンピュータの機能構成を示す
ブロック図、 第2図は入力する図形データを表わす単位ベクトルの説
明図、 第3図は始点と単位ベクトルで表わされた図形データの
一例を示す図、 第4図は第3図のデータを基に座標系に描いた入力図形
を示すこの発明の実施例を説明するための説明図、 第5図は同じくその一部を拡大して示す説明図、 第6図はこの実施例のマイクロコンピュータによるスム
ージング処理によつて求めた図形データの記録状態を示
す図、 第7図は同じくスムージング処理後の図形を示す図、 第8図はこの実施例のマイクロコンピュータによるスム
ージング処理の手順を示すフロー図である。
FIG. 1 is a block diagram showing a functional configuration of a microcomputer which is an embodiment of a graphic data smoothing processing apparatus according to the present invention, FIG. 2 is an explanatory diagram of a unit vector representing graphic data to be input, and FIG. FIG. 4 is a diagram showing an example of graphic data represented by a unit vector. FIG. 4 is an explanatory diagram for explaining an embodiment of the present invention showing an input graphic drawn in a coordinate system based on the data of FIG. FIG. 5 is an explanatory view showing a part thereof in an enlarged manner, FIG. 6 is a view showing a recording state of graphic data obtained by smoothing processing by the microcomputer of this embodiment, and FIG. FIG. 8 is a flowchart showing the procedure of smoothing processing by the microcomputer of this embodiment.

Claims (3)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】始点と単位ベクトルの繋がりで表わされる
閉じた図形の入力データに対して、前記始点を開始点と
する辺から順次隣接する辺の単位ベクトルの延長線に対
する次の頂点の位置をチェックし、前記延長線に対する
頂点の位置が2回連続して右側あるいは左側の一方に位
置する変化パターンを検出したとき、その2つの頂点の
うち先に現れた頂点を近似区間を区切る位置に決定し、
該近似区間を区切る位置に基づいて前記入力データの近
似区間を決定する近似区間決定部と、 該部によつて決定された近似区間内の全ての隣り合う頂
点間の中点の座標を求める中点算出部と、 該部で求められた各中点に基づいて、近似区間毎に最小
2乗法により近似直線又は近似円弧を求める直線・円弧
近似部と、 該部で求められた近似直線又は近似円弧を予め設定した
条件で評価して、その条件を満たす場合は近似線として
決定し、満たさない場合は近似区間を短縮した区間につ
いて前記中点算出部及び前記直線・円弧近似部による処
理を繰り返して、設定した条件を満たす近似線を決定す
る近似線評価部と、 該部で決定された近似線と隣り合う近似区間の近似線と
の交点の座標を求める交点・円弧要素算出部と、 該部で求められた交点の座標と前記近似線評価部で決定
された近似線のデータを記憶するデータ書込部と からなることを特徴とする図形データスムージング処理
装置。
1. For input data of a closed figure represented by a connection between a start point and a unit vector, a position of a next vertex with respect to an extension line of a unit vector of an adjacent side is sequentially determined from a side having the start point as a start point. When a check is made and a change pattern in which the position of the vertex with respect to the extension line is located on the right or left side twice consecutively is detected, the vertex appearing first of the two vertices is determined as a position separating the approximate section. And
An approximation interval determining unit that determines an approximation interval of the input data based on a position dividing the approximation interval; and determining an intermediate point coordinate between all adjacent vertices in the approximation interval determined by the approximation interval. A point calculation unit, a straight line / arc approximation unit for obtaining an approximate straight line or an approximate arc by the least squares method for each approximation section based on each midpoint obtained by the unit, and an approximate line or approximation obtained by the unit The arc is evaluated under a preset condition, and if the condition is satisfied, it is determined as an approximation line. If the condition is not satisfied, the processing by the midpoint calculation unit and the straight line / arc approximation unit is repeated for a section obtained by shortening the approximation section. An approximation line evaluation unit that determines an approximation line that satisfies the set conditions; an intersection / arc element calculation unit that obtains coordinates of an intersection between the approximation line determined by the unit and an approximation line of an adjacent approximation section; Exchange requested by the department Graphic data smoothing processing apparatus characterized by comprising a data writing unit for storing data of the approximate line determined by the coordinates and the approximate line evaluation unit.
【請求項2】始点と単位ベクトルの繋がりで表わされる
閉じた図形の入力データに対して、前記始点を開始点と
する辺から順次隣接する辺の単位ベクトルの延長線に対
する次の頂点の位置をチェックし、前記延長線に対する
頂点の位置が2回連続して右側あるいは左側の一方に位
置する変化パターンを検出したとき、その2つの頂点の
うち先に現れた頂点を近似区間を区切る位置に決定し、
該近似区間を区切る位置に基づいて前記入力データの近
似区間を決定する近似区間決定部と、 該部によつて決定された近似区間内の全ての隣り合う頂
点間の中点の座標を求める中点算出部と、 該部で求められた各中点に基づいて、近似区間毎に最小
2乗法により近似直線と近似円弧を求める直線・円弧近
似部と、 該部で求められた近似直線と近似円弧を予め設定した条
件で評価し、その条件を満たす方を近似線として決定
し、双方とも条件を満たさない場合は近似区間を短縮し
た区間について前記中点算出部及び前記直線・円弧近似
部による処理を繰り返して、設定した条件を満たす近似
線を決定する近似線評価部と、 該部で決定された近似線と隣り合う近似区間の近似線と
の交点の座標を求める交点・円弧要素算出部と、 該部で求められた交点の座標と前記近似線評価部で決定
された近似線のデータを記録するデータ書込部と からなることを特徴とする図形データスムージング処理
装置。
2. With respect to input data of a closed figure represented by a connection between a start point and a unit vector, a position of a next vertex with respect to an extension line of a unit vector of an adjacent side is sequentially determined from a side having the start point as a start point. When a check is made and a change pattern in which the position of the vertex with respect to the extension line is located on the right or left side twice consecutively is detected, the vertex appearing first of the two vertices is determined as a position separating the approximate section. And
An approximation interval determining unit that determines an approximation interval of the input data based on a position dividing the approximation interval; and determining an intermediate point coordinate between all adjacent vertices in the approximation interval determined by the approximation interval. A point calculation unit, a straight line / arc approximation unit for obtaining an approximate straight line and an approximate arc by the least squares method for each approximation section based on each midpoint obtained by the unit, and an approximation line to the approximate line obtained by the unit The arc is evaluated under a preset condition, and the one that satisfies the condition is determined as an approximation line. If neither of the conditions is satisfied, the intermediate point calculation unit and the straight line / arc approximation unit perform the shortening of the approximate interval. An approximation line evaluation unit that repeats the process to determine an approximation line that satisfies the set conditions; and an intersection / arc element calculation unit that obtains coordinates of an intersection between the approximation line determined by the unit and an approximation line of an adjacent approximation section. And asked by the department Graphic data smoothing processing apparatus characterized by comprising a data writing unit for recording data of the determined approximate line by the coordinates and the approximate line evaluation of intersection were.
【請求項3】請求項1又は2記載の図形データスムージ
ング処理装置において、 前記近似線評価部で決定された近似線が近似円弧である
場合には、前記データ書込部で交点の座標と共に近似線
のデータとして始角,終角,半径,及び回転方向等の円
弧要素データを記録するようにしたことを特徴とする図
形データスムージング処理装置。
3. The graphic data smoothing processing device according to claim 1, wherein when the approximate line determined by the approximate line evaluation unit is an approximate arc, the data writing unit approximates the coordinates of the intersection. A graphic data smoothing processing apparatus characterized by recording arc element data such as a start angle, an end angle, a radius, and a rotation direction as line data.
JP4688689A 1989-02-28 1989-02-28 Graphic data smoothing processing device Expired - Fee Related JP2807251B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4688689A JP2807251B2 (en) 1989-02-28 1989-02-28 Graphic data smoothing processing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4688689A JP2807251B2 (en) 1989-02-28 1989-02-28 Graphic data smoothing processing device

Publications (2)

Publication Number Publication Date
JPH02270002A JPH02270002A (en) 1990-11-05
JP2807251B2 true JP2807251B2 (en) 1998-10-08

Family

ID=12759845

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4688689A Expired - Fee Related JP2807251B2 (en) 1989-02-28 1989-02-28 Graphic data smoothing processing device

Country Status (1)

Country Link
JP (1) JP2807251B2 (en)

Also Published As

Publication number Publication date
JPH02270002A (en) 1990-11-05

Similar Documents

Publication Publication Date Title
US5768136A (en) Method and apparatus for deciding trace of tool to be moved
US5617335A (en) System for and method of recognizating and tracking target mark
JPH08292938A (en) Method and device for finite element mesh generation and method and device for analysis
KR920002346B1 (en) Robot controller
JP2807251B2 (en) Graphic data smoothing processing device
JPS6244282B2 (en)
JP3310335B2 (en) Numerical control device with three-dimensional graphic display function
JPH0721224A (en) Graphic correction method
JPH1185241A (en) Method for setting work condition of tool in offline teaching
JPS6015710A (en) Specifying method of three-dimensional curve
JP2796016B2 (en) CAD system
US5471536A (en) Figure digitizing system
JP2947811B2 (en) Color image processing method
US7002575B2 (en) Design supporting program, design supporting method, design supporting apparatus and computer-readable recording medium recorded with design supporting program
JP2512756B2 (en) Fillet surface creation device
JP3305395B2 (en) Figure division device
JP2601835B2 (en) How to check software potential lines
US5331566A (en) Digitizing apparatus with extension-intersection measuring function
JPH10269371A (en) Free curved line generating method, free curved surface generating method and its recording medium
JP2813059B2 (en) Position data approximation method
JPS6044278A (en) Positioning method
JP3405827B2 (en) Graphic processing apparatus and intersection determination processing method
JPH10240790A (en) Method for instructing formation of fillet surface
JP2723058B2 (en) Line-symmetric figure input device
JPS5922272B2 (en) Drawing setting method for digitizer analysis equipment

Legal Events

Date Code Title Description
LAPS Cancellation because of no payment of annual fees