JPS62221004A - Method for producing locus of 2-dimensional tool - Google Patents

Method for producing locus of 2-dimensional tool

Info

Publication number
JPS62221004A
JPS62221004A JP6394586A JP6394586A JPS62221004A JP S62221004 A JPS62221004 A JP S62221004A JP 6394586 A JP6394586 A JP 6394586A JP 6394586 A JP6394586 A JP 6394586A JP S62221004 A JPS62221004 A JP S62221004A
Authority
JP
Japan
Prior art keywords
contour
machining
area
tool
pixels
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
JP6394586A
Other languages
Japanese (ja)
Other versions
JPH07107645B2 (en
Inventor
Rumiko Mikami
三上 留美子
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 JP6394586A priority Critical patent/JPH07107645B2/en
Publication of JPS62221004A publication Critical patent/JPS62221004A/en
Publication of JPH07107645B2 publication Critical patent/JPH07107645B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Numerical Control (AREA)

Abstract

PURPOSE:To properly form a working area from a working form drawn by lines by counting the picture elements added with the 1st identification code crossing a scan line when the working form is scanned in a fixed direction to decide the internal picture elements of the working area with an area having the odd even count value of picture elements and then painting out the decided inside area. CONSTITUTION:An input working form is stored in a storage device 4 in the form of data. A data processing part 1 transfers the working form, i.e., the contour curves I-III are transferred to a video RAM 5 and displays them on a screen display part 3. Then an operator supplies the offset value of a contour working tool. The part 1 forms the offset contour curves I'-III' by reducing the curves I-III toward the working area by a ratio equal to the input offset value. The display on the part 3 is changed with those curves I'-III and at the same time the curves I'-III' are stored in the device 4 as the contour working tool lock. Then the part 1 paints out a working area A' enclosed by curves I' and II' as well as a working area B' enclosed by the curve III'.

Description

【発明の詳細な説明】 [技術分野] 本発明は、数値制御工作機械で加工領域を加工するため
に工具を移動させるときの2次元軌跡を生成する2次元
工具軌跡生成方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Technical Field] The present invention relates to a two-dimensional tool trajectory generation method for generating a two-dimensional trajectory when moving a tool to machine a machining area with a numerically controlled machine tool.

[従来技術] 近年、FA(Factory Automation)
やFMS(FlexibleManufacturin
g 5yten+)が広く提唱されており、このような
システムには切削加工、溶接作業、溶断作業および製図
作業等を自動的に行なうため、数値制御工作機械が用い
られている。
[Prior art] In recent years, FA (Factory Automation)
and FMS (Flexible Manufacturing
g 5yten+) has been widely proposed, and numerically controlled machine tools are used in such systems to automatically perform cutting, welding, fusing, drafting, etc.

この数値制御工作機械は、あらかじめ与えられた移動位
置および速度等の数値データ(すなわち制御プログラム
)に基づいて1選択された工具を移動させ、被加工物(
ワーク)を目的とする工作物に加工するものである。
This numerically controlled machine tool moves one selected tool based on numerical data (i.e., control program) such as movement position and speed given in advance, and moves the workpiece (
It is used to process objects (workpieces) into desired workpieces.

従来、このような数値制御工作機械に制御プログラムを
入力するには、所定の数値制御用プログラム言語によっ
て工作物の形状を定義するか、あるいは、加工形状が複
雑な場合には、工作形状の模型(マスク)を形成してこ
のマスクの表面を工具で1−レースさせてそのトレース
位置を直接数値制御工作機械に入力させている(倣い加
工)。
Conventionally, in order to input a control program into such a numerically controlled machine tool, the shape of the workpiece was defined using a predetermined numerical control programming language, or, if the machining shape was complex, a model of the workpiece shape was used. (mask) is formed, the surface of this mask is traced once with a tool, and the trace position is directly input into a numerically controlled machine tool (copy processing).

しかしながら、このようにして入力した加工形状から実
際に加工するための加工領域を塗り潰して形成するとき
、加工形状によっては塗り潰しができない部分を生じる
場合があり、適切な工具軌跡を自動的に形成することが
できなかった。
However, when filling out and forming the machining area for actual machining from the input machining shape in this way, there may be parts that cannot be filled in depending on the machining shape, so it is necessary to automatically form an appropriate tool path. I couldn't do that.

[目的] 本発明は、上述した実情に鑑みてなされたものであり、
線画で形成された加工形状から加工領域を適切に形成で
き、工具の軌跡を自動的に生成できる2次元工具軌跡生
成方法を提供することを目的としている。
[Purpose] The present invention has been made in view of the above-mentioned circumstances, and
It is an object of the present invention to provide a two-dimensional tool trajectory generation method that can appropriately form a machining area from a machining shape formed by a line drawing and automatically generate a tool trajectory.

[構成] 本発明は、線画で形成された加工形状のオフセット線を
形成してこれを輪郭加工工具の軌跡として記憶し、オフ
セット線をなす画素に第1の識別符号を付加するととも
にオフセット線にあらわれる頂点および単独な線を検出
してそれらを形成する画素に第2の識別符号を付加する
。そして、加工形状を一定方向に走査したときに走査線
と交差する上記第1の識別符号が付加された画素を計数
してその計数値が奇数の領域は加工領域の内部の画素と
判別するとともにその計数値が偶数の領域は加工領域の
外部の画素として判別して加工領域の内部として判別し
た部分を塗り潰し、これによって加工領域を形成してい
る。
[Structure] The present invention forms an offset line of a machining shape formed by a line drawing, stores this as a locus of a contour machining tool, adds a first identification code to pixels forming the offset line, and adds a first identification code to the offset line. Appearing vertices and individual lines are detected and a second identification code is added to the pixels forming them. Then, when the processed shape is scanned in a certain direction, the pixels to which the first identification code is added that intersect with the scanning line are counted, and areas where the count value is an odd number are determined to be pixels inside the processed area. Areas where the count value is an even number are determined as pixels outside the processing area, and portions determined as inside the processing area are filled in, thereby forming the processing area.

以下、添付図面を参照しながら、本発明の実施例を詳細
に説明する。
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

第1図は1本発明の一実施例にかかる装置を示している
FIG. 1 shows an apparatus according to an embodiment of the present invention.

同図において、データ処理部1は後述する処理を実行し
て工具軌跡を生成するものであり、キーボード2はオペ
レータからデータ処理部1に対する操作情報を入力する
ためのフルキーおよび例えば水平方向に400点垂直方
向に400点の解像度をもつ画面表示部3の任意の位置
を表示画素単位に指示でき、加工形状の線画を形成する
ためのポインティングデバイスを備えている。
In the figure, a data processing section 1 executes processing to be described later to generate a tool trajectory, and a keyboard 2 has full keys for inputting operation information from an operator to the data processing section 1 and, for example, 400 points in the horizontal direction. An arbitrary position on the screen display section 3 having a resolution of 400 points in the vertical direction can be indicated in display pixel units, and a pointing device is provided for forming a line drawing of the processed shape.

記憶装置4は各種の中間ファイル等のデータを記憶する
ものであり、ビデオRAM(ランダム・アクセス・メモ
リ)5は画面表示部3に表示するデータを記憶するもの
であり5表示制御部6はビデオRAM5に記憶された表
示データを画面表示部3に表示するものである。この画
面表示部3と表示制御部6によっていわゆるビットマツ
プディスプレイ装置が構成されている。また、このビッ
トマツプディスプレイ装置とキーボード2によってグラ
フツクターミナルが構成される。
A storage device 4 stores data such as various intermediate files, a video RAM (random access memory) 5 stores data to be displayed on the screen display section 3, and a display control section 6 stores video data. Display data stored in the RAM 5 is displayed on the screen display section 3. The screen display section 3 and display control section 6 constitute a so-called bitmap display device. Further, this bitmap display device and keyboard 2 constitute a graphics terminal.

このような作業環境の中で、オペレータは会話的に操作
および作業を進めることができ、視覚的に処理状況を確
認できる。
In such a work environment, operators can perform operations and work interactively and visually check the processing status.

以上の構成で、まず、オペレータはキーボード2から加
工形状を形成することをデータ処理部1に指令し、キー
ボード2および画面表示部3を介してデータ処理部lと
会話しながら、例えば第2図(a)に示したような線画
からなる加工形状を画面表示部3に描く。ここで入力し
た加工形状は、直線し1〜LL4および円弧At、A2
によって形成された軸郭曲線I、直線L21〜L23に
よって形成された輪郭曲線■、および、円A31で形成
された輪郭曲線■から構成され、輪郭曲線Iと輪郭曲線
■で囲まれた領域Aと1輪郭曲線■の内側の領域Bが加
工領域として設定されている。
With the above configuration, the operator first instructs the data processing section 1 to form a machining shape from the keyboard 2, and while talking with the data processing section 1 via the keyboard 2 and the screen display section 3, for example, as shown in FIG. A processed shape consisting of a line drawing as shown in (a) is drawn on the screen display section 3. The machining shapes input here are straight lines 1 to LL4 and circular arcs At, A2.
The area A is composed of the axial contour curve I formed by the contour curve I, the contour curve ■ formed by the straight lines L21 to L23, and the contour curve ■ formed by the circle A31, and is surrounded by the contour curve I and the contour curve ■. A region B inside one contour curve ■ is set as a processing region.

このような加工形状を線画で形成する方法としては、例
えばポインティングデバイスで指定した画面表示部3の
2点を直線で結んだり、中心を指定して円あるいは円弧
を描く操作を行なって入力する方法や、特定のプログラ
ム言語によって加工形状を直接数値(数式)で定義する
ことにより入力する方法がある。
A method for forming such a processed shape using a line drawing is, for example, by connecting two points on the screen display section 3 specified with a pointing device with a straight line, or by specifying the center and drawing a circle or arc. Alternatively, there is a method of inputting the machining shape by directly defining it as a numerical value (formula) using a specific programming language.

このようにして入力された加工形状は、ビデオRAM5
内にデータとして記憶されているので、データ処理部1
はこのビデオRAM5に最終的に記憶されているデータ
を、入力された加工形状のデータとして記憶装置4に記
憶する。
The machining shape input in this way is stored in the video RAM 5.
Since the data is stored as data in the data processing unit 1,
stores the data finally stored in the video RAM 5 in the storage device 4 as data of the input machining shape.

オペレータによる加工形状の定義入力を終了すると、デ
ータ処理部1は加工領域の輪郭曲線1 、If。
When the operator finishes inputting the definition of the machining shape, the data processing unit 1 calculates the contour curve 1, If of the machining area.

■を径が小さい輪郭加工工具で加工するための輪郭加工
工具軌跡と、加工領域A、Bを径が大きいサライ加工工
具で加工するためのサライ加工工具軌跡を、第3図に示
した処理ルーチンによって生成し、その生成した輪郭加
工工具軌跡とサライ加工工具軌跡を記憶装置4に記憶す
る。
The processing routine shown in Figure 3 is a contour machining tool trajectory for machining ■ with a contour machining tool with a small diameter, and a contour machining tool trajectory for machining machining areas A and B with a contour machining tool with a large diameter. The contour machining tool trajectory and the contour machining tool trajectory thus generated are stored in the storage device 4.

すなわち、まず、データ処理部1は記憶装置4に記憶し
ている加工形状すなわち輪郭曲線t、n、mをビデオR
AM5に転送して表示制御部6によって画面表示部3に
表示させ(処理110)、輪郭加工工具のオフセット量
(半径)をオペレータに入力させる。
That is, first, the data processing unit 1 converts the processed shape, that is, the contour curves t, n, m stored in the storage device 4 into the video R.
The data is transferred to the AM 5 and displayed on the screen display unit 3 by the display control unit 6 (process 110), and the operator is prompted to input the offset amount (radius) of the contour processing tool.

次にデータ処理部1は、おのおのの輪郭曲線!。Next, the data processing unit 1 processes each contour curve! .

■、■をその入力されたオフセット量だけ加工領域方向
に縮小したオフセット輪郭曲線ビ、■l 、 [11を
周知の適宜な方法により形成し、このオフセット輪郭曲
線1’、n’、I[I’で画面表示部3の表示を書き換
えるとともに、このオフセット輪郭曲線11゜n’、m
’を輪郭加工工具軌跡として記憶装置4に記憶する。
An offset contour curve B, ■l, [11, which is obtained by reducing ■, ■ in the direction of the machining area by the input offset amount, is formed by a well-known appropriate method, and this offset contour curve 1', n', I[I ' to rewrite the display on the screen display section 3, and also change the offset contour curve 11゜n', m
' is stored in the storage device 4 as a contour machining tool trajectory.

そしてデータ処理部1は、オフセット輪郭曲線ビとオフ
セット輪郭曲線■′によって囲まれた加工領域A′およ
びオフセット輪郭曲線■′で囲まれた加工領域B′を塗
り潰す(処理13o)。
Then, the data processing section 1 fills out the processing area A' surrounded by the offset contour curve B and the offset contour curve ■' and the processing area B' surrounded by the offset contour curve ■' (process 13o).

この塗り潰しの処理130では、塗り潰しできない領域
が出ないように、第4図に示したような処理を行なう。
In this filling process 130, the process shown in FIG. 4 is performed so that no areas that cannot be filled out appear.

まず、オフセット輪郭曲線ビ、■l、■j上にある画素
に「1」を、それ以外の画素にrQJを割り当てる(処
理201)、このとき、例えば加工形状のオフセット輪
郭曲線が第5図(a)のようなものであるとすると、そ
のオフセット輪郭曲線を構成している画素は同図(b)
に示したようになる。なお同図(b)においては、黒丸
であられしたものがオフセット輪郭曲線を構成している
画素を、白丸であられしたものがそれ以外の部分の画素
を示す。
First, "1" is assigned to the pixels on the offset contour curves Bi, ■l, ■j, and rQJ is assigned to the other pixels (process 201). At this time, for example, the offset contour curve of the machining shape is If it is as shown in a), the pixels that make up the offset contour curve are as shown in figure (b).
The result will be as shown in . In FIG. 3B, black circles indicate pixels forming the offset contour curve, and white circles indicate pixels in other parts.

次に基準位置(例えば画面表示部3の左上角の位置)か
ら画像の水平方向(画面表示部3の水平走査方向に相当
する)に画素を走査して、「0」から「1」に変化して
いる最初の画素すなわち輪郭形状(輪郭曲線)の開始画
素Sを見つけ、その開始画素Sの座標値を記憶する(処
理202)。
Next, pixels are scanned in the horizontal direction of the image (corresponding to the horizontal scanning direction of the screen display section 3) from the reference position (for example, the position of the upper left corner of the screen display section 3), and the pixels change from "0" to "1". The first pixel S, that is, the start pixel S of the contour shape (contour curve) is found, and the coordinate values of the start pixel S are stored (process 202).

次にこの開始画素Sを始点とした8連結ベクトル追跡法
によりオフセット輪郭曲線を形成している輪郭線を全て
抽出し、それらの輪郭線を構成している画素のデータを
「2」に置換する(処理203)。
Next, all the contour lines forming the offset contour curve are extracted by the 8-connected vector tracing method using this start pixel S as the starting point, and the data of the pixels forming these contour lines is replaced with "2". (Process 203).

この8連結ベクトル追跡法とは、その開始画素Sを始点
として、次に値がrlJの隣接画素(変化画素)を見つ
け、その方向を第5図(c)に示した8つの方向のベク
トルのいずれか1つによってあられし。
This 8-connected vector tracking method uses the starting pixel S as the starting point, then finds an adjacent pixel (change pixel) whose value is rlJ, and then calculates the direction of the vector in the eight directions shown in Figure 5(c). Hail by one of them.

次に、その見つけた変化画素を起点としてその変化画素
に入ってきたベクトルよりも2つ左のベクトルの方向か
ら反時計回り(あるいは2つ右のベクトルの方向から時
計回り)に次の変化画素を見っけ、その位置する方向を
8つの方向のベクトルのいずれか1つによってあられし
、これを始点に戻ってくるまで順次繰り返すことで、開
始画素の座標値と、それに順次連続する変化画素のベク
トルの並びからなるデータによって輪郭線を形成してい
る閉曲線をあられす方法である。なお、この輪郭線デー
タの最後には終了をあられすマークが付される。
Next, starting from the found change pixel, move counterclockwise from the direction of the vector two places to the left (or clockwise from the direction of the vector two places to the right) from the vector that entered the change pixel to the next change pixel. By finding the position of the pixel and determining its position using one of the eight directional vectors, and repeating this sequentially until it returns to the starting point, we can calculate the coordinate value of the starting pixel and the successive change pixels. This is a method of finding a closed curve forming a contour line using data consisting of a sequence of vectors. Note that a mark indicating the end of the outline data is attached at the end of the outline data.

このようにして、オフセット輪郭曲線を抽出すると、輪
郭線データ(すなわち開始画素Sの座標値と追跡ベクト
ルのデータ)に基づき、オフセット輪郭曲線にあられれ
ている頂点と幅が1画素の線(重複線)を検出して、そ
れらの頂点および重複線として検出された画素の値をマ
ークRに置換する(処理205,206)。ここで頂点
とは、画素に入る方向のベクトルと出る方向のベクトル
とのなす角度が鋭角に変化している部分および画素に入
る方向のベクトルと出る方向のベクトルの方向の変化が
水平方向に凸状になっている部分をいう。また重複線は
、画素に入る方向のベクトルと出る方向のベクトルが逆
方向になっている部分である。
When the offset contour curve is extracted in this way, based on the contour data (that is, the coordinate values of the start pixel S and the data of the tracking vector), the vertices of the offset contour curve and a line with a width of 1 pixel (overlapping lines), and their vertices and the values of pixels detected as overlapping lines are replaced with marks R (processes 205, 206). Here, a vertex is a part where the angle between the vector entering the pixel and the vector exiting the pixel changes sharply, or where the change in direction between the vector entering the pixel and the vector exiting the pixel is convex in the horizontal direction. Refers to the part that is shaped like An overlap line is a portion where the vector entering the pixel and the vector exiting the pixel are in opposite directions.

なお、画素に入る方向のベクトルと出る方向のベクトル
とのなす角度は、次式(1)に示したように2つのベク
トルの内積を演算することによって算出できる。
Note that the angle formed by the vector in the direction of entering the pixel and the vector in the direction of exiting the pixel can be calculated by calculating the inner product of the two vectors as shown in the following equation (1).

θ:cos−1(V、・V、/(I V、il V21
)) ・・・(1)ここで、■1は画素に入る方向のベ
クトルをあられし、■、は画素から出る方向のベクトル
をあられしている。
θ: cos-1(V, ・V, /(I V, il V21
)) ... (1) Here, ■1 represents a vector in the direction of entering the pixel, and ■, represents a vector in the direction of exiting from the pixel.

次に、水平方向に画像を走査して、直前の画素の値がr
QJになっている画素で値が「2」のものを計数すると
ともに、その計数値が奇数の区間に位置している画素を
加工領域の内部の画素として判別し、計数値が偶数の期
間に位置している画素を加工領域の外部の画素として判
別し、加工領域の内部の画素として判別した画素の値を
加工領域の内部をあられすマークIに置換する(処理2
07,208)。
Next, scan the image horizontally and find the value of the previous pixel r
The pixels that are QJ and have a value of "2" are counted, and the pixels located in the interval where the count value is an odd number are determined as pixels inside the processing area, and the pixels located in the period where the count value is an even number are determined. The located pixel is determined as a pixel outside the processing area, and the value of the pixel determined as a pixel inside the processing area is replaced with a hail mark I inside the processing area (processing 2
07,208).

すなわち、水平方向に走査して加工領域の内部を識別す
るときに障害となる頂点と重複線には特別なマークRを
付加し、処理207.208を実行したときにはそれら
のマークRが付加されている画素は計数しないので、加
工領域の塗り潰しを適確に行なうことができる。
That is, special marks R are added to vertices and overlapping lines that are obstacles when identifying the inside of the processing area by scanning in the horizontal direction, and when processes 207 and 208 are executed, those marks R are added. Since the pixels that are present are not counted, the processing area can be filled in accurately.

このようにして、加工領域の内部に位置する画素にはマ
ーク■が与えられ、最後に値が「2」あるいはマークR
,Hになっている全ての画素の値を「1」に置換して、
これによって加工領域の塗り潰しが完了する。その状態
を第5図(d)に示す。またこのようにして形成された
加工領域のデータは、サライ加工領域データとして記憶
装置4に記憶される。
In this way, the mark ■ is given to the pixel located inside the processing area, and finally the value is "2" or the mark R
, H, all pixel values are replaced with "1",
This completes the filling of the processing area. The state is shown in FIG. 5(d). Further, the data of the processing area thus formed is stored in the storage device 4 as Sarai processing area data.

次に、このようにして塗り潰されて形成されたオフセッ
ト加工領域A’ 、B’に対して、おのおののオフセッ
ト加工領域A’ 、B″をサライ加工工具で加工するた
めの工具軌跡を算出するサライ加工工具軌跡生成処理1
40を実行する。
Next, with respect to the offset machining areas A' and B' that have been filled in and formed in this way, the tool trajectory for machining each of the offset machining areas A' and B'' with a machining tool is calculated. Machining tool trajectory generation processing 1
Execute 40.

このサライ加工工具軌跡生成処理140では、まずデー
タ処理部1は、オフセット加工領域A7.B′をオペレ
ータから指定されたサライ加工工具のオフセット量だけ
加工領域の内側に縮小して、オフセット加工領域A’ 
、B’の最外側をサライ加工工具で加工するために加工
領域を更新する(処理141)。
In this straight machining tool trajectory generation process 140, the data processing unit 1 first generates offset machining area A7. B' is reduced to the inside of the machining area by the offset amount of the Sarai machining tool specified by the operator, and the offset machining area A' is created.
, B' is updated with the processing tool (processing 141).

この処理141は、次のようにして行なわれる。This process 141 is performed as follows.

すなわち第6図に示すように、まず加工領域の輪郭線を
抽出する(処理301)。この処理301では、画像を
基準位置から一定方向に走査して最初に値が「1」にな
っている画素を開始画素として判別し。
That is, as shown in FIG. 6, first, the outline of the processing area is extracted (process 301). In this process 301, an image is scanned in a fixed direction from a reference position, and the first pixel whose value is "1" is determined as a start pixel.

その画素を始点として上述した8連結ベクトル追跡法に
より最外側の輪郭線データを形成する。ただし、この場
合2つのベクトルの差が180度以上になる角は輪郭線
を形成し得ないので、さらに反時計回り方向に変化画素
を探す。なおこの2つのベクトルのなす角度は、次式(
1)″に示したように2つのベクトルの内積を演算する
ことによって算出できる。
Using this pixel as a starting point, the outermost contour data is formed by the above-mentioned 8-connected vector tracing method. However, in this case, since a contour cannot be formed at a corner where the difference between the two vectors is 180 degrees or more, a changing pixel is further searched for in a counterclockwise direction. The angle formed by these two vectors is given by the following formula (
It can be calculated by calculating the inner product of two vectors as shown in 1)''.

e =cos−1(V、−V、/(IV、l−l v、
1))−・・(■)’ここで、■1は変化画素に入って
くるまでの複数個(例えば5個)のベクトルの平均バク
1〜ルをあられし、■2は変化画素からでていく方向の
複数個のベクトルの平均ベクトルをあられしている。
e = cos-1(V, -V, /(IV, l-l v,
1)) -... (■)'Here, ■1 is the average vector of multiple (for example, 5) vectors up to the change pixel, and ■2 is the average value of the vectors from the change pixel. The average vector of multiple vectors in the forward direction is calculated.

このようにして輪郭線を抽出すると、1回目であるとき
にはく判断302の結果が’/ES)、そのときに抽出
した輪郭線は加工領域の最外側の輪郭をあられすためこ
の最外枠のデータ(始点の位置座標とベクトルデータ)
を記憶する(処理303)。
When the contour line is extracted in this way, the result of judgment 302 is '/ES) when the contour line is extracted for the first time. Data (starting point position coordinates and vector data)
is stored (process 303).

そして、処理301で輪郭線として抽出した画素に対し
、処理済みをあられす処理済マークを付加する(処理3
04)。ただし、なるべく加工領域を分断しないために
、輪郭線が2ビット以上離れていない部分には処理済マ
ークを付加しない。この処理済マークを付加する画素と
付加しない画素の区別は、その画素に入ってくるベクト
ルとその画素から次の変化画素に出ていく画素へのベク
トルとの関係によって判別できる。
Then, a processed mark is added to the pixels extracted as the contour line in process 301 to indicate that the process has been completed (process 3
04). However, in order to avoid dividing the processing area as much as possible, the processed mark is not added to areas where the contour lines are not separated by 2 bits or more. Pixels to which the processed mark is added and pixels to which the processed mark is not added can be distinguished by the relationship between the vector entering the pixel and the vector from that pixel to the next changed pixel.

次に最外枠から所定数の画素数だけ輪郭線の抽出を行な
ったかどうかを調べ(判断305) 、この判断305
の結果がNOのときには処理301に戻り、このときに
は処理済マークを付加している画素と値が「1」になっ
ている画素すなわち加工領域との境界をなす輪郭線を抽
出して順次加工領域の内側の輪郭線を形成している画素
を抽出し、その抽出した画素に処理済マークを付加する
Next, it is checked whether the contour line has been extracted for a predetermined number of pixels from the outermost frame (determination 305), and this determination 305
If the result is NO, the process returns to step 301, and in this case, the contour line that forms the boundary between the pixel to which the processed mark has been added and the pixel whose value is "1", that is, the processing area, is extracted and the processing area is sequentially processed. Pixels forming the inner contour line are extracted, and a processed mark is added to the extracted pixels.

ここで、判断305で判断する画素数は、サライ加工工
具のオフセット量に相当する画素数である。
Here, the number of pixels determined in the determination 305 is the number of pixels corresponding to the offset amount of the Sarai machining tool.

したがって、この判断305を終了した時点では、最外
枠の輪郭線からサライ加工工具のオフセット量だけ内側
の部分の画素に処理済マークが付加される。
Therefore, at the time when this determination 305 is completed, a processed mark is added to the pixels located inside the outline of the outermost frame by the offset amount of the processing tool.

ところで、処理304によれば、可能な限りに加工領域
を連続させるため、輪郭線の間隔が2ビット以上離れて
いない部分には処理済マークが付加されず、また、画像
の主走査方向あるいは副走査方向に対して45度に傾斜
している部分では実際にサライ加工工具によって加工さ
れる範囲の17a倍の部分までにしか処理済マークが付
加されない。
By the way, according to process 304, in order to make the processed area as continuous as possible, a processed mark is not added to areas where the contour lines are not separated by 2 bits or more, and In a portion that is inclined at 45 degrees with respect to the scanning direction, a processed mark is added only to a portion that is 17a times as large as the range that is actually machined by the Sarai machining tool.

そこで、実際にサライ加工工具で加工される領域を正確
に形成するために、処理303で記憶した最外枠の輪郭
線をあられすベクトルデータを読み込み(処理306)
、サライ加工工具のオフセット量に相当する画素数の2
倍の径で描いた加工日の中心をこの最外枠の輪郭線に沿
って移動したときにその加工日の内側に含まれる領域に
属する画素で処理済マークが付加されていないものに処
理済マークを付加して加工領域を補正する(処理307
)。
Therefore, in order to accurately form the area to be actually machined with the Sarai machining tool, vector data representing the outline of the outermost frame stored in Process 303 is read (Process 306).
, 2 of the number of pixels corresponding to the offset amount of the Sarai machining tool
When the center of the processing date drawn with double the diameter is moved along the outline of this outermost frame, pixels that belong to the area included inside the processing date and have not been marked with a processed mark are processed. Correct the processing area by adding marks (processing 307
).

これによって、正確なサライ加工工具のオフセット量に
対応する部分の画素に処理済マークが付加される。
As a result, a processed mark is added to the pixels of the portion corresponding to the accurate offset amount of the machining tool.

次に、更新した加工領域において、処理済マークを付加
した画素と値が「1」になっている画素との境界線(輪
郭線)を第6図の処理301と同様な方法で算出し、そ
の抽出した輪郭線のデータを最外枠工具軌跡として記憶
する(処理143)。
Next, in the updated processing area, the boundary line (contour line) between the pixel to which the processed mark has been added and the pixel whose value is "1" is calculated in the same manner as in process 301 in FIG. 6, The data of the extracted contour line is stored as the outermost frame tool trajectory (process 143).

そして、次に第6図の処理をサライ加工工具のオーバラ
ップ量に相当する画素数について適用し、最外枠工具軌
跡をサライ加工工具が通過したときと1つ内側の工具軌
跡をサライ加工工具が通過したときのオーバラップ量に
相当する部分の画素に処理済マークを付加する(処理1
43)。なお、この処理143においては、工具軌跡が
一筆書き状になるように連続性を失わないような処理を
施す。
Next, the process shown in Fig. 6 is applied to the number of pixels corresponding to the overlap amount of the side machining tool, and the time when the side machining tool passes the outermost frame tool trajectory and the one tool path inside the side frame tool are Adds a processed mark to pixels corresponding to the amount of overlap when passing through (processing 1
43). In addition, in this process 143, a process is performed so that continuity is not lost so that the tool trajectory becomes a single stroke.

このような処理141,142,143を、全ての加工
領域の最外枠について適用するまで繰り返し実行しく判
断144のループ)、各加工領域のサライ加工領域の最
外枠工具軌跡を算出する。
Such processes 141, 142, and 143 are repeatedly executed until they are applied to the outermost frames of all machining areas (loop of judgment 144), and the outermost frame tool locus of the horizontal machining area of each machining area is calculated.

次に、第6図の処理をサライ加工工具のオフセット量に
相当する画素数について適用して内側の加工領域を加工
するためのオフセット線を抽出シ(処理145)、第6
図の処理301と同様な方法によってこのオフセット線
に対応した工具軌跡を算出しく処理146)、第6図の
処理をサライ加工工具のオーバラップ量に相当する画素
数について適用してオーバラップする分の画素に処理済
マークを付加しく処理147)、サライ加工領域の全て
の画素に処理済マークが付加されるまで処理145,1
46,147を繰り返し実行して(判断148のループ
)、最外枠以外のサライ加工領域を加工するための工具
軌跡を算出する。
Next, the process of FIG. 6 is applied to the number of pixels corresponding to the offset amount of the Sarai machining tool to extract an offset line for machining the inner machining area (process 145).
A process 146) is performed to calculate a tool trajectory corresponding to this offset line using a method similar to process 301 in the figure, and the process shown in FIG. Process 147) to add a processed mark to the pixels of
Steps 46 and 147 are repeatedly executed (loop of judgment 148) to calculate a tool trajectory for machining the horizontal machining area other than the outermost frame.

このようにして、サライ加工工具軌跡生成処理140に
より、全ての加工領域におけるサライ加工工具の工具軌
跡が算出される。
In this manner, the tool trajectory of the slanting tool in all machining areas is calculated by the slanting tool trajectory generation process 140.

その結果、加工領域A’ 、B’をそれぞれ加工するた
めの工具軌跡が、第2図(c)に示したように形成され
て、記憶装置4に記憶される。なお、同図において破線
で示したものが輪郭加工工具軌跡であり、実線で示した
ものがサライ加工工具軌跡である。
As a result, tool trajectories for machining the machining areas A' and B' are formed as shown in FIG. 2(c) and stored in the storage device 4. In addition, in the figure, what is shown by a broken line is a contour machining tool trajectory, and what is shown by a solid line is a contour machining tool trajectory.

ところで、オフセット加工領域の最外枠を加工するため
のサライ加工工具軌跡にスムージング処理を施すことも
できる。
Incidentally, it is also possible to perform smoothing processing on the trajectory of a machining tool for machining the outermost frame of the offset machining area.

すなわち、このスムージング処理は、処理142で形成
した追跡ベクトルを円、工具径の10倍程度の長い直線
、頂点、短い直線、円弧および自由曲線の組合せによっ
てあられす。
That is, in this smoothing process, the tracking vector formed in process 142 is formed by combining a circle, a long straight line about 10 times the tool diameter, a vertex, a short straight line, a circular arc, and a free curve.

このようなスムージング処理では、第7図に示したよう
に、まず輪郭線の円の部分を判定する(処理401)。
In such smoothing processing, as shown in FIG. 7, first, the circular portion of the outline is determined (processing 401).

この処理401では、輪郭線の任意の3点を選んでこの
3点を通る円の中心を算出し、さらに別の3点を適当に
複数組選んで複数個の中心を算出し、これらの複数個の
中心の中心位置を算出し、この中心から輪郭線までを半
径とする円を描いたときに、その円に輪郭線が一致する
かどうか次式(II)に基づいて判定する。
In this process 401, three arbitrary points on the contour are selected, the center of a circle passing through these three points is calculated, a plurality of other three points are selected as appropriate, a plurality of centers are calculated, and these plural points are calculated. When a circle having a radius from the center to the contour line is drawn, it is determined whether the contour line coincides with the circle based on the following equation (II).

C:(x2+y’) /y  ・・・(II)ただし、
Cは中心である。
C: (x2+y') /y...(II) However,
C is the center.

ここで、円は1つの閉曲線をなすから、この円の判定に
よって1つの輪郭線を形成する全ての軌跡が終了したか
どうかを調べ(判断402)、この判断402の結果が
NOのときには次の処理へと進む。
Here, since a circle forms one closed curve, it is checked whether all the trajectories forming one contour line have been completed by determining this circle (determination 402), and if the result of this determination 402 is NO, the next Proceed to processing.

次には、サライ加工工具の10倍以上の長さの直線を算
出する(処理403)。この処理403では、単位ベク
トル5個分のベクトルの平均ベクトルを形成し、その平
均ベクトルのベクトル角から1次式([1)に基づいて
仮の直線期間を算出する。
Next, a straight line that is ten times longer than the length of the Sarai machining tool is calculated (process 403). In this process 403, an average vector of five unit vectors is formed, and a temporary linear period is calculated from the vector angle of the average vector based on the linear equation ([1)].

次に、各画素データと式(III)で算出した仮の直線
との距離ΔQ1の絶対値の積算値SAおよび積算値SB
をそれぞれ式(IV)、(V)に基づいて算出し、それ
らの結果に基づいて式(III)で算出した仮の直線が
実際の直線として識別できるかどうかを判定する。
Next, an integrated value SA and an integrated value SB of the absolute value of the distance ΔQ1 between each pixel data and the temporary straight line calculated by equation (III)
are calculated based on equations (IV) and (V), respectively, and based on the results, it is determined whether the temporary straight line calculated using equation (III) can be identified as an actual straight line.

ax+by+c=o       −壷φ(m )SA
=Σ1ΔQsl  ・・・(TV)i露l 5B=ΣΔQl  ・・・(V) l禦1 なお、さらにベクトルの方向のヒストグラムを形成し、
そのヒストグラムに2−3のピークがある場合にはその
区間を直線として、ヒストグラムのピークがそれ以上の
個数ある場合にはそれ以外のものとして判別している。
ax+by+c=o −urnφ(m)SA
= Σ1ΔQsl ... (TV) i 5B = ΣΔQl ... (V) l 1 Furthermore, a histogram of the direction of the vector is further formed,
If the histogram has 2-3 peaks, that section is determined to be a straight line, and if the histogram has more peaks, it is determined to be something else.

次に、処理401および処理403で円および長い直線
と判別されなかった部分について1輪郭線に現われる頂
点を判別する(処理404)。
Next, vertices appearing in one outline are determined for portions that were not determined to be circles or long straight lines in processes 401 and 403 (process 404).

この処理では、処理403で形成した平均ベクトルを上
述した式(1)″に代入して2つの平均ベクトルのなす
角度を算出し、その算出結果に基づいて頂点を判別する
。このとき、平均ベクトルの算出起点によっては、頂点
が誤って判断されるおそれがあるので、2つの平均ベク
トルのなす角度がある程度鋭くなっている部分では、平
均ベクトルの算出起点を順次変化させ、2つの平均ベク
トルのなす角度が最も鋭くかつ安定している状態を判別
し、それによって適切な頂点を検出している。
In this process, the average vector formed in process 403 is substituted into the above-mentioned equation (1)'' to calculate the angle formed by the two average vectors, and the vertex is determined based on the calculation result.At this time, the average vector Depending on the starting point of the calculation, there is a risk that the vertex may be incorrectly determined. Therefore, in parts where the angle formed by the two average vectors is sharp to some extent, the starting point of the calculation of the average vector is sequentially changed, and the angle formed by the two average vectors is It determines the state where the angle is sharpest and most stable, and thereby detects the appropriate vertex.

次に、処理403で算出した直線の端点と処理404で
算出した頂点の間の区間、あるいは、頂点と頂点との間
の区間で直線と判定できる部分を、処理403と同様な
判断基準で算出する(処理405)。
Next, the section between the end point of the straight line calculated in step 403 and the vertex calculated in step 404, or the section between the vertices that can be determined to be a straight line, is calculated using the same criteria as in step 403. (process 405).

次に、処理401,403,404,405で処理され
なかった区間に対し、円弧の部分を算出する(処理40
6)。
Next, the arc portion is calculated for the sections that were not processed in processes 401, 403, 404, and 405 (process 40
6).

この処理406では、処理401とほぼ同様にして仮の
円弧区間を算出し、この仮の円弧区間の仮の中心を仮の
円弧区間の8点の座標をもとに算出し、仮の中心から次
式(VI)のような円の方程式を形成する。
In this process 406, a temporary circular arc section is calculated in substantially the same manner as in the process 401, and the temporary center of this temporary circular arc section is calculated based on the coordinates of 8 points of the temporary circular arc section, and from the temporary center. A circle equation such as the following equation (VI) is formed.

(x−xo)”+(y−yo)”=r”  ・・・(V
I)そして、この仮の円弧との実際の画素の座標との差
を上式(IV)、(V)によって算出し、その算出結果
に基づいてその仮の円弧区間を適切なものであるかどう
かを判断するとともに、半径を判定する。
(x-xo)”+(y-yo)”=r”...(V
I) Then, calculate the difference between this temporary arc and the actual pixel coordinates using the above formulas (IV) and (V), and check whether the temporary arc section is appropriate based on the calculation result. At the same time, the radius is determined.

最後に、処理401,403〜406で対象とならなか
った区間に対して、スプライン曲線からなる自由曲線を
あてはめる(処理407)。
Finally, a free curve made of a spline curve is applied to the sections that were not targeted in processes 401, 403 to 406 (process 407).

このようにして、サライ加工工具の最外枠工具軌跡がス
ムージング処理される。なお、工具軌跡をスムージング
する方法としては、上述したものに限ることはない。
In this way, the outermost frame tool locus of the Sarai machining tool is smoothed. Note that the method for smoothing the tool trajectory is not limited to the method described above.

[効果] 以上説明したように、本発明によれば、線画で形成され
た加工形状のオフセット線を形成してこれを輪郭加工工
具の軌跡として記憶し、オフセット線をなす画素に第1
の識別符号を付加するとともにオフセット線にあらわれ
る頂点および単独な線を検出してそれらを形成する画素
に第2の識別符号を付加する。そして、加工形状を一定
方向に走査したときに走査線と交差する上記第1の識別
符号が付加された画素を計数してその計数値が奇数の領
域は加工領域の内部の画素と判別するとともにその計数
値が偶数の領域は加工領域の外部の画素として判別して
加工領域の内部として判別した部分を塗り潰し、これに
よって加工領域を形成しているので、線画で形成された
加工形状から加工領域を適切に形成できるという効果が
ある。また加工形状の輪郭部分は径の小さい輪郭加工工
具で、それ以外の部分は径の大きい領域加工工具で加工
するための工具軌跡を生成しているので、効率のよい切
削加工をするための工具軌跡を生成できるという効果も
得られる。
[Effects] As described above, according to the present invention, an offset line of a machining shape formed by a line drawing is formed, this is stored as a locus of a contour machining tool, and the pixels forming the offset line are
At the same time, a second identification code is added to the pixels forming the vertices and individual lines appearing in the offset line by detecting them. Then, when the processed shape is scanned in a certain direction, the pixels to which the first identification code is added that intersect with the scanning line are counted, and areas where the count value is an odd number are determined to be pixels inside the processed area. Areas with even count values are identified as pixels outside the processing area, and the parts identified as inside the processing area are filled in, thereby forming the processing area, so the processing area is determined from the processing shape formed by the line drawing. This has the effect of being able to appropriately form the . In addition, a tool path is generated for machining the contour part of the machined shape with a contour machining tool with a small diameter, and other parts with a machining tool with a large diameter, so it is possible to use a tool for efficient cutting. The effect of being able to generate a trajectory can also be obtained.

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

第1図は本発明の一実施例にかかるデータ処理装置を示
したブロック図、第2図(a)〜(c)は線画から工具
軌跡が生成される様子を示した説明図、第3図は工具軌
跡を生成するための処理を示したフローチャート、第4
図は塗り潰しのための処理例を示したフローチャー1・
、第5図(a)〜(d)は塗り潰しの様子を示した説明
図、第6図は工具で切削される部分を形成する処理例を
示したフローチャート、第7図はスムージング処理例を
示したフローチャートである。 1・・・データ処理部、2・・・キーボード、3・・・
画面表示部、4・・・記憶装置、5・・・ビデオRAM
(ランダム・アクセス・メモリ)、6・・・画面制御部
。 代理人 弁理士  紋 日  誠 第1図 第2図 (a)      (b) (C) 第3図 第4図 第5図 (a)       (b)       (c)(d
) 第6図 第7図 手続補正帯(自発) 昭和61年7月7日
FIG. 1 is a block diagram showing a data processing device according to an embodiment of the present invention, FIGS. 2(a) to (c) are explanatory diagrams showing how a tool trajectory is generated from a line drawing, and FIG. 4 is a flowchart showing the process for generating a tool path.
The figure shows flowchart 1 showing an example of processing for filling.
, FIGS. 5(a) to (d) are explanatory diagrams showing the state of filling, FIG. 6 is a flowchart showing an example of processing for forming the part to be cut with a tool, and FIG. 7 is an example of smoothing processing. This is a flowchart. 1...Data processing unit, 2...Keyboard, 3...
Screen display unit, 4...Storage device, 5...Video RAM
(Random access memory), 6... Screen control unit. Agent Patent Attorney Makoto Hijiri Figure 1 Figure 2 (a) (b) (C) Figure 3 Figure 4 Figure 5 (a) (b) (c) (d
) Figure 6 Figure 7 Procedure Amendment Band (Voluntary) July 7, 1985

Claims (1)

【特許請求の範囲】[Claims] 数値制御工作機械に加工させる加工形状を線画で形成し
、その加工形状の輪郭を加工するための輪郭加工工具に
対応したオフセット線を形成してこれをその輪郭加工工
具の軌跡として記憶し、上記オフセット線をなす画素に
第1の識別符号を付加し、上記オフセット線にあらわれ
る頂点および単独な線を検出してそれらの頂点および単
独な線を形成する画素に第2の識別符号を付加し、上記
加工形状を一定方向に走査したときに当該走査線と交差
する上記第1の識別符号が付加された画素を計数してそ
の計数値が奇数の領域は加工領域の内部の画素と判別す
るとともにその計数値が偶数の領域は加工領域の外部の
画素として判別して加工領域の内部の画素と判別した画
素には第3の識別符号を付加し、この第3の識別符号が
付加されている画素の領域を加工領域と判別して輪郭線
以外の加工領域を加工する領域加工工具のオフセット量
およびオーバラップ量に基づいて一筆書き状の2次元工
具軌跡を形成することを特徴とする2次元工具軌跡生成
方法。
The machining shape to be machined by a numerically controlled machine tool is formed as a line drawing, an offset line corresponding to a contour machining tool for machining the contour of the machining shape is formed, and this is memorized as the trajectory of the contour machining tool. adding a first identification code to the pixels forming the offset line, detecting vertices and individual lines appearing in the offset line, and adding a second identification code to the pixels forming the vertices and the individual line; When the processed shape is scanned in a certain direction, pixels to which the first identification code is added that intersect with the scanning line are counted, and areas where the counted value is an odd number are determined to be pixels inside the processed area. Areas where the count value is an even number are determined as pixels outside the processing area, and a third identification code is added to the pixels determined to be inside the processing area, and this third identification code is added. A two-dimensional tool that determines a pixel area as a machining area and forms a one-stroke two-dimensional tool trajectory based on an offset amount and an overlap amount of an area machining tool that processes a machining area other than the contour line. Tool path generation method.
JP6394586A 1986-03-24 1986-03-24 Two-dimensional tool trajectory generation method Expired - Lifetime JPH07107645B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP6394586A JPH07107645B2 (en) 1986-03-24 1986-03-24 Two-dimensional tool trajectory generation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6394586A JPH07107645B2 (en) 1986-03-24 1986-03-24 Two-dimensional tool trajectory generation method

Publications (2)

Publication Number Publication Date
JPS62221004A true JPS62221004A (en) 1987-09-29
JPH07107645B2 JPH07107645B2 (en) 1995-11-15

Family

ID=13243991

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6394586A Expired - Lifetime JPH07107645B2 (en) 1986-03-24 1986-03-24 Two-dimensional tool trajectory generation method

Country Status (1)

Country Link
JP (1) JPH07107645B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012058824A (en) * 2010-09-06 2012-03-22 Fanuc Ltd Servo control system improving processing accuracy
CN113778019A (en) * 2021-08-20 2021-12-10 清华大学 Method and device for avoiding singular point problem of machine tool, electronic equipment and storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012058824A (en) * 2010-09-06 2012-03-22 Fanuc Ltd Servo control system improving processing accuracy
US9008821B2 (en) 2010-09-06 2015-04-14 Fanuc Corporation Servo control system capable of improving processing accuracy
CN113778019A (en) * 2021-08-20 2021-12-10 清华大学 Method and device for avoiding singular point problem of machine tool, electronic equipment and storage medium
CN113778019B (en) * 2021-08-20 2023-02-24 清华大学 Method and device for avoiding singular point problem of machine tool, electronic equipment and storage medium

Also Published As

Publication number Publication date
JPH07107645B2 (en) 1995-11-15

Similar Documents

Publication Publication Date Title
JP5981143B2 (en) Robot tool control method
US4789931A (en) System for automatically generating tool path data for automatic machining center
CA1331796C (en) Automatic seam tracker and real time error cumulative control system for an industrial robot
KR890002005B1 (en) Process for graphically representing a variable structure in perspective
EP0323277A2 (en) Parametric path modeling for an optical automatic seam tracker and real time robotic control system
EP0323276A2 (en) Path contriving system for look-ahead sensor in a robotic control system
US5282143A (en) Method and system for machining a sculptured surface
CN111805051A (en) Groove cutting method, device, electronic equipment and system
JP2018176332A (en) Device, system and method for automatically creating operation trajectory of robot
CN105045206A (en) Tool track display device
CN113660473A (en) Auxiliary positioning method based on projector
JP3517529B2 (en) Image input type robot system
JPS62221004A (en) Method for producing locus of 2-dimensional tool
WO2014096412A2 (en) Method for determining the workpiece location
JPS62221003A (en) Method for producing locus of 2-dimensional tool
JP3450609B2 (en) Offline teaching device for robots
CN113814528B (en) Interactive welding line curve extraction and automatic track generation method
JPS6097409A (en) Operation teaching method of robot
JPH0683422A (en) Numerical control method
DE19829661A1 (en) Computer-aided robot control sequence generation method
JP2629759B2 (en) Data generation method for numerical control machining
JPH0796368A (en) Automatic welding method
JP2701307B2 (en) Method for generating a rough tool path for area machining
US20230047775A1 (en) Robot programming device
CN109949328B (en) Method for calculating gray level of rectangular domain on straight line edge in laser welding workpiece image