JP2870397B2 - How to fill the drawing - Google Patents

How to fill the drawing

Info

Publication number
JP2870397B2
JP2870397B2 JP5336295A JP33629593A JP2870397B2 JP 2870397 B2 JP2870397 B2 JP 2870397B2 JP 5336295 A JP5336295 A JP 5336295A JP 33629593 A JP33629593 A JP 33629593A JP 2870397 B2 JP2870397 B2 JP 2870397B2
Authority
JP
Japan
Prior art keywords
offset
line
data
contour
level
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
JP5336295A
Other languages
Japanese (ja)
Other versions
JPH07200664A (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.)
NEC Corp
Original Assignee
Nippon Electric 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 Nippon Electric Co Ltd filed Critical Nippon Electric Co Ltd
Priority to JP5336295A priority Critical patent/JP2870397B2/en
Publication of JPH07200664A publication Critical patent/JPH07200664A/en
Application granted granted Critical
Publication of JP2870397B2 publication Critical patent/JP2870397B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は図面の塗り潰し方法に関
し、特に多角形の図形の図面の塗り潰し方法に関するも
のである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method for filling a drawing, and more particularly to a method for filling a drawing of a polygonal figure.

【0002】[0002]

【従来の技術】従来、多角形の図形の塗り潰しは、図形
を塗り潰すために用意されたアパーチャ、あるいはペン
の中から最大径の物を選び、そのアパーチャ、あるいは
ペンで塗り潰せない部分は、アパーチャあるいはペンを
径の小さいものに替えて塗り潰していた。
2. Description of the Related Art Conventionally, a polygonal figure is filled by selecting an aperture prepared for filling the figure or an object having a maximum diameter from a pen, and the aperture or the portion which cannot be filled with the pen is selected from the following. I replaced the aperture or pen with a smaller one and filled it.

【0003】フローチャートを図2に示す。FIG. 2 shows a flowchart.

【0004】最初に処理13により、CADデータの中
から多角形のデータを読み込む。多角形のデータの内、
外形データのみを処理14にて取り出す。次にオフセッ
ト線作成処理15について説明する。
First, in a process 13, polygon data is read from the CAD data. Of the polygonal data,
Only the outer shape data is extracted in processing 14. Next, the offset line creation processing 15 will be described.

【0005】まず、処理15,19,20に関係するア
パーチャ(またはペン)テーブルを作成する。アパーチ
ャ(またはペン)テーブルは複数の多角形を含むCAD
データを処理するごとに用意してもよいし、予め固定の
テーブルを用意してもよい。アパーチャ(またはペン)
テーブルには、アパーチャ(またはペン)の大きさ、ア
パーチャ(またはペン)をそれぞれ区別できるコード、
色などの情報を持たせ、アパーチャ(またはペン)の大
きさを基に、大きいものから順に配列に並べる。配列の
個数がアパーチャ(またはペン)の数に相当するため個
数を記憶しておく。アパーチャ(またはペン)テーブル
の例を表1に示す。
First, an aperture (or pen) table related to processes 15, 19, and 20 is created. Aperture (or pen) table is a CAD containing multiple polygons
It may be prepared every time data is processed, or a fixed table may be prepared in advance. Aperture (or pen)
The table shows the size of the aperture (or pen), a code that can distinguish the aperture (or pen),
Information such as color is provided, and the images are arranged in order from the largest one based on the size of the aperture (or pen). Since the number of arrays corresponds to the number of apertures (or pens), the number is stored. Table 1 shows an example of the aperture (or pen) table.

【0006】[0006]

【表1】 [Table 1]

【0007】各配列には、アパーチャ径、色、コード
(アパーチャ名称)などの情報を持たせておく。配列番
号はアパーチャの個数を知るために付けてあり、ここで
は、8個の配列がある事を記憶しておく。使用するアパ
ーチャは、大きさにより判別される。以下の説明では、
簡単のためにアパーチャのみとし、必要な色は黒のみと
する。また実用上は、コードが必要であるが、図形を塗
り潰す処理の説明には、コードは特に必要ないので、省
略する。(ペンの場合、アパーチャとペンを読み替えて
も何ら問題がないのは明白である。) アパーチャテーブル作成後(または固定のテーブルの場
合そのテーブルより)配列要素1番目よりアパーチャを
選択し、オフセットする量をアパーチャの半径とし、オ
フセット方向を外形に対して内側方向とし、オフセット
線を作成する。例を図3に示す。外形21に対し、アパ
ーチャの半径分の距離を保ったオフセット線分22を作
成し、外形21の線分の接続情報(またはデータ構成)
により、線分22の有効部分を接続して、オフセット線
23を得る。
Each array is provided with information such as an aperture diameter, a color, and a code (aperture name). The array numbers are given to know the number of apertures. Here, it is stored that there are eight arrays. The aperture to be used is determined based on the size. In the following description,
For simplicity, only the aperture is used, and only the required color is black. In practice, a code is required, but a description of the process of filling a figure is omitted because a code is not particularly necessary. (In the case of a pen, it is clear that there is no problem even if the aperture and the pen are replaced.) After creating the aperture table (or from a fixed table, from that table), select and offset the aperture from the first array element An offset line is created with the amount being the radius of the aperture and the offset direction being inward with respect to the outer shape. An example is shown in FIG. An offset line segment 22 is created with the distance of the radius of the aperture kept from the contour 21, and connection information (or data configuration) of the segment of the contour 21 is created.
Thus, the effective portion of the line segment 22 is connected to obtain the offset line 23.

【0008】次に処理16により、オフセット線の有効
範囲の判別を行う。まずオフセット線は、一筆書きでき
るループを形成しているので、自己交差が存在するかど
うかを調べる。存在しなければ、オフセット線の全てが
有効となる。自己交差が存在する場合、交差点によりオ
フセット線を分割して新しいループを形成する。ただ
し、この時各ループを形成する線分の方向は保存してお
く。各ループが右回り構成であるか左回り構成であるか
を調べて、外形の構成と同じ構成のループを有効範囲と
する。図3の例では、外形21の構成ループの方向24
が右回りとなっている。自己交差25,26により、オ
フセット線23を3つのループに分割する。この例では
自己交差25,26で挟まれたループだけが左回りとな
り、削除される。残ったループ2つがオフセット線有効
範囲となる。
Next, in step 16, the effective range of the offset line is determined. First, since the offset line forms a loop that can be drawn with one stroke, it is checked whether a self-intersection exists. If not, all of the offset lines are valid. If there is a self-intersection, split the offset line by the intersection to form a new loop. However, at this time, the direction of the line segment forming each loop is stored. It is checked whether each loop has a clockwise configuration or a counterclockwise configuration, and a loop having the same configuration as the external configuration is set as an effective range. In the example of FIG.
Is clockwise. The self-intersections 25 and 26 divide the offset line 23 into three loops. In this example, only the loop sandwiched between the self-intersections 25 and 26 is counterclockwise and is deleted. The remaining two loops are the effective range of the offset line.

【0009】次に判断17であるが、1回目の処理16
の直後は、必ずnoとなる。
Next, in decision 17, the first processing 16
Immediately after is always no.

【0010】次に処理18で有効オフセット線で閉じた
領域を塗り潰すためにハッチング線を作成する。ハッチ
ングピッチは、直前の処理15で使用したアパーチャの
直径(実用的には、機械の誤差を考慮して、アパーチャ
の直径マイナス許容誤差とするのが良い)とする。ハッ
チング方向は任意であるが、線分の総延長が最小となる
ようにするのが、一般的である。また、ハッチング線作
成の前に、ハッチングに使用するアパーチャの半径をオ
フセット量とするオフセット線を計算し、そのオフセッ
ト線の有効範囲が存在するかどうかを確認する。図3の
例では、この確認を行うとハッチング線が作成されな
い。(する必要がない) 次に判断19でより小さなアパーチャがあるか調べる。
表1のアパーチャテーブルを見ると使用可能なアパーチ
ャが存在する事がわかるのでyesとなる。アパーチャ
を小さくする事により、多角形の輪郭がより高精度に塗
り潰せるようになる。また、図3の例では、削除された
部分がまだ塗り潰せていないので、アパーチャを小さく
する事により、塗り潰せるようになる。ただし、最小の
アパーチャで塗り潰せない部分は、多角形を塗り潰す際
の誤差となる。
Next, in processing 18, a hatching line is created to fill the area closed by the effective offset line. The hatching pitch is the diameter of the aperture used in the immediately preceding process 15 (practically, it is better to set the diameter of the aperture minus the permissible error in consideration of machine errors). Although the hatching direction is arbitrary, it is general to minimize the total extension of the line segment. Before creating the hatching line, an offset line is calculated using the radius of the aperture used for hatching as an offset amount, and it is confirmed whether or not the effective range of the offset line exists. In the example of FIG. 3, a hatching line is not created when this check is performed. (No need to do this.) Next, in decision 19, it is checked whether there is a smaller aperture.
If the aperture table in Table 1 is checked, it can be seen that there is an available aperture, so the answer is yes. By reducing the aperture, the outline of the polygon can be filled with higher precision. Further, in the example of FIG. 3, since the deleted portion has not yet been filled, the aperture can be reduced by reducing the aperture. However, a portion that cannot be filled with the smallest aperture becomes an error when the polygon is filled.

【0011】処理20によりアパーチャを小さくすると
ともに、オフセット量、アパーチャコードを変更する。
その後、2回目の処理15を行う。この様に順次アパー
チャがなくなるまで繰り返す。
In step 20, the aperture is reduced and the offset amount and aperture code are changed.
Then, the second process 15 is performed. The process is repeated until there is no more aperture.

【0012】図2のフローチャートでは、ハッチング線
の作成を1回しか行わないようにしているが、この実現
のためにはアパーチャの径を小さくする段階で、アパー
チャの径を50%未満にしてはならない。例として表1
のアパーチャテーブルで配列番号3がなかったとする
と、図2の処理20でアパーチャを1段階小さくすると
25%となる。このとき、1回目のアパーチャで塗り潰
せなかった部分を25%の大きさのアパーチャで塗り潰
そうとするとハッチング線が必要となる。図4において
オフセット線27が1回目のアパーチャの軌跡で、オフ
セット線28が25%の大きさのアパーチャの軌跡であ
る。円29,30は、各アパーチャの大きさのイメージ
を表しており、斜線部分31にハッチング線が必要にな
る事がわかる。
In the flowchart of FIG. 2, the hatching line is created only once, but in order to realize this, the diameter of the aperture should be reduced to less than 50% at the stage of reducing the diameter of the aperture. No. Table 1 as an example
If there is no array number 3 in the aperture table, the aperture is reduced by one step in the processing 20 in FIG. At this time, a hatching line is required if a portion that could not be filled with the first aperture is to be filled with an aperture having a size of 25%. In FIG. 4, the offset line 27 is the locus of the first aperture, and the offset line 28 is the locus of the aperture having a size of 25%. The circles 29 and 30 represent the image of the size of each aperture, and it can be seen that hatching lines are required in the hatched portions 31.

【0013】以上のような手順で多角形は塗り潰されて
いた。
The polygon has been filled in the above procedure.

【0014】なお、この種のCAD/CAMにおける
り潰し方法に関連するものに、特開昭64−44580
号公報が、CADシステムを用いたオフセット線作成に
関連するものに、特開平2−51779号公報が挙げら
れる。
Japanese Patent Application Laid-Open No. 64-44580 discloses a method related to the crushing method in this kind of CAD / CAM.
Japanese Unexamined Patent Application Publication No. 2-51779 discloses a technique related to offset line creation using a CAD system .

【0015】[0015]

【発明が解決しようとする課題】従来技術では、アパー
チャ(またはペン)の大きさを小さくして塗り潰して行
く課程で、既に塗り潰せている部分にもオフセット線を
作成しているため、アパーチャ(またはペン)の軌跡の
総延長が長くなってしまう。また、用意された(また
は、処理ごとに作成された)アパーチャ(またはペン)
テーブルの中の最小のアパーチャ(またはペン)よりも
小さい多角形は塗り潰せないので、削除しなければなら
ないが、繰り返し処理が最小のアパーチャ(またはペ
ン)を使用するに至るまで、判断できず、計算処理に無
駄がある。
In the prior art, in the process of reducing the size of the aperture (or pen) and filling in, the offset line is created even in the portion that has already been filled, so that the aperture (or pen) is created. Or the total length of the trajectory of the pen increases. Also, prepared apertures (or pens created for each process)
Polygons smaller than the smallest aperture (or pen) in the table cannot be filled and must be deleted, but until the iteration uses the smallest aperture (or pen), There is waste in the calculation process.

【0016】オフセット線作成方法においても、複数の
輪郭線を持つ多角形の場合や、オフセット線の閉ループ
の方向性による判別が不可能となるオフセット線が重な
ってしまう場合など、解決されていない課題がある。
The offset line creation method has not been solved, for example, in the case of a polygon having a plurality of contours, or in the case where offset lines which cannot be determined by the closed loop directionality of the offset lines overlap. There is.

【0017】[0017]

【課題を解決するための手段】上述した問題点を解決す
るため、本発明の図面の塗り潰し方法では、(1)計算
機で作成した図形データを読み込み、そのうちから多角
形データを抽出し記憶手段に読み込む手段と、計算機処
理により、(2)多角形データに属する複数の輪郭線デ
ータの包含関係レベルを計算する手段と、(3)該輪郭
線データの閉領域の内外の別を計算する手段と、(4)
輪郭線データの線分データをオフセットする方向を計算
する手段と、(5)該オフセット方向へ該線分データを
オフセットして線分データを計算し記憶する手段と、
(6)該オフセット線データの表す形の交差及び重複を
判別する手段を有し、多角形領域を重なり部分を重複せ
ずに塗り潰す線分データを作成し出力することを特徴と
している
[SUMMARY OF] To solve the above problems, in the method for filling the drawings of the invention are, (1) calculate
Load the figure data created by the
Means for extracting the shape data and reading it into the storage means;
(2) multiple contour lines belonging to polygon data
Means for calculating the inclusion relation level of the data, and (3) the contour
Means for calculating the difference between inside and outside of the closed area of the line data; (4)
Calculate the direction to offset line data of contour data
And (5) transferring the line segment data in the offset direction.
Means for calculating and storing offset line data;
(6) Check the intersection and overlap of the form represented by the offset line data.
It has a means for discriminating and overlapping polygonal areas
Create and output line segment data to fill without
Have .

【0018】[0018]

【作用】まず、多角形の複数の輪郭線にそれぞれの包含
関係により最外に位置するものから、レベル,レベル
2…と順位付けする。同様にそれぞれのオフセット線に
もレベルを付けることで、レベルの違うループ同志
係を判別できる。
First, a plurality of outlines of a polygon are ranked as level 1 , level 2,. Similarly, by assigning a level to each offset line, the relationship between loops having different levels can be determined.

【0019】オフセット量は、アパーチャ(またはペ
ン)テーブルの1番から順に選択して決まるので、径の
小さいものから使用できるようにテーブルを作成する。
これで、最初の判別で、塗り潰せる大きさより小さな多
角形を容易に削除できる。
Since the offset amount is determined by selecting the aperture (or pen) table in order from the first, the table is created so that the table with the smaller diameter can be used.
Thus, in the first determination, a polygon smaller than the size that can be filled can be easily deleted.

【0020】オフセット線を作成する処理を繰り返す
と、アパーチャ(またはペン)の実際の軌跡が重なる部
分がでてくるので、その部分を削除することにより、塗
り潰しに必要な線分の総延長を短かくできる。
When the process of creating the offset line is repeated, a portion where the actual trajectory of the aperture (or pen) overlaps appears. By deleting this portion, the total length of the line necessary for filling can be shortened. I can do it.

【0021】上記処理を適用することにより、課題を解
決することが可能となる。
By applying the above processing, the problem can be solved.

【0022】[0022]

【実施例】以下、本発明の実施例に基づいて説明する。DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below.

【0023】図1に本発明のフローチャートを示す。入
力1により多角形データの読み込みを行う。
FIG. 1 shows a flowchart of the present invention. The input 1 reads polygon data.

【0024】次に処理2において、多角形のすべての輪
郭線を抽出する。具体的には、輪郭線は閉ループとなっ
ているので、線分データの接続関係を調べ、ループがい
くつ形成されているかを調べる。図5の例では、輪郭線
32,33の3つのループが見つかる。
Next, in process 2, all contours of the polygon are extracted. Specifically, since the contour line is a closed loop, the connection relationship of the line segment data is checked to determine how many loops are formed. In the example of FIG. 5, three loops of the contour lines 32 and 33 are found.

【0025】次に処理3において輪郭線の順位付けを行
う。輪郭線同志には、接続関係はなく包含関係のみが存
在している。よって各輪郭線を構成する要素の絶対座標
値のX方向成分の最大値,最小値とY方向成分の最大
値,最小値を各輪郭線ごとに求め、大小関係から包含関
係を判別する。外形をレベル1の輪郭線とすると、それ
に含まれる輪郭線を、レベル2とする。さらにレベル2
の輪郭線に含まれる輪郭線を、レベル3とする。このよ
うに包含関係により輪郭線にレベルを付けることで順位
付けする。次に輪郭線の方向を決める。レベル1の輪郭
線は右回りでも左回りでもよい。ただしレベル2以降の
輪郭線は、一段階上位レベルの輪郭線と逆方向とする。
図5では、輪郭線32がレベル1、輪郭線33(ループ
数2)がレベル2となる。各レベルの輪郭線のループの
方向は、レベル1が右回り、レベル2が左回りとする。
Next, in process 3, the contours are ranked. There is no connection relation between contour lines, and only an inclusion relation exists. Therefore, the maximum value and the minimum value of the X direction component and the maximum value and the minimum value of the Y direction component of the absolute coordinate values of the elements constituting each contour are obtained for each contour, and the inclusion relation is determined from the magnitude relation. Assuming that the outline is a level 1 outline, the outline included in the outline is a level 2 outline. Level 2
The contour line included in the contour line is set to level 3. In this way, the contour lines are ranked by assigning levels to the contour lines based on the inclusion relation. Next, the direction of the contour line is determined. The level 1 contour may be clockwise or counterclockwise. However, the contour lines of level 2 and thereafter are in the opposite direction to the contour lines of the next higher level.
In FIG. 5, the contour 32 is at level 1 and the contour 33 (the number of loops 2) is at level 2. The direction of the loop of the contour line of each level is clockwise at level 1 and counterclockwise at level 2.

【0026】次に処理4において、オフセット線を作成
する。オフセットする方向は各輪郭線のレベルによって
決定する。奇数レベルのとき輪郭線で閉じた領域にオフ
セットする。偶数レベルのとき、輪郭線で閉じた領域の
外側にオフセットする。オフセット方向を決定した後、
輪郭線を線分ごとにオフセットする。オフセットする量
は、多角形を塗り潰すために用意したアパーチャ(また
はペン)テーブルに従って決定する。テーブルは、表1
に示すような配列であるが、本発明の場合、径の小さい
ものから順に使用し、オフセット量は径の1/2とす
る。
Next, in process 4, an offset line is created. The offset direction is determined by the level of each contour line. Offset to the area closed by the contour line at the odd number level. At an even number level, offset outside the area closed by the contour. After determining the offset direction,
Offset the contour line by line segment. The offset amount is determined according to an aperture (or pen) table prepared for filling the polygon. Table 1
However, in the case of the present invention, the offsets are used in ascending order of the diameter, and the offset amount is 1 / of the diameter.

【0027】オフセットした線分は、輪郭線の接続関係
を保つように、交点でつなぐ。輪郭線上で接続していた
線分のオフセット線同志が交点を持たない場合、円弧で
つなぐ。図6の例で説明する。輪郭線分36,37,3
8は接続関係があり、輪郭線の方向は右回りとする。輪
郭線分をオフセットした各線分を破線で示す。輪郭線分
36,37をオフセットした線分は交点39を持つ。よ
って交点39でオフセットした線分同志をつなぐ。次に
輪郭線分37,38をオフセットした線分は、交点がな
いので、円弧40にて接続する。円弧40の中心は、輪
郭線分37の終点、または輪郭線分38の始点とする。
こうして隣接する輪郭線分をオフセットした線分を接続
し、オフセット線を作成する。このときオフセット線は
輪郭線の方向とレベルを受け継ぐ。
The offset line segments are connected at intersections so as to maintain the connection of the outline lines. If the offset lines of the segments connected on the contour line do not have an intersection, they are connected by an arc. This will be described with reference to the example of FIG. Outline segment 36, 37, 3
8 has a connection relationship, and the direction of the contour line is clockwise. Each line segment obtained by offsetting the contour line segment is indicated by a broken line. A line segment obtained by offsetting the contour lines 36 and 37 has an intersection 39. Accordingly, the line segments offset at the intersection 39 are connected. Next, the line segments obtained by offsetting the contour lines 37 and 38 have no intersection, so they are connected by an arc 40. The center of the arc 40 is set as the end point of the contour line segment 37 or the start point of the contour line segment 38.
In this way, the line segments obtained by offsetting the adjacent contour lines are connected to create an offset line. At this time, the offset line inherits the direction and level of the contour line.

【0028】輪郭線の構成の中に円弧が含まれる場合
で、オフセット方向が円弧の中心座標が含まれる領域側
であり、オフセット量が円弧の半径より大きい場合、円
弧のデータを削除する必要がある。図7の例で説明す
る。オフセット線は輪郭線から等距離にある線だから、
円弧をオフセットする場合、図7(a),(b)のよう
に、円弧41に対してのオフセット線43は、円弧41
の中心42を中心座標とする同心円の一部となる。この
とき、図7(a)は、オフセット方向が円弧の中心座標
がある側と逆なので、オフセット量を考慮しなくてよ
い。しかし図7(b)の例では、オフセット方向が円弧
の中心座標がある側なので、オフセット量が円弧の半径
よりも大きくなった場合、円弧のデータを削除した方が
計算が楽になる。仮に、円弧の半径よりも大きいオフセ
ット量でオフセット線を作成すると図7(c)の一点鎖
線44のようになるが、これは図面上の話である。計算
機では、円弧の半径からオフセット量を差し引いた値を
半径とする円弧を作成しようとするが、図7(c)の例
では、負の大きさの半径を持つことになり、判断が複雑
になる。また図7(c)ので判るように、仮円弧44
を含むループは、ループの向きの判定で必ず削除され
る。よって最初から円弧データを無視してオフセット線
を作成しても問題はない。
When an arc is included in the configuration of the contour line, the offset direction is on the side of the area including the center coordinate of the arc, and when the offset amount is larger than the radius of the arc, the data of the arc must be deleted. is there. This will be described with reference to the example of FIG. Since the offset line is a line that is equidistant from the contour line,
When the arc is offset, as shown in FIGS. 7A and 7B, the offset line 43 with respect to the arc 41 is
Is a part of a concentric circle having the center 42 as the center coordinate. At this time, in FIG. 7A, since the offset direction is opposite to the side where the center coordinates of the arc are located, it is not necessary to consider the offset amount. However, in the example of FIG. 7B, since the offset direction is on the side where the center coordinate of the arc is located, if the offset amount is larger than the radius of the arc, the calculation is easier if the arc data is deleted. If an offset line is created with an offset amount larger than the radius of the arc, it will be as shown by a dashed line 44 in FIG. 7C, but this is a story on the drawing. The computer attempts to create an arc whose radius is the value obtained by subtracting the offset amount from the radius of the arc, but in the example of FIG. 7C, the computer has a negative radius, which makes the determination complicated. Become. Further, as can be seen from the example of FIG.
Are always deleted in the determination of the direction of the loop . Therefore, there is no problem even if the offset line is created ignoring the arc data from the beginning.

【0029】次に処理5において、オフセット線の有効
範囲を判別し、新たな輪郭線を作成する。有効範囲はレ
ベル1より順に判別する。ただし、有効範囲同志が干渉
(交差)する事があるので、干渉(交差)の可能性があ
る奇数レベル、偶数レベル一組のオフセット線の有効範
囲を判別するごとに、オフセット線同志の干渉(交差)
を判別する。判別により決定された有効範囲を各レベル
の新しい輪郭線とする。
Next, in process 5, the effective range of the offset line is determined, and a new contour line is created. The effective range is determined in order from level 1. However, since the effective ranges may interfere (intersect) with each other, every time the effective range of a set of offset lines of odd and even levels that may cause interference (intersection) is determined, the interference of the offset lines (intersection) is determined. Intersection)
Is determined. The effective range determined by the determination is set as a new contour line of each level.

【0030】次に有効範囲の判別方法を説明する。まず
レベル1のオフセット線に自己交差が存在するかを調べ
る。自己交差が存在しなかった場合、レベル1のオフセ
ット線は、そのすべてが有効範囲となる。自己交差が存
在する場合、交差点でオフセット線を分割する。ただ
し、オフセット線の線分が重なる場合、これを交差とせ
ず、オフセット線の分割も行わない。オフセット線は、
1つのループであるが、分割によりループの数が増え
る。分割された各ループは、その方向がレベル1の輪郭
線の方向と同じ場合、有効とし、逆方向の場合は、無効
として削除する。図8(a)の例では、破線で示したオ
フセット線に対し、交差点45,46でループを分割
し、有効範囲であるループ47,48を得る。このよう
にしてレベル1のオフセット線有効範囲を決定する。
Next, a method of determining the effective range will be described. First, it is checked whether a self-intersection exists in the level 1 offset line. If there were no self-intersections, the level 1 offset lines would all be in scope. If there is a self-intersection, split the offset line at the intersection. However, when the segments of the offset line overlap, they do not intersect and do not divide the offset line. The offset line is
Although it is one loop, the number of loops increases due to division. Each of the divided loops is determined to be valid if its direction is the same as the direction of the level 1 contour, and is deleted as invalid if it is in the opposite direction. In the example of FIG. 8A, the loop is divided at the intersections 45 and 46 with respect to the offset line indicated by the broken line, and the loops 47 and 48 that are the effective range are obtained. Thus, the effective range of the level 1 offset line is determined.

【0031】次にレベル2のオフセット線の有効範囲を
判別する。まず自己交差が存在するか調べる。この処理
は、レベル1と同様である。次にレベル2以降の処理と
して、同レベルのオフセット線同志の干渉(交差)を調
べる必要がある。この場合、交差点によりループのつな
ぎ替えを行う。複数存在するオフセット線の閉ループの
うち、任意の1つの閉ループの、任意の線分から、自身
のループの方向へたどって、交差点で自身以外の閉ルー
プへ接続する。この時、自身以外の閉ループへの接続
は、方向を保つようにする。これを最初の線分に戻るま
で続けると新たな閉ループが得られる。
Next, the effective range of the level 2 offset line is determined. First, check whether a self-intersection exists. This processing is the same as in level 1. Next, it is necessary to check the interference (intersection) between the offset lines of the same level as the processing after the level 2. In this case, loop reconnection is performed at an intersection. From an arbitrary line segment of an arbitrary one of the closed loops of the plurality of offset lines, the line is traced in the direction of the own loop, and connected to a closed loop other than the own at an intersection. At this time, the connection to the closed loop other than itself is maintained in the direction. By continuing this until returning to the first line segment, a new closed loop is obtained.

【0032】次に最初に選んだ任意のループを、最初の
交差点からたどって、同様に閉ループを得る。これを分
割前の各ループの構成要素がすべて使用されるまで続け
る。図8(b)の例で説明する。図では、レベル1の輪
郭線49のオフセット線を簡単のために省略してある。
まずレベル2の輪郭線50に対し、破線で示すオフセッ
ト線を作成する。左右どちらか一方のループの任意の線
分からたどっていくと、交差点51、あるいは52のど
ちらかに当たる。そこで、ループの方向(ここでは左回
り)を保ちながら、ループのつなぎ替えをする。これを
最初に選んだ任意の線分に戻るまで続けると、閉ループ
53、あるいは54が得られる。次に左右のループのう
ち、最初に選んだループを交差点51,52のうち、最
初に当たった方からたどっていくと、閉ループ53,5
4のうち、先に得られたもの以外が得られる。
Next, the first selected arbitrary loop is traced from the first intersection, and a closed loop is similarly obtained. This is continued until all the components of each loop before the division are used. This will be described with reference to the example of FIG. In the figure, the offset lines of the level 1 outline 49 are omitted for simplicity.
First, an offset line indicated by a broken line is created for the contour line 50 of level 2. If the user follows an arbitrary line segment of one of the left and right loops, it will hit either the intersection 51 or 52. Therefore, the connection of the loop is changed while maintaining the direction of the loop (here, counterclockwise). If this operation is continued until an arbitrary line segment is selected, a closed loop 53 or 54 is obtained. Next, when the loop selected first among the left and right loops is traced from the first one of the intersections 51 and 52, the closed loops 53 and 5 are obtained.
Of the four, those other than those previously obtained are obtained.

【0033】閉ループのつなぎ替えが完了したら、それ
ぞれの閉ループの包含関係を調べる。包含関係の判別
は、処理3の順位付けと同様に、最大、最小のX,Y方
向成分を求めて比較すればよい。これにより最外に位置
するループをレベル2のオフセット線有効範囲とする。
次に最外に位置するループに含まれるループ(複数ある
場合は、そのすべて)について、ループの方向を調べ
る。レベル2の輪郭線と同じ方向の場合削除する。逆方
向のものがあれば、このループもオフセット線の有効範
囲となる。図8(b)の例では閉ループ54は削除され
る。
When the reconnection of the closed loop is completed, the inclusion relation of each closed loop is examined. The determination of the inclusion relation may be performed by obtaining the maximum and minimum X and Y direction components and comparing them in the same manner as in the ranking in the process 3. Thus, the outermost loop is set as the level 2 offset line effective range.
Next, the loop direction is checked for the loops included in the outermost loop (if there are a plurality of loops, all of them). If the direction is the same as the level 2 contour line, it is deleted. If there is a reverse direction, this loop is also the effective range of the offset line. In the example of FIG. 8B, the closed loop 54 is deleted.

【0034】ここで、レベル1及びレベル2のオフセッ
ト線有効範囲の干渉(交差)と包含関係を調べる。図形
を塗り潰すためのオフセットを考えれば、レベルの順序
が奇数、偶数という場合に、オフセット線同志に干渉
(交差)の可能性がある。まず干渉(交差)が存在する
かを調べる。干渉(交差)が存在しない場合、レベル1
及びレベル2のオフセット有効範囲の包含関係が、それ
ぞれの輪郭線の包含関係と同じであるか調べる。包含関
係が同じ場合、両オフセット線とも最終的に有効であ
り、逆転している場合、両オフセット線とも削除する。
図5の例では、レベル1のオフセット線34とレベル2
のオフセット線35は、干渉(交差)がなく包含関係に
逆転もないので、それぞれ新しい輪郭線となる。包含関
係が逆転した場合、オフセット線は作成されない事にな
るが、この多角形はアパーチャ(またはペン)の精度以
下という事でデータより削除してもよい誤差とする。干
渉(交差)が存在する場合、交差点でループを分割す
る。分割方法は、同レベルのオフセット線同志の干渉
(交差)がある場合と同じである。レベル1のオフセッ
ト線のループの線分からたどって、レベル2のオフセッ
ト線のループとの交差点で、ループの方向を保つように
つなぎ替え、レベル1のオフセット線の最初に選んだ線
分に接続するまでたどると、有効範囲が決まる。判断方
法は、分割されたループの方向が、レベル1の輪郭線と
同じ方向の場合有効とし、逆方向の場合無効として削除
する。図9の例では、レベル1のオフセット線55とレ
ベル2のオフセット線56を交差点でループのつなぎ替
えをした後、新しいループの方向から、有効範囲57を
得る。
Here, the interference (intersection) and the inclusion relation in the effective range of the offset lines of level 1 and level 2 are examined. Considering an offset for filling a figure, there is a possibility of interference (intersection) between offset lines when the order of levels is odd and even. First, check whether interference (crossing) exists. Level 1 if there is no interference (crossing)
Then, it is checked whether the inclusion relation of the offset effective range of level 2 is the same as the inclusion relation of each contour line. When the inclusion relation is the same, both offset lines are finally effective, and when reversed, both offset lines are deleted.
In the example of FIG. 5, the level 1 offset line 34 and the level 2
Since there is no interference (intersection) and there is no inversion in the inclusion relationship, the offset lines 35 become new contour lines. If the inclusion relationship is reversed, no offset line will be created, but this polygon is considered to be an error that may be deleted from the data because it is below the aperture (or pen) accuracy. If there is interference (intersection), split the loop at the intersection. The division method is the same as in the case where there is interference (intersection) between offset lines at the same level. Following the level 1 offset line loop segment, at the intersection with the level 2 offset line loop, reconnect so that the direction of the loop is maintained, and connect to the first selected line segment of the level 1 offset line. Following this, the effective range is determined. The judgment method is that if the direction of the divided loop is the same as the level 1 contour line, it is valid, and if it is the opposite direction, it is invalid and deleted. In the example of FIG. 9, after changing the loop between the level 1 offset line 55 and the level 2 offset line 56 at the intersection, the effective range 57 is obtained from the new loop direction.

【0035】レベル2とレベル3の輪郭線に対するオフ
セット線については、オフセットする方向が互いに遠ざ
かる方向にあるため、干渉(交差)や包含関係は調べる
必要がない。一般的に図形の塗り潰しに関し、オフセッ
ト線のレベルが偶数、奇数という順序の並び関係の時、
干渉(交差)や包含関係は調べない。調べる必要がある
のはオフセット線のレベルが奇数、偶数という順序の並
び関係(1,2および3,4…)にある場合である。
With respect to the offset lines with respect to the level 2 and level 3 contour lines, since the offset directions are away from each other, it is not necessary to examine the interference (intersection) and the inclusion relation. In general, when filling the figure, when the offset line levels are even and odd,
It does not check for interference (intersection) or inclusion. It is necessary to examine the case where the levels of the offset lines are in an odd-numbered, even-numbered order (1, 2, 3, 4,...).

【0036】この処理5において有効範囲を判別するた
めに、干渉(交差)を調べたが、もし2つのループが線
分を共有する(線分要素の一部または全部が重複する)
場合、これを交差とせず、ループの分割も行わないもの
とする。これにより、重複した線分上をトレースできる
アパーチャ(またはペン)は、オフセット量を半径とし
なくてはならない。このことが後の処理のオフセット量
を2倍ずつ大きくするという根拠となる。
In this processing 5, interference (intersection) was checked to determine the effective range. If two loops share a line segment (part or all of the line segment elements overlap)
In this case, it is assumed that this is not an intersection and that the loop is not divided. Thus, an aperture (or pen) that can trace on the overlapped line segment must use the offset amount as a radius. This is the basis for increasing the offset amount in the subsequent processing by two times.

【0037】次に判断6で処理5を通過したのが1回目
であるかを調べる。1回目のとき、処理7を実行する。
2回目以降のときは、処理8を実行する。
Next, it is checked in decision 6 whether processing 5 has passed the first time. At the first time, processing 7 is executed.
At the second and subsequent times, the process 8 is executed.

【0038】処理7でオフセット量を1回目と同じにす
る。すなわち最初の輪郭線から見ると1回目の2倍の距
離とする。これは、1回目のオフセット線をアパーチャ
(またはペン)の軌道とした時、アパーチャ(またはペ
ン)で塗り潰された領域の輪郭線を次のオフセット線と
するためである。これにより、オフセット線を繰り返し
作成するときに、すでに塗り潰せた領域を判別しなくて
よくなる。また塗り残りがなくなる。例えば、図10の
例で説明する。図の長方形をアパーチャ58で塗り潰す
ための軌道を作成すると破線のようになる。アパーチャ
58で塗り潰せなかった領域59を塗り潰すために本発
明では領域59の輪郭線をオフセット線として、大きさ
がアパーチャ58の2倍のアパーチャで、そのオフセッ
ト線をトレースする。もし、アパーチャを2倍よりも大
きくした場合、次にオフセット線がすべて無効となり、
領域59を塗り残す可能性がある。その場合、またアパ
ーチャを小さくしてハッチング線を作成するなどの処理
が増えてしまうので、効率が悪くなる。よってオフセッ
ト量は、2倍ずつ大きくしていくのが効率が良い。ただ
し、実際の処理では、オフセット線を新しい輪郭線とし
て次のオフセット線を計算するので、1回目のみオフセ
ット量は、アパーチャの径の1/2となるが、2回目以
降のオフセット量はアパーチャの径の1/4となる。つ
まり、2回目のオフセット量が1回目と同じとなるの
は、径を2倍してさらに1/4倍する事で、結果アパー
チャ径の1/2となるからである。
In processing 7, the offset amount is made the same as the first time. That is, when viewed from the first contour, the distance is twice as long as the first time. This is because, when the first offset line is the trajectory of the aperture (or pen), the outline of the area filled with the aperture (or pen) is used as the next offset line. Thus, when the offset line is repeatedly created, it is not necessary to determine the already filled area. In addition, there is no remaining paint. For example, description will be made with reference to the example of FIG. When a trajectory for filling the rectangle in the figure with the aperture 58 is created, the trajectory becomes like a broken line. In order to fill the area 59 that could not be filled with the aperture 58, in the present invention, the outline of the area 59 is used as an offset line, and the offset line is traced with an aperture twice as large as the aperture 58. If you make the aperture larger than twice, then all offset lines will be invalid,
The region 59 may be left unpainted. In this case, the number of processes such as creating a hatching line by reducing the aperture increases, and the efficiency becomes poor. Therefore, it is efficient to increase the offset amount by two times. However, in the actual processing, the next offset line is calculated using the offset line as a new contour line, so that the offset amount for the first time is 径 of the diameter of the aperture, but the offset amount for the second and subsequent times is the aperture amount of the aperture. 1/4 of the diameter. That is, the reason why the second offset amount is the same as the first offset amount is that, by doubling the diameter and further 1 /, the result is オ フ セ ッ ト of the aperture diameter.

【0039】この後、処理3,4,5を実行し、判断6
でnoとなるので判断9を実行する。
Thereafter, the processings 3, 4, and 5 are executed, and a judgment 6 is made.
Therefore, the judgment 9 is executed.

【0040】判断9では、多角形の塗り潰しが完了して
いるかを調べる。処理5において、新しい輪郭線が作成
されなかった場合で、オフセット線の作成が2回目以降
であるという条件を満たしていれば、塗り潰しが完了し
たと判断できる。
In judgment 9, it is checked whether or not the polygon is completely filled. In process 5, when a new contour line has not been created and the condition that the offset line is created for the second time or later is satisfied, it can be determined that the filling has been completed.

【0041】処理8では、塗り潰しに必要なアパーチャ
の軌道の総延長を短かくする処理を行う。まず2回目の
オフセット線を新しい輪郭線として残しておく。
In process 8, a process for shortening the total extension of the trajectory of the aperture necessary for filling is performed. First, the second offset line is left as a new contour line.

【0042】次に2回目のオフセット線を、奇数レベル
のものは閉ループで閉じた領域の外側に、偶数レベルの
ものは閉ループで閉じた領域の内側にオフセットする。
つまり処理4でのオフセット方向と逆向きにオフセット
する。オフセット量は、処理4と同じとする。ここでオ
フセットした線は、その大部分が1回目のオフセット線
と重複するので、重複した線分を削除してしまう。これ
により、オフセット線の総延長は短かくなる。しかし、
データ量は増加してしまうので、データ量を優先する場
合、処理8を実行せずに判断10へ進むようにすればよ
い。データ量が増加するのは、単純に説明すれば1本の
線分を2本の線分に分割するからである。図11の
(a),(b),(c),(d)を例にして説明する。
図11(a)で外形64,65に対してレベル1のオフ
セット線60、レベル2のオフセット線61を作成す
る。図11(b)は、図11(a)のオフセット線6
0,61を新しい輪郭線として、2回目のオフセット線
を作成したものである。この2回目のオフセット線62
に処理8を実施すると、図11(c)の破線63が得ら
れる。この破線63を図11(a)の1回目のオフセッ
ト線60,61から差し引いて、オフセット線60,6
1の残った部分を示したものが図11(d)である。図
11(d)を得ることにより、処理8は終了する。
Next, the offset line for the second time is offset to the outside of the area closed by the closed loop for the odd number level, and to the inside of the area closed by the closed loop for the even number level.
That is, the offset is performed in the direction opposite to the offset direction in the process 4. The offset amount is the same as in the processing 4. Here, most of the offset line overlaps with the first offset line, so the duplicated line segment is deleted. Thereby, the total extension of the offset line becomes shorter. But,
Since the data amount increases, when the data amount is prioritized, the process 8 may be performed without performing the process 8. The data amount is increased simply because one line segment is divided into two line segments. A description will be given by taking, as examples, (a), (b), (c), and (d) of FIG.
In FIG. 11A, a level 1 offset line 60 and a level 2 offset line 61 are created for the outlines 64 and 65. FIG. 11B shows the offset line 6 in FIG.
A second offset line is created by setting 0, 61 as a new contour line. This second offset line 62
When the process 8 is performed on the, the dashed line 63 in FIG. 11C is obtained. The dashed line 63 is subtracted from the first offset lines 60 and 61 in FIG.
FIG. 11D shows the remaining portion of 1. By obtaining FIG. 11D, the process 8 ends.

【0043】3回目以降も、処理4と逆向きにオフセッ
トした線と1回前のオフセット線との差分をとって1回
前のオフセット線を更新する。
In the third and subsequent times, the difference between the line offset in the direction opposite to the process 4 and the previous offset line is calculated to update the previous offset line.

【0044】判断10では、オフセット線の作成回数を
カウントしつつ、任意の設定値に達したかを調べる。達
していない場合、処理11でオフセット量を2倍にして
処理3へ移す。設定値になっていた場合、処理12を実
行する。
In the judgment 10, while counting the number of times the offset line is created, it is checked whether the offset line has reached an arbitrary set value. If not reached, the offset amount is doubled in processing 11 and the processing moves to processing 3. If the set value has been reached, process 12 is executed.

【0045】処理12では、ハッチング線を作成する。
ハッチングに使用するアパーチャ(またはペン)は、最
後のオフセット線作成に使用したものと同じにする。ハ
ッチングピッチは、アパーチャ(またはペン)の塗り幅
よりも少し小さめとする。これは、作画機やプロッタの
動作の誤差を考慮したためである。ピッチは、最後のオ
フセット量の4倍から、誤差を差し引いたものとなる。
次にハッチングの作成法について説明する。ハッチング
方向は、ハッチング線がX軸と平行になるときを0度方
向、Y軸と平行になるときを90度方向とする。ここで
は、簡単のためにハッチング方向を0度、90度のみと
して説明する。
In process 12, a hatching line is created.
The aperture (or pen) used for hatching should be the same as the one used to create the last offset line. The hatching pitch is slightly smaller than the aperture (or pen) coating width. This is because an error in the operation of the drawing machine or the plotter is considered. The pitch is obtained by subtracting an error from four times the last offset amount.
Next, a method for creating hatching will be described. The hatching direction is defined as a 0 degree direction when the hatching line is parallel to the X axis, and a 90 degree direction when the hatching line is parallel to the Y axis. Here, for the sake of simplicity, the description will be made assuming that the hatching directions are only 0 degrees and 90 degrees.

【0046】まず、新しい輪郭線のデータから、X方向
成分の最大,最小値、Y方向成分の最大,最小値を求め
る。次にX,Y方向成分の最大値,最小値の差を計算
し、X方向の差とY方向の差の比較を行う。このとき、
レベル1の輪郭線が複数あったとしても便宜上1つのル
ープ(輪郭線)と考えて、最大,最小を求める。この計
算は奇数レベルの輪郭線でのみ行う。なぜなら、この最
大値,最小値で囲まれた長方形の領域は、ハッチングを
仮想的に作成するための最小領域を求めたものなので、
各偶数レベルの輪郭線は、必ず奇数レベルに含まれてい
るため判断する必要がなくなる。
First, the maximum and minimum values of the X-direction component and the maximum and minimum values of the Y-direction component are obtained from the new contour line data. Next, the difference between the maximum value and the minimum value of the X and Y direction components is calculated, and the difference between the X direction and the Y direction is compared. At this time,
Even if there are a plurality of level 1 contours, the maximum and minimum are determined by considering one loop (contour) for convenience. This calculation is performed only for odd-level contour lines. Because the rectangular area surrounded by the maximum value and the minimum value is the minimum area for virtually creating hatching,
Since the contour lines of the even-numbered levels are always included in the odd-numbered levels, there is no need to make a determination.

【0047】この仮想の長方形は、対角座標の1組がX
方向,Y方向とも最大値の座標とX方向,Y方向とも最
小値の座標で構成される。先のX,Y方向成分の最大
値,最小値の差のX,Y方向での比較により、この長方
形の長辺ガX,Yのどちらの軸に平行なのかを調べてい
る。X軸に平行である場合、0度のハッチング線を、Y
軸に平行である場合、90度のハッチング線を作成す
る。
In this virtual rectangle, one set of diagonal coordinates is X
The coordinates of the maximum value in both the direction and the Y direction, and the coordinates of the minimum value in both the X and Y directions. By comparing the difference between the maximum value and the minimum value of the components in the X and Y directions in the X and Y directions, it is checked which of the axes of the long sides X and Y of this rectangle is parallel. If parallel to the X axis, the hatched line at 0 degree
If parallel to the axis, create a 90 degree hatch line.

【0048】以下0度方向のハッチング線を作成する長
方形を基準に考える。ハッチング線は、X軸に平行なの
で、Y座標によってハッチング線は決定される。Y座標
の最大値,あるいは最小値からハッチングピッチずつY
座標をずらしてハッチング線を長方形の内部に作成す
る。次にレベル1の輪郭線で閉じた領域の外側のハッチ
ング線は削除する。レベル1の輪郭線で閉じた領域の内
側は、その中にレベル2以降の輪郭線が存在しない場
合、処理12を終了し、レベル2以降の輪郭線が存在す
るとき、レベルの大きい方を優先として偶数レベルの輪
郭線で閉じた領域に含まれるハッチング線は削除し、奇
数レベルの輪郭線で閉じた領域に含まれるハッチング線
は残すという処理をする。具体的には、ハッチング線上
をX座標の小さい方から大きい方へたどっていき、レベ
ル1の輪郭線に当たったら、そこまでのハッチング線を
削除し、さらにたどってレベル1、あるいはレベル2に
当たったらハッチング線を2度目の交点で2分割し、交
点の左側の線を残す。さらに右側の線分をたどる。また
輪郭線に当たったらそこまでの線分を削除し、さらにた
どって輪郭線に当たったらそこまでを残し、さらにたど
る。これをハッチング線上のX座標が最大値になるまで
行う。X座標が最大値になった時点で、最後の線分も削
除する。このときただ一点での交差(接触)は交点とし
て扱わない。また輪郭線の線分がハッチング線に重複し
た場合も、交点はないものとする。計算機で実現するた
めには、1本のハッチング線とすべての輪郭線との交点
を計算する。このとき輪郭線との接触および重複は無視
する。求めた交点をX座標の小さい順に並び替えて配列
にする。配列の奇数番目を始点、偶数番目を終点とし、
1番目から順に線分を作成する事により、輪郭線を塗り
潰すためハッチング線ができる。これを各ハッチング線
に適用すればよい。
In the following, consideration will be made with reference to a rectangle for forming a hatching line in the 0-degree direction. Since the hatching line is parallel to the X axis, the hatching line is determined by the Y coordinate. Hatching pitch Y from maximum or minimum value of Y coordinate
Create hatched lines inside the rectangle by shifting the coordinates. Next, hatching lines outside the area closed by the level 1 contour are deleted. If there is no contour line after level 2 inside the area closed by the contour line of level 1, the processing 12 is terminated, and when there is a contour line of level 2 or later, the higher level is prioritized. , The hatching line included in the region closed by the even-numbered outline is deleted, and the hatching line included in the region closed by the odd-numbered outline is left. Specifically, the hatching line is traced from the smaller X coordinate to the larger one. When the contour line of level 1 is hit, the hatching line up to that point is deleted, and the hatching line is traced to level 1 or level 2. Then, the hatched line is divided into two at the second intersection, leaving a line on the left side of the intersection. Follow the line on the right. Further, when the object hits the contour, the line segment up to that point is deleted. This is performed until the X coordinate on the hatched line reaches the maximum value. When the X coordinate reaches the maximum value, the last line segment is also deleted. At this time, an intersection (contact) at only one point is not treated as an intersection. Also, when the line segment of the contour line overlaps the hatching line, there is no intersection. In order to realize this using a computer, the intersection between one hatched line and all contour lines is calculated. At this time, contact and overlap with the outline are ignored. The obtained intersections are rearranged in ascending order of the X coordinate to form an array. The odd-numbered array start point, the even-numbered array end point,
By creating line segments in order from the first, hatching lines are created to fill the contour lines. This may be applied to each hatched line.

【0049】次に90度方向のときの処理を説明する。
まず仮想長方形に含まれる輪郭線のすべてを、座標値
X,Y成分とも0である点、すなわち複数の多角形を含
むCADデータの原点を中心として90度回転してしま
う。このときの回転とは、数学でいう座標の回転と同じ
もので、反時計回りを正の方向とする回転の事である。
こうする事により、ハッチングの計算を0度方向のハッ
チング線を作成する処理と全く同じとできる。ハッチン
グ線を求めたら、各ハッチング線を原点を中心として−
90度回転することにより、90度方向のハッチング線
を得られる。
Next, processing in the 90-degree direction will be described.
First, all the contour lines included in the virtual rectangle are rotated 90 degrees around the point where the coordinate values X and Y components are both 0, that is, the origin of CAD data including a plurality of polygons. The rotation at this time is the same as the rotation of the coordinates in mathematics, and is a rotation with the counterclockwise direction being a positive direction.
By doing so, Ru can be the calculation of hatching the process of creating a hatch line of 0 degrees direction exactly the same. After finding the hatching lines, set each hatching line around the origin-
By rotating by 90 degrees, a hatching line in the direction of 90 degrees can be obtained.

【0050】以上0度,90度のハッチング線作成につ
いて説明したが、0度を基準とすれば任意の方向(角
度)のハッチング線も作成できる。ます輪郭線のすべて
を回転し、その後仮想長方形を計算し、その長方形の内
側に仮のハッチング線を作成し、0度の時と同様の処理
をすればよい。その後、ハッチング線を逆回転して戻
す。90度のハッチング線作成のときの仮想長方形は、
回転前の輪郭線で計算したものを回転したものと、回転
後の輪郭線から計算したものが同じなので、2度計算す
る必要はないので、輪郭線と一緒に回転している。
Although the creation of hatching lines at 0 ° and 90 ° has been described above, hatching lines in any direction (angle) can be created based on 0 °. First, all the outlines are rotated, then a virtual rectangle is calculated, a temporary hatching line is created inside the rectangle, and the same processing as at 0 degrees may be performed. Thereafter, the hatching line is rotated back and returned. The virtual rectangle when creating a 90-degree hatch line is
Since the rotation calculated from the contour before rotation and the rotation calculated from the contour after rotation are the same, there is no need to calculate twice, so the rotation is performed together with the contour.

【0051】図12(a)には、仮想長方形66を示し
ている。図12(b)には、ハッチング線と輪郭線との
交点A,B,C,D,E,Fを示し、X座標の小さい方
から順番に奇数番目を始点、偶数番目を終点とする線分
が必要なハッチング線であることを示している。
FIG. 12A shows a virtual rectangle 66. FIG. 12B shows intersections A, B, C, D, E, and F of the hatching line and the contour line, and the lines having the odd-numbered start point and the even-numbered end point in ascending order of the X coordinate. This indicates that the minute is a required hatching line.

【0052】ハッチング線作成処理で多角形の塗り潰し
は終了する。
In the hatching line creation processing, the polygon filling is completed.

【0053】[0053]

【発明の効果】以上、説明した様に、本発明は図面の塗
り潰し方法において、複数の輪郭線を持つ多角形の輪郭
線に順位付けを行い、それぞれの干渉(交差)を判断す
る事により、複数の輪郭線を持つ形状の複雑な多角形を
塗り潰す事が出来る。
As described above, according to the present invention, in the method of filling a drawing, a polygonal contour having a plurality of contours is ranked and each interference (intersection) is determined. Complex polygons with multiple outlines can be filled.

【0054】また、最小の径のアパーチャ(またはペ
ン)から使用する事により、精度以下の多角形を最短の
処理で見つけて削除できるので、CADなどの計算機
よる処理時間を短縮できる。
Also, by using an aperture (or pen) with the smallest diameter, a polygon having a precision or less can be found and deleted by the shortest processing, thereby shortening the processing time by a computer such as a CAD. it can.

【0055】また、アパーチャ(またはペン)を2倍に
して、ハッチング線に使うためのアパーチャ(またはペ
ン)を大きくする事により、データ量および塗り潰し線
の総延長を短縮できる。2倍にした時に、重ねて塗り潰
される部分を前のオフセット線から削除する事でさらに
塗り潰し線の総延長を短縮できる効果がある。
Further, by doubling the aperture (or pen) and increasing the aperture (or pen) used for the hatching line, the data amount and the total length of the solid line can be reduced. When the area is doubled, by removing the overlapped portion from the previous offset line, there is an effect that the total extension of the filled line can be further reduced.

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

【図1】本発明のフローチャート。FIG. 1 is a flowchart of the present invention.

【図2】従来例のフローチャート。FIG. 2 is a flowchart of a conventional example.

【図3】従来のオフセット線作成イメージ図。FIG. 3 is a conceptual diagram of a conventional offset line creation.

【図4】ハッチングが2回必要になる従来例の図。FIG. 4 is a diagram of a conventional example in which hatching is required twice.

【図5】本発明のオフセット線作成イメージ図。FIG. 5 is an image diagram of creating an offset line according to the present invention.

【図6】オフセット線が交点を持たない時、円弧でつな
ぐイメージ図。
FIG. 6 is an image diagram showing a case where offset lines have no intersection and are connected by an arc.

【図7】(a)(b)(c)とも輪郭線に円弧がある場
合。
7 (a), (b) and (c) show a case where the contour has an arc.

【図8】(a)はレベル1のオフセット線の自己交差に
よる有効範囲判別の図。(b)はレベル2のオフセット
線の干渉(交差)点による有効範囲判別の図。
FIG. 8A is a diagram illustrating an effective range determination based on a self-intersection of a level 1 offset line. FIG. 6B is a diagram of the effective range determination based on the interference (intersection) point of the level 2 offset line.

【図9】レベル1とレベル2のオフセット線の干渉(交
差)点による有効範囲判別の図。
FIG. 9 is a diagram illustrating an effective range determination based on an interference (intersection) point between offset lines of level 1 and level 2;

【図10】アパーチャ(またはペン)を2倍よりも大き
くした時困る図。
FIG. 10 is a diagram showing a problem when the aperture (or pen) is made larger than twice.

【図11】(a)(b)(c)(d)の一連でオフセッ
ト線の重複部分削除法の図。
FIG. 11 is a diagram showing a method of removing overlapping portions of offset lines in a series of (a), (b), (c), and (d).

【図12】(a)ハッチング作成図の仮想長方形の図。 (b)ハッチング線分の図。FIG. 12A is a diagram of a virtual rectangle in a hatching creation diagram. (B) A diagram of a hatched line segment.

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

1 データ入力部 2 輪郭線抽出処理 3 順位付け処理 4 オフセット線作成処理 5 輪郭線の更新処理 6 判断(1回目の処理か) 7 オフセット量変更処理 8 重複線分削除処理 9 判断(完了したか) 10 判断(規定回数の処理をしたか) 11 オフセット量変更処理 12 ハッチング処理 13 データ入力部 14 データ抽出処理 15 オフセット線作成処理 16 有効範囲判別処理 17 判断(ハッチングしたか) 18 ハッチング処理 19 判断(アパーチャがあるか) 20 アパーチャを小さくする処理 21 外形線 22 オフセットした線 23 オフセット線 24 ループの方向 25 自己交差点 26 自己交差点 27 オフセット線(1回目) 28 オフセット線(2回目) 29 アパーチャイメージ(2回目) 30 アパーチャイメージ(1回目) 31 ハッチングが必要な部分 32 レベル1の輪郭線 33 レベル2の輪郭線 34 レベル1のオフセット線 35 レベル2のオフセット線 36 レベル1の輪郭線分 37 レベル1の輪郭線分 38 レベル1の輪郭線分 39 オフセットした線分の交点 40 補間円弧 41 輪郭の円弧部分 42 円弧の中心 43 オフセット線分の円弧 44 仮円弧を含むオフセット線 45 オフセットした線の自己交差点 46 オフセットした線の自己交差点 47 オフセット線有効ループ 48 オフセット線有効ループ 49 レベル1の輪郭線 50 レベル2の輪郭線 51 レベル2のオフセット線の交差点 52 レベル2のオフセット線の交差点 53 オフセット線(閉ループ) 54 オフセット線(閉ループ) 55 レベル1のオフセット線 56 レベル2のオフセット線 57 オフセット有効範囲 58 アパーチャ 59 アパーチャ58で塗れない領域 60 レベル1のオフセット線 61 レベル2のオフセット線 62 オフセット線有効範囲(2回目) 63 逆オフセット線 64 レベル1の輪郭線 65 レベル2の輪郭線 66 仮想長方形 1 Data input unit 2 Contour extraction processing 3 Ranking processing 4 Offset line creation processing 5 Contour update processing 6 Judgment (1st processing) 7 Offset amount change processing 8 Duplicate line deletion processing 9 Judgment (completed) 10 Judgment (whether the processing has been performed the specified number of times) 11 Offset amount change processing 12 Hatch processing 13 Data input unit 14 Data extraction processing 15 Offset line creation processing 16 Effective range determination processing 17 Judgment (whether hatching) 18 Hatching processing 19 Judgment (Aperture is present) 20 Processing to reduce aperture 21 Outline line 22 Offset line 23 Offset line 24 Loop direction 25 Self-intersection 26 Self-intersection 27 Offset line (first time) 28 Offset line (second time) 29 Aperture image ( Second time) 30 aperture images ( 32) Level 1 contour line 33 Level 2 contour line 34 Level 1 offset line 35 Level 2 offset line 36 Level 1 contour line 37 Level 1 contour line 38 Level 1 contour Contour line 39 Intersection point of offset line 40 Interpolated arc 41 Arc part of contour 42 Center of arc 43 Arc line of offset line 44 Offset line including temporary arc 45 Self-intersection point of offset line 46 Self-intersection point of offset line 47 Offset line effective loop 48 Offset line effective loop 49 Level 1 outline 50 Level 2 outline 51 Intersection of level 2 offset line 52 Intersection of level 2 offset line 53 Offset line (closed loop) 54 Offset line (closed loop) 55 Level 1 offset line 56 levels Offset line 57 offset effective range 58 aperture 59 area that cannot be painted with aperture 58 60 level 1 offset line 61 level 2 offset line 62 offset line effective range (second time) 63 reverse offset line 64 level 1 contour 65 level 2 Outline 66 virtual rectangle

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 CADにより作成された図形データを計
算機の記憶手段に読み込み、計算処理により、 (1)該記憶手段が記憶する図形データのうちから多角
形の輪郭線データを抽出し記憶手段に記憶するステップ
と、 (2)その輪郭線データの中において、1つの多角形に
属する輪郭線データが複数存在する時に、複数の輪郭線
構成する要素の絶対座標値のX方向成分の最大値,最
小値とY方向成分の最大値,最小値を各輪郭線ごとに計
算し、該絶対座標値の成分の最大値及び最小値の大小関
係を計算する事で包含関係を計算し、輪郭線データの包
含関係の順位を表わすレベル値を計算し該レベル値を輪
郭線データに加え記憶手段に記憶するステップと、 (3)レベル値を記憶した輪郭線データとある一定の距
離を保つ線データ(以下オフセット線データと呼ぶ)を
作成する方向(以下オフセット方向と呼ぶ)を輪郭線で
閉じた領域の内側か外側を計算し記憶手段に記憶する
テップと、 (4)輪郭線データにオフセット方向最小のオフセッ
ト量を加えたオフセット線データを計算し記憶手段に記
するステップと、 (5)作成したオフセット線データの有効範囲をオフセ
ット線データの自己交差及び他のオフセット線データ
の交差、重複の条件により計算し、オフセット線データ
の有効部分で形成された閉ループデータをオフセット線
データより抽出し記憶手段に記憶するステップと、 (6)前記(5)で計算した閉ループデータを新たな輪
郭線データとして、多角形の最初の輪郭線データを基準
とするオフセット量を1回前のオフセット量の2倍以下
として、前記(2)、(3)、(4)、(5)のステッ
プを行うステップと、 (7)前記(6)のステップの後、(6)のステップで
行ったオフセット方向と逆方向に、オフセット量を
(6)のステップのオフセット量と1回前のオフセット
量の絶対値の差として、オフセット線データを作成し
憶手段に記憶し、1回前の輪郭線データと比較する事に
より、重複した部分のデータを1回前の輪郭線データ
ら削除し記憶し、多角形の塗り潰しに必要な輪郭線デー
を少なくするステップと、 (8)前記(6)、(7)のステップを任意の回数繰り
返し、最新の輪郭線データで閉じられた領域に、ハッチ
ング線データを作成するステップとを有することを特徴
とする図面の塗り潰し方法。
1. A read into the storage means of the computer graphics data created by CAD, the computer process, (1) the storage means extracting storage means a polygonal contour line data from among the graphic data stored in the maximum and storing, (2) in its contour data, when the contour line data belonging to one polygon there are a plurality of X-direction component of the absolute coordinate values of the elements constituting the plurality of contour lines Value, maximum
The small value and the maximum and minimum values of the Y-direction component are calculated for each contour line.
The maximum and minimum values of the components of the absolute coordinate value.
By calculating the relation, the inclusion relation is calculated, and the envelope data
Calculate the level value representing the order of the implicit relationship, and link the level value
And storing in the storage means in addition to Guo line data, (3) level value (hereinafter referred to as the offset line data) line data to keep the contour line data phrase certain distance which stores the offset direction direction (hereinafter to create a (4) calculating the inside or outside of the area closed by the contour line and storing it in the storage means ; and (4) offset line data obtained by adding the minimum offset amount in the offset direction to the contour line data. Calculate and write to storage
A step of 憶, (5) the effective range of the offset line data created intersection of the self-intersection and other offset line data of the offset line data, calculated by the conditions of the overlap, the effective portion of the offset line data <br/> The closed loop data formed by
And storing the extracted storage means from the data, (6) the (5) a closed loop data as new contour data calculated by the offset amount relative to the first contour line data of the polygon first previous as two times the offset amount, the (2), (3), (4), and performing the step of (5), after step (7) above (6), in step (6) In the direction opposite to the offset direction, offset line data is created and recorded using the offset amount as the difference between the offset amount in the step (6) and the absolute value of the offset amount one time before.
By storing the data in the storage unit and comparing it with the previous contour data , the data of the overlapping portion is deleted from the previous contour data and stored , and the data necessary for filling the polygon is stored. Contour line day
A step of reducing the motor, (8) the (6), number of repetitions steps of any (7), in the area closed by the latest outline data, that a step of creating a hatching data Characteristic drawing method.
JP5336295A 1993-12-28 1993-12-28 How to fill the drawing Expired - Fee Related JP2870397B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5336295A JP2870397B2 (en) 1993-12-28 1993-12-28 How to fill the drawing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5336295A JP2870397B2 (en) 1993-12-28 1993-12-28 How to fill the drawing

Publications (2)

Publication Number Publication Date
JPH07200664A JPH07200664A (en) 1995-08-04
JP2870397B2 true JP2870397B2 (en) 1999-03-17

Family

ID=18297633

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5336295A Expired - Fee Related JP2870397B2 (en) 1993-12-28 1993-12-28 How to fill the drawing

Country Status (1)

Country Link
JP (1) JP2870397B2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4760261B2 (en) * 2005-09-26 2011-08-31 日産自動車株式会社 Sectional shape data creation method
CN105652799B (en) * 2014-12-05 2018-03-06 广西大学 Ring cutting orbit generation method based on side pair-wise offset
JP2018024155A (en) 2016-08-09 2018-02-15 ブラザー工業株式会社 Plotter, plotter program, and pen attachable to plotter
JP2018023922A (en) * 2016-08-09 2018-02-15 ブラザー工業株式会社 Plotter and plotter program
CN109887052B (en) * 2019-01-29 2023-08-25 广联达科技股份有限公司 Two-dimensional polygon offset method

Also Published As

Publication number Publication date
JPH07200664A (en) 1995-08-04

Similar Documents

Publication Publication Date Title
JPS6074003A (en) Shape creating device
JPH0251786A (en) Scan converting system
JPH03667B2 (en)
JP2870397B2 (en) How to fill the drawing
CN117332749A (en) Layout detection method, electronic equipment and storage medium
EP0344686A2 (en) Clipping process and processor
JP3332476B2 (en) Graphic correction method and information processing apparatus for implementing the method
JPH0336668A (en) Shape generating system for cad system
JP2634851B2 (en) Image processing device
JPH04362793A (en) Drawing method in raster device
JP3333578B2 (en) Area calculator
JP2571662B2 (en) Line drawing method and apparatus
US6957176B2 (en) Reduction processing method and computer readable storage medium having program stored thereon for causing computer to execute the method
JP3109585B2 (en) Method and apparatus for generating three-dimensional object data, and recording medium storing program for generating three-dimensional object data
JP3305395B2 (en) Figure division device
JP2613653B2 (en) Image processing device
JPH056439A (en) Vector data/image data conversion system
JP3536894B2 (en) Graphic processing unit
JP3641856B2 (en) Method for generating fillet surface
JP3047851B2 (en) Apparatus and method for displaying dimension values of figures
JPH0350686A (en) Graphic processing system
JPH0414190A (en) Painting-out circuit
JP2965021B2 (en) Coating processing method, coating processing method, and recording medium storing coating processing program
JPS61138375A (en) Pattern information processing device
JPH05174113A (en) Automatic mesh division system suitable for axial symmetric rotary structure

Legal Events

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