JP3293157B2 - Point closed area search processor - Google Patents

Point closed area search processor

Info

Publication number
JP3293157B2
JP3293157B2 JP5402292A JP5402292A JP3293157B2 JP 3293157 B2 JP3293157 B2 JP 3293157B2 JP 5402292 A JP5402292 A JP 5402292A JP 5402292 A JP5402292 A JP 5402292A JP 3293157 B2 JP3293157 B2 JP 3293157B2
Authority
JP
Japan
Prior art keywords
point
closed
intersections
loop
line
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
JP5402292A
Other languages
Japanese (ja)
Other versions
JPH05258060A (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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP5402292A priority Critical patent/JP3293157B2/en
Publication of JPH05258060A publication Critical patent/JPH05258060A/en
Application granted granted Critical
Publication of JP3293157B2 publication Critical patent/JP3293157B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Generation (AREA)
  • Image Analysis (AREA)

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、計算機による平面図形
の処理において、或る閉ループ図形に対して、点が内部
にあるか外部にあるかを識別するための点の閉領域検索
処理方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a closed area search processing method for identifying whether a point is inside or outside a certain closed-loop figure in processing of a plane figure by a computer. .

【0002】[0002]

【従来の技術と発明が解決しようとする課題】いわゆる
CAD等で、図形を処理する場合に、直線と曲線で構成
された閉ループに対して、或る点が閉ループ内にある
か、閉ループの外にあるか識別することが必要になる。
2. Description of the Related Art When a graphic is processed by so-called CAD or the like, a certain point exists in a closed loop formed by a straight line and a curve, or a point outside the closed loop. Need to be identified.

【0003】このような識別は通常次のように処理され
る。即ち、図2(a)に示すように、曲線部分を折れ線で
置き換えて、閉ループを多角形で近似し、指定の点(図
の中央の黒円)と多角形の各辺とのなす角を、辺の順に
順次計数し、点からみて例えば左回りに測った場合の角
度を正、右回りになるときを負として和を求める。
[0003] Such identification is usually processed as follows. That is, as shown in FIG. 2A, the curved part is replaced with a polygonal line, the closed loop is approximated by a polygon, and the angle between a specified point (black circle in the center of the figure) and each side of the polygon is determined. , The sides are counted in order, and the angle is measured positively when viewed from the point, for example, counterclockwise.

【0004】その結果図2の(a)と(b)の例から容易に推
測されるように、点が閉ループの内部にあれば(図2
(a))、角度の総和は2πとなり、外部にあれば(図2
(b))総和は0になるので、角度の総和によって点の位
置を識別する。
As a result, as can be easily inferred from the examples of FIGS. 2A and 2B, if the point is inside the closed loop (FIG. 2).
(a)), the sum of the angles is 2π, and if it is outside (Fig.
(b)) Since the sum is 0, the position of the point is identified by the sum of the angles.

【0005】なお、実際には角度の計算の誤差により、
総和は一般に正確には2π又は0にならないので、例え
ばπより大きいか、小さいかによって判定する。この方
法によると、閉ループの曲線部分を折れ線に分解して、
閉ループを多角形で近似し、そのすべての辺について、
各辺と指定点とで作る各三角形について角度を計算する
必要があり、そのために要する計算量は比較的長大とな
る。
[0005] Actually, due to an error in the calculation of the angle,
Since the sum generally does not exactly equal 2π or 0, it is determined, for example, whether the sum is greater than or less than π. According to this method, the curve portion of the closed loop is decomposed into broken lines,
Approximate the closed loop with a polygon, and for all its sides,
It is necessary to calculate an angle for each triangle formed by each side and the designated point, and the amount of calculation required for that is relatively large.

【0006】又、直線による近似を行うために、例えば
図2(c)、(d)に示すように、閉ループの内部にある点が
近似多角形に対しては外部になったり(図2(c)の
例)、その逆の場合(図2(d)の例)が生じるのを避け
ることができず、そのような場合の誤認を避けるための
適当な処理も必要になる。
In order to perform approximation by a straight line, for example, as shown in FIGS. 2 (c) and 2 (d), a point inside the closed loop becomes outside the approximate polygon (FIG. The example (c)) and the reverse case (the example in FIG. 2 (d)) cannot be avoided, and appropriate processing for avoiding erroneous recognition in such a case is necessary.

【0007】一方、点を一端とする半直線を考えると、
点が閉ループ内部にあれば、その半直線と閉ループとの
交点が奇数個となり、点が外部にあれば、閉ループとの
交点は偶数か0であることは、よく知られている。
[0007] On the other hand, considering a half line having a point as one end,
It is well known that if a point is inside the closed loop, the number of intersections between the half line and the closed loop is odd, and if the point is outside, the intersection with the closed loop is even or zero.

【0008】図3(a)及び(b)は、この関係を例によって
説明する図であり、(a)は点が閉ループ内部にあって半
直線との交点が3個となり、(b)では点が外部にあるの
で交点が2個になる。
FIGS. 3 (a) and 3 (b) are diagrams illustrating this relationship by way of example. FIG. 3 (a) shows that the point is inside the closed loop and there are three intersections with the half-line. Since the point is outside, there are two intersections.

【0009】しかし、この関係を利用して、点の位置す
る領域を識別しようとすると、例えば図3(c)のよう
に、半直線が閉ループの要素の線分や曲線の端点を通る
ようになると、各要素との交点が各1個となって、交点
の個数を誤り、図の例の場合には、交点を3個と数え
て、点が内部にあると誤判定し得る。
However, if an attempt is made to identify an area where a point is located by using this relationship, for example, as shown in FIG. 3 (c), a half line passes through a line segment of a closed loop element or an end point of a curve. Then, the number of intersections with each element becomes one, and the number of intersections is erroneous. In the case of the example in the figure, the number of intersections is counted as three, and it may be erroneously determined that the point is inside.

【0010】又図3(d)のように、半直線が閉ループの
要素の曲線の接線になると、この交点は1個なので、図
の例の場合には、点は内部にあると誤認する。更に、実
際の計算では誤差のために、閉ループが必ずしも完全に
閉じていないで、要素の線分や曲線の間に間隙を生じる
ことが一般にあり、半直線がそのような間隙を通ると、
交点は無いことになって、交点の個数を誤る。
When the half line is tangent to the curve of the element of the closed loop as shown in FIG. 3D, there is only one intersection, and in the case of the example shown in the figure, the point is erroneously recognized as being inside. Furthermore, in practice, due to errors, closed loops are not always completely closed, and generally result in gaps between element line segments or curves, and when a ray passes through such a gap,
There are no intersections, and the number of intersections is incorrect.

【0011】このような条件を考慮して誤認を生じない
ようにする処置を要する等の問題があるために、半直線
の交点を数える方法は、比較的計算時間が少ない方法で
あるのに関わらず従来一般に使用されていない。
Since there is a problem that it is necessary to take measures to prevent erroneous recognition in consideration of such conditions, the method of counting the intersections of the half-lines is a method that requires a relatively short calculation time. And has not been commonly used.

【0012】本発明は、半直線と閉ループとの交点数に
よって、効率よく点の領域を識別できる点の閉領域検索
処理方法を目的とする。
SUMMARY OF THE INVENTION It is an object of the present invention to provide a closed point search processing method for a point in which a point area can be efficiently identified by the number of intersections between a half line and a closed loop.

【0013】[0013]

【課題を解決するための手段】図1は、本発明の構成を
示す処理の流れ図である。図は点の閉領域検索処理方法
の構成であって、所与の平面図形について、指定の点の
位置が指定の閉ループ図形の内か外かを、該指定点を一
端とする半直線について、該閉ループ図形を構成する要
素である線分及び曲線との各交点を所定の計算によって
求め、該交点の個数によって判定するに際し、該計算の
精度に応じて誤差値を設ける。
FIG. 1 is a flow chart of the processing showing the configuration of the present invention. The figure is a configuration of a point closed area search processing method, for a given plane figure, whether the position of the specified point is inside or outside the specified closed loop figure, for a half line having the specified point as one end, Each intersection between the line segment and the curve, which are the elements constituting the closed-loop figure, is obtained by a predetermined calculation, and an error value is provided according to the accuracy of the calculation when making a determination based on the number of the intersections.

【0014】該半直線と、何れの該要素の端点との距離
も、該指定点を通る何れの該曲線の接線の接点との距離
も、該誤差値より大きいことを条件として、該半直線の
傾きを選択する(処理ステップ1)。
On the condition that both the distance between the half line and the end point of any of the elements and the distance between the tangent of any curve passing through the designated point and the tangent of the curve are larger than the error value, Is selected (processing step 1).

【0015】該選択した傾きを有する該半直線について
該計算によって該交点を求める(処理ステップ2)。求
めた該交点の個数が、奇数の場合に該指定点が該閉ルー
プの内部にあり、奇数でない場合に外部にあると判定す
る(処理ステップ3)。
The intersection is obtained by the calculation for the half line having the selected inclination (processing step 2). When the obtained number of intersections is odd, it is determined that the designated point is inside the closed loop, and when it is not odd, it is outside (closed).

【0016】[0016]

【作用】本発明の処理方法により、計算精度の限界によ
る交点の誤認、及び交点数を誤認する可能性のある特異
な交点を避けるように、半直線の傾きを選ぶことがで
き、その半直線による交点の個数によって指定点の位置
する領域を識別するので、比較的少ない計算量によって
正確な識別を行うことができる。
According to the processing method of the present invention, the inclination of the half line can be selected so as to avoid misinterpretation of intersections due to the limit of calculation accuracy and unusual intersections that may misrecognize the number of intersections. Since the area where the designated point is located is identified by the number of intersections, accurate identification can be performed with a relatively small amount of calculation.

【0017】[0017]

【実施例】図4は本発明の詳細な処理の流れの一例を示
す図であり、先ず処理ステップ10で、指定の閉ループ図
形の要素の各曲線について、指定点を通る接線を求め
て、各接点の座標を決定する。
FIG. 4 is a diagram showing an example of a detailed processing flow of the present invention. First, in processing step 10, a tangent line passing through a designated point is determined for each curve of the element of the designated closed-loop figure. Determine the coordinates of the point of contact.

【0018】処理ステップ11で、指定点を一端とする半
直線を設定するものとし、その傾きを例えば最初は水平
右向き、次は垂直上向き等のように、なるべく計算に便
利な傾きを採るように定めておく。
In processing step 11, a half-line having the designated point as one end is set, and its inclination is set to be as convenient as possible for calculation, such as, for example, first horizontally rightward, and then vertically upward. I will decide.

【0019】定められた順序で或る傾きの半直線を選ぶ
と、処理ステップ12で、閉ループの各要素の端点、及び
前記処理ステップ10で求めてある接点と、半直線との距
離を順次計算するものとし、一つの端点又は接点との距
離を計算すると、処理ステップ13でその距離を所定の誤
差値と比較する。
When a semi-line having a certain inclination is selected in a predetermined order, in step 12, the end points of the respective elements of the closed loop and the distance between the contact point obtained in step 10 and the half-line are sequentially calculated. When the distance to one end point or contact point is calculated, the distance is compared with a predetermined error value in processing step 13.

【0020】距離が誤差値より大きくなければ、現に選
択した半直線の傾きを不適当として、処理ステップ11に
戻り、次に選択する傾きで処理をやり直す。この誤差値
は、後に行う交点計算の精度に基づいて設定し、半直線
の交点が端点と一致する場合が、計算結果として端点の
近傍となったり、端点間の隙間を通過することになる可
能性のある場合も含めて、そのようになる半直線の傾き
を除去できるようにする。接点との関係についても同様
である。
If the distance is not larger than the error value, the inclination of the currently selected half-line is determined to be inappropriate, and the process returns to the processing step 11 to repeat the processing with the next selected inclination. This error value is set based on the accuracy of the intersection calculation performed later, and when the intersection of the half line coincides with the end point, the calculation result may be near the end point or pass through the gap between the end points It is possible to remove the inclination of such a half line including the case where there is a possibility. The same applies to the relationship with the contact.

【0021】距離が誤差値より大きければ、処理ステッ
プ14で識別して、閉ループの全要素について処理ステッ
プ12からの処理を繰り返す。以上によって、半直線の適
当な傾きが決まると、処理ステップ15でその半直線と閉
ループの各要素との交点を求め、処理ステップ16で当該
要素との交点の個数を累積し、処理ステップ17で識別し
て全要素について処理するまで、以上の処理を繰り返
す。
If the distance is greater than the error value, it is identified in processing step 14 and the processing from processing step 12 is repeated for all elements of the closed loop. As described above, when an appropriate inclination of the half line is determined, an intersection between the half line and each element of the closed loop is obtained in processing step 15, the number of intersections with the element is accumulated in processing step 16, and in processing step 17, The above processing is repeated until all the elements are identified and processed.

【0022】全要素の処理を終わると、処理ステップ18
で、累積した交点の総個数が奇数か識別し、奇数なら処
理ステップ19で指定点の領域は閉ループ内部であるとい
う判定結果を出し、又、交点総数が奇数でない、即ち0
又は偶数の場合には、指定点の領域は閉ループ外部であ
るという判定結果を出す。
When processing of all elements is completed, processing step 18
Then, it is determined whether or not the total number of accumulated intersections is an odd number. If the total number is an odd number, a result of determination is made in processing step 19 that the area of the designated point is inside the closed loop.
Or, in the case of an even number, a determination result is issued that the area of the designated point is outside the closed loop.

【0023】図5は以上の処理による点の領域検索の例
であり、最初に水平の半直線を試用するものとして、図
5(a)の場合には、水平の半直線が除外条件に該当しな
いので、各要素(図に〜を付して示す)との交点を
計算すると、要素ととに各1個の交点があり、その
他の要素では交点が0となり、累積総数が2となるの
で、交点総数が偶数で、指定点は閉ループ外部であると
判定する。
FIG. 5 shows an example of a point area search by the above processing. First, a horizontal half line is used as a trial. In the case of FIG. 5 (a), a horizontal half line corresponds to the exclusion condition. Therefore, when the intersection with each element (shown by adding 〜 in the figure) is calculated, there is one intersection with each element, and the intersection is 0 with the other elements, and the cumulative total is 2. It is determined that the total number of intersections is even and the designated point is outside the closed loop.

【0024】図5(b)の場合には、最初の水平の半直線
は、閉ループの要素及びの端点を通るために、除外
条件に該当するとして捨てられる。次にπ/2回転し
て、上向き垂直の半直線にすると、除外条件に該当しな
いので、各要素との交点を計算し、要素との交点1個
のみがあるので、交点総数が奇数で、指定点は閉ループ
内部であると判定する。
In the case of FIG. 5 (b), the first horizontal half-line passes through the closed loop elements and endpoints and is discarded as meeting the exclusion condition. Next, when the line is rotated by π / 2 to make an upward vertical half line, the intersection with each element is calculated because there is no exclusion condition. Since there is only one intersection with the element, the total number of intersections is an odd number. The designated point is determined to be inside the closed loop.

【0025】[0025]

【発明の効果】以上の説明から明らかなように本発明に
よれば、計算機による図形処理に関し、半直線と閉ルー
プとの交点数を使用する方法により、点の領域の識別が
少ない計算時間で正確にできるので、図形処理の処理効
率を改善するという著しい工業的効果がある。
As is apparent from the above description, according to the present invention, in regard to graphic processing by a computer, the method of using the number of intersections between a half line and a closed loop makes it possible to identify a point area accurately in a short calculation time. Therefore, there is a remarkable industrial effect of improving the processing efficiency of graphic processing.

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

【図1】 本発明の構成を示す処理の流れ図FIG. 1 is a flowchart of a process showing a configuration of the present invention.

【図2】 従来の方法を説明する図FIG. 2 is a diagram illustrating a conventional method.

【図3】 半直線の交点による方法を説明する図FIG. 3 is a diagram for explaining a method based on intersections of half lines;

【図4】 本発明の実施例の処理の流れ図FIG. 4 is a flowchart of a process according to an embodiment of the present invention.

【図5】 本発明の処理例を説明する図FIG. 5 is a diagram illustrating a processing example of the present invention.

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

1〜3、10〜20 処理ステップ 1-3, 10-20 processing steps

───────────────────────────────────────────────────── フロントページの続き (56)参考文献 特開 昭64−64081(JP,A) 特開 昭61−213976(JP,A) 特開 平2−130686(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06T 7/60 G06T 11/40 ──────────────────────────────────────────────────続 き Continuation of the front page (56) References JP-A-64-64081 (JP, A) JP-A-61-213976 (JP, A) JP-A-2-130686 (JP, A) (58) Investigation Field (Int.Cl. 7 , DB name) G06T 7/60 G06T 11/40

Claims (1)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】所与の平面図形について、指定点の位置が
指定の閉ループ図形の内か外かを判定する点の閉領域検
索処理装置であって、 指定点から指定の閉ループ図形を構成する要素である曲
線への接線を全て求めて、接点の座標を所定の精度で計
算する手段と、 前記指定点を一端とする半直線と、前記閉ループ図形を
構成する要素の端点、又は該要素が曲線であった場合は
該端点及び該要素の前記接点の座標との距離を前記所定
の精度で求め、該距離が該所定の精度に対応して予め設
定された誤差値より大きくなる半直線を選択する手段
と、 選択した前記半直線と前記閉ループ図形を構成する要素
との全ての交点を求めて、該交点の個数を記憶手段に累
積して格納する手段と、 前記記憶手段に累積された交点の総個数が奇数かを識別
し、奇数であれば前記指定点が前記閉ループ図形の内部
にあり、奇数でなければ前記指定点が前記閉ループ図形
の外部にあると判定する手段と、 を備えることを特徴とする点の閉領域検索処理装置。
1. A closed-area search processing device for a point which determines whether the position of a specified point is inside or outside a specified closed-loop figure for a given plane figure, wherein the specified closed-loop figure is formed from the specified points. Means for calculating all the tangents to the curve which is the element, calculating the coordinates of the contact point with a predetermined accuracy, a half line having the specified point as one end, and the end point of the element constituting the closed loop graphic, or the element is If it is a curve, the distance between the end point and the coordinates of the contact point of the element is determined with the predetermined accuracy, and a half line in which the distance is larger than an error value set in advance corresponding to the predetermined accuracy is determined. Means for selecting, obtaining all the intersections of the selected half-line and the elements constituting the closed-loop figure, and accumulating and storing the number of the intersections in the storage means; Identify whether the total number of intersections is odd and Means for determining that the designated point is inside the closed-loop figure if the number is a number, and that the designated point is outside the closed-loop figure if the number is not an odd number. apparatus.
JP5402292A 1992-03-13 1992-03-13 Point closed area search processor Expired - Fee Related JP3293157B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5402292A JP3293157B2 (en) 1992-03-13 1992-03-13 Point closed area search processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5402292A JP3293157B2 (en) 1992-03-13 1992-03-13 Point closed area search processor

Publications (2)

Publication Number Publication Date
JPH05258060A JPH05258060A (en) 1993-10-08
JP3293157B2 true JP3293157B2 (en) 2002-06-17

Family

ID=12958965

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5402292A Expired - Fee Related JP3293157B2 (en) 1992-03-13 1992-03-13 Point closed area search processor

Country Status (1)

Country Link
JP (1) JP3293157B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102581602B (en) * 2012-03-26 2014-01-01 无锡华联科技集团有限公司 Lifting mechanism for bridge U-shaped rib assembling machine compressing beam

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6070317B2 (en) * 2013-03-19 2017-02-01 ブラザー工業株式会社 Image processing apparatus and computer program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102581602B (en) * 2012-03-26 2014-01-01 无锡华联科技集团有限公司 Lifting mechanism for bridge U-shaped rib assembling machine compressing beam

Also Published As

Publication number Publication date
JPH05258060A (en) 1993-10-08

Similar Documents

Publication Publication Date Title
JP2739130B2 (en) Image processing method
Ellis et al. Ellipse detection and matching with uncertainty
JPH0793541A (en) Shape recognizing method
JPH01111281A (en) Parts recognizing method
CN112528776B (en) Text line correction method and device
JP3293157B2 (en) Point closed area search processor
CN110929738A (en) Certificate card edge detection method, device, equipment and readable storage medium
JPH06274619A (en) Image processor
CN109816677B (en) Information detection method and device
Alter et al. Error propagation in full 3D-from-2D object recognition
CN111251335A (en) High-precision mechanical arm collision detection method based on bounding box algorithm
CN116823766A (en) Chamfer determination method, device, equipment and medium
RU2117331C1 (en) Method for clipping graphic images in system for graphic data processing and device for processing of graphic data
CN113140021B (en) Vector line generating method, system and computer readable storage medium
JPH07225843A (en) Method for measuring center position of circle
CN108121690A (en) Font processing method and device
US5450534A (en) Method of finding and painting a region of a graphics figure
JPS6324473A (en) Graphic recognizing device
JP2632028B2 (en) Mounting data erroneous input detection method
CN115793652B (en) Driving control method and device and electronic equipment
JPH05164569A (en) Run road detector of traveling vehicle
Kwon et al. Ellipse detection method based on the advanced three point algorithm
JP2755145B2 (en) Division point setting method
JPH07147500A (en) Method of judging mutual interference of mounted part
JP4312891B2 (en) 3D position and orientation detection device for circular features

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20011106

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20020305

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

Free format text: PAYMENT UNTIL: 20080405

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090405

Year of fee payment: 7

LAPS Cancellation because of no payment of annual fees