JP2003288606A - Boundary discrimination device and program therefor - Google Patents

Boundary discrimination device and program therefor

Info

Publication number
JP2003288606A
JP2003288606A JP2002092985A JP2002092985A JP2003288606A JP 2003288606 A JP2003288606 A JP 2003288606A JP 2002092985 A JP2002092985 A JP 2002092985A JP 2002092985 A JP2002092985 A JP 2002092985A JP 2003288606 A JP2003288606 A JP 2003288606A
Authority
JP
Japan
Prior art keywords
line
area
line segment
intersection
region
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.)
Pending
Application number
JP2002092985A
Other languages
Japanese (ja)
Inventor
Yukio Tomobuchi
行雄 友渕
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.)
JEKKU KK
JECC Co Ltd
Original Assignee
JEKKU KK
JECC 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 JEKKU KK, JECC Co Ltd filed Critical JEKKU KK
Priority to JP2002092985A priority Critical patent/JP2003288606A/en
Publication of JP2003288606A publication Critical patent/JP2003288606A/en
Pending legal-status Critical Current

Links

Abstract

<P>PROBLEM TO BE SOLVED: To provide a boundary discrimination system which can quickly, securely and easily judge the inside and outside areas of a line passing through a closed region. <P>SOLUTION: The present invention performs discrimination of area whether a line Ai passing through a closed region R which comprises a plurality of boundary lines Bj is inside or outside the closed region. Intersection and intersection points of the line Ai and each boundary line Bj are determined, and if the line Ai crosses an intermediate point of the boundary lines B1 and B4, the intermediate point is determined as true intersection points 1 and 2 as shown in [2] (c). If the line Ai crosses only the ends of the boundary lines B1 and B7 and the boundary lines B1 and B7 are located at the right side of the line Ai, the each of the edges is determined as the true intersection points 1 and 2 as shown in [1]. The true intersection points are then sorted in the increasing order of distance from the line Ai. Based on the sorted data string of true intersection points, the boundary discrimination to judge inside and outside is performed. <P>COPYRIGHT: (C)2004,JPO

Description

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

【0001】[0001]

【発明の属する技術分野】この発明は、閉領域を通る線
分について領域内及び領域外の部分を判別する領域判別
システムに関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an area discriminating system for discriminating a portion inside a region and a portion outside a region of a line segment passing through a closed region.

【0002】[0002]

【従来の技術】図形データで表現される図面上の閉領域
内を所定の色や模様で塗り潰すことは「塗潰し」又は
「色塗り」と呼ばれており、図形処理において広く利用
されている。例えば、GIS(地理情報システム)など
においては、地質層から判断して地震災害時に液状化が
予測される地域を地質ボーリングなどで測定し、GIS
基図(現況地図)上に液状化予測地域を重ね合わせ、地
震強度(震度)などの条件に応じて、個々の家屋の倒
壊、半壊又は一部破損が起り得る範囲をシミュレーショ
ンすることがある。この場合、地図上において地物を表
わす所定の閉領域の内部に、家屋の被災度に対応する所
定の塗潰し(又は色塗り)処理を施すことにより、シミ
ュレーションされた状態を的確に把握することができ
る。
2. Description of the Related Art Filling a closed area on a drawing represented by graphic data with a predetermined color or pattern is called "painting" or "color painting" and is widely used in graphic processing. There is. For example, in GIS (geographical information system), the area where liquefaction is predicted at the time of an earthquake disaster is measured by geological boring etc.
A liquefaction prediction area may be overlaid on the base map (current situation map), and the range in which individual houses may be collapsed, partially destroyed, or partially damaged may be simulated depending on conditions such as earthquake intensity (seismic intensity). In this case, the simulated state can be accurately grasped by applying a predetermined painting (or coloring) process corresponding to the degree of damage to the house inside a predetermined closed area that represents a feature on the map. You can

【0003】塗潰し(又は色塗り)処理においては、目
的とする閉領域を通過する走査線又は作図線などの線分
について、領域内部分であるか領域外部分であるかを判
別する必要がある。そこで、線分が、閉領域を構成する
領域線と交差するたびに“領域外”→“領域内”→“領
域外”→“領域内”→…というように交互に切り替わる
法則を利用することにより、当該閉領域の内側部分にあ
るか外側部分にあるかを判別することができる。
In the painting (or coloring) processing, it is necessary to determine whether a line segment such as a scanning line or a drawing line that passes through a target closed region is inside or outside the region. is there. Therefore, use the rule that each time a line segment crosses a region line that constitutes a closed region, it alternates such as “outside region” → “inside region” → “outside region” → “inside region” → ... Thus, it is possible to determine whether it is inside or outside the closed area.

【0004】この判別方法では、塗り潰したい閉領域の
形状が単純な地物であり、線分が領域線の中間を横切る
場合には、誤りなく領域内外の判定ができる。しかしな
がら、数多くの凹凸形状を有する地物などでは、線分が
閉領域(即ち、領域線で形成される多角形)の頂点上を
通過したり、領域線の接点を通過したり、領域線上に重
なって通過するなどの事態が多々生じることがあり、領
域内外の判定を間違えたり、領域内外の判定ができない
ことがある。
According to this discrimination method, when the shape of the closed region to be filled is a simple feature and the line segment crosses the middle of the region line, the inside / outside region can be discriminated without error. However, in the case of many features with uneven shapes, line segments pass over the vertices of a closed region (that is, the polygon formed by the region lines), pass through the contact points of the region lines, or over the region lines. There are many cases in which the vehicles pass over each other, and there are cases where the inside / outside area is erroneously determined or the inside / outside area cannot be determined.

【0005】[0005]

【発明が解決しようとする課題】この発明は、このよう
な事情に鑑み、閉領域を通過する線分の領域内部分及び
領域外部分を、簡単且つ確実に、短時間で判別すること
ができる領域判別システムを提供することを目的とす
る。
SUMMARY OF THE INVENTION In view of such circumstances, the present invention is capable of easily and reliably determining the area inside and outside the line segment passing through the closed area in a short time. An object is to provide a region discrimination system.

【0006】[0006]

【課題を解決するための手段】この発明の主たる特徴に
従うと、複数の領域線(Bj)により構成される閉領域
(R)を通る線分(Ai)に対して該閉領域(R)の内
部であるか外部であるかの領域判別を行う領域判別装置
であって、線分(Ai)が領域線(Bj)の中間点で交
差していることを検出して、当該中間点を交点(“真の
交点”)に決定する手段(F1,F2;S2〜S4)
と、線分(Ai)が領域線(Bj)の端点で交差し且つ
当該領域線(Bj)が線分(Ai)の右側又は左側に偏
在していることを検出して、当該端点を交点(“真の交
点”)に決定する手段(F1,F2;S2〜S4)と、
決定された交点(“真の交点”)を線分(Ai)の始点
から近い順にソートして、交点列(“真の交点”列)を
生成する手段(F3)と、生成された交点列(“真の交
点”列)に基づいて、順次、閉領域(R)の内部である
旨と閉領域(R)の外部である旨との領域判定を交互に
出力する手段(F4)とを具備する領域判別装置(請求
項1)が提供される。なお、括弧書きは対応する実施例
の記号等を示し、以下においても同様である。
According to the main feature of the present invention, a line segment (Ai) passing through a closed region (R) constituted by a plurality of region lines (Bj) is defined by the closed region (R). An area discriminating device for discriminating whether the area is inside or outside, detecting that a line segment (Ai) intersects at an intermediate point of an area line (Bj), and setting the intermediate point as an intersection point. Means (F1, F2; S2-S4) to determine ("true intersection")
And that the line segment (Ai) intersects at the end point of the area line (Bj) and the area line (Bj) is unevenly distributed on the right side or left side of the line segment (Ai), the end point is intersected. Means (F1, F2; S2-S4) for determining ("true intersection"),
Means (F3) for sorting the determined intersections ("true intersections") in order from the starting point of the line segment (Ai) to generate an intersection row ("true intersection" row), and the generated intersection row Based on (the "true intersection" column), means (F4) for alternately outputting the region determinations that the inside of the closed region (R) and the outside of the closed region (R) are sequentially output. An area discriminating apparatus (claim 1) is provided. Note that parentheses indicate symbols and the like of the corresponding examples, and the same applies below.

【0007】また、この特徴に従い、複数の領域線(B
j)により構成される閉領域(R)を通る線分(Ai)
に対して該閉領域(R)の内部であるか外部であるかの
領域判別を行う図形情報処理装置(PC)に対して、線
分(Ai)が領域線(Bj)の中間点で交差しているこ
とを検出して、当該中間点を交点(“真の交点”)に決
定するステップ(F1,F2;S2〜S4)と、線分
(Ai)が領域線(Bj)の端点で交差し且つ当該領域
線(Bj)が線分(Ai)の右側又は左側に偏在してい
ることを検出して、当該端点を交点(“真の交点”)に
決定するステップ(F1,F2;S2〜S4)と、決定
された交点を線分(Ai)の始点から近い順にソートし
て、交点列(“真の交点”列)を生成するステップ(F
3)と、生成された交点列(“真の交点”列)に基づい
て、順次、閉領域(R)の内部である旨と閉領域(R)
の外部である旨との領域判定を交互に出力するステップ
(F4)とから成る手順を実行させるための領域判別プ
ログラム(請求項2)が提供される。
Further, according to this feature, a plurality of area lines (B
line segment (Ai) passing through the closed region (R) composed of j)
, The line segment (Ai) intersects the graphic information processing device (PC) that determines whether it is inside or outside the closed region (R) at the midpoint of the region line (Bj). That the line segment (Ai) is the end point of the area line (Bj), and the step (F1, F2; S2-S4) of determining that the intermediate point is the intersection ("true intersection"). A step (F1, F2;) of detecting the intersection and the area line (Bj) being unevenly distributed on the right side or the left side of the line segment (Ai) and determining the end point as an intersection point (“true intersection point”). S2 to S4) and the determined intersections are sorted in ascending order from the starting point of the line segment (Ai) to generate an intersection row (a "true intersection" row) (F
3) and the generated intersection line (“true intersection” line), the fact that the inside of the closed region (R) and the closed region (R) are sequentially
An area discriminating program (claim 2) for executing a procedure comprising the step (F4) of alternately outputting the area discriminant indicating that the area is outside.

【0008】〔発明の作用〕この発明では、複数の領域
線(Bj)により構成される閉領域(R)を通る線分
(Ai)に対して閉領域(R)の内部であるか外部であ
るかの領域判別を行うに際し、まず、線分(Ai)と各
領域線(Bj)との交差及び交点を判定する。ここで、
線分(Ai)が領域線(Bj)の中間点で交差している
(図5〔1a〕)ことを検出したときは、当該中間点を
交点(“真の交点”)に決定すると共に(F1,F2;
S2〜S4)、線分(Ai)が領域線(Bj)の端点で
交差し且つ当該領域線(Bj)が線分(Ai)の右側又
は左側に偏在している(図5〔1b〕又は図5〔1
c〕)ことを検出したときには、当該端点を交点(“真
の交点”)に決定する(F1,F2;S2〜S4)。次
に、決定された交点(“真の交点”)を線分(Ai)の
始点から近い順にソートし、ソートされた交点列(“真
の交点”列)を生成する(F3)。そして、生成された
交点列(“真の交点”列)に基づいて、順次、閉領域
(R)の内部である旨と閉領域(R)の外部である旨と
の領域判定を交互に出力する(F4;図8)。
[Operation of the Invention] According to the present invention, the line segment (Ai) passing through the closed region (R) constituted by a plurality of region lines (Bj) is inside or outside the closed region (R). When determining whether there is an area, first, the intersections and intersections of the line segment (Ai) and each area line (Bj) are determined. here,
When it is detected that the line segment (Ai) intersects at the midpoint of the area line (Bj) (FIG. 5 [1a]), the midpoint is determined to be the intersection ("true intersection") and ( F1, F2;
S2 to S4), the line segment (Ai) intersects at the end point of the region line (Bj), and the region line (Bj) is unevenly distributed on the right side or the left side of the line segment (Ai) (FIG. 5 [1b] or 5 [1
c]) is detected, the corresponding end point is determined as an intersection (“true intersection”) (F1, F2; S2 to S4). Next, the determined intersections (“true intersections”) are sorted in ascending order from the starting point of the line segment (Ai), and a sorted intersection row (“true intersection” row) is generated (F3). Then, based on the generated intersection line (“true intersection” line), region determinations of the inside of the closed region (R) and the outside of the closed region (R) are alternately output alternately. (F4; FIG. 8).

【0009】従って、この発明によると、閉領域(R)
の頂点上を通過したり〔図8〔2〕(a)〕、領域線の
接点(Bj)を通過したり〔図8〔2〕(b),
(c)〕、線分(Ai)が領域線(Bj)上に重なって
通過する〔図8〔1〕〕などのことがあっても、領域内
外の判定を間違えたり、領域内外の判定ができないとい
うことがなく、簡単に、誤りなく確実に領域内外の判別
を行うことができる。
Therefore, according to the present invention, the closed region (R)
8 [2] (a)], passing through the contact point (Bj) of the area line [FIG. 8 [2] (b),
(C)], the line segment (Ai) passes over the area line (Bj) in an overlapping manner [FIG. 8 [1]], etc. It is possible to easily and reliably determine the inside / outside of the area without making a mistake.

【0010】[0010]

【発明の実施の形態】以下、図面を参照しつつ、この発
明の好適な実施例を詳述する。なお、以下の実施例は単
なる一例であって、この発明の精神を逸脱しない範囲で
種々の構成変更が可能である。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS Preferred embodiments of the present invention will be described in detail below with reference to the drawings. The following embodiments are merely examples, and various modifications can be made without departing from the spirit of the present invention.

【0011】図1は、この発明の一実施例による領域判
別機能を有する図形情報処理システムのハードウエア構
成例を極く概略的に示すブロック図である。この例で
は、図形情報処理システムの制御部としてパーソナルコ
ンピュータ(PC)が用いられ、PCに領域判別機能を
もたせる。PCは、中央処理装置(CPU)1の外に、
読出専用メモリ(ROM)や、ランダムアクセスメモリ
(RAM)、ハードディスク(HD)などの記憶装置
2、キーボードやマウス等の入力操作子を含む入力装置
3、CRTやLCDなどのディスプレイを含む表示装置
4などが、バス5を介して互いに接続されている。
FIG. 1 is a block diagram schematically showing a hardware configuration example of a graphic information processing system having a region discriminating function according to an embodiment of the present invention. In this example, a personal computer (PC) is used as a control unit of the graphic information processing system, and the PC has an area discrimination function. In addition to the central processing unit (CPU) 1, the PC is
A read-only memory (ROM), a random access memory (RAM), a storage device 2 such as a hard disk (HD), an input device 3 including input operators such as a keyboard and a mouse, and a display device 4 including a display such as a CRT or LCD. Are connected to each other via a bus 5.

【0012】システム全体を制御するCPU1は、所定
のプログラムに従って種々の制御を行い、システムに搭
載した図形処理やその他各種のソフトウエアプログラム
によって、図形処理だけでなく、文章や、表、図面など
のデータの取込み、作成、編集などのための各種処理を
行う。CPU1により、特に、領域判別アルゴリズムを
含む塗潰し処理プログラムに従って、領域判別を行い、
対応する塗潰し処理を実行することができる。
The CPU 1 for controlling the entire system performs various controls according to a predetermined program, and executes not only graphic processing but also text, tables, drawings, etc. by graphic processing and various other software programs installed in the system. Performs various processes such as data acquisition, creation, and editing. In particular, the CPU 1 discriminates an area in accordance with a paint processing program including an area discrimination algorithm,
A corresponding fill process can be performed.

【0013】記憶装置2は、読出専用メモリ(RO
M)、ランダムアクセスメモリ(RAM)及び外部記憶
装置が含まれる。ROMには、基本プログラムや、上述
した種々の処理を実行するための各種応用プログラム、
各種固定データ/パラメータが記録される。RAMは、
現在作業中の各種データ/パラメータ等を一時記憶する
バッファなどに用いられ、例えば、“真の交点”リスト
バッファが設けられる。
The storage device 2 is a read-only memory (RO
M), random access memory (RAM) and external storage. The ROM includes a basic program, various application programs for executing the various processes described above,
Various fixed data / parameters are recorded. RAM is
It is used as a buffer or the like for temporarily storing various data / parameters etc. currently being worked, and for example, a "true intersection" list buffer is provided.

【0014】外部記憶装置は、ハードディスク(HD)
や、フレキシブルディスク(FD)やコンパクトディス
クROM(CD−ROM)等の他の可搬性記録媒体を含
み、HDには、ROMと同様に各種応用プログラムを記
憶したり、上述した種々の処理に伴う各種データ、例え
ば、領域判定される各種図形データを、記憶することが
できる。また、可搬性記録媒体も、種々の応用プログラ
ムや各種データを記憶したり或いは取り出したりするこ
とができる。
The external storage device is a hard disk (HD).
Also, other portable recording media such as a flexible disk (FD) and a compact disk ROM (CD-ROM) are included, and the HD stores various application programs like the ROM and is associated with the above-described various processes. Various data, for example, various graphic data for area determination can be stored. The portable recording medium can also store or retrieve various application programs and various data.

【0015】入力装置3はキーボードやポインティング
デバイス(マウス等)などの入力操作子を含み、表示装
置4はCRTやLCDなどのディスプレイを含む。ユー
ザ(オペレータ)は、ディスプレイ(4)に表示される
各種画面を視認しつつ、入力操作子(3)による所定の
キー操作或いは画面上の操作ボタン操作などによって、
領域判別処理を含む各種処理における各種ユーザインタ
ーフェース機能を遂行することができる。また、ディス
プレイ(4)には、領域判別結果に基づいて閉図形に塗
潰し処理された図面などを表示することができる。
The input device 3 includes input operators such as a keyboard and a pointing device (mouse), and the display device 4 includes a display such as a CRT or LCD. The user (operator) visually recognizes various screens displayed on the display (4) and operates a predetermined key with the input operator (3) or operates an operation button on the screen.
It is possible to perform various user interface functions in various processes including the region determination process. Further, the display (4) can display a drawing or the like that has been filled in with a closed figure based on the area discrimination result.

【0016】PCのバス5には、インターフェース(I
/F)6を介して、イメージスキャナー7、レーザープ
リンタ8、プロッタ(ラスタプロッタやペンプロッタ)
9などの入出力装置が接続され、スキャナー7により各
種図面から画像データを取り込むことができる。プリン
タ8又はプロッタ9は、領域判別結果に基づいて閉図形
に塗潰し処理された図面などを紙出力することができ
る。
An interface (I
/ F) 6, image scanner 7, laser printer 8, plotter (raster plotter or pen plotter)
An input / output device such as 9 is connected, and the scanner 7 can capture image data from various drawings. The printer 8 or the plotter 9 can output on paper the drawing or the like that has been filled in with the closed figure based on the area determination result.

【0017】〔塗潰し処理の概要〕図2は、この発明の
一実施例による塗潰し処理の手順の概要を表わす概略的
機能ブロック図を示し、図3は、この発明の一実施例に
よる領域判別に用いられる内外判定の原則を説明するた
めの図である。この発明の一実施例による塗潰し処理
は、交差判定ブロック(モジュール)F1、交点判定ブ
ロック(モジュール)F2、交点ソートブロック(モジ
ュール)F3、領域判定ブロック(モジュール)F4及
び塗潰し描画ブロック(モジュール)F5を経て、実行
される。
[Outline of Painting Process] FIG. 2 is a schematic functional block diagram showing an outline of the procedure of the painting process according to an embodiment of the present invention, and FIG. 3 is a region according to the embodiment of the present invention. It is a figure for demonstrating the principle of inside / outside determination used for determination. The filling process according to the embodiment of the present invention is performed by an intersection determination block (module) F1, an intersection determination block (module) F2, an intersection sorting block (module) F3, an area determination block (module) F4, and a filled drawing block (module). ) Performed via F5.

【0018】まず、交差判定ブロックF1では、表示装
置4や、プリンタ8、プロッタ9などの出力装置におい
て描画出力されるべき図形データから、塗潰し対象とな
る閉領域(閉図形)Rを指示し、当該閉領域(閉図形)
Rを構成する領域線Bj(当該閉図形がn角形の場合:
j=1,2,3,…,n。)を取り出し、出力装置4,
8,9での表示や印刷のために用いられる走査線又は作
画線を表わす各線分Ai(i=1,2,3,…)が各領
域線Bjと交差するか否かを判定し、交点を算出する。
ここで、線分Aiと領域線Bjとが、図3の黒丸で示さ
れるように、一点で重なるとき、“交差”すると判定さ
れ、この重なり点(共有点)を交点Cとする。
First, in the intersection determination block F1, a closed area (closed figure) R to be painted is designated from the figure data to be drawn and output by the display device 4, the output device such as the printer 8 and the plotter 9. , The closed area (closed figure)
Area line Bj forming R (when the closed figure is an n-sided polygon:
j = 1, 2, 3, ..., N. ) Is taken out and output device 4,
It is determined whether or not each line segment Ai (i = 1, 2, 3, ...) Representing a scanning line or a drawing line used for display and printing at 8 and 9 intersects each area line Bj, and the intersection point To calculate.
Here, when the line segment Ai and the area line Bj overlap at a single point, as shown by the black circle in FIG. 3, it is determined to "intersect", and this overlapping point (shared point) is taken as the intersection point C.

【0019】次の交点判定ブロックF2では、求められ
た各交点Cについて“真の交点”を決定する。ここで、
“真の交点”とは、当該閉領域Rの内部であるか外部で
あるかの判定に用いられる交点をいう。次いで、交点ソ
ートブロックF3にて、“真の交点”に決定された交点
Cを、各線分Aiごとに、当該線分Aiの始点に近い順
にソートする。つまり、線分Aiを、第1線分A1、第
2線分A2、…、最終線分Anの順に、終始点を合わせ
て一列に並べ、“真の交点”を第1線分A1の始点から
の距離が小さい順に並べ替え、並べ替え(ソート)後の
“真の交点”列は(以下、単に「“真の交点”列」とい
う。)、RAM内の“真の交点”リストバッファに一時
的に格納される。このソートにおいて、同一距離の“真
の交点”が複数ある場合、同一距離の“真の交点”は、
同一順位であることが分かるように配置されればよく、
取出し順序について格別の考慮は不要である。
In the next intersection determination block F2, the "true intersection" is determined for each obtained intersection C. here,
The “true intersection” is an intersection used to determine whether the inside of the closed region R is inside or outside. Next, in the intersection point sorting block F3, the intersection points C determined to be "true intersection points" are sorted for each line segment Ai in the order close to the start point of the line segment Ai. That is, the line segments Ai are arranged in a line with the end and start points in the order of the first line segment A1, the second line segment A2, ..., And the final line segment An, and the “true intersection” is the start point of the first line segment A1. The "true intersection" column after sorting (sorting) in ascending order of distance from (hereinafter, simply referred to as "" true intersection "column") is stored in the "true intersection" list buffer in RAM. Stored temporarily. In this sort, if there are multiple "true intersections" at the same distance, the "true intersections" at the same distance are
It should be arranged so that it can be seen that they are in the same rank,
No special consideration is required regarding the extraction order.

【0020】続く内外判定ブロックF4では、図3に示
されるように、各線分Aiの座標点を当該線分Aiの始
点から進行させ、交点ソートブロックF3でソートされ
“真の交点”リストバッファに格納されている“真の交
点”列を参照して、例えば、当初は領域“外”とし、領
域線Bjとの交点に遭遇する毎に、順次、領域“内”→
領域“外”→領域“内”と判定して行く。つまり、線分
Aiの座標点の進行に伴い領域線Bjとの交点に遭遇す
る度に、遭遇回数が奇数であるか偶数であるかに応じ
て、当該座標点が領域Rの内部に入ったか外部に出たか
を決定する。そして、塗潰し描画ブロックF5におい
て、各線分Aiの始点から、領域判定ブロックF4での
領域“外”又は“内”の判定結果に応じて、非描画又は
塗潰し描画を行っていく。
In the inside / outside determination block F4, as shown in FIG. 3, the coordinate points of each line segment Ai are advanced from the starting point of the line segment Ai, and sorted in the intersection sorting block F3 to the "true intersection" list buffer. Referring to the stored “true intersection” column, for example, the area “outside” is initially set, and each time the intersection with the area line Bj is encountered, the area “inside” →
The area “outside” → the area “inside” is determined. That is, each time the intersection point with the area line Bj is encountered as the coordinate point of the line segment Ai progresses, whether the coordinate point is inside the area R depending on whether the encounter frequency is odd or even. Determine if you went out. Then, in the painted drawing block F5, non-drawing or painted drawing is performed from the start point of each line segment Ai according to the determination result of the area “outside” or “inside” in the area determination block F4.

【0021】〔領域判別の手順〕図4は、この発明の一
実施例による交差・交点判定の処理手順を表わすフロー
チャートを示す。この処理フローは、交差及び交点判定
ブロックF1,F2で実行される交差及び交点の判定処
理を1つの線分Aiと1つの閉領域Rについて示したも
のであり、実際には、塗潰し描画に用いられる全線分及
び塗潰し描画の対象となる全ての閉領域について実行さ
れる。
[Procedure for Area Discrimination] FIG. 4 is a flowchart showing a processing procedure for intersection / intersection determination according to an embodiment of the present invention. This processing flow shows the intersection and intersection determination processing executed in the intersection and intersection determination blocks F1 and F2 for one line segment Ai and one closed region R. It is executed for all the line segments used and all closed regions that are the targets of the filled drawing.

【0022】交差・交点判定処理フローの第1ステップ
S1では、内外判定を行いたい線分Aiと、閉領域Rを
構成する1つの線分Bj(j←“1”)を取り出す。つ
まり、閉領域Rの形状は、通常、n個の領域線B1〜B
nが結合したn角形(n≧3)で表現される(円弧など
の曲線は複数の微小直線で近似される)ので、これらの
領域線B1〜Bnのうち最初の1領域線Bj(j=1)
を、線分Aiとの交差判定(F1)の対象として取り出
す。
In the first step S1 of the intersection / intersection determination processing flow, a line segment Ai to be subjected to the inside / outside determination and one line segment Bj (j ← “1”) forming the closed region R are taken out. That is, the shape of the closed region R is usually n region lines B1 to B.
Since n is represented by an n-sided polygon (n ≧ 3) (a curved line such as a circular arc is approximated by a plurality of minute straight lines), the first one region line Bj (j = 1)
Is taken out as an object of the intersection determination (F1) with the line segment Ai.

【0023】次のステップS2では、線分Aiが線分B
jに交差しているかどうかを計算する。この場合、内外
判定したい線分Aiと、領域Rの任意の1つの境界線B
jとの関係は、図5に示す5つのケース〔1a〕〜〔2
b〕のうち、何れか一つになる。図5〔1a〕〜〔1
c〕は、線分Aiと1つの領域線Bjが1点のみで重な
る(線分Aiが領域線Bj上の1点のみを通過する)ケ
ースであり、これらのケースでは、両者Ai,Bjは
「“交差”している」と判定し、両者Ai,Bjが重な
っている1点を交点Cとする。
In the next step S2, the line segment Ai is changed to the line segment B.
Compute if j is crossed. In this case, the line segment Ai to be determined inside / outside and any one boundary line B of the region R
The relationship with j is five cases [1a] to [2] shown in FIG.
b]. 5 [1a] to [1
c] is a case where the line segment Ai and one area line Bj overlap at only one point (the line segment Ai passes only one point on the area line Bj). In these cases, both Ai and Bj are It is determined that "they intersect", and one point where the two Ai and Bj overlap each other is defined as an intersection C.

【0024】つまり、図5〔1a〕では、線分Ai上に
領域線Bjの中間点が交点Cとして存在し、領域線Bj
が線分Aiの左右に偏らずに交差している。これに対し
て、図5〔1b〕,〔1c〕は、線分Ai上に領域線B
jの端点が交点Cとして存在し、図5〔1b〕では、領
域線Bjが線分Aiの右側に偏った状態で交差してお
り、また、図5〔1c〕では、領域線Bjが線分Aiの
左に偏った状態で交差している。
That is, in FIG. 5 [1a], the midpoint of the area line Bj exists on the line segment Ai as the intersection C, and the area line Bj
Intersect without being biased to the left and right of the line segment Ai. On the other hand, in FIG. 5 [1b] and [1c], the area line B is formed on the line segment Ai.
The end point of j exists as an intersection C, and in FIG. 5 [1b], the area line Bj intersects with being biased to the right of the line segment Ai, and in FIG. 5 [1c], the area line Bj is a line. It intersects in a state of being biased to the left of minute Ai.

【0025】一方、図5〔2a〕,〔2b〕のように、
線分Aiと1つの領域線Bjが1点のみで重ならないケ
ースについては、両者Ai,Bjは「交差しない=“非
交差”である」と判定する。つまり、図5〔2a〕で
は、領域線Bjが線分Aiとは離れて存在し、両者A
i,Bjは明らかに交差しない。また、図5〔2b〕で
は、領域線Bj全体が線分Aiに重なって存在し、計算
上、交点を求めることができないので、両者Ai,Bj
は“非交差”とみなされる。
On the other hand, as shown in FIGS. 5 [2a] and [2b],
In the case where the line segment Ai and one area line Bj do not overlap each other at only one point, it is determined that both Ai and Bj are “not crossing =“ non-crossing ””. That is, in FIG. 5 [2a], the area line Bj exists apart from the line segment Ai, and
i and Bj obviously do not intersect. Further, in FIG. 5 [2b], since the entire area line Bj overlaps with the line segment Ai, the intersection point cannot be calculated, so that both Ai and Bj
Is considered "non-crossing".

【0026】次のステップS3においては、ステップS
2での交差計算の結果に基づいて、線分Aiは線分Bj
に“交差”するか否かを判定する。ここで、線分Ai,
Bjの関係が図5〔1a〕〜〔1c〕に示される“交
差”判定基準パターンに該当しており“交差”すると判
定されたときは(S3→YES)、ステップS4に進ん
で、さらに、線分Bjが線分Aiの左(又は右)側に偏
っていないか否かを判定する。
In the next step S3, step S
Based on the result of the intersection calculation at 2, the line segment Ai is the line segment Bj.
It is determined whether or not to "cross". Here, the line segment Ai,
If the relationship of Bj corresponds to the "intersection" determination reference pattern shown in FIG. 5 [1a] to [1c] and it is determined to "intersect" (S3 → YES), the process proceeds to step S4, and further, It is determined whether the line segment Bj is not biased to the left (or right) side of the line segment Ai.

【0027】ステップS4で線分Bjが線分Aiの左
(又は右)側に偏っていないと判定されたときは(S4
→YES)、ステップS5に進み、線分Ai,Bjが交
差している点(交点)は、“真の交点”として認識さ
れ、領域判定(F4)に用いられる交点に決定される。
つまり、図5の5ケースのうち、〔1a〕及び〔1b〕
(又は〔1a〕及び〔1c〕)のケースにおける交点の
みが“真の交点”に決定される。
When it is determined in step S4 that the line segment Bj is not biased to the left (or right) side of the line segment Ai (S4
→ YES), the process proceeds to step S5, and the point (intersection) where the line segments Ai and Bj intersect is recognized as a “true intersection” and is determined as the intersection used for the area determination (F4).
That is, of the five cases in FIG. 5, [1a] and [1b]
Only the intersections in the cases of (or [1a] and [1c]) are determined as "true intersections".

【0028】ステップS3で「交差しない=“非交差”
である」と判定されたとき(S3→NO)、及び、ステ
ップS4で線分Bjが線分Aiの左(又は右)側に偏っ
ていると判定されたときは(S4→NO)、“真の交
点”はないとみなされる。つまり、図5〔2a〕,〔2
b〕のような“非交差”のケース(S3→NO)や、図
5〔1c〕(又は〔1b〕)のように、領域線Bjが線
分Aiと交差していても、線分Aiの左側(又は右側)
に偏っているケース(S4→NO)については、“真の
交点”はないものとみなされる。
In step S3, "do not intersect =" non-cross "
"(S3 → NO)" and when it is determined in step S4 that the line segment Bj is biased to the left (or right) side of the line segment Ai (S4 → NO), " There is no true intersection. That is, in FIG. 5 [2a], [2
b) such as “non-intersection” (S3 → NO), or even if the area line Bj intersects the line segment Ai as shown in FIG. 5 [1c] (or [1b]), the line segment Ai Left side (or right side)
In the case of being biased to (S4 → NO), it is considered that there is no “true intersection”.

【0029】ステップS5,S6の処理の後は、ステッ
プS7に進み、もう、領域Rを構成する線分(領域線)
Bjが残っていないか否かを判定する。ここで、未だ線
分(領域線)Bjが残っているときは(S7→NO)、
ステップS8で、新たな線分Bj(j←j+1:領域線
番号jをインクリメント)を取り出した後、ステップS
2に戻り、新たな線分(領域線)Bjについて、ステッ
プS2〜S6の処理を繰り返す。そして、もう領域線B
jが残っていないときは(S7→YES)、この交差・
交点判定処理を終了する。
After the processes of steps S5 and S6, the process proceeds to step S7, and the line segment (region line) that constitutes the region R is already formed.
It is determined whether or not Bj remains. If the line segment (area line) Bj still remains (S7 → NO),
In step S8, a new line segment Bj (j ← j + 1: increment the area line number j) is taken out, and then step S8
2, the process of steps S2 to S6 is repeated for the new line segment (region line) Bj. And the area line B
When j does not remain (S7 → YES), this intersection
The intersection determination process ends.

【0030】〔交点の検出例〕交差判定(F1;S2)
においては、線分Aiと領域線Bjの交点を検出する必
要がある。図6は、この発明の一実施例による線分と領
域線の交点の算出方法を説明するための図である。
[Example of detection of intersection] Intersection determination (F1; S2)
In, it is necessary to detect the intersection of the line segment Ai and the area line Bj. FIG. 6 is a diagram for explaining a method of calculating an intersection of a line segment and a region line according to an embodiment of the present invention.

【0031】いま、図6のように、始点Pa1(Xa
1,Ya1)・終点Pa2(Xa2,Ya2)間を結ぶ
線分Aiと、一端点Pb1(Xb1,Yb1)・他端点
Pb2(Xb2,Yb2)間を結ぶ領域線Bjとの仮の
交点をPc(Xc,Yc)とする。また、線分Aiのx
及びy軸成分を夫々ΔXa及びΔYa、領域線Bjのx
及びy軸成分を夫々ΔXb及びΔYb、線分Aiの始点
Pa1(Xa1,Ya1)から仮交点Pc(Xc,Y
c)及び終点Pa2(Xa2,Ya2)までの距離を夫
々LAc及びLA、領域線Bjの一端点Pb1(Xb
1,Yb1)から仮交点Pc(Xc,Yc)及び他端点
Pb2(Xb2,Yb2)までの距離を夫々LBc及び
LBとする。
Now, as shown in FIG. 6, the starting point Pa1 (Xa
1, Ya1) and the end point Pa2 (Xa2, Ya2), and the area line Bj that connects one end point Pb1 (Xb1, Yb1) and the other end point Pb2 (Xb2, Yb2) to a temporary intersection Pc. (Xc, Yc). Also, the x of the line segment Ai
And y-axis components are ΔXa and ΔYa, respectively, and x of the area line Bj is
, And y-axis components are ΔXb and ΔYb, respectively, from the starting point Pa1 (Xa1, Ya1) of the line segment Ai to the temporary intersection point Pc (Xc, Y
c) and the end point Pa2 (Xa2, Ya2) are LAc and LA, respectively, and the end point Pb1 (Xb) of the area line Bj.
1, Yb1) to the temporary intersection Pc (Xc, Yc) and the other end point Pb2 (Xb2, Yb2) are LBc and LB, respectively.

【0032】まず、仮交点Pc(Xc,Yc)の座標
は、線分Ai,Bjの分割点であることから、次式
(1),(2)で求めることができる:
First, since the coordinates of the temporary intersection Pc (Xc, Yc) are the dividing points of the line segments Ai, Bj, they can be obtained by the following equations (1), (2):

【数1】 [Equation 1]

【0033】次に、式(1),(2)のXc,Ycを表
わす各式が等しいことから次式(3)が得られ、移項に
より次々式(4)が得られる:
Next, since the respective expressions representing Xc and Yc in the expressions (1) and (2) are equal to each other, the following expression (3) is obtained, and the transfer is followed by the expression (4):

【数2】 [Equation 2]

【0034】式(4)は,さらに、次式(5)のように
展開することができる:
Equation (4) can be further expanded into the following equation (5):

【数3】 [Equation 3]

【0035】ここで、式(5)の上の式から下の式を引
くと、次式(6)が得られる:
Here, by subtracting the lower expression from the upper expression of the expression (5), the following expression (6) is obtained:

【数4】 [Equation 4]

【0036】そして、式(6)から、線分Aiの始点P
a1(Xa1,Ya1)から仮交点Pc(Xc,Yc)
までの距離LAcを次式(7)により求めることができ
る:
From equation (6), the starting point P of the line segment Ai is
Temporary intersection Pc (Xc, Yc) from a1 (Xa1, Ya1)
The distance LAc to can be obtained by the following equation (7):

【数5】 [Equation 5]

【0037】従って、式(7)で決定されたLAcの値
を式(1)に当てはめることにより、仮交点Pcの座標
(Xc,Yc)を決定することができる。これにより求
められる座標(Xc,Yc)は仮想点であるため、線分
Ai,Bjの延長上にあるかも知れないので、求められ
た仮交点Pc(Xc,Yc)が線分Ai,Bj上にある
かどうかの判断が必要になる。これを決定するために
は、線分Aiについては、次式(8)で表わされる距離
LAc,LAの割合αAを判定する必要がある:
Therefore, the coordinate (Xc, Yc) of the temporary intersection Pc can be determined by applying the value of LAc determined by the equation (7) to the equation (1). Since the coordinates (Xc, Yc) obtained by this are virtual points, they may be on the extension of the line segments Ai, Bj. Therefore, the obtained tentative intersection Pc (Xc, Yc) is on the line segment Ai, Bj. It is necessary to judge whether it is in. To determine this, for the line segment Ai, it is necessary to determine the ratio αA of the distances LAc, LA expressed by the following equation (8):

【数6】 [Equation 6]

【0038】割合αAが“0”以上且つ“1”1以下の
ときは(0≦αA≦1)、線分Ai上で直線Bjと交差
していると言える。また、割合αAが負のときは(αA
<0)、直線Bjは線分Ajの始点Pa1の外側に外
れ、割合αAが“1”より大きいときには(αA>
1)、線分Ajの終点Pa2の外側に外れている。ただ
し、距離LAcを表わす式(7)の分母“ΔXa×ΔY
b−ΔYa×ΔXb”が0になるとき、両直線Ai,B
jは延長上でも交わらない(平行である)ため交点の計
算は不能である(図5〔2b〕のケースはその一例)。
When the ratio αA is "0" or more and "1" 1 or less (0≤αA≤1), it can be said that the line segment Ai intersects the straight line Bj. When the ratio αA is negative, (αA
<0), the straight line Bj deviates outside the starting point Pa1 of the line segment Aj, and when the ratio αA is larger than “1” (αA>
1), it is outside the end point Pa2 of the line segment Aj. However, the denominator “ΔXa × ΔY” of the equation (7) representing the distance LAc.
When b−ΔYa × ΔXb ″ becomes 0, both straight lines Ai and B
Since j does not intersect (parallel to) even on extension, calculation of the intersection is impossible (the case of FIG. 5 [2b] is one example).

【0039】また、領域線Bjについては、式(8)と
同様に表わされる距離LBc,LBの割合αB(αB=
LBc/LB)を同様に判定する。例えば、0≦αB≦
1のとき領域線Bj上で直線Aiと交差し、αB<0の
とき直線Aiは領域線Bjの一端点Pb1の外側に外れ
(図5〔2a〕)、αB>1のときは直線Aiは領域線
Bjの他端点Pb2の外側に外れ、式(7)と同様に求
められる距離LBcの式の分母“ΔXa×ΔYb−ΔY
a×ΔXb”が0になるときは、両直線Ai,Bjは延
長上でも交わらない(平行)ため交点の計算は不能であ
る。
As for the area line Bj, the ratio αB (αB = αB = αB = α) of the distances LBc and LB expressed in the same manner as the equation (8).
LBc / LB) is similarly determined. For example, 0 ≦ αB ≦
1 intersects the straight line Ai on the area line Bj, and when αB <0, the straight line Ai deviates outside the one end point Pb1 of the area line Bj (FIG. 5 [2a]), and when αB> 1, the straight line Ai changes. The denominator “ΔXa × ΔYb−ΔY” of the equation of the distance LBc that deviates outside the other end point Pb2 of the area line Bj and is obtained in the same manner as the equation (7).
When a × ΔXb ″ becomes 0, both straight lines Ai and Bj do not intersect (parallel) even on the extension, and therefore the intersection cannot be calculated.

【0040】つまり、0≦αA≦1且つ0≦αB≦1の
場合、線分Aiと領域線Bjは“交差”する。この場
合、0<αB<1のときは、領域線Bjの中間点で交差
し、例えば、図5〔1a〕で表わされる。また、αB=
0のときは、領域線Bjの一端点Pb1で交差し、例え
ば、図5〔1b〕で表わされ、αB=1のときは、領域
線Bjの他端点Pb2で交差し、例えば、図5〔1c〕
で表わされる。そして、これ以外の場合は(αA<0,
αA>1,αB<0,αB>1)、線分Aiと領域線B
jは互いに外れて存在し(例えば、図5〔2a〕)、さ
らに、“ΔXa×ΔYb=ΔYa×ΔXb”の場合に
は、延長上でも交わらず(例えば、図5〔2b〕)、何
れの場合も“非交差”となる。
That is, when 0 ≦ αA ≦ 1 and 0 ≦ αB ≦ 1, the line segment Ai and the area line Bj “cross”. In this case, when 0 <αB <1, they intersect at the midpoint of the area line Bj and are represented by, for example, FIG. 5 [1a]. Also, αB =
When it is 0, it intersects at one end point Pb1 of the area line Bj, and is represented by, for example, FIG. 5 [1b]. When αB = 1, it intersects at the other end point Pb2 of the area line Bj, for example, FIG. [1c]
It is represented by. And in other cases (αA <0,
αA> 1, αB <0, αB> 1), line segment Ai and area line B
j exist apart from each other (for example, FIG. 5 [2a]), and further, in the case of “ΔXa × ΔYb = ΔYa × ΔXb”, they do not intersect on the extension (for example, FIG. 5 [2b]). In this case, it will be "non-crossing".

【0041】〔点が直線の何れ側にあるかの検出例〕交
差判定(F1;S2)で線分Aiと領域線Bjが交差す
ると判定された場合は、さらに、交点判定(F2;S
4)において、領域線Bjが線分Aiの左側(又は右
側)に偏在していることを識別する必要がある。図7
は、この発明の一実施例による線分に対する点の存在側
の検出方法を説明するための図である。
[Detection Example of Which Side of Point is on Straight Line] When it is determined in the intersection determination (F1; S2) that the line segment Ai and the area line Bj intersect, the intersection determination (F2; S2) is further performed.
In 4), it is necessary to identify that the region line Bj is unevenly distributed on the left side (or right side) of the line segment Ai. Figure 7
FIG. 6 is a diagram for explaining a method of detecting a point existing side with respect to a line segment according to an embodiment of the present invention.

【0042】いま、図7のように、x−y座標上に直線
Ai及び点Pb(Xb,Yb)を任意に設定し、直線A
i上の2点P1(X1,Y1),P2(Xa2,Ya
2)と点Pbを直線で結ぶと共に、点P1,P2,Pb
を通るy軸に平行な直線とx軸との交点を夫々点S1
(X1,0),S2(X2,0),Sb(Xb,0)と
すると、台形P1−S1−S2−P2の面積をAR0、
台形P1−S1−Sb−Pbの面積をAR1、台形Pb
−Sb−S2−P2の面積をAR2とすると、各面積A
R0〜AR2は、次の各式(1)〜(3)で表わされ
る: AR0 = (Y1+Y2)×(X2−X1)/2 ……(1) AR1 = (Y1+Yb)×(Xb−X1)/2 ……(2) AR2 = (Yb+Y2)×(X2−Xb)/2 ……(3)
Now, as shown in FIG. 7, a straight line Ai and a point Pb (Xb, Yb) are arbitrarily set on the xy coordinates, and the straight line Ai is set.
Two points on i: P1 (X1, Y1), P2 (Xa2, Ya
2) and point Pb are connected by a straight line, and points P1, P2, Pb
The intersection of the straight line parallel to the y-axis passing through and the x-axis is point S1
(X1,0), S2 (X2,0), Sb (Xb, 0), the area of the trapezoid P1-S1-S2-P2 is AR0,
Area of trapezoid P1-S1-Sb-Pb is AR1, trapezoid Pb
If the area of -Sb-S2-P2 is AR2, each area A
R0 to AR2 are represented by the following equations (1) to (3): AR0 = (Y1 + Y2) * (X2-X1) / 2 (1) AR1 = (Y1 + Yb) * (Xb-X1) / 2 ... (2) AR2 = (Yb + Y2) * (X2-Xb) / 2 ... (3)

【0043】ここで、面積AR1及び面積AR2の和
“AR1+AR2”を面積AR0と比較することによっ
て、点Pbが直線Aiのどちら側に位置するかどうかが
判る。つまり、面積AR0と面積“AR1+AR2”の
差AR(三角形P1−P2−Pbの面積)は、式(1)
〜(3)から次式(4)で表わすことができ、差ΔAR
の値によって存在側を判別することができる: ΔAR = AR0−(AR1+AR2) ……(4) 〔1〕ΔAR<0のときには、点Pbは直線Aiの左側
にあり、〔2〕ΔAR=0のときには、点Pbは直線A
i上にあり、〔3〕ΔAR>0のときには、点Pbは直
線Aiの右側にあることを意味する。
Here, by comparing the sum "AR1 + AR2" of the area AR1 and the area AR2 with the area AR0, it can be known which side of the straight line Ai the point Pb is located on. That is, the difference AR (area of the triangles P1-P2-Pb) between the area AR0 and the area "AR1 + AR2" is calculated by the equation (1).
From (3) to (3), the difference ΔAR
The existence side can be discriminated by the value of: ΔAR = AR0- (AR1 + AR2) (4) [1] When ΔAR <0, the point Pb is on the left side of the straight line Ai, and [2] ΔAR = 0 Sometimes point Pb is straight line A
On the i, and [3] ΔAR> 0, it means that the point Pb is on the right side of the straight line Ai.

【0044】従って、交点判定(F2;S4)におい
て、領域線Bjが線分Aiの左側(又は右側)に偏在し
ていることを判断する場合は、例えば、領域線Bjの2
端点Pb1,Pb2の何れか一方が線分Aiとの交点P
cに一致したと交差判定されたとき、線分Aiの始終点
Pa1,Pa2を図7の点P1,P2にセットし、領域
線Bjの他方の端点を図7の点Pbとして取り扱い、上
述した差ARの値によって存在側を判別すればよい。
Therefore, in the intersection determination (F2; S4), when it is determined that the area line Bj is unevenly distributed on the left side (or right side) of the line segment Ai, for example, the area line Bj is 2
One of the end points Pb1 and Pb2 is the intersection P with the line segment Ai.
When it is determined to intersect with c, the start and end points Pa1 and Pa2 of the line segment Ai are set to the points P1 and P2 in FIG. 7, and the other end point of the area line Bj is treated as the point Pb in FIG. The existence side may be determined by the value of the difference AR.

【0045】〔領域判別の例〕図8は、この発明の一実
施例による領域判別の一例を示す。図8を用いてこの発
明による領域判別の概要を説明する。この発明では、複
数の領域線Bjにより構成される閉領域Rを通る線分A
iに対して領域“内”又は“外”の領域判別を行う。ま
ず、線分Aiと各領域線Bjとの交差及び交点を判定す
る。例えば、図8〔2〕(c)のように、線分Aiが領
域線B1,B4の中間点で交差しているときは、中間点
を“真の交点”「1」,「2」に決定し、図8〔1〕の
ように、Aiが領域線B1,B7の端点で交差し且つこ
れらの領域線B1,B7が線分Aiの右側に偏在してい
るときには、各端点を“真の交点”「1」,「2」に決
定する。そして、“真の交点”を線分Aiの始点から近
い順にソートし、ソートされた“真の交点”列に基づい
て、順次、“内”と“外”という領域判定を交互に出力
する。
[Example of Area Discrimination] FIG. 8 shows an example of area discrimination according to an embodiment of the present invention. An outline of the area discrimination according to the present invention will be described with reference to FIG. In the present invention, the line segment A passing through the closed region R formed by the plurality of region lines Bj
The area “inside” or “outside” of the area i is determined. First, the intersections and intersections of the line segment Ai and each area line Bj are determined. For example, as shown in FIG. 8 [2] (c), when the line segment Ai intersects at the midpoint of the area lines B1 and B4, the midpoint is changed to “true intersection” “1” and “2”. As shown in FIG. 8 [1], when Ai intersects the end points of the area lines B1 and B7 and these area lines B1 and B7 are unevenly distributed on the right side of the line segment Ai, the end points are set to “true”. It is decided that the intersection is "1" or "2". Then, the "true intersections" are sorted in order from the starting point of the line segment Ai, and the "inside" and "outside" area determinations are sequentially output alternately based on the sorted "true intersections" column.

【0046】以下、図8の各例について、より詳しく説
明する。図8においては、線分Aiが領域線Bjの端点
で交差していると判定されたとき、領域線Bjが線分A
iの右側に偏っている場合に、交点を領域判定に有効な
“真の交点”に決定するものとする。なお、図8におい
て、○印は交点を表わしており、数字付○印は“真の交
点”を表わす。また、○内の数字は、各線分Ai毎の
“真の交点”の出現(遭遇)順を表わすために用いられ
る便宜上の説明用番号であり、同一順位(同一座標点)
に複数の“真の交点”がある場合には、異なる番号でも
同一座標点で出現(遭遇)するものであり、場所をずら
して図示されている。
Hereinafter, each example of FIG. 8 will be described in more detail. In FIG. 8, when it is determined that the line segment Ai intersects at the end points of the region line Bj, the region line Bj indicates the line segment Ai.
When it is biased to the right of i, the intersection is determined to be a "true intersection" effective for area determination. It should be noted that in FIG. 8, the circles represent the intersections, and the circles with numbers represent the "true intersections". Also, the numbers in circles are explanatory numbers for convenience, which are used to represent the appearance (encounter) order of "true intersections" for each line segment Ai, and are in the same order (same coordinate points).
When there are a plurality of "true intersections", the different numbers appear (encounter) at the same coordinate point, and the positions are shown differently.

【0047】この発明の一実施例においては、或る閉領
域Rに対して線分Aiの領域判別を行うには、線分Ai
の線分番号iを“1”から順次インクリメント(“+
1”)し、各線分Aiについて、RAMの“真の交点”
リストバッファに格納されている“真の交点”列を参照
しつつ、図3の原則に従って、閉領域Rを構成する複数
の領域線Bjとの“真の交点”が出現する度に領域判定
を進めて行く。図8〔1〕の例は、特に、閉領域Rを構
成する複数の領域線Bj(j=1〜12)のうち、一部
の領域線Bj(j=2,6,…)に重なって線分Aiが
通過する場合を取り上げて説明するものである。
In one embodiment of the present invention, in order to determine the area of the line segment Ai with respect to a certain closed region R, the line segment Ai is used.
The line segment number i of is sequentially incremented from "1"("+
1 ”), and for each line segment Ai,“ true intersection ”of RAM
According to the principle of FIG. 3, while referring to the “true intersection” column stored in the list buffer, the area determination is performed every time the “true intersection” with the plurality of area lines Bj forming the closed area R appears. Go forward. In the example of FIG. 8 [1], in particular, among the plurality of region lines Bj (j = 1 to 12) forming the closed region R, some of the region lines Bj (j = 2, 6, ...) Overlap. The case where the line segment Ai passes will be described by taking it as an example.

【0048】図8において、或る線分Aiについて、R
AM内の“真の交点”リストバッファにある“真の交
点”列を参照して左端の始点が“真の交点”でないこと
を確認すると、当該始点を領域“外”と判定し、以後、
“真の交点”列を参照しつつ線分Ai上の座標点を右方
向に進んで行き、“真の交点”が出現するまでは領域
“外”判定を維持する。
In FIG. 8, for a certain line segment Ai, R
When it is confirmed that the left end start point is not the "true intersection" by referring to the "true intersection" column in the "true intersection" list buffer in AM, the start point is determined to be the area "outside", and thereafter,
The area “outside” determination is maintained until the “true intersection” appears by moving rightward through the coordinate points on the line segment Ai while referring to the “true intersection” column.

【0049】線分Aiの座標点を進行させると、奇数番
号「1」で表わされる線分B1との“真の交点”が出現
するので、この点から領域“内”であると領域判定を切
り替える。つまり、線分Aiは領域線B1の端点と交差
し、しかも領域線B1は線分Aiの右側に偏っているの
で、この番号「1」の“真の交点”から次に“真の交
点”が検出されるまでは領域Rの内部であると判定され
る。
When the coordinate point of the line segment Ai is advanced, a "true intersection" with the line segment B1 represented by an odd number "1" appears, so that the region is determined to be "inside" from this point. Switch. That is, since the line segment Ai intersects the end point of the area line B1, and the area line B1 is biased to the right side of the line segment Ai, the "true intersection point" of the number "1" is followed by the "true intersection point". It is determined to be inside the region R until is detected.

【0050】ここで、番号「1」の第1領域線B1との
“真の交点”は第2領域線B2の一端に一致するが、領
域線B2は、線分Ai上に重なっているので、領域線B
2に関する情報は領域判定には用いられず(無視さ
れ)、領域“内”の判定は切り替えられない。次に、領
域線B2の他端は線分Aiと第3領域線B3との交点で
あり、この点で、線分Aiは領域線B3の端点と交差す
るが、領域線B3は線分Aiの左側に偏っているので、
領域線B3との交点情報は領域判定に利用されず、領域
“内”の判定は維持されたままである。
Here, the "true intersection" with the first area line B1 having the number "1" coincides with one end of the second area line B2, but the area line B2 overlaps the line segment Ai. , Area line B
The information about 2 is not used (disregarded) in the area determination, and the determination “inside” the area cannot be switched. Next, the other end of the area line B2 is the intersection of the line segment Ai and the third area line B3, and at this point the line segment Ai intersects the end point of the area line B3, but the area line B3 is the line segment Ai. Since it is biased to the left of
The intersection information with the area line B3 is not used for the area determination, and the area "inside" determination remains maintained.

【0051】さらに、線分Aiは第5領域線B5の端点
と交差するが、領域線B5は線分Aiの左側に偏ってい
るので、この点で領域判定はされず、依然として、領域
判定は領域“内”のままである。また、領域線B5との
交点は、第6領域線B6の一端に一致しているが、領域
線B6全体が線分Ai上に重なっているので、領域判定
されず、やはり、領域判定は切り替えられない。
Further, the line segment Ai intersects with the end point of the fifth region line B5, but since the region line B5 is biased to the left side of the line segment Ai, the region determination is not made at this point, and the region determination is still made. It remains “inside” the area. Further, the intersection with the area line B5 coincides with one end of the sixth area line B6, but since the entire area line B6 overlaps the line segment Ai, the area determination is not made and the area determination is switched again. I can't.

【0052】そして、線分Ai上を更に右方向に進行
し、偶数番号「2」で表わされる領域線B7との“真の
交点”が出現すると、この点で領域“外”であると領域
判定を切り替える。つまり、線分Aiは領域線B7の端
点と交差し、しかも領域線B7は線分Aiの右側に偏っ
ているので、この番号「2」の“真の交点”からは領域
Rの“外部”であると判定される。そして、線分Ai上
には、これ以降、“真の交点”が出現しないので、領域
“外”判定が維持される。
When the "true intersection" with the area line B7 represented by the even number "2" appears further rightward on the line segment Ai, the area is "outside" at this point. Switch judgment. That is, since the line segment Ai intersects the end point of the region line B7, and the region line B7 is biased to the right side of the line segment Ai, the “outer” of the region R from the “true intersection” of the number “2”. It is determined that Then, since the "true intersection" does not appear on the line segment Ai thereafter, the area "outside" determination is maintained.

【0053】また、塗潰し処理については、領域の内外
判定が切替わった点から、判定結果に基づいて塗潰しを
するかしないかが決定される。例えば、図8〔1〕の線
分Aiに関する領域判別例では、第1領域線B1の端点
と右側に偏って交差する番号「1」の“真の交点”から
塗潰しを開始する。第2領域線B2上では線分Aに重な
っているので交差ではないと無視されて塗潰しを続行
し、第3及び第5領域線B3,B5との交点でも領域線
B3,B5が左側に偏っていると無視されて塗潰しを続
行し、さらに、第6領域線B6上でも、やはり、線分A
に重なっているので交差ではないと無視されて塗潰しを
続行するが、番号「2」の第7領域線B7の端点と右側
に偏って交差する番号「2」の“真の交点”に到達する
と塗潰しを中止し、これ以降、塗潰し中止状態を維持す
る。
Regarding the painting processing, from the point where the inside / outside determination of the area is switched, it is determined whether or not the painting is performed based on the determination result. For example, in the area discrimination example regarding the line segment Ai of FIG. 8 [1], the filling is started from the “true intersection” of the number “1” which intersects the end point of the first area line B1 with a bias toward the right. Since it overlaps with the line segment A on the second area line B2, it is ignored if it is not an intersection and the filling is continued, and the area lines B3 and B5 are leftward even at the intersection with the third and fifth area lines B3 and B5. If it is biased, it will be ignored and the painting will continue, and also on the sixth area line B6, the line segment A
Since it is overlapped with, it will be ignored if it is not an intersection and the painting will continue, but it will reach the "true intersection" of the number "2" that intersects the end point of the 7th area line B7 of the number "2" with a bias to the right. Then, the painting is stopped, and thereafter, the painting stopped state is maintained.

【0054】さて、上述した線分Aiを順次更新して行
き、線分番号iをmインクリメント(“+m”)したと
き、領域Rに対して、図8〔1〕の下部の“線分Ai+
m”で示されるような位置状態である場合について、線
分Aiを特に“線分Ai+m”で表わして説明を補足す
る。
Now, when the line segment Ai described above is sequentially updated and the line segment number i is incremented by m (“+ m”), the “line segment Ai +” at the bottom of FIG.
In the case of the position state shown by "m", the line segment Ai is particularly expressed by "line segment Ai + m" to supplement the description.

【0055】この場合、線分Ai+mは、左端の始点で
領域“外”と判定された後、第1領域線B1の他端との
交点に達するが、領域線B1は線分Ai+mの左側に偏
っているので、領域線B1との交点は“真の交点”では
なく無視される。また、領域線B1との交点は第12領
域線B12の一端に一致するが、領域線B12は線分A
i上に重なっているので無視され、領域判定は切り替え
られない。
In this case, the line segment Ai + m reaches the intersection with the other end of the first region line B1 after it is determined as the region "outside" at the left end start point, but the region line B1 is to the left of the line segment Ai + m. Since they are biased, the intersection with the area line B1 is ignored rather than the “true intersection”. Further, the intersection with the area line B1 coincides with one end of the twelfth area line B12, but the area line B12 is the line segment A.
Since it overlaps i, it is ignored and the area determination cannot be switched.

【0056】その後、線分Ai+mが、奇数番号「1」
で表わされる第11領域線B11との“真の交点”に遭
遇すると、この点「1」で領域判定を領域“内”に切り
替え、次いで、偶数番号「2」の第9領域線B9との
“真の交点”に遭遇すると、この点「2」で、領域
“外”に判定を切り替える。つまり、点「1」及び
「2」では、線分Ai+mは領域線B11,B9の端点
と交差ししかも領域線B11,B9は線分Ai+mの右
側に偏っているので、領域判定を、“外”→“内”及び
“内”→“外”に切り替える。
After that, the line segment Ai + m becomes an odd number "1".
When the "true intersection" with the eleventh area line B11 represented by is encountered, the area determination is switched to the area "inside" at this point "1", and then with the ninth area line B9 with the even number "2". When the "true intersection" is encountered, the determination is switched to the area "outside" at this point "2". That is, at the points “1” and “2”, the line segment Ai + m intersects the end points of the region lines B11, B9, and the region lines B11, B9 are biased to the right of the line segment Ai + m. Switching from "→" inside "and" inside "→" outside ".

【0057】次いで、“真の交点”「2」は、第8領域
線B8の一端であるが領域線B8は線分Ai+m上に重
なっているので無視され、領域判定は切り替えられな
い。そして、第7領域線B7の他端と交差するが、領域
線B7は線分Ai+1の左側に偏っているので無視さ
れ、領域判定は切り替えず、線分Ai+1の終点(右
端)に到達するまで、領域“外”の判定が維持される。
Next, the "true intersection""2" is one end of the eighth area line B8, but since the area line B8 overlaps the line segment Ai + m, it is ignored and the area determination cannot be switched. Then, although it intersects with the other end of the seventh area line B7, it is ignored because the area line B7 is biased to the left side of the line segment Ai + 1, and the area determination is not switched until the end point (right end) of the line segment Ai + 1 is reached. , The determination of “outside” the area is maintained.

【0058】なお、線分Aiが閉領域Rの第4領域線B
4全体と重なる場合は(図示せず)、領域線B4の左端
及び右端位置で、第3及び第5領域線B3,B5との
“真の交点”「1」及び「2」が出現するので、前述し
た線分Aiと第1及び第7領域線B1,B7との“真の
交点”「1」及び「2」と同様に、それぞれ、“外”→
“内”及び“内”→“外”に切り替えられる。
The line segment Ai is the fourth region line B of the closed region R.
4 (not shown), the "true intersections""1" and "2" with the third and fifth area lines B3 and B5 appear at the left and right ends of the area line B4. , "Outside" as in the "true intersections""1" and "2" between the line segment Ai and the first and seventh area lines B1 and B7, respectively.
It can be switched from "inside" and "inside" to "outside".

【0059】また、線分Aiが第10領域線B10全体
と重なる場合(図示せず)は、領域線B10の左端及び
右端位置で、第11及び第9領域線B11,B9の他端
と交差するものの、領域線B11,B9が線分Aiの左
側に偏っているので、前述した“線分Ai+m”と第1
及び第7領域線の他端との交点と同様に、何ら領域判定
の切替えが行われず、当初に領域“外”と判定されたま
まである。
When the line segment Ai overlaps the entire tenth area line B10 (not shown), the left and right end positions of the area line B10 intersect with the other ends of the eleventh and ninth area lines B11, B9. However, since the area lines B11 and B9 are biased to the left of the line segment Ai, the above-mentioned “line segment Ai + m” and the first line
Similarly to the intersection with the other end of the seventh area line, the area determination is not switched at all, and the area is initially determined to be “outside”.

【0060】図8〔1〕において、上述したように、線
分Aiが、第4領域線B4、第2及び第6領域線B2,
B6、第12及び第8領域線B12,B8、並びに、第
10領域線B10と重なる場合以外は、図3〔1〕に示
すように、見掛け上交差する点は、全て“真の交点”と
なり、線分Aiがこの点を通過する毎に、領域判定を切
り替える。
In FIG. 8 [1], as described above, the line segment Ai is the fourth area line B4, and the second and sixth area lines B2.
B6, the twelfth and eighth area lines B12, B8, and the tenth area line B10 are all overlapped with each other, as shown in FIG. , The area determination is switched every time the line segment Ai passes through this point.

【0061】この発明の一実施例による領域判別は、或
る閉領域(閉図形)の頂点、つまり、当該閉領域を構成
する領域線Bjのうち、隣接する領域線Bj,Bj+1
において互いに結合されている端点を、線分Aiが通過
する場合にも効果的である。図8〔2〕の例は、特に、
線分Aiが領域の頂点上を通過する場合を取り上げて説
明するものである。
In the area discrimination according to the embodiment of the present invention, the vertices of a certain closed area (closed figure), that is, the adjacent area lines Bj and Bj + 1 among the area lines Bj forming the closed area.
It is also effective when the line segment Ai passes through the end points connected to each other at. The example of FIG. 8 [2] is
The case where the line segment Ai passes over the apex of the area will be described.

【0062】図8〔2〕(a)の例では、線分Aiの左
端で領域“外”とされた後、線分Ai上を右方向に進行
すると、2つの隣接して結合する領域線B1,B2の各
端点と同一座標点で交差する。これらの交差では、両領
域線B1,B2は共に線分Aiの右側に偏っているの
で、線分Aiと領域線B1及び領域線B2との交点は、
何れも“真の交点”であり、例えば、番号「1」及び
「2」で表わすことができる。
In the example of FIG. 8 [2] (a), after the area “outside” is set at the left end of the line segment Ai, when the line segment Ai proceeds to the right, two adjacently joined region lines are formed. It intersects with each end point of B1 and B2 at the same coordinate point. At these intersections, since both the area lines B1 and B2 are biased to the right of the line segment Ai, the intersection point of the line segment Ai and the area line B1 and the area line B2 is
Both are “true intersections” and can be represented by the numbers “1” and “2”, for example.

【0063】この場合、“真の交点”列を参照して、ま
ず領域線B1との“真の交点”データ「1」が取り出さ
れて一旦領域“内”と切替え判定しても、同一の座標点
で、領域線B2との“真の交点”データ「2」が取り出
されて、直ちに、領域“外”と判定を切り替えて、結
局、当該座標点での内外判定結果は、領域“外”を維持
する。
In this case, referring to the "true intersection" column, the "true intersection" data "1" with the area line B1 is first taken out, and even if it is determined to switch to the "inside" area, the same result is obtained. At the coordinate point, the "true intersection" data "2" with the area line B2 is taken out, and the determination is immediately switched to the area "outside", and the inside / outside determination result at the coordinate point is the area "outside". "Keep it.

【0064】図8〔2〕(b),(c)は、閉領域の頂
点から進入又は進出したり、閉領域の頂点上を通過する
ときの他の例である。なお、この明細書では、これらの
例のように180°以上の頂角を持つ閉領域(閉図形)
の頂点を、特に、「領域線の接点」と呼んでいる(閉図
形の屈曲点という方が適当かも知れない)。
FIGS. 8B, 8C, and 8C are other examples when entering or advancing from the apex of the closed area or passing over the apex of the closed area. In this specification, a closed region (closed figure) having an apex angle of 180 ° or more as in these examples.
In particular, the vertex of is called "the contact point of the area line" (the bending point of the closed figure may be more appropriate).

【0065】図8〔2〕(b)の例では、線分Aiの左
端で領域“外”とされた後、線分Ai上を右方向に進行
すると、隣接する2つの領域線B1,B2の各端点と同
一座標点で交差する。これらの交差のうち、領域線B1
は線分Aiの右側に偏っているので、線分Aiと領域線
B1の交点は、奇数番号「1」で表わされる“真の交
点”であるが、領域線B2は線分Aiの左側に偏ってい
るので、線分Aiと領域線B1の交点は、領域判定に用
いられず無視される。従って、番号「1」の“真の交
点”で、領域“外”→“内”に切替え判定する。
In the example of FIG. 8 [2] (b), when the area “outside” is set at the left end of the line segment Ai, and when the line segment Ai proceeds to the right, two adjacent region lines B1 and B2 are formed. Intersect with each end point of the same coordinate point. Of these intersections, the area line B1
Is biased to the right of the line segment Ai, the intersection of the line segment Ai and the area line B1 is the "true intersection" represented by the odd number "1", but the area line B2 is to the left of the line segment Ai. Since they are biased, the intersection of the line segment Ai and the area line B1 is ignored and not used for area determination. Therefore, at the "true intersection" of the number "1", the area "outside" → "inside" is switched.

【0066】次いで、線分Aiは、領域に進入した後、
領域線B4の中間点で交差する。この点は、偶数番号
「2」で表わされる領域線B4との“真の交点”である
から、領域判定は“内”→“外”に切り替え、以後、領
域“外”の判定を維持する。
Then, after the line segment Ai enters the area,
It intersects at the midpoint of the area line B4. Since this point is the "true intersection" with the area line B4 represented by the even number "2", the area determination is switched from "inside" to "outside" and thereafter the area "outside" determination is maintained. .

【0067】図8〔2〕(c)の例では、線分Aiの左
端で領域“外”とされた後、線分Ai上を右方向に進行
すると、領域線B1の中間点と交差する。この座標点
は、奇数番号「1」で表わされる“真の交点”であるか
ら、ここで領域“外”→“内”に切替え判定する。
In the example of FIG. 8 [2] (c), after the area “outside” is set at the left end of the line segment Ai, when the vehicle moves rightward on the line segment Ai, it intersects with the intermediate point of the region line B1. . Since this coordinate point is the "true intersection" represented by the odd number "1", it is determined here that the area is switched from "outside" to "inside".

【0068】次いで、線分Aiは隣接領域線B2,B3
の各端点と同一座標点で交差する。これらの交差では、
両領域線B2,B3共に線分Aiの左側に偏っているの
で、線分Aiとの交点は、何れも、領域判定に用いられ
ず無視される。領域“内”判定は維持される。そして、
領域線B4の中間点と交差すると、この交差は偶数番号
「2」の“真の交点”であるから、ここで、領域判定を
領域“内”→“外”に切り替え、以後、領域“外”の判
定を維持する。
Next, the line segment Ai indicates the adjacent area lines B2 and B3.
Intersect with each end point of the same coordinate point. At these intersections,
Since both the area lines B2 and B3 are biased to the left of the line segment Ai, any intersection with the line segment Ai is not used for the area determination and is ignored. The "inside" region determination is maintained. And
When it intersects with the middle point of the area line B4, this intersection is the "true intersection" of the even number "2". Therefore, the area determination is switched from the area "inside" to the "outside" here, and then the area "outside" Keep the judgment of ".

【0069】これらの判別例で説明したように、この発
明の一実施例に従って“真の交点”リストを参照して領
域の内外判別を行うことにより、多数の領域線によりど
んなに複雑な形状で構成された領域であっても、領域の
“外”→“内”→“外”→“内”→“外”という順序に
則した内外判定は、狂うことがなく、正確な領域判定を
実現することができる。
As described in these discrimination examples, by discriminating the inside and outside of the region by referring to the "true intersection" list according to the embodiment of the present invention, it is possible to construct a complicated shape with a large number of region lines. Even if the area is defined, the inside / outside judgment based on the order of “outside” → “inside” → “outside” → “inside” → “outside” does not get out of order and realizes accurate area determination. be able to.

【0070】[0070]

【発明の効果】以上説明したように、この発明によれ
ば、線分が領域線の中間点で交差しているときは、中間
点を交点(“真の交点”)に決定し、線分が領域線の端
点で交差し且つ当該領域線が線分の右側又は左側に偏在
しているときには、この端点を交点(“真の交点”)に
決定し、これらの交点(“真の交点”)を線分Aiの始
点から近い順にソートし、ソートされた交点列(“真の
交点”列)に基づいて、順次、閉領域の内部と外部との
領域判定を交互に出力するようにしているので、簡単な
構成で短時間に、線分が領域線上に重なって通過したり
閉領域の頂点や領域線の接点上を通過するなどのことが
あっても、誤りなく確実に領域内外の判別を行うことが
できる。
As described above, according to the present invention, when the line segments intersect at the midpoint of the area line, the midpoint is determined as the intersection ("true intersection") and the line segment is determined. Crosses at the end points of the area line and the area line is unevenly distributed on the right or left side of the line segment, the end points are determined as intersections (“true intersections”) and these intersections (“true intersections”) are determined. ) Are sorted in order from the starting point of the line segment Ai, and the area determination between the inside and the outside of the closed area is alternately output based on the sorted intersection row (the "true intersection" row). Therefore, even if the line segments pass over the area line or pass over the apex of the closed area or the contact point of the area line in a short time with a simple configuration, it is possible to reliably and reliably It is possible to make a distinction.

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

【図1】図1は、この発明の一実施例による領域判別機
能を有する図形情報処理システムの概略的ハードウエア
構成ブロック図である。
FIG. 1 is a schematic hardware configuration block diagram of a graphic information processing system having a region discriminating function according to an embodiment of the present invention.

【図2】図2は、この発明の一実施例による塗潰し処理
の手順の概要を表わす概略的機能ブロック図である。
FIG. 2 is a schematic functional block diagram showing an outline of a procedure of painting processing according to an embodiment of the present invention.

【図3】図3は、この発明の一実施例による領域判別に
用いられる内外判定の原則を説明するための図である。
FIG. 3 is a diagram for explaining the principle of inside / outside determination used for area determination according to an embodiment of the present invention.

【図4】図4は、この発明の一実施例による交差・交点
判定の処理手順を表わすフローチャートである。
FIG. 4 is a flowchart showing a processing procedure of intersection / intersection determination according to an embodiment of the present invention.

【図5】図5は、この発明の一実施例による交差判定を
説明するための図である。
FIG. 5 is a diagram for explaining intersection determination according to an embodiment of the present invention.

【図6】図6は、この発明の一実施例による線分と領域
線の交点の算出方法を説明するための図である。
FIG. 6 is a diagram for explaining a method of calculating an intersection of a line segment and a region line according to an embodiment of the present invention.

【図7】図7は、この発明の一実施例による線分に対す
る点の存在側の検出方法を説明するための図である。
FIG. 7 is a diagram for explaining a method of detecting a point existing side with respect to a line segment according to an embodiment of the present invention.

【図8】図8は、この発明の一実施例による領域判別例
を表わす図である。
FIG. 8 is a diagram showing an example of area discrimination according to an embodiment of the present invention.

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

Ai,Ai+m(i,m=1,2,…) 描画(表示・
印刷)のための走査線又は作画線を表わす線分、 Bj(j=1,2,…) 閉領域(閉図形)Rを構成す
る領域線、 Pa1,Pa2;P1,P2 線分Ai上の点、 Pb1,Pb2;Pb 線分Bj上の点、 C,Pc 線分Aiと線分Bjの交点。
Ai, Ai + m (i, m = 1, 2, ...) Drawing (display /
A line segment representing a scanning line or a drawing line for printing), Bj (j = 1, 2, ...) A region line forming a closed region (closed figure) R, Pa1, Pa2; P1, P2 on the line segment Ai Point, Pb1, Pb2; Point on Pb line segment Bj, C, Pc Intersection point of line segment Ai and line segment Bj.

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】複数の領域線により構成される閉領域を通
る線分に対して該閉領域の内部であるか外部であるかの
領域判別を行う領域判別装置であって、 線分が領域線の中間点で交差していることを検出して、
当該中間点を交点に決定する手段と、 線分が領域線の端点で交差し且つ当該領域線が線分の右
側又は左側に偏在していることを検出して、当該端点を
交点に決定する手段と、 決定された交点を線分の始点から近い順にソートして、
交点列を生成する手段と、 生成された交点列に基づいて、順次、閉領域の内部であ
る旨と閉領域の外部である旨との領域判定を交互に出力
する手段とを具備することを特徴とする領域判別装置。
1. An area discriminating apparatus which discriminates a line segment passing through a closed region composed of a plurality of region lines, which region is inside or outside the closed region, wherein the line segment is a region. Detecting that they intersect at the midpoint of the line,
Means for determining the intermediate point as an intersection, and detecting that the line segment intersects at the end point of the region line and the region line is unevenly distributed on the right or left side of the line segment, and determines the end point as the intersection point. The means and the determined intersections are sorted in order from the starting point of the line segment,
A means for generating a sequence of intersections, and means for alternately outputting region determinations indicating that the region is inside the closed region and the region that is outside the closed region based on the generated sequence of intersections. Characteristic area discrimination device.
【請求項2】複数の領域線により構成される閉領域を通
る線分に対して該閉領域の内部であるか外部であるかの
領域判別を行う図形情報処理装置に対して、 線分が領域線の中間点で交差していることを検出して、
当該中間点を交点に決定するステップと、 線分が領域線の端点で交差し且つ当該領域線が線分の右
側又は左側に偏在していることを検出して、当該端点を
交点に決定するステップと、決定された交点を線分の始
点から近い順にソートして、交点列を生成するステップ
と、 生成された交点列に基づいて、順次、閉領域の内部であ
る旨と閉領域の外部である旨との領域判定を交互に出力
するステップとから成る手順を実行させるための領域判
別プログラム。
2. A graphic information processing apparatus for discriminating a region, which is inside or outside a closed region, of a line segment passing through a closed region composed of a plurality of region lines, Detect the intersection at the midpoint of the area line,
The step of determining the intermediate point as an intersection, and detecting that the line segment intersects at the end point of the area line and the area line is unevenly distributed on the right or left side of the line segment, and determines the end point as the intersection point. Steps, sorting the determined intersections in ascending order from the starting point of the line segment, generating a sequence of intersections, and, based on the generated sequence of intersections, the fact that it is inside the closed region and outside the closed region. The area discrimination program for executing the procedure consisting of the step of alternately outputting the area determination that ".
JP2002092985A 2002-03-28 2002-03-28 Boundary discrimination device and program therefor Pending JP2003288606A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002092985A JP2003288606A (en) 2002-03-28 2002-03-28 Boundary discrimination device and program therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002092985A JP2003288606A (en) 2002-03-28 2002-03-28 Boundary discrimination device and program therefor

Publications (1)

Publication Number Publication Date
JP2003288606A true JP2003288606A (en) 2003-10-10

Family

ID=29237652

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002092985A Pending JP2003288606A (en) 2002-03-28 2002-03-28 Boundary discrimination device and program therefor

Country Status (1)

Country Link
JP (1) JP2003288606A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106872997A (en) * 2016-12-30 2017-06-20 重庆多道电子技术有限公司 Determine the system that mining area goods transport vehicle is efficiently entering designated geographic area
CN106970396A (en) * 2016-12-30 2017-07-21 重庆多道电子技术有限公司 Determine the method that destination object is efficiently entering designated geographic area
CN106980128A (en) * 2016-12-30 2017-07-25 重庆多道电子技术有限公司 Data processing equipment
CN107045135A (en) * 2016-12-30 2017-08-15 重庆多道电子技术有限公司 A kind of electronic equipment
CN107045134A (en) * 2016-12-30 2017-08-15 重庆多道电子技术有限公司 Determine that destination object is efficiently entering the device of designated geographic area
CN111274344A (en) * 2020-01-20 2020-06-12 东南大学 Multi-target buffer area merging method for regularly selecting and rejecting arc sections

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106872997A (en) * 2016-12-30 2017-06-20 重庆多道电子技术有限公司 Determine the system that mining area goods transport vehicle is efficiently entering designated geographic area
CN106970396A (en) * 2016-12-30 2017-07-21 重庆多道电子技术有限公司 Determine the method that destination object is efficiently entering designated geographic area
CN106980128A (en) * 2016-12-30 2017-07-25 重庆多道电子技术有限公司 Data processing equipment
CN107045135A (en) * 2016-12-30 2017-08-15 重庆多道电子技术有限公司 A kind of electronic equipment
CN107045134A (en) * 2016-12-30 2017-08-15 重庆多道电子技术有限公司 Determine that destination object is efficiently entering the device of designated geographic area
CN111274344A (en) * 2020-01-20 2020-06-12 东南大学 Multi-target buffer area merging method for regularly selecting and rejecting arc sections

Similar Documents

Publication Publication Date Title
US5990900A (en) Two-dimensional to three-dimensional image converting system
JP3199765B2 (en) Composite image editor
US20030071810A1 (en) Simultaneous use of 2D and 3D modeling data
US5734383A (en) Apparatus and method for generating a three-dimensional model on a graphic display from a two-dimensional image
JP6468756B2 (en) 3D model generation method, 3D model generation system, and 3D model generation program
JPH0527906A (en) Graphic selector
JP2009134620A (en) Drawing device, drawing program and drawing method
CN106934842A (en) The recognition methods of enclosed region and device
JP2003288606A (en) Boundary discrimination device and program therefor
JPH04184689A (en) Polygon dividing method and its device
US6728407B1 (en) Method for automatically determining trackers along contour and storage medium storing program for implementing the same
JP2001117487A (en) Device and method for generating polygon road network data
US20100309227A1 (en) Map display device
KR102433396B1 (en) Method for modeling 3d image and computer-readable recording medium
JPH06215074A (en) Graphic processor
JPH10240790A (en) Method for instructing formation of fillet surface
JP3339648B2 (en) Information processing apparatus and drawing method
JPS62269287A (en) Visual recognizing device
US20220284667A1 (en) Image processing method and image processing device for generating 3d content by means of 2d images
Riškus et al. A simple centerline extraction approach for 2D polygons
JPS6125190B2 (en)
JPH07287750A (en) Method for recognizing road area from segment data expressing map
JP3455301B2 (en) Apparatus and method for correcting shape in CAD system
JPH08212299A (en) Method for controlling handwritten input and its device
JP2723058B2 (en) Line-symmetric figure input device

Legal Events

Date Code Title Description
A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A711

Effective date: 20040308

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20041220

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20041222

A02 Decision of refusal

Effective date: 20060126

Free format text: JAPANESE INTERMEDIATE CODE: A02