JP4066103B2 - Graphic clipping device and graphic clipping method - Google Patents

Graphic clipping device and graphic clipping method Download PDF

Info

Publication number
JP4066103B2
JP4066103B2 JP11841098A JP11841098A JP4066103B2 JP 4066103 B2 JP4066103 B2 JP 4066103B2 JP 11841098 A JP11841098 A JP 11841098A JP 11841098 A JP11841098 A JP 11841098A JP 4066103 B2 JP4066103 B2 JP 4066103B2
Authority
JP
Japan
Prior art keywords
vertex
vertices
convex polygon
convex
initial
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
JP11841098A
Other languages
Japanese (ja)
Other versions
JPH11312240A (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.)
Brother Industries Ltd
Original Assignee
Brother Industries 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 Brother Industries Ltd filed Critical Brother Industries Ltd
Priority to JP11841098A priority Critical patent/JP4066103B2/en
Publication of JPH11312240A publication Critical patent/JPH11312240A/en
Application granted granted Critical
Publication of JP4066103B2 publication Critical patent/JP4066103B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Description

【0001】
【発明の属する技術分野】
本発明は、例えば、画像処理装置、描画装置または図形編集装置等に用いられる図形クリッピング装置および図形クリッピング方法に関し、さらに詳しくは、複数の凸多角形の互いに重なり合った部分を抽出する図形クリッピング装置および図形クリッピング方法に関する。
【0002】
【従来の技術】
例えば、コンピュータグラフィックス等の分野において、画像の作成または編集を行うときには、画像処理装置、描画装置または図形編集装置等が用いられる。これらの装置は、画像を構成する複数の図形に対応する図形データに対して演算処理を施し、図形の変形、移動、削除等の図形編集処理を行う。
【0003】
ところで、このような図形編集処理の1つに、図形クリッピング処理がある。図形クリッピング処理とは、複数の図形の互いに重なり合った部分を切り出す(クリッピングする)処理である。この図形クリッピング処理には、スラブ法が用いられる。スラブ法は、一般に知られた方法であり、例えば、朝野哲夫「計算幾何学」,朝倉書店等に記載されている。
【0004】
ここで、2つの凸多角形の互いに重なり合った部分を切り出す方法を図11に従って説明する。
【0005】
図11において、X−Y座標面上に配置された凸多角形Pと凸多角形Qとは、互いに重なり合っている。ここで、互いに重なり合った部分を重なり部分Rとする。また、凸多角形Pの各頂点のうち、最上に位置する頂点を上端点Puとし、最下に位置する頂点を下端点Pbとし、凸多角形Pの各辺を、上端点Puから下端点Pbに向けて反時計回りに辿ったときに通過する各頂点を、通過する順番にPLi(i=1,2,3,…)とし、凸多角形Pの各辺を、下端点Pbから上端点Puに向けて反時計回りに辿ったときに通過する各頂点を、通過する順番にPRj(j=1,2,3,…)とする。同様に、凸多角形Qの各頂点のうち、最上に位置する頂点を上端点Quとし、最下に位置する頂点を下端点Qbとし、凸多角形Qの各辺を、上端点Quから下端点Qbに向けて反時計回りに辿ったときに通過する各頂点を、通過する順番にQLm(m=1,2,3,…)とし、凸多角形Qの各辺を、下端点Qbから上端点Quに向けて反時計回りに辿ったときに通過する各頂点を、通過する順番にQRn(n=1,2,3,…)とする。さらに、図の左上端をX−Y座標面の原点とし、例えば、凸多角形Pの上端点PuのY座標をY(Pu)と表記する。その他の頂点Pb,PLi,PRj,Qu,Qb,QLm,QRnのY座標についてもこれと同様に表記する。
【0006】
以上のような条件の下で、例えば、凸多角形Qの各頂点QRnに着目し、以下のステップ(1)〜(3)を実行する。
【0007】
(1)凸多角形Pの各頂点PLi,PRjの中から、下記の数式1を満たす頂点PLi,PRjを選択する。
【0008】
【数1】
Y(PLi-1)<Y(QRn)≦Y(PLi)
Y(PRj+1)<Y(QRn)≦Y(PRj)
(2)凸多角形Qの辺(QRn,QRn+1)が、凸多角形Pのいずれかの辺と交わるか否かを判定し、交わるときには、その交点の座標を出力する。
【0009】
(3)凸多角形Qの頂点QRnが、凸多角形Pの辺(PLi-1,PLi)と辺(PRj,PRj+1)との間に位置するか否かを判定し、頂点QRnがこれらの辺の間に位置するときには、頂点QRnの座標を出力する。
【0010】
例えば、図11中の凸多角形Qの頂点QR2に着目し、上記ステップ(1)〜(3)を実行した場合、上記数式1を満たす頂点PLi,PRjは、PL3,Pb(PQ0=Pbとする)である。そして、凸多角形Qの辺(QR2,QR3)は、凸多角形Pの辺(PL1,PL2)と交わるので、交点Aの座標を出力する。さらに、頂点QR2は、辺(PL2,PL3)と辺(Pb,PR1)との間に位置するので、頂点QR2の座標を出力する。
【0011】
上記ステップ(1)〜(3)を各凸多角形P,Qの各頂点PLi,PRj,QLm,QRn、上端点Pu,Quおよび下端点Pb,Qbについて実行することによって、重なり部分Rを包囲する各点の座標が出力されることになる。なお、上端点Pu,Quについては、上記ステップ(1)および(3)のみを実行する。そして、出力された各点の座標基づいて重なり部分Rに対応する図形を特定することができ、この重なり部分Rを切り出すことができる。
【0012】
なお、スラブ法とは、凸多角形を複数の台形(スラブ)の集合と考え、異なる凸多角形に属するスラブの間に交差があるか否かを判定することによって、各凸多角形の重なり部分があるか否かを認識するものである。上述したステップ(1)〜(3)は、このスラブ法に基づいて図形クリッピング処理を実現したときの具体的な手順を示したものである。
【0013】
【発明が解決しようとする課題】
ところで、上記ステップ(1)〜(3)を各凸多角形の各頂点について実行すれば、理論的には、各凸多角形の重なり部分を切り出すことができる。しかしながら、上記ステップ(1)〜(3)を実際に、画像処理装置、描画装置または図形編集装置に実行させて、図形クリッピング処理を行うと、演算処理に時間がかかるという問題がある。
【0014】
特に、上記ステップ(3)では、一方の多角形の頂点が他方の多角形の2つの辺との間に位置するか否かの判定を行う。この判定には、頂点の座標および各辺の端点の座標等を用いて外積計算を行う必要があるため、演算処理に時間がかかるという問題がある。
【0015】
例えば、図形クリッピング処理の対象となる凸多角形が、複雑な形状をなし、膨大な頂点および辺を有する場合、各凸多角形の重なり部分を切り出すには、外積計算を何度も実行しなければならない。また、図形クリッピング処理の対象となる図形が曲線を含む場合には、通常、曲線を多数の短い直線に近似して処理を行う。このような場合にも、頂点および辺の数が膨大となり、外積計算を行う回数が膨大となる。この結果、演算処理の時間が長くなり、画像の作成または編集の作業性が低下する場合があるという問題がある。
【0016】
本発明は、上述した問題に鑑みなされたものであり、図形クリッピング処理を高速に実行することができ、図形クリッピング作業の作業性を向上させることができる図形クリッピング装置および図形クリッピング方法を提供することを目的としている。
【0017】
【課題を解決するための手段】
上述した課題を解決するために、請求項1の発明は、X軸方向を左右方向とし、かつ、Y軸方向を上下方向とするX−Y座標面上における2つの凸多角形の重なり合った部分に対応する図形を切り出す図形クリッピング装置であって、れぞれの凸多角形の各辺のうち、それぞれの凸多角形の最上に位置する頂点である上端頂点から最下に位置する頂点である下端頂点までを右回りに辿ることができる辺である右辺についてそれぞれ設けられた属性フラグおよびそれぞれの凸多角形の前記上端頂点から前記下端頂点までを左回りに辿ることができる辺である左辺についてそれぞれ設けられた属性フラグと、前記2つの凸多角形の前記上端頂点のうち、より下方に位置する上端頂点を初期頂点として選択し、前記初期頂点が当該初期頂点を含まない他方の凸多角形の前記左辺と前記右辺との間に位置するか否かを判定し、その判定の結果、前記初期頂点が前記他方の凸多角形の左辺と右辺との間に位置するときには、当該初期頂点の座標を出力し、かつ、前記初期頂点を含む方の凸多角形の前記右辺についての前記属性フラグおよび前記左辺についての前記属性フラグをそれぞれON状態にセットすると共に前記他方の凸多角形の前記右辺についての前記属性フラグおよび前記左辺についての前記属性フラグをそれぞれOFF状態にセットし、一方、前記初期頂点が前記他方の凸多角形の左辺と右辺の間に位置しないときには、前記初期頂点を含む方の凸多角形の前記右辺についての前記属性フラグおよび前記左辺についての前記属性フラグをそれぞれOFF状態にセットすると共に前記他方の凸多角形の前記右辺についての前記属性フラグおよび前記左辺についての前記属性フラグをそれぞれOFF状態にセットする初期設定手段と、前記初期頂点の両隣にある2つの頂点と、当該初期頂点を通り、かつ、X軸に平行な線と交差する前記他方の凸多角形の2辺それぞれの端点である2つ頂点のうち、より下方に位置するそれぞれの頂点との4つの頂点、もしくは、前回の選択頂点に隣接し、かつ、当該選択頂点よりも下方に位置する頂点と、前記前回の選択頂点の候補である選択候補頂点から前記前回の選択頂点を除く3つの頂点との4つの頂点、のいずれか一方の4つの頂点今回の選択候補頂点とし、当該選択候補頂点のうち最上に位置する頂点を今回の前記選択頂点として選択する頂点選択手段と、前記選択頂点を含む方の凸多角形の各辺のうち、当該選択頂点と当該選択頂点よりも上方に位置する頂点とを端点とする辺を選択辺とし、当該選択頂点を含まない方の凸多角形の各辺のうち、前記選択候補頂点と当該選択候補頂よりも上方に位置する頂点とを端点とする2つの辺と前記選択辺とがそれぞれ交差するか否かを判定する交差判定手段と、前記交差判定手段による判定の結果、前記選択辺が前記選択頂点を含まない方の凸多角形の辺と交差するときには、その度に、その交点の座標を出力すると共に、互いに交差する辺についての前記属性フラグをそれぞれ反転させる交点座標出力手段と、前記属性フラグのうち、前記選択辺に対応する属性フラグがON状態か否かを判定する属性フラグ判定手段と、前記属性フラグ判定手段によって属性フラグがON状態と判定されたときに、前記選択頂点の座標を出力する頂点座標出力手段と、前記頂点座標出力手段によって出力された前記選択頂点の座標、前記初期設定手段によって前記初期頂点の座標が出力された場合にはその座標、および、前記交点座標出力手段によって前記交点の座標が出力された場合にはその座標に基づいて前記2つの凸多角形の重なり合った部分に対応する図形を切り出す切出手段とを備えている。
【0018】
即ち、2つの凸多角形は、例えば、記憶回路内等に形成されたX−Y座標平面上に配置されており、これらの凸多角形を所定の走査方向に走査することによって図形クリッピング処理を行う。つまり、X−Y座標平面上における上方から下方に向けて、図形クリッピング処理は進行する。
【0019】
また、2つの凸多角形のうち、一方の凸多角形について、最上に位置する頂点である上端頂点から最下に位置する頂点である下端頂点までを右回りに辿ることができる各辺(下端頂点から上端頂点に向けて反時計回りに辿ったときに通過する各辺)を一方の凸多角形の右辺と呼び、一方の凸多角形の各辺を、上端頂点から下端頂点までを左回りに辿ることができる各辺(上端頂点から下端頂点に向けて反時計回りに辿ったときに通過する各辺)を一方の凸多角形の左辺と呼ぶ。そして、一方の凸多角形の右辺についての属性フラグと、一方の凸多角形の左辺についての属性フラグをそれぞれ設ける。ここで、属性フラグとは、例えば、書き換え可能な記録回路上に設けられたフラグであり、ON状態とOFF状態の2種類の状態を記憶することができる。
【0020】
これと同様に、他方の凸多角形についても、上端頂点から下端頂点までを右回りに辿ることができる辺を右辺と呼び、上端頂点から下端頂点までを左回りに辿ることができる辺を左辺と呼ぶ。そして、他方の凸多角形の右辺についての属性フラグと、一方の凸多角形の左辺についての属性フラグをそれぞれ設ける。
【0021】
このように、4つの属性フラグを用いて図形クリッピング処理を行う。
【0022】
次に、初期設定手段は、2つの凸多角形の上端頂点のうち、より下方に位置する上端頂点を初期頂点として選択する。さらに、初期設定手段は、初期頂点が当該初期頂点を含まない方の凸多角形の左辺と右辺との間に位置するか否かを判定する。
【0023】
その判定の結果、初期頂点が当該初期頂点を含まない方の凸多角形の左辺と右辺との間に位置するときには、当該初期頂点の座標を出力し、かつ、初期頂点を含む方の凸多角形の右辺についての属性フラグおよび左辺についての属性フラグをそれぞれON状態にセットすると共に初期頂点を含まない方の凸多角形の右辺についての属性フラグおよび左辺についての属性フラグをそれぞれOFF状態にセットする。一方、初期頂点が当該初期頂点を含まない方の凸多角形の左辺と右辺の間に位置しないときには、当該初期頂点の座標を出力せず、初期頂点を含む方の凸多角形の右辺についての属性フラグおよび左辺についての属性フラグをそれぞれOFF状態にセットすると共に初期頂点を含まない方の凸多角形の右辺についての属性フラグおよび左辺についての属性フラグをそれぞれOFF状態にセットする。
【0024】
次に、頂点選択手段は、各凸多角形の各頂点の中から、後述する交差判定手段、交点座標出力手段、属性フラグ判定手段および頂点座標出力手段による一連の処理の対象となる頂点を選択頂点として選択する。
【0025】
即ち、頂点選択手段、交差判定手段、交点座標出力手段、属性フラグ判定手段および頂点座標出力手段による一連の処理は、繰り返し実行される。そして、この一連の処理が一巡する毎に、頂点選択手段は、各凸多角形の各頂点のうち、未処理の新たな頂点を選択頂点として次々に選択する。
【0026】
さらに具体的に説明すると、初期設定手段による処理が終了した直後においては、頂点選択手段は、初期頂点の両隣にある2つの頂点と、当該初期頂点を通り、かつ、X軸に平行な線と交差する他方の凸多角形の2辺それぞれの端点である2つ頂点のうち、より下方に位置するそれぞれの頂点との合計4つの頂点を選択候補頂点として選択し、これら4つの選択候補頂点の中から最上に位置する頂点を選択頂点として選択する。また、頂点選択手段、交差判定手段、交点座標出力手段、属性フラグ判定手段および頂点座標出力手段による一連の処理が1回以上実行された後は、頂点選択手段は、前回の選択頂点に隣接し、かつ、当該選択頂点よりも下方に位置する頂点と、選択候補頂点(前回の選択候補頂点)から前記前回の選択頂点を除いた3つの頂点との合計4つの頂点を選択候補頂点とし、これら4つの選択候補頂点の中から最上に位置する頂点を選択頂点として選択する
【0027】
次に、交差判定手段は、選択頂点と当該選択頂点よりも上方に位置する頂点とを端点とする辺を選択辺とし、選択頂点を含まない方の凸多角形において選択候補頂点と当該選択候補頂よりも上方に位置する頂点とを端点とする2つの辺と選択辺とが交差するか否かを判定する。
【0028】
次に交点座標出力手段は、前記交差判定手段による判定の結果、選択辺が選択頂点を含まない方の凸多角形の2辺のうちのいずれか一方と交差するときには、その交点の座標を出力すると共に、互いに交差する辺についての属性フラグをそれぞれ反転させる。即ち、属性フラグの状態がOFF状態のときには、それをON状態に切り換える。一方、属性フラグの状態がON状態のときには、それをOFF状態に切り換える。また、交点座標出力手段は、前記交差判定手段による判定の結果、選択辺が選択頂点を含まない方の凸多角形の2辺の双方とそれぞれ交差するときには、各交点の座標を出力すると共に、互いに交差する辺についての属性フラグをそれぞれ反転させる。なお、前記交差判定手段による判定の結果、選択辺が選択頂点を含まない方の凸多角形のいずれの辺とも交差しないときには、各属性フラグの状態は維持される。
【0029】
次に、属性フラグ判定手段は、選択辺に対応する属性フラグがON状態か否かを判定する。続いて、頂点座標出力手段は、属性フラグ判定手段によって属性フラグがON状態と判定されたとき、選択頂点の座標を出力する。
【0030】
そして、頂点選択手段、交差判定手段、交点座標出力手段、属性フラグ判定手段および頂点座標出力手段による一連の処理繰り返し実行する。
【0031】
次に、切出手段は、頂点座標出力手段によって出力された選択頂点の座標、初期設定手段において初期頂点の座標が出力された場合にはその座標、および、交点座標出力手段によって交点の座標が出力された場合にはその座標に基づいて2つの凸多角形の重なり合った部分に対応する図形を切り出す。
【0032】
このように、上述した図形クリッピング装置では、選択頂点の座標を出力するか否かを、属性フラグの状態に基づいて決定している。そして、属性フラグは、一方の凸多角形の選択頂点が他方の凸多角形の内部にあるときに、ON状態となり、一方の凸多角形の選択頂点が他方の凸多角形の外部にあるときには、OFF状態となるようにセットされる。
【0033】
例えば、初期設定手段において、一方の凸多角形の初期頂点が他方の凸多角形の2つの辺の間に位置するとき、属性フラグはON状態にセットされる。一方の凸多角形の初期頂点が、他方の凸多角形の2つの辺の間に位置するということは、即ち、一方の凸多角形の初期頂点が、他方の凸多角形の内部に位置することを意味する。また、交点座標出力手段において、選択辺が他方の凸多角形のいずれかの辺と交差するとき、属性フラグの状態は反転する。選択辺が他方の凸多角形のいずれかの辺と交差したということは、一方の凸多角形の選択頂点が他方の凸多角形の内部に入ったこと、または、一方の凸多角形の選択頂点が他方の凸多角形の内部から外部に出たことを意味する。
【0034】
このように、属性フラグは、一方の凸多角形の選択頂点が他方の凸多角形の内部に位置するときに、ON状態にセットされる。従って、属性フラグがON状態のときに、その選択頂点の座標を出力すれば、各凸多角形の重なり合った部分を包囲する各点の座標を抽出することができ、重なり合った部分に対応する図形を特定して切り出すことができる。
【0035】
これにより、初期設定手段において、初期頂点が他方の凸多角形の2つの辺の間に位置するか否かを判定するときに、外積計算を1回だけ実行するものの、その後は、外積計算を一切行わずに、各凸多角形の互いに重なり合った部分を包囲する各点の座標を抽出することができ、この重なり合った部分を切り出すことができる。従って、図形クリッピング処理における演算処理の時間を減少させることができ、図形クリッピング作業の作業性を向上させることができる。
【0036】
また、請求項2の発明による図形クリッピング方法によっても、上述した請求項1の発明による図形クリッピング装置と同様に、図形クリッピング処理における演算処理の時間を減少させることができ、図形クリッピング作業の作業性を向上させることができる。
【0037】
さらに、請求項3の発明による録媒体に記録されたプログラムをコンピュータに読み取らせ、このプログラムをコンピュータに実行させることにより、コンピュータを、上述した請求項1の発明による図形クリッピング装置として機能させることができる。
【0038】
【発明の実施の形態】
以下、本発明の実施の形態を添付図面に従って説明する。
【0039】
図1は、本発明の実施形態による図形クリッピング装置10を示している。この図形クリッピング装置10は、複数の図形の互いに重なり合った部分を切り出す処理、即ち、図形クリッピング処理を行うものである。
【0040】
図1に示すように、図形クリッピング装置10は、CPU1,ROM2,RAM3,ディスプレイ4、マウス5、キーボード6を備えており、これらは、バス7を介して相互に接続されている。
【0041】
CPU1は、図形クリッピング装置10の全体的な制御を行うものである。また、CPU1は、図5ないし図10に示す図形クリッピング処理プログラムを実行する。ROM2には、図形クリッピング装置10を制御するためのプログラムおよび図5ないし図10に示す図形クリッピング処理プログラム等が記憶されている。RAM3には、図2に示すような属性フラグ8が記録されている。また、RAM3は、図形クリッピング処理を行うときの作業エリアとして使用される。ディスプレイ4は、図形クリッピング処理を行うときに、処理の対象となる図形等を表示するものであり、マウス5およびキーボード6は図形クリッピング装置10に指令やデータを入力するものである。
【0042】
次に、図形クリッピング処理について説明する。以下の説明では、図3に示す2つの凸多角形P,Qの重なり合った部分を切り出す場合を例に挙げる。
【0043】
図3において、X−Y座標面上に配置された凸多角形Pと凸多角形Qとは、互いに重なり合っている。ここで、互いに重なり合った部分を重なり部分Rとする。また、凸多角形Pの各頂点のうち、最上に位置する頂点(Y座標が最も小さい頂点)を上端点Puとし、最下に位置する頂点(Y座標が最も大きい頂点)を下端点Pbとし、凸多角形Pの各辺を、上端点Puから下端点Pbに向けて反時計回りに辿ったときに通過する各頂点を、通過する順番にPLi(i=1,2,3,…)とし、凸多角形Pの各辺を、下端点Pbから上端点Puに向けて反時計回りに辿ったときに通過する各頂点を、通過する順番にPRj(j=1,2,3,…)とする。同様に、凸多角形Qの各頂点のうち、最上に位置する頂点を上端点Quとし、最下に位置する頂点を下端点Qbとし、凸多角形Qの各辺を、上端点Quから下端点Qbに向けて反時計回りに辿ったときに通過する各頂点を、通過する順番にQLm(m=1,2,3,…)とし、凸多角形Qの各辺を、下端点Qbから上端点Quに向けて反時計回りに辿ったときに通過する各頂点を、通過する順番にQRn(n=1,2,3,…)とする。さらに、図の左上端をX−Y座標面の原点とする。
【0044】
また、説明の便宜上、例えば、凸多角形Pの上端点PuのY座標をY(Pu)と表記する。その他の頂点Pb,PLi,PRj,Qu,Qb,QLm,QRnのY座標についてもこれと同様に表記する。また、凸多角形Pの上端点Puから下端点Pbに向けて反時計回りに辿ったときに通過する各辺を凸多角形Pの左辺と呼び、下端点Pbから上端点Puに向けて反時計回りに辿ったときに通過する各辺を凸多角形Pの右辺と呼ぶ。同様に、凸多角形Qの上端点Quから下端点Qbに向けて反時計回りに辿ったときに通過する各辺を凸多角形Qの左辺と呼び、下端点Qbから上端点Quに向けて反時計回りに辿ったときに通過する各辺を凸多角形Qの右辺と呼ぶ。
【0045】
また、図形クリッピング処理には、X−Y座標面のX軸に平行な走査線を用いる。この走査線を、Y座標値の小さい側から大きい側にY軸に沿って移動させることにより、後述する頂点出力処理等を行う。以下、走査線が移動する方向を走査方向と呼び、Y座標値の小さい側を走査方向開始側と呼び、Y座標値の大きい側を走査方向終了側または走査方向側と呼ぶ。
【0046】
さらに、図形クリッピング処理には、図2に示す属性フラグ8が用いられる。属性フラグ8とは、凸多角形Pの左辺の状態、凸多角形Pの右辺の状態、凸多角形Qの左辺の状態および凸多角形Qの右辺の状態を示す4つのフラグから構成されている。これらのフラグは、図形クリッピング処理の中でON状態またはOFF状態にそれぞれセットされる。
【0047】
それでは、図形クリッピング処理について図5ないし図10のフローチャートに沿って説明する。
【0048】
まず、作業者が、図3に示す凸多角形P,Qに対応する図形データと図形クリッピング処理を開始させるための指令を図形クリッピング装置10に入力すると、CPU1は、凸多角形P,Qに対応する図形データをRAM3の作業エリアに記憶し、図5に示す図形クリッピング処理のメインルーチンを実行する。
【0049】
図5に示すように、まず、凸多角形P,Qに対応する図形データに基づいて、凸多角形P,Qの各頂点、各上端点および各下端点の座標を認識する(ステップ1)。このとき、図3に示すように、2つの凸多角形のうち、上端点のY座標の値が小さい方を凸多角形Pとし、上端点のY座標の値が大きい方を凸多角形Qとする。
【0050】
次に、凸多角形Qの上端点QuのY座標が、凸多角形Pの下端点PbのY座標よりも大きいか否かを判定し(ステップ2)、大きいときには、図形クリッピング処理を終了する。凸多角形Qの上端点QuのY座標が、凸多角形Pの下端点PbのY座標よりも大きいときには、凸多角形Pと凸多角形Qは重なっていないと判断できるからである。一方、凸多角形Qの上端点QuのY座標が、凸多角形Pの下端点PbのY座標よりも大きくないときには、凸多角形Pと凸多角形Qは重なっている判断できる。そこで、まず初期設定処理を実行すべく、図6に示す初期設定処理プログラムを起動する(ステップ3)。
【0051】
図6中の初期設定処理では、まず、下記の数式2を満たすPLi,PRjを求める(ステップ11およびステップ12)。
【0052】
【数2】
Y(PLi-1)<Y(QRn)≦Y(PLi)
Y(PRj+1)<Y(QRn)≦Y(PRj)
次に、上記数式2を満たすPLi,PRjをそれぞれ含む凸多角形Pの左辺(PLi-1,PLi)と右辺(PRj,PRj+1)を求め、凸多角形Qの上端点Qu(初期頂点)が、これらの辺の間に位置するか否かを判定する(ステップ13)。上端点Quがこれら2つの辺の間に位置するときには、上端点Quの座標をRAM3の記憶エリア中の所定の場所に出力すると共に、凸多角形Qの左辺および右辺の属性フラグをON状態にセットする(ステップ14およびステップ15)。一方、凸多角形Qの上端点Quが、これらの辺の間に位置しないときには、上端点Quの座標を出力せず、凸多角形Qの左辺および右辺の属性フラグをOFF状態にセットする(ステップ16)。
【0053】
次に、凸多角形Pの左辺および右辺の属性フラグをOFF状態にセットし(ステップ17)、図5に示すメインルーチンのステップ4に移行する。
【0054】
図5中のステップ4では、凸多角形Qの上端点Quの両隣にある2つの頂点QLm,QRnと、当該凸多角形Qの上端点Quを通る走査線と交差する凸多角形Pの2辺が持つ走査方向側の2つの頂点PLi,PRjとの合計4つの頂点を選択候補としてそれぞれ選択する。さらに、選択候補として選択された4つの頂点の中から、Y座標の値が最小の頂点を選択頂点として選択する。そして、図7ないし図10に示す頂点出力処理を起動する(ステップ5)。
【0055】
頂点出力処理では、選択頂点が頂点PLi,PRj,QLmおよびQRnのいずれかを判定する(図7中のステップ21ないしステップ23)。そして、選択頂点が頂点PLiのときには図8中のステップ41へ移行する。
【0056】
図8中のステップ41では、凸多角形Pの各左辺の中から、走査方向側に選択頂点PLiを持つ左辺(PLi-1,PLi)を選択辺として設定する。さらに、凸多角形Qにおいて走査方向側に選択候補頂点を持つ2つの辺、即ち、右辺(QRn,QRn+1)および左辺(QLm-1,QLm)を処理対象辺として設定する。
【0057】
次に、凸多角形Pの選択辺(PLi-1,PLi)が、処理対象辺として設定されている凸多角形Qの右辺(QRn,QRn+1)と交差するか否かを判定する(ステップ42)。そして、凸多角形Pの選択辺(PLi-1,PLi)が、凸多角形Qの右辺(QRn,QRn+1)と交差するときには、その交点の座標を出力すると共に、互いに交差する2つの属性フラグ8を反転させる(ステップ43およびステップ44)。一方、凸多角形Pの選択辺(PLi-1,PLi)が、凸多角形Qの右辺(QRn,QRn+1)と交差しないときには、属性フラグ8を反転させない。
【0058】
次に、凸多角形Pの選択辺(PLi-1,PLi)が、処理対象辺として設定されている凸多角形Qの左辺(QLm-1,QLm)と交差するか否かを判定する(ステップ45)。そして、凸多角形Pの選択辺(PLi-1,PLi)が、凸多角形Qの左辺(QLm-1,QLm)と交差するときには、その交点の座標を出力すると共に、互いに交差する2つの属性フラグ8を反転させる(ステップ46およびステップ47)。一方、凸多角形Pの選択辺(PLi-1,PLi)が、凸多角形Qの左辺(QLm-1,QLm)と交差しないときには、属性フラグを反転させない。
【0059】
次に、凸多角形Pの左辺の属性フラグ8がON状態か否かを判定し、ON状態のときには、選択頂点として選択されている頂点PLiの座標をRAM3の記憶エリア中の所定の場所に出力する(ステップ48およびステップ49)。一方、凸多角形Pの左辺の属性フラグ8がOFF状態のときには、頂点PLiの座標を出力しない。
【0060】
一方、選択頂点が頂点PRjのときには図9中のステップ51へ移行する。そして、図9中のステップ51では、凸多角形Pの各右辺の中から、走査方向側に選択頂点PRjを持つ右辺(PRj,PRj+1)を選択辺として設定する。さらに、凸多角形Qにおいて走査方向側に選択候補頂点を持つ2つの辺、即ち、左辺(QLm-1,QLm)および右辺(QRn,QRn+1)を処理対象辺として設定する。
【0061】
次に、凸多角形Pの選択辺(PRj,PRj+1)が、処理対象辺として設定されている凸多角形Qの左辺(QLm-1,QLm)と交差するか否かを判定する(ステップ52)。そして、凸多角形Pの選択辺(PRj,PRj+1)が、凸多角形Qの左辺(QLm-1,QLm)と交差するときには、その交点の座標を出力すると共に、互いに交差する2つの属性フラグ8を反転させる(ステップ53およびステップ54)。一方、凸多角形Pの選択辺(PRj,PRj+1)が、凸多角形Qの左辺(QLm-1,QLm)と交差しないときには、属性フラグ8を反転させない。
【0062】
次に、凸多角形Pの選択辺(PRj,PRj+1)が、処理対象辺として設定されている凸多角形Qの右辺(QRn,QRn+1)と交差するか否かを判定する(ステップ55)。そして、凸多角形Pの選択辺(PRj,PRj+1)が、凸多角形Qの右辺(QRn,QRn+1)と交差するときには、その交点の座標を出力すると共に、互いに交差する2つの属性フラグ8を反転させる(ステップ56およびステップ57)。一方、凸多角形Pの選択辺(PRj,PRj+1)が、凸多角形Qの右辺(QRn,QRn+1)と交差しないときには、属性フラグを反転させない。
【0063】
次に、凸多角形Pの右辺の属性フラグ8がON状態か否かを判定し、ON状態のときには、選択頂点として選択されている頂点PRjの座標をRAM3の記憶エリア中の所定の場所に出力する(ステップ58およびステップ59)。一方、凸多角形Pの右辺の属性フラグ8がOFF状態のときには、頂点PRjの座標を出力しない。
【0064】
一方、選択頂点が頂点QLmのときには図10中のステップ61へ移行する。そして、図10中のステップ61では、凸多角形Qの各左辺の中から、走査方向側に選択頂点QLmを持つ左辺(QLm-1,QLm)を選択辺として設定する。さらに、凸多角形Pにおいて走査方向側に選択候補頂点を持つ2つの辺、即ち、右辺(PRj,PRj+1)および左辺(PLi-1,PLi)を処理対象辺として設定する。
【0065】
次に、凸多角形Qの選択辺(QLm-1,QLm)が、処理対象辺として設定されている凸多角形Pの右辺(PRj,PRj+1)と交差するか否かを判定する(ステップ62)。そして、凸多角形Qの選択辺(QLm-1,QLm)が、凸多角形Pの右辺(PRj,PRj+1)と交差するときには、その交点の座標を出力すると共に、互いに交差する2つの属性フラグ8を反転させる(ステップ63およびステップ64)。一方、凸多角形Qの選択辺(QLm-1,QLm)が、凸多角形Pの右辺(PRj,PRj+1)と交差しないときには、属性フラグ8を反転させない。
【0066】
次に、凸多角形Qの選択辺(QLm-1,QLm)が、処理対象辺として設定されている凸多角形Pの左辺(PLi-1,PLi)と交差するか否かを判定する(ステップ65)。そして、凸多角形Qの選択辺(QLm-1,QLm)が、凸多角形Pの左辺(PLi-1,PLi)と交差するときには、その交点の座標を出力すると共に、互いに交差する2つの属性フラグ8を反転させる(ステップ66およびステップ67)。一方、凸多角形Qの選択辺(QLm-1,QLm)が、凸多角形Pの左辺(PLi-1,PLi)と交差しないときには、属性フラグを反転させない。
【0067】
次に、凸多角形Qの左辺の属性フラグ8がON状態か否かを判定し、ON状態のときには、選択頂点として選択されている頂点QLmの座標をRAM3の記憶エリア中の所定の場所に出力する(ステップ68およびステップ69)。一方、凸多角形Qの左辺の属性フラグ8がOFF状態のときには、頂点QLmの座標を出力しない。
【0068】
一方、選択頂点が頂点QRnのときには図7中のステップ24へ移行する。そして、図7中のステップ24では、凸多角形Qの各右辺の中から、走査方向側に選択頂点QRnを持つ右辺(QRn,QRn+1)を選択辺として設定する。さらに、凸多角形Pにおいて走査方向側に選択候補頂点を持つ2つの辺、即ち、左辺(PLi-1,PLi)および右辺(PRj,PRj+1)を処理対象辺として設定する。
【0069】
次に、凸多角形Qの選択辺(QRn,QRn+1)が、処理対象辺として設定されている凸多角形Pの左辺(PLi-1,PLi)と交差するか否かを判定する(ステップ25)。そして、凸多角形Qの選択辺(QRn,QRn+1)が、凸多角形Pの左辺(PLi-1,PLi)と交差するときには、その交点の座標を出力すると共に、互いに交差する2つの属性フラグ8を反転させる(ステップ26およびステップ27)。一方、凸多角形Qの選択辺(QRn,QRn+1)が、凸多角形Pの左辺(PLi-1,PLi)と交差しないときには、属性フラグ8を反転させない。
【0070】
次に、凸多角形Qの選択辺(QRn,QRn+1)が、処理対象辺として設定されている凸多角形Pの右辺(PRj,PRj+1)と交差するか否かを判定する(ステップ28)。そして、凸多角形Qの選択辺(QRn,QRn+1)が、凸多角形Pの右辺(PRj,PRj+1)と交差するときには、その交点の座標を出力すると共に、互いに交差する2つの属性フラグ8を反転させる(ステップ29およびステップ30)。一方、凸多角形Qの選択辺(QRn,QRn+1)が、凸多角形Pの右辺(PRj,PRj+1)と交差しないときには、属性フラグを反転させない。
【0071】
次に、凸多角形Qの右辺の属性フラグ8がON状態か否かを判定し、ON状態のときには、選択頂点として選択されている頂点QRnの座標をRAM3の記憶エリア中の所定の場所に出力する(ステップ31およびステップ32)。一方、凸多角形Qの右辺の属性フラグ8がOFF状態のときには、頂点QRnの座標を出力しない。
【0072】
以上のような図7ないし図10に示す頂点出力処理が終了したら、図5に示すメインルーチンのステップ6に移行する。
【0073】
図6中のステップ6では、選択頂点が凸多角形Pの下端点Pbまたは凸多角形Qの下端点Qbか否かを判定する。そして、選択頂点が下端点Pbまたは下端点Qbでないときには、ステップ4に戻る。
【0074】
そして、ステップ4では、今まで選択頂点として選択していた頂点を選択候補から外し、その代わりに、今まで選択頂点として選択していた頂点のY軸方向隣に位置する頂点を新たな選択候補に加える。即ち、今まで選択していた頂点が頂点PLiの場合には、その頂点PLiを選択候補から外し、頂点PLi+1を新たに選択候補に加える。また、今まで選択していた頂点が頂点PRjの場合には、その頂点PRjを選択候補から外し、頂点PRj-1を新たに選択候補に加える。さらに、今まで選択していた頂点が頂点QLmの場合には、その頂点QLmを選択候補から外し、頂点QLm+1を新たに選択候補に加える。さらにまた、今まで選択していた頂点が頂点QRnの場合には、その頂点QRnを選択候補から外し、頂点QRn-1を新たに選択候補に加える。さらに、ステップ4では、選択候補として選択された4つの頂点の中から、Y座標の値が最小の頂点を選択頂点として新たに選択する。そして、図7ないし図10に示す頂点出力処理を再び起動する(ステップ5)。
【0075】
このように、ステップ4ないしステップ6の処理を繰り返すことにより、図3中の矢示に示すような走査方向に沿って処理の開始側から終了側に向けて頂点出力処理が進行する。即ち、図3に示す凸多角形P,Qの各頂点がY座標の値が小さい順に次々に選択頂点として選択され、頂点出力処理の対象となる。そして、選択頂点として下端点Pbまたは下端点Qbが選択されたときに、ステップ6で「YES」と判定され、ステップ7に移行する。この段階で、凸多角形Pと凸多角形Qとの重なり部分Rを包囲する各頂点の座標が、RAM3の記憶エリア中の所定の場所に出力されている。
【0076】
そして、ステップ7では、RAM3の記憶エリア中の所定の場所に出力された上記各頂点の座標に基づいて、重なり部分Rの切出処理を行う。
【0077】
次に、実際に図3に示す凸多角形P,Qの重なり部分Rを切り出す動作について図4に示す属性フラグの履歴を参照しつつ説明する。
【0078】
まず、凸多角形Qの上端点QuのY座標は、凸多角形Pの下端点PbのY座標より大きくないため、初期設定処理が実行される(ステップ2およびステップ3)。そして、初期設定処理において、上端点Qu(初期頂点)が、上記数式2を満たすPLi,PRj、即ち、PL2,PR2を含む凸多角形Pの左辺(PL1,PL2)と右辺(PR2,PR3)との間に位置するか否か判定される(ステップ11ないしステップ13)。この判定の結果、上端点Quは、左辺(PL1,PL2)と右辺(PR2,PR3)との間に位置しないため、上端点Quの座標は出力されず、凸多角形Pの左辺および右辺並びに凸多角形Qの左辺および右辺の各属性フラグ8は、図4に示すように、OFF状態にセットされる(ステップ16およびステップ17)。
【0079】
次に、凸多角形Qの上端点Quの両隣にある2つの頂点QL1,QR3と、凸多角形Qの上端点Quを通る走査線と交差する凸多角形Pの2辺が持つ走査方向側の2つの頂点PL2,PR2との合計4つの頂点が選択候補として選ばれる。さらに、この4つの頂点の中から頂点PR2が選択頂点として選択され、頂点PR2に対して頂点出力処理が実行される(ステップ4およびステップ5)。そして、頂点出力処理において、まず、選択辺として凸多角形Pの右辺(PR2,PR3)が設定され、処理対象辺として凸多角形Qの左辺(Qu,QL1)および右辺(QR3,Qu)が設定される(ステップ51)。次に、凸多角形Pの選択辺(PR2,PR3)が、凸多角形Qの左辺(Qu,QL1)と交差するか否か判定される(ステップ52)。図3に示すように、凸多角形Pの選択辺(PR2,PR3)は、凸多角形Qの左辺(Qu,QL1)と交差しないため、次に、凸多角形Pの選択辺(PR2,PR3)が、凸多角形Qの右辺(QR3,Qu)と交差するか否か判定される(ステップ55)。図3に示すように、凸多角形Pの選択辺(PR2,PR3)は、凸多角形Qの右辺(QR3,Qu)と交差しないため、次に、凸多角形Pの右辺(選択辺)の属性フラグがON状態か否か判定される(ステップ58)。図4に示すように、凸多角形Pの右辺の属性フラグ8はOFF状態であるため、当該頂点PR2の座標は出力されない。
【0080】
次に、凸多角形P,Qの各頂点のうち、頂点PL2,PR1,QL1,QR3が選択候補として選ばれる。さらに、この4つの頂点の中から頂点QR3が選択頂点として選択され、頂点QR3に対して頂点出力処理が実行される(ステップ4およびステップ5)。そして、頂点出力処理において、まず、選択辺として凸多角形Qの右辺(QR3,Qu)が設定され、処理対象辺として凸多角形Pの左辺(PL1,PL2)および右辺(PR1,PR2)が設定される(ステップ24)。次に、凸多角形Qの選択辺(QR3,Qu)が、凸多角形Pの左辺(PL1,PL2)と交差するか否か判定される(ステップ25)。図3に示すように、凸多角形Qの選択辺(QR3,Qu)は、凸多角形Pの左辺(PL1,PL2)と交差しないため、次に、凸多角形Qの選択辺(QR3,Qu)が、凸多角形Pの右辺(PR1,PR2)と交差するか否か判定される(ステップ28)。図3に示すように、凸多角形Qの選択辺(QR3,Qu)は、凸多角形Pの右辺(PR1,PR2)とも交差しないため、次に、凸多角形Qの右辺(選択辺)の属性フラグがON状態か否か判定される(ステップ31)。図4に示すように、凸多角形Qの右辺の属性フラグ8はOFF状態であるため、当該頂点QR3の座標は出力されない。
【0081】
次に、凸多角形P,Qの各頂点のうち、頂点PL2,PR1,QL1,QR2が選択候補として選ばれる。さらに、この4つの頂点の中から頂点QL1が選択頂点として選択され、頂点QL1に対して頂点出力処理が実行される(ステップ4およびステップ5)。そして、頂点出力処理において、まず、選択辺として凸多角形Qの左辺(Qu,QL1)が設定され、処理対象辺として凸多角形Pの右辺(PR1,PR2)および左辺(PL1,PL2)が設定される(ステップ61)。次に、凸多角形Qの選択辺(Qu,QL1)が、凸多角形Pの右辺(PR1,PR2)と交差するか否か判定される(ステップ62)。図3に示すように、凸多角形Qの選択辺(Qu,QL1)は、凸多角形Pの右辺(PR1,PR2)と交差しないため、次に、凸多角形Qの選択辺(Qu,QL1)が、凸多角形Pの左辺(PL1,PL2)と交差するか否か判定される(ステップ65)。図3に示すように、凸多角形Qの選択辺(Qu,QL1)は、凸多角形Pの左辺(PL1,PL2)とも交差しないため、次に、凸多角形Qの左辺(選択辺)の属性フラグがON状態か否か判定される(ステップ68)。図4に示すように、凸多角形Qの左辺の属性フラグ8はOFF状態であるため、当該頂点QL1の座標は出力されない。
【0082】
次に、凸多角形P,Qの各頂点のうち、頂点PL2,PR1,QL2,QR2が選択候補として選ばれる。さらに、この4つの頂点の中から頂点PL2が選択頂点として選択され、頂点PL2に対して頂点出力処理が実行される(ステップ4およびステップ5)。そして、頂点出力処理において、まず、選択辺として凸多角形Pの左辺(PL1,PL2)が設定され、処理対象辺として凸多角形Qの右辺(QR2,QR3)および左辺(QL1,QL2)が設定される(ステップ41)。次に、凸多角形Pの選択辺(PL1,PL2)が、凸多角形Qの右辺(QR2,QR3)と交差するか否か判定される(ステップ42)。図3に示すように、凸多角形Pの選択辺(PL1,PL2)は、凸多角形Qの右辺(QR2,QR3)と交点Aで交差しているため、交点Aの座標が出力されると共に、凸多角形Pの左辺(選択辺)および凸多角形Qの右辺の属性フラグ8がそれぞれON状態に反転する(ステップ43およびステップ44)。次に、凸多角形Pの選択辺(PL1,PL2)が、凸多角形Qの左辺(QL1,QL2)と交差するか否か判定される(ステップ45)。図3に示すように、凸多角形Pの選択辺(PL1,PL2)は、凸多角形Qの左辺(QL1,QL2)と交差しないため、次に、凸多角形Pの左辺(選択辺)の属性フラグがON状態か否か判定される(ステップ48)。図4に示すように、凸多角形Qの左辺の属性フラグはON状態であるため、当該頂点PL2の座標が出力される(ステップ49)。
【0083】
同様にして、頂点PR1,QL2,QR2,PL3,PL4,QR1が、この順序で次々に選択頂点として選択され、頂点出力処理が繰り返し実行される。その過程において、頂点QR2の座標,頂点PL3の座標および凸多角形Pの左辺(PL3,PL4)と凸多角形Qの右辺(QR1,QR2)との交点Bの座標がそれぞれ出力される。その後、選択頂点として下端点Pbが選択されたとき、ステップ6で「YES」と判定されてステップ7に移行し、ステップ7において切出処理が実行される。この段階で、RAM3の記録エリア内の所定の場所には、重なり部分Rを包囲するすべての頂点の座標、即ち、頂点PL2,頂点PL3,頂点QR2,交点Aおよび交点Bのそれぞれの座標が出力されているので、これらの座標に基づいて重なり部分Rを切り出す。
【0084】
かくして、本実施形態による図形クリッピング装置10によれば、選択頂点の座標を出力するか否かを、属性フラグ8の状態に基づいて決定している。そして、属性フラグ8は、一方の凸多角形の選択頂点が他方の凸多角形の内部にあるときに、ON状態となり、一方の凸多角形の選択頂点が他方の凸多角形の外部にあるときには、OFF状態となるようにセットされる。
【0085】
例えば、初期設定処理において、凸多角形Qの上端点Quが、上記数式2を満たす頂点PLi,PRjをそれぞれ含む凸多角形Pの左辺と右辺との間に位置するとき、属性フラグ8はON状態にセットされる。凸多角形Qの上端点Quが、凸多角形Pの左辺と右辺との間に位置するということは、即ち、凸多角形Qの上端点Quが、凸多角形Pの内部に位置することを意味する。また、頂点出力処理において、選択頂点を含む一方の凸多角形の辺が、他方の凸多角形の左辺および右辺のうちいずれか一方の辺と交差するとき、属性フラグの状態は反転する。選択頂点を含む一方の凸多角形の辺が、他方の凸多角形の辺と交差したということは、一方の凸多角形の選択頂点が他方の凸多角形の内部に入ったこと、または、一方の凸多角形の選択頂点が他方の凸多角形の内部から外部に出たことを意味する。
【0086】
このように、属性フラグ8は、一方の凸多角形の選択頂点が他方の凸多角形の内部に位置するときに、ON状態にセットされる。従って、属性フラグがON状態のときに、その選択頂点の座標を出力すれば、各凸多角形P,Qの重なり部分Rを包囲する各頂点の座標を抽出することができ、抽出した各点の座標に基づいて重なり部分Rを切り出すことができる。
【0087】
これにより、初期設定処理において、凸多角形Qの上端点Quが凸多角形Pの左辺と右辺との間に位置するか否かを判定するときに、外積計算を1回だけ実行するものの、その後は、外積計算を一切行わずに、属性フラグ8を参照するだけで、各凸多角形P,Qの重なり部分Rを包囲する各点の座標を抽出することができ、重なり部分Rを切り出すことができる。従って、図形クリッピング処理における演算処理の時間を減少させることができ、図形クリッピング作業の作業性を向上させることができる。
【0088】
なお、前記実施形態では、図形クリッピング処理を、凸多角形Qの上端点Quから凸多角形Pの下端点Pbに向けてY軸方向に実行したが、本発明はこれに限らず、図形クリッピング処理を、凸多角形Pの下端点Pbから凸多角形Qの上端点Quに向けてY軸方向に実行してもよく、さらに、図形クリッピング処理をX軸方向に実行してもよい。
【0089】
また、前記実施形態では、図形クリッピング処理プログラムをROM2に記憶するものとして述べたが、本発明はこれに限らず、図形クリッピング処理プログラムを外部から図形クリッピング装置10に読み込ませ、RAM3等に記憶させる構成としてもよい。さらに、図形クリッピング処理プログラムをCD−ROMまたはフロッピーディスク等の記録媒体に記録し、この記録媒体を介して図形クリッピング処理プログラムをコンピュータに読み取らせ、コンピュータを図形クリッピング装置として機能させる構成としてもよい。
【0090】
なお、図6中のステップ11ないしステップ17が初期設定手段の具体例である。図5中のステップ4が頂点選択手段の具体例であり、図7中のステップ24,ステップ25およびステップ28、図8中のステップ41,ステップ42およびステップ45、図9中のステップ51,ステップ52およびステップ55、図10中のステップ61,ステップ62およびステップ65が交差判定手段の具体例である。図7中のステップ26、ステップ27、ステップ29およびステップ30,図8中のステップ43、ステップ44、ステップ46およびステップ47、図9中のステップ53、ステップ54、ステップ56およびステップ57、図10中のステップ63、ステップ64、ステップ66およびステップ67が交点座標出力手段の具体例である。図7中のステップ31、図8中のステップ48、図9中のステップ58、図10中のステップ68が属性フラグ判定手段の具体例であり、図7中のステップ32、図8中のステップ49、図9中のステップ59、図10中のステップ69が頂点座標出力手段の具体例である。図5中のステップ7が切出手段の具体例である。
【0091】
【発明の効果】
以上詳述したとおり、請求項1の発明の図形クリッピング装置によれば、一方の凸多角形の選択頂点が他方の凸多角形の内部に位置するときにON状態にセットされ、一方の凸多角形の選択頂点が他方の凸多角形の外部に位置するときにはOFF状態にセットされる属性フラグを設け、この属性フラグがON状態のときに、選択頂点の座標を出力する構成としたから、初期設定時において、初期頂点が他方の凸多角形の2つの辺の間に位置するか否かを判定するときに、外積計算を1回だけ実行するものの、その後は、外積計算を一切行わずに、各凸多角形の互いに重なり合った部分を包囲する各点の座標を抽出することができ、この重なり合った部分を切り出すことができる。従って、図形クリッピング処理における演算処理の時間を減少させることができ、図形クリッピング作業の作業性を向上させることができる。
【0092】
特に、図形クリッピング処理の対象となる図形が曲線を含む場合には、通常、曲線を多数の短い直線に近似して処理を行うため、処理の対象となる頂点の数が膨大となる。このような場合には、図形クリッピング処理における演算処理の時間を大幅に短縮することができ、図形クリッピング処理の高速化を図ることができる。
【0093】
また、請求項2の発明による図形クリッピング方法によっても、上述した請求項1の発明による図形クリッピング装置と同様に、図形クリッピング処理における演算処理の時間を減少させることができ、図形クリッピング作業の作業性を向上させることができる。
【0094】
さらに、請求項3の発明による録媒体に記録されたプログラムをコンピュータに読み取らせ、このプログラムをコンピュータに実行させることにより、コンピュータを、上述した請求項1の発明による図形クリッピング装置として機能させることができ、請求項1の発明による図形クリッピング装置と同様の効果を得ることができる。
【図面の簡単な説明】
【図1】 本発明の実施の形態による図形クリッピング装置の構成を示すブロック図である。
【図2】 本発明の実施の形態による属性フラグを示す説明図である。
【図3】 本発明の実施の形態による図形クリッピング処理の対象となる凸多角形を示す説明図である。
【図4】 本発明の実施の形態における属性フラグの履歴を示す説明図である。
【図5】 本発明の実施の形態における図形クリッピング処理のメインルーチンを示すフローチャートである。
【図6】 本発明の実施の形態における初期設定処理を示すフローチャートである。
【図7】 本発明の実施の形態における頂点出力処理を示すフローチャートである。
【図8】 本発明の実施の形態における頂点出力処理を示すフローチャートである。
【図9】 本発明の実施の形態における頂点出力処理を示すフローチャートである。
【図10】 本発明の実施の形態における頂点出力処理を示すフローチャートである。
【図11】 図形クリッピング処理の対象となる凸多角形を示す説明図である。
【符号の説明】
1 CPU
2 ROM
3 RAM
8 属性フラグ
10 図形クリッピング装置
P,Q 凸多角形
[0001]
BACKGROUND OF THE INVENTION
  The present invention relates to a graphic clipping device and a graphic clipping method used in, for example, an image processing device, a drawing device, a graphic editing device, and the like, and more specifically, a graphic clipping device that extracts overlapping portions of a plurality of convex polygons and The present invention relates to a figure clipping method.
[0002]
[Prior art]
  For example, in the field of computer graphics and the like, when creating or editing an image, an image processing device, a drawing device, a graphic editing device, or the like is used. These devices perform arithmetic processing on graphic data corresponding to a plurality of graphics constituting an image, and perform graphic editing processing such as deformation, movement, and deletion of the graphic.
[0003]
  Incidentally, as one of such graphic editing processes, there is a graphic clipping process. The figure clipping process is a process of cutting out (clipping) overlapping portions of a plurality of figures. A slab method is used for the graphic clipping process. The slab method is a generally known method and is described in, for example, Tetsuo Asano “Computational Geometry”, Asakura Shoten, and the like.
[0004]
  Here, a method of cutting out overlapping portions of two convex polygons will be described with reference to FIG.
[0005]
  In FIG. 11, the convex polygon P and the convex polygon Q arranged on the XY coordinate plane overlap each other. Here, the overlapping portion is defined as an overlapping portion R. Of the vertices of the convex polygon P, the top vertex is the upper end point Pu, the lowermost vertex is the lower end point Pb, and each side of the convex polygon P is the lower end point from the upper end point Pu. Each vertex that passes when tracing counterclockwise toward Pb is designated as PLi (i = 1, 2, 3,...) In the order of passage, and each side of the convex polygon P is located above the lower end point Pb. Each vertex passing when tracing counterclockwise toward the end point Pu is defined as PRj (j = 1, 2, 3,...) In the passing order. Similarly, among the vertices of the convex polygon Q, the top vertex is the upper end point Qu, the lowermost vertex is the lower end point Qb, and each side of the convex polygon Q is the lower end point from the upper end point Qu. Each vertex passing through when tracing counterclockwise toward the point Qb is defined as QLm (m = 1, 2, 3,...) In the order of passing, and each side of the convex polygon Q is defined from the lower end point Qb. Each vertex passing through when tracing counterclockwise toward the upper end point Qu is set to QRn (n = 1, 2, 3,...) In the order of passing. Furthermore, the upper left end of the figure is the origin of the XY coordinate plane, and for example, the Y coordinate of the upper end point Pu of the convex polygon P is expressed as Y (Pu). The Y coordinates of other vertices Pb, PLi, PRj, Qu, Qb, QLm, and QRn are also expressed in the same manner.
[0006]
  Under the above conditions, for example, paying attention to each vertex QRn of the convex polygon Q, the following steps (1) to (3) are executed.
[0007]
  (1) From the vertices PLi, PRj of the convex polygon P, vertices PLi, PRj satisfying the following formula 1 are selected.
[0008]
[Expression 1]
Y (PLi-1) <Y (QRn) ≤Y (PLi)
Y (PRj + 1) <Y (QRn) ≦ Y (PRj)
  (2) It is determined whether or not the side (QRn, QRn + 1) of the convex polygon Q intersects any side of the convex polygon P, and when it intersects, the coordinates of the intersection are output.
[0009]
  (3) It is determined whether or not the vertex QRn of the convex polygon Q is located between the side (PLi−1, PLi) and the side (PRj, PRj + 1) of the convex polygon P, and the vertex QRn is When located between these sides, the coordinates of the vertex QRn are output.
[0010]
  For example, when attention is paid to the vertex QR2 of the convex polygon Q in FIG. 11 and the above steps (1) to (3) are executed, the vertices PLi, PRj satisfying the above equation 1 are PL3, Pb (PQ0 = Pb and ). Then, since the sides (QR2, QR3) of the convex polygon Q intersect with the sides (PL1, PL2) of the convex polygon P, the coordinates of the intersection A are output. Furthermore, since the vertex QR2 is located between the side (PL2, PL3) and the side (Pb, PR1), the coordinates of the vertex QR2 are output.
[0011]
  The above steps (1) to (3) are carried out for each vertex PLi, PRj, QLm, QRn, upper end point Pu, Qu and lower end point Pb, Qb of each convex polygon P, Q, thereby enclosing the overlapping portion R. The coordinates of each point to be output are output. For the upper end points Pu and Qu, only the above steps (1) and (3) are executed. And the coordinates of each output pointInThe figure corresponding to the overlapping portion R can be specified based on this, and the overlapping portion R can be cut out.
[0012]
  Note that the slab method considers a convex polygon as a set of trapezoids (slabs), and determines whether or not there is an intersection between slabs belonging to different convex polygons. It recognizes whether there is a part. Steps (1) to (3) described above show specific procedures when the graphic clipping process is realized based on this slab method.
[0013]
[Problems to be solved by the invention]
  By the way, if the above steps (1) to (3) are executed for each vertex of each convex polygon, theoretically, an overlapping portion of each convex polygon can be cut out. However, if the image clipping device is actually executed by causing the image processing device, the drawing device, or the graphic editing device to execute the above steps (1) to (3), there is a problem that the arithmetic processing takes time.
[0014]
  In particular, in the above step (3), it is determined whether or not the vertex of one polygon is located between two sides of the other polygon. This determination has a problem that it takes time for the arithmetic processing because it is necessary to perform the outer product calculation using the coordinates of the vertices and the coordinates of the end points of each side.
[0015]
  For example, if a convex polygon that is subject to graphic clipping processing has a complex shape and has a large number of vertices and sides, the outer product calculation must be performed many times to cut out the overlapping parts of each convex polygon. I must. Further, when a graphic to be subjected to graphic clipping processing includes a curve, the processing is usually performed by approximating the curve to many short straight lines. Even in such a case, the number of vertices and sides becomes enormous, and the number of times of outer product calculation becomes enormous. As a result, there is a problem in that the time for the arithmetic processing becomes long and the workability of image creation or editing may be reduced.
[0016]
  The present invention has been made in view of the above-described problems, and provides a graphic clipping device and a graphic clipping method capable of executing graphic clipping processing at high speed and improving the workability of graphic clipping work. It is an object.
[0017]
[Means for Solving the Problems]
  In order to solve the above-described problems, the invention of claim 1On the XY coordinate plane where the X-axis direction is the left-right direction and the Y-axis direction is the up-down directionA figure clipping device that cuts out a figure corresponding to an overlapping part of two convex polygons,SoOf each side of each convex polygon,An edge that can be traced clockwise from the top vertex that is the top vertex of each convex polygon to the bottom vertex that is the bottom vertexAttribute flags provided for the right side andAn edge that can be traced counterclockwise from the top vertex to the bottom vertex of each convex polygonAbout the left sideRespectivelyAn attribute flag provided,The twoConvex polygonalTop vertexOut ofUpper end located belowSelect a vertex as the initial vertex, and the initial vertex does not contain the initial vertexThe otherConvex polygonalSaidLeft side andSaidIt is determined whether or not it is located between the right side, and as a result of the determination, the initial vertex isThe otherWhen located between the left and right sides of the convex polygon, the coordinates of the initial vertex are output and the initial vertex is included.One ofConvex polygonalSaidThe attribute flag for the right-hand side andSaidSet the attribute flags for the left side to the ON state andThe otherConvex polygonalSaidThe attribute flag for the right-hand side andSaidThe attribute flags for the left side are each set to the OFF state, while the initial vertex isThe otherThe left and right sides of the convex polygonWhenIf not located between, include the initial vertexOne ofConvex polygonalSaidThe attribute flag for the right-hand side andSaidSet the attribute flags for the left side to OFF state respectivelyThe otherConvex polygonalSaidThe attribute flag for the right-hand side andSaidInitial setting means for setting the attribute flag for the left side to OFF state, two vertices on both sides of the initial vertex, and the initial vertexParallel to the X axisIntersect the lineSaidTwo sides of the other convex polygonEach of the two vertices that are the end points of each is located below4 vertices with vertices or last selected vertexIs located below and below the selected vertexVertices,It is a candidate for the previous selected vertex4 vertices with 3 vertices excluding the previous selected vertex from the selection candidate vertices,4 vertices of eitherTheOf this timeSelect candidate vertices,ConcernedOf the selection candidate verticesLocated at the topVertexThis timeVertex selection means for selecting as a selected vertex;Out of each side of the convex polygon that includes the selected vertex, the selected vertex and a vertex positioned above the selected vertex are end points.The side is the selected side,ConcernedOf the convex polygon that does not contain the selected vertexOut of each side, the selection candidate vertex and a vertex located above the selection candidate vertex are end points.Two sides andSaidThe selected side isRespectivelyAs a result of the determination by the intersection determination unit and the intersection determination unit that determines whether or not to intersect, when the selected side intersects the side of the convex polygon that does not include the selected vertex, the intersection point Output the coordinates of and for the edges that intersect each otherSaidIntersection point coordinate output means for inverting each attribute flag;Among the attribute flags, corresponding to the selected sideAttribute flag determining means for determining whether or not the attribute flag is in an ON state, vertex coordinate output means for outputting the coordinates of the selected vertex when the attribute flag is determined to be in the ON state by the attribute flag determining means, The coordinates of the selected vertex output by the vertex coordinate output means, the coordinates of the initial vertex when the initial setting means is output, and the coordinates of the intersection by the intersection coordinate output means A cutting means for cutting out a figure corresponding to an overlapped portion of the two convex polygons based on the coordinates;,It has.
[0018]
  That is, the two convex polygons are formed in, for example, the memory circuitXYIt is arranged on a coordinate plane, and graphic clipping processing is performed by scanning these convex polygons in a predetermined scanning direction. That meansXYOn the coordinate planeFrom top to bottomThe graphic clipping process proceeds toward this point.
[0019]
  Of the two convex polygons, one convex polygon, Each side that can trace clockwise from the top vertex, which is the top vertex, to the bottom vertex, which is the bottom vertex (passed when tracing counterclockwise from the bottom vertex to the top vertex) Each side)Is called the right side of one convex polygon, and each side of one convex polygon isEach side that can be traced counterclockwise from the top vertex to the bottom vertex (each side that passes when tracing counterclockwise from the top vertex to the bottom vertex)Is called the left side of one convex polygon. Then, an attribute flag for the right side of one convex polygon and an attribute flag for the left side of one convex polygon are provided. Here, the attribute flag is, for example, a flag provided on a rewritable recording circuit, and can store two types of states, an ON state and an OFF state.
[0020]
  Similarly, for the other convex polygon,Trace clockwise from top to bottomThe side is called the right side,Traces counterclockwise from top vertex to bottom vertexThe side is called the left side. Then, an attribute flag for the right side of the other convex polygon and an attribute flag for the left side of the one convex polygon are provided.
[0021]
  In this way, graphic clipping processing is performed using the four attribute flags.
[0022]
  Next, the initial setting meansTwoConvex polygonalTopOf the vertices,Upper end located belowSelect a vertex as the initial vertex. Further, the initial setting means is such that the initial vertex does not include the initial vertex.One ofIt is determined whether or not it is located between the left side and the right side of the convex polygon.
[0023]
  As a result of the determination, the initial vertex does not include the initial vertex.One ofWhen located between the left and right sides of a convex polygon, the coordinates of the initial vertex are output and the initial vertex is included.One ofSet the attribute flag for the right side of the convex polygon and the attribute flag for the left side to the ON state and do not include the initial vertexOne ofThe attribute flag for the right side and the attribute flag for the left side of the convex polygon are each set to the OFF state. On the other hand, the initial vertex does not include the initial vertexOne ofThe left and right sides of the convex polygonWhenIf the position is not between, the coordinates of the initial vertex are not output and the initial vertex is included.One ofThe attribute flag for the right side of the convex polygon and the attribute flag for the left side are both set to the OFF state and the initial vertex is not included.One ofThe attribute flag for the right side and the attribute flag for the left side of the convex polygon are each set to the OFF state.
[0024]
  Next, the vertex selection means selects a vertex to be subjected to a series of processing by the intersection determination means, the intersection coordinate output means, the attribute flag determination means, and the vertex coordinate output means, which will be described later, from each vertex of each convex polygon. Select as a vertex.
[0025]
  That is, a series of processes by the vertex selection unit, the intersection determination unit, the intersection coordinate output unit, the attribute flag determination unit, and the vertex coordinate output unit are repeatedly executed. Each time this series of processes is completed, the vertex selecting means sequentially selects new unprocessed vertices as selected vertices among the vertices of each convex polygon.
[0026]
  More specifically, immediately after the processing by the initial setting means is completed, the vertex selecting means passes two vertices adjacent to the initial vertex and the initial vertex.Parallel to the X axisTwo sides of the other convex polygon that intersects the lineEach of the two vertices that are the end points of each is located belowSelect a total of four vertices with vertices as selection candidate vertices, and select from these four selection candidate verticesLocated at the topSelect a vertex as the selected vertex. In addition, after a series of processes by the vertex selection unit, the intersection determination unit, the intersection coordinate output unit, the attribute flag determination unit, and the vertex coordinate output unit are executed at least once, the vertex selection unitIs located below and below the selected vertexA total of four vertices including the vertex and three vertices excluding the previous selected vertex from the selection candidate vertex (previous selection candidate vertex) are selected candidate vertices, and from among these four selection candidate verticesLocated at the topSelect a vertex as the selected vertex.
[0027]
  Next, the intersection determination meansThe selected vertex and the vertex located above the selected vertex are the end points.In a convex polygon whose side is the selected side and does not include the selected vertexThe selection candidate vertices and the vertices located above the selection candidate vertices are the end points.It is determined whether or not the two sides intersect with the selected side.
[0028]
  Next, the intersection coordinate output means, as a result of the determination by the intersection determination means, the selected side does not include the selected vertexOne ofWhen intersecting one of the two sides of the convex polygon, the coordinates of the intersection are output and the attribute flags for the intersecting sides are inverted. That is, when the attribute flag is in the OFF state, it is switched to the ON state. On the other hand, when the attribute flag is in the ON state, it is switched to the OFF state. In addition, the intersection coordinate output means, as a result of the determination by the intersection determination means, the selected side does not include the selected vertexOne ofWhen each of the two sides of the convex polygon intersects, the coordinates of each intersection are output and the attribute flags for the sides intersecting each other are inverted. As a result of the determination by the intersection determination means, the selected side does not include the selected vertex.One ofWhen it does not intersect any side of the convex polygon, the state of each attribute flag is maintained.
[0029]
  Next, the attribute flag determination meansCorresponds to the selected sideIt is determined whether or not the attribute flag is ON. Subsequently, the vertex coordinate output means outputs the coordinates of the selected vertex when the attribute flag is determined to be ON by the attribute flag determination means.
[0030]
  Then, a series of processes by the vertex selection means, the intersection determination means, the intersection coordinate output means, the attribute flag determination means, and the vertex coordinate output meansTheRun repeatedly.
[0031]
  Next, the cutting means outputs the coordinates of the selected vertex output by the vertex coordinate output means, the coordinates of the initial vertex when the coordinates of the initial vertex are output by the initial setting means, and the coordinates of the intersection by the intersection coordinate output means. If it is output, a figure corresponding to the overlapping portion of the two convex polygons is cut out based on the coordinates.
[0032]
  As described above, in the graphic clipping device described above, whether or not to output the coordinates of the selected vertex is determined based on the state of the attribute flag. The attribute flag is ON when the selected vertex of one convex polygon is inside the other convex polygon, and when the selected vertex of one convex polygon is outside the other convex polygon. , Set to be in the OFF state.
[0033]
  For example, in the initial setting means, when the initial vertex of one convex polygon is located between two sides of the other convex polygon, the attribute flag is set to the ON state. The initial vertex of one convex polygon is located between two sides of the other convex polygon, that is, the initial vertex of one convex polygon is located inside the other convex polygon Means that. Further, in the intersection coordinate output means, when the selected side intersects any side of the other convex polygon, the state of the attribute flag is inverted. The fact that the selected edge intersects one of the other convex polygons means that the selected vertex of one convex polygon is inside the other convex polygon, or one convex polygon is selected. It means that the vertex has come out from the inside of the other convex polygon.
[0034]
  Thus, the attribute flag is set to the ON state when the selected vertex of one convex polygon is located inside the other convex polygon. Therefore, if the coordinates of the selected vertex are output when the attribute flag is ON, the coordinates of each point surrounding the overlapping part of each convex polygon can be extracted, and the figure corresponding to the overlapping part Can be identified and cut out.
[0035]
  Thereby, in the initial setting means, when it is determined whether or not the initial vertex is located between the two sides of the other convex polygon, the cross product calculation is executed only once. Without doing anything, it is possible to extract the coordinates of each point that surrounds the overlapping portions of each convex polygon, and to cut out these overlapping portions. Accordingly, it is possible to reduce the calculation processing time in the graphic clipping process and improve the workability of the graphic clipping work.
[0036]
  Also, according to the graphic clipping method according to the second aspect of the present invention, similarly to the graphic clipping apparatus according to the first aspect of the present invention described above, it is possible to reduce the processing time in the graphic clipping process, and the workability of the graphic clipping work is improved. Can be improved.
[0037]
  Further, according to the invention of claim 3RecordRecording mediaRecorded programMake the computer read thisprogramBy causing the computer to execute the above, it is possible to cause the computer to function as the graphic clipping device according to the first aspect of the present invention.
[0038]
DETAILED DESCRIPTION OF THE INVENTION
  Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings.
[0039]
  FIG. 1 shows a figure clipping device 10 according to an embodiment of the present invention. The graphic clipping device 10 performs a process of cutting out overlapping portions of a plurality of graphics, that is, a graphic clipping process.
[0040]
  As shown in FIG. 1, the graphic clipping device 10 includes a CPU 1, a ROM 2, a RAM 3, a display 4, a mouse 5, and a keyboard 6, which are connected to each other via a bus 7.
[0041]
  The CPU 1 performs overall control of the graphic clipping device 10. Further, the CPU 1 executes a graphic clipping processing program shown in FIGS. The ROM 2 stores a program for controlling the graphic clipping device 10 and a graphic clipping processing program shown in FIGS. An attribute flag 8 as shown in FIG. 2 is recorded in the RAM 3. The RAM 3 is used as a work area when performing graphic clipping processing. The display 4 displays a graphic or the like to be processed when performing graphic clipping processing, and the mouse 5 and the keyboard 6 are used to input commands and data to the graphic clipping device 10.
[0042]
  Next, graphic clipping processing will be described. In the following description, an example in which an overlapping portion of two convex polygons P and Q shown in FIG. 3 is cut out will be described.
[0043]
  In FIG. 3, the convex polygon P and the convex polygon Q arranged on the XY coordinate plane overlap each other. Here, the overlapping portion is defined as an overlapping portion R. Further, among the vertices of the convex polygon P, the vertex positioned at the top (vertex having the smallest Y coordinate) is set as the upper end point Pu, and the vertex positioned at the bottom (vertex having the largest Y coordinate) is set as the lower end point Pb. , PLi (i = 1, 2, 3,...) In the order of passing through the vertices that pass through each side of the convex polygon P counterclockwise from the upper end point Pu to the lower end point Pb. PRj (j = 1, 2, 3,... In order of passing through the vertices that pass through each side of the convex polygon P counterclockwise from the lower end point Pb toward the upper end point Pu. ). Similarly, among the vertices of the convex polygon Q, the top vertex is the upper end point Qu, the lowermost vertex is the lower end point Qb, and each side of the convex polygon Q is the lower end point from the upper end point Qu. Each vertex passing through when tracing counterclockwise toward the point Qb is defined as QLm (m = 1, 2, 3,...) In the order of passing, and each side of the convex polygon Q is defined from the lower end point Qb. Each vertex passing through when tracing counterclockwise toward the upper end point Qu is set to QRn (n = 1, 2, 3,...) In the order of passing. Further, the upper left corner of the figure is the origin of the XY coordinate plane.
[0044]
  For convenience of explanation, for example, the Y coordinate of the upper end point Pu of the convex polygon P is expressed as Y (Pu). The Y coordinates of other vertices Pb, PLi, PRj, Qu, Qb, QLm, and QRn are also expressed in the same manner. Further, each side that passes when the convex polygon P is traced counterclockwise from the upper end point Pu to the lower end point Pb is referred to as the left side of the convex polygon P, and is opposite to the upper end point Pu from the lower end point Pb. Each side that passes through when tracing clockwise is called the right side of the convex polygon P. Similarly, each side that passes when the convex polygon Q is traced counterclockwise from the upper end point Qu to the lower end point Qb is called the left side of the convex polygon Q, and the lower end point Qb is directed to the upper end point Qu. Each side that passes when it traces counterclockwise is called the right side of the convex polygon Q.
[0045]
  Further, the graphic clipping process uses a scanning line parallel to the X axis of the XY coordinate plane. By moving this scanning line along the Y axis from the small side of the Y coordinate value to the large side, a vertex output process or the like described later is performed. Hereinafter, the direction in which the scanning line moves is referred to as the scanning direction, the side with the small Y coordinate value is referred to as the scanning direction start side, and the side with the large Y coordinate value is referred to as the scanning direction end side or the scanning direction side.
[0046]
  Further, the attribute flag 8 shown in FIG. 2 is used for the graphic clipping process. The attribute flag 8 is composed of four flags indicating the left side state of the convex polygon P, the right side state of the convex polygon P, the left side state of the convex polygon Q, and the right side state of the convex polygon Q. Yes. These flags are set to the ON state or the OFF state, respectively, during the graphic clipping process.
[0047]
  The graphic clipping process will now be described with reference to the flowcharts of FIGS.
[0048]
  First, when an operator inputs graphic data corresponding to the convex polygons P and Q shown in FIG. 3 and a command for starting graphic clipping processing to the graphic clipping device 10, the CPU 1 applies the convex polygons P and Q to the convex polygons P and Q. Corresponding graphic data is stored in the work area of the RAM 3, and the main routine of graphic clipping processing shown in FIG. 5 is executed.
[0049]
  As shown in FIG. 5, first, the coordinates of each vertex, each upper end point, and each lower end point of the convex polygons P, Q are recognized based on the graphic data corresponding to the convex polygons P, Q (step 1). . At this time, as shown in FIG. 3, of the two convex polygons, the one having the smaller Y coordinate value of the upper end point is defined as a convex polygon P, and the one having the larger Y coordinate value of the upper end point is defined as the convex polygon Q. And
[0050]
  Next, it is determined whether or not the Y coordinate of the upper end point Qu of the convex polygon Q is larger than the Y coordinate of the lower end point Pb of the convex polygon P (step 2). . This is because when the Y coordinate of the upper end point Qu of the convex polygon Q is larger than the Y coordinate of the lower end point Pb of the convex polygon P, it can be determined that the convex polygon P and the convex polygon Q do not overlap. On the other hand, when the Y coordinate of the upper end point Qu of the convex polygon Q is not larger than the Y coordinate of the lower end point Pb of the convex polygon P, it can be determined that the convex polygon P and the convex polygon Q overlap. Therefore, first, the initial setting processing program shown in FIG. 6 is started to execute the initial setting processing (step 3).
[0051]
  In the initial setting process in FIG. 6, first, PLi and PRj satisfying the following mathematical formula 2 are obtained (step 11 and step 12).
[0052]
[Expression 2]
Y (PLi-1) <Y (QRn) ≤Y (PLi)
Y (PRj + 1) <Y (QRn) ≦ Y (PRj)
  Next, the left side (PLi−1, PLi) and the right side (PRj, PRj + 1) of the convex polygon P including PLi and PRj satisfying the above formula 2 are obtained, and the upper end point Qu (initial vertex) of the convex polygon Q ) Is positioned between these sides (step 13). When the upper end point Qu is located between these two sides, the coordinates of the upper end point Qu are output to a predetermined location in the storage area of the RAM 3 and the attribute flags on the left and right sides of the convex polygon Q are turned ON. Set (step 14 and step 15). On the other hand, when the upper end point Qu of the convex polygon Q is not located between these sides, the coordinates of the upper end point Qu are not output, and the attribute flags of the left side and the right side of the convex polygon Q are set to the OFF state ( Step 16).
[0053]
  Next, the attribute flags on the left and right sides of the convex polygon P are set to the OFF state (step 17), and the process proceeds to step 4 of the main routine shown in FIG.
[0054]
  In step 4 in FIG. 5, two vertices QLm, QRn on both sides of the upper end point Qu of the convex polygon Q and 2 of the convex polygon P that intersects the scanning line passing through the upper end point Qu of the convex polygon Q. A total of four vertices including two vertices PLi and PRj on the scanning direction side of the side are respectively selected as selection candidates. Further, the vertex having the smallest Y coordinate value is selected as the selected vertex from the four vertices selected as selection candidates. Then, the vertex output process shown in FIGS. 7 to 10 is started (step 5).
[0055]
  In the vertex output process, it is determined whether the selected vertex is one of the vertices PLi, PRj, QLm, and QRn (step 21 to step 23 in FIG. 7). When the selected vertex is the vertex PLi, the process proceeds to step 41 in FIG.
[0056]
  In step 41 in FIG. 8, among the left sides of the convex polygon P, the left side (PLi-1, PLi) having the selected vertex PLi on the scanning direction side is set as the selected side. Further, in the convex polygon Q, two sides having selection candidate vertices on the scanning direction side, that is, the right side (QRn, QRn + 1) and the left side (QLm-1, QLm) are set as processing target sides.
[0057]
  Next, it is determined whether or not the selected side (PLi−1, PLi) of the convex polygon P intersects the right side (QRn, QRn + 1) of the convex polygon Q set as the processing target side ( Step 42). When the selected side (PLi-1, PLi) of the convex polygon P intersects the right side (QRn, QRn + 1) of the convex polygon Q, the coordinates of the intersection are output and two intersecting ones are output. The attribute flag 8 is inverted (steps 43 and 44). On the other hand, when the selected side (PLi−1, PLi) of the convex polygon P does not intersect the right side (QRn, QRn + 1) of the convex polygon Q, the attribute flag 8 is not inverted.
[0058]
  Next, it is determined whether or not the selected side (PLi-1, PLi) of the convex polygon P intersects the left side (QLm-1, QLm) of the convex polygon Q set as the processing target side ( Step 45). When the selected side (PLi-1, PLi) of the convex polygon P intersects the left side (QLm-1, QLm) of the convex polygon Q, the coordinates of the intersection are output and two intersecting ones are output. The attribute flag 8 is inverted (step 46 and step 47). On the other hand, when the selected side (PLi-1, PLi) of the convex polygon P does not intersect the left side (QLm-1, QLm) of the convex polygon Q, the attribute flag is not inverted.
[0059]
  Next, it is determined whether or not the attribute flag 8 on the left side of the convex polygon P is in an ON state. When the attribute flag 8 is in the ON state, the coordinates of the vertex PLi selected as the selected vertex are placed in a predetermined location in the storage area of the RAM 3. Output (step 48 and step 49). On the other hand, when the attribute flag 8 on the left side of the convex polygon P is OFF, the coordinates of the vertex PLi are not output.
[0060]
  On the other hand, when the selected vertex is the vertex PRj, the routine proceeds to step 51 in FIG. In step 51 in FIG. 9, the right side (PRj, PRj + 1) having the selected vertex PRj on the scanning direction side is set as the selected side from among the right sides of the convex polygon P. Further, in the convex polygon Q, two sides having selection candidate vertices on the scanning direction side, that is, the left side (QLm−1, QLm) and the right side (QRn, QRn + 1) are set as processing target sides.
[0061]
  Next, it is determined whether or not the selected side (PRj, PRj + 1) of the convex polygon P intersects the left side (QLm-1, QLm) of the convex polygon Q set as the processing target side ( Step 52). When the selected side (PRj, PRj + 1) of the convex polygon P intersects the left side (QLm-1, QLm) of the convex polygon Q, the coordinates of the intersection are output and two intersecting ones are output. The attribute flag 8 is inverted (step 53 and step 54). On the other hand, when the selected side (PRj, PRj + 1) of the convex polygon P does not intersect the left side (QLm-1, QLm) of the convex polygon Q, the attribute flag 8 is not inverted.
[0062]
  Next, it is determined whether or not the selected side (PRj, PRj + 1) of the convex polygon P intersects the right side (QRn, QRn + 1) of the convex polygon Q set as the processing target side ( Step 55). When the selected side (PRj, PRj + 1) of the convex polygon P intersects with the right side (QRn, QRn + 1) of the convex polygon Q, the coordinates of the intersection are output and two intersecting each other The attribute flag 8 is inverted (step 56 and step 57). On the other hand, when the selected side (PRj, PRj + 1) of the convex polygon P does not intersect the right side (QRn, QRn + 1) of the convex polygon Q, the attribute flag is not inverted.
[0063]
  Next, it is determined whether or not the attribute flag 8 on the right side of the convex polygon P is in an ON state. When the attribute flag 8 is in an ON state, the coordinates of the vertex PRj selected as the selected vertex are placed in a predetermined location in the storage area of the RAM 3. Output (step 58 and step 59). On the other hand, when the attribute flag 8 on the right side of the convex polygon P is OFF, the coordinates of the vertex PRj are not output.
[0064]
  On the other hand, when the selected vertex is the vertex QLm, the routine proceeds to step 61 in FIG. In step 61 in FIG. 10, the left side (QLm−1, QLm) having the selected vertex QLm on the scanning direction side is set as the selected side from the left sides of the convex polygon Q. Furthermore, two sides having a selection candidate vertex on the scanning direction side in the convex polygon P, that is, the right side (PRj, PRj + 1) and the left side (PLi-1, PLi) are set as processing target sides.
[0065]
  Next, it is determined whether or not the selected side (QLm-1, QLm) of the convex polygon Q intersects the right side (PRj, PRj + 1) of the convex polygon P set as the processing target side ( Step 62). When the selected side (QLm-1, QLm) of the convex polygon Q intersects the right side (PRj, PRj + 1) of the convex polygon P, the coordinates of the intersection are output and two intersecting ones are output. The attribute flag 8 is inverted (step 63 and step 64). On the other hand, when the selected side (QLm-1, QLm) of the convex polygon Q does not intersect the right side (PRj, PRj + 1) of the convex polygon P, the attribute flag 8 is not inverted.
[0066]
  Next, it is determined whether or not the selected side (QLm-1, QLm) of the convex polygon Q intersects the left side (PLi-1, PLi) of the convex polygon P set as the processing target side ( Step 65). When the selected side (QLm-1, QLm) of the convex polygon Q intersects the left side (PLi-1, PLi) of the convex polygon P, the coordinates of the intersection are output and two intersecting ones are output. The attribute flag 8 is inverted (step 66 and step 67). On the other hand, when the selected side (QLm-1, QLm) of the convex polygon Q does not intersect the left side (PLi-1, PLi) of the convex polygon P, the attribute flag is not inverted.
[0067]
  Next, it is determined whether or not the attribute flag 8 on the left side of the convex polygon Q is in the ON state. If the attribute flag 8 is in the ON state, the coordinates of the vertex QLm selected as the selected vertex are placed in a predetermined location in the storage area of the RAM 3. Output (step 68 and step 69). On the other hand, when the attribute flag 8 on the left side of the convex polygon Q is in the OFF state, the coordinates of the vertex QLm are not output.
[0068]
  On the other hand, when the selected vertex is the vertex QRn, the routine proceeds to step 24 in FIG. In step 24 in FIG. 7, the right side (QRn, QRn + 1) having the selected vertex QRn on the scanning direction side is set as the selected side from among the right sides of the convex polygon Q. Further, in the convex polygon P, two sides having selection candidate vertices on the scanning direction side, that is, the left side (PLi-1, PLi) and the right side (PRj, PRj + 1) are set as processing target sides.
[0069]
  Next, it is determined whether or not the selected side (QRn, QRn + 1) of the convex polygon Q intersects the left side (PLi-1, PLi) of the convex polygon P set as the processing target side ( Step 25). When the selected side (QRn, QRn + 1) of the convex polygon Q intersects the left side (PLi-1, PLi) of the convex polygon P, the coordinates of the intersection are output and two intersecting ones are output. The attribute flag 8 is inverted (steps 26 and 27). On the other hand, when the selected side (QRn, QRn + 1) of the convex polygon Q does not intersect the left side (PLi-1, PLi) of the convex polygon P, the attribute flag 8 is not inverted.
[0070]
  Next, it is determined whether or not the selected side (QRn, QRn + 1) of the convex polygon Q intersects the right side (PRj, PRj + 1) of the convex polygon P set as the processing target side ( Step 28). When the selected side (QRn, QRn + 1) of the convex polygon Q intersects the right side (PRj, PRj + 1) of the convex polygon P, the coordinates of the intersection are output and two intersecting ones are output. The attribute flag 8 is inverted (step 29 and step 30). On the other hand, when the selected side (QRn, QRn + 1) of the convex polygon Q does not intersect the right side (PRj, PRj + 1) of the convex polygon P, the attribute flag is not inverted.
[0071]
  Next, it is determined whether or not the attribute flag 8 on the right side of the convex polygon Q is in an ON state. When the attribute flag 8 is in an ON state, the coordinates of the vertex QRn selected as the selected vertex are placed in a predetermined location in the storage area of the RAM 3. Output (step 31 and step 32). On the other hand, when the attribute flag 8 on the right side of the convex polygon Q is OFF, the coordinates of the vertex QRn are not output.
[0072]
  When the vertex output processing shown in FIGS. 7 to 10 is completed, the process proceeds to step 6 of the main routine shown in FIG.
[0073]
  In step 6 in FIG. 6, it is determined whether or not the selected vertex is the lower end point Pb of the convex polygon P or the lower end point Qb of the convex polygon Q. When the selected vertex is not the lower end point Pb or the lower end point Qb, the process returns to step 4.
[0074]
  Then, in step 4, the vertex that has been selected as the selected vertex so far is excluded from the selection candidates, and instead, a vertex that is located next to the vertex that has been selected as the selected vertex so far in the Y-axis direction is a new selection candidate. Add to. That is, when the vertex selected so far is the vertex PLi, the vertex PLi is excluded from the selection candidates, and the vertex PLi + 1 is newly added to the selection candidates. If the vertex selected so far is the vertex PRj, the vertex PRj is excluded from the selection candidates, and the vertex PRj-1 is newly added to the selection candidates. Further, when the vertex selected so far is the vertex QLm, the vertex QLm is excluded from the selection candidates, and the vertex QLm + 1 is newly added to the selection candidates. Furthermore, when the vertex selected so far is the vertex QRn, the vertex QRn is excluded from the selection candidates, and the vertex QRn-1 is newly added to the selection candidates. Further, in step 4, a vertex having the smallest Y coordinate value is newly selected as a selected vertex from the four vertices selected as selection candidates. Then, the vertex output process shown in FIGS. 7 to 10 is started again (step 5).
[0075]
  In this way, by repeating the processing from step 4 to step 6, the vertex output processing proceeds from the processing start side to the end side along the scanning direction as shown by the arrow in FIG. That is, the vertices of the convex polygons P and Q shown in FIG. 3 are sequentially selected as the selected vertices in ascending order of the Y coordinate value, and are subjected to vertex output processing. When the lower end point Pb or the lower end point Qb is selected as the selected vertex, “YES” is determined in the step 6, and the process proceeds to the step 7. At this stage, the coordinates of the vertices surrounding the overlapping portion R of the convex polygon P and the convex polygon Q are output to a predetermined location in the storage area of the RAM 3.
[0076]
  In step 7, the overlapping portion R is cut out based on the coordinates of each vertex output to a predetermined location in the storage area of the RAM 3.
[0077]
  Next, the operation of actually cutting out the overlapping portion R of the convex polygons P and Q shown in FIG. 3 will be described with reference to the attribute flag history shown in FIG.
[0078]
  First, since the Y coordinate of the upper end point Qu of the convex polygon Q is not larger than the Y coordinate of the lower end point Pb of the convex polygon P, an initial setting process is executed (step 2 and step 3). In the initial setting process, the upper end points Qu (initial vertices) satisfy Pli and PRj satisfying the above-described equation 2, that is, the left side (PL1, PL2) and the right side (PR2, PR3) of the convex polygon P including PL2 and PR2. (Step 11 to step 13). As a result of this determination, since the upper end point Qu is not located between the left side (PL1, PL2) and the right side (PR2, PR3), the coordinates of the upper end point Qu are not output, and the left and right sides of the convex polygon P and The attribute flags 8 on the left and right sides of the convex polygon Q are set to the OFF state as shown in FIG. 4 (steps 16 and 17).
[0079]
  Next, two vertices QL1, QR3 on both sides of the upper end point Qu of the convex polygon Q, and the two sides of the convex polygon P intersecting the scanning line passing through the upper end point Qu of the convex polygon Q have a scanning direction side. A total of four vertices of the two vertices PL2 and PR2 are selected as selection candidates. Further, the vertex PR2 is selected as the selected vertex from the four vertices, and the vertex output process is executed on the vertex PR2 (step 4 and step 5). In the vertex output process, first, the right side (PR2, PR3) of the convex polygon P is set as the selected side, and the left side (Qu, QL1) and the right side (QR3, Qu) of the convex polygon Q are set as the processing target sides. It is set (step 51). Next, it is determined whether or not the selected side (PR2, PR3) of the convex polygon P intersects the left side (Qu, QL1) of the convex polygon Q (step 52). As shown in FIG. 3, the selected side (PR2, PR3) of the convex polygon P does not intersect the left side (Qu, QL1) of the convex polygon Q. It is determined whether or not PR3) intersects the right side (QR3, Qu) of the convex polygon Q (step 55). As shown in FIG. 3, the selected side (PR2, PR3) of the convex polygon P does not intersect with the right side (QR3, Qu) of the convex polygon Q, so the right side (selected side) of the convex polygon P is next. It is determined whether or not the attribute flag is ON (step 58). As shown in FIG. 4, since the attribute flag 8 on the right side of the convex polygon P is in the OFF state, the coordinates of the vertex PR2 are not output.
[0080]
  Next, among the vertices of the convex polygons P and Q, vertices PL2, PR1, QL1, and QR3 are selected as selection candidates. Further, the vertex QR3 is selected as the selected vertex from the four vertices, and the vertex output process is executed on the vertex QR3 (steps 4 and 5). In the vertex output process, first, the right side (QR3, Qu) of the convex polygon Q is set as the selected side, and the left side (PL1, PL2) and the right side (PR1, PR2) of the convex polygon P are set as the processing target sides. It is set (step 24). Next, it is determined whether or not the selected side (QR3, Qu) of the convex polygon Q intersects the left side (PL1, PL2) of the convex polygon P (step 25). As shown in FIG. 3, the selected side (QR3, Qu) of the convex polygon Q does not intersect the left side (PL1, PL2) of the convex polygon P. It is determined whether or not Qu) intersects the right side (PR1, PR2) of the convex polygon P (step 28). As shown in FIG. 3, the selected side (QR3, Qu) of the convex polygon Q does not intersect with the right side (PR1, PR2) of the convex polygon P. Next, the right side (selected side) of the convex polygon Q It is determined whether or not the attribute flag is ON (step 31). As shown in FIG. 4, since the attribute flag 8 on the right side of the convex polygon Q is in the OFF state, the coordinates of the vertex QR3 are not output.
[0081]
  Next, among the vertices of the convex polygons P and Q, vertices PL2, PR1, QL1, and QR2 are selected as selection candidates. Further, the vertex QL1 is selected as the selected vertex from the four vertices, and the vertex output process is executed on the vertex QL1 (step 4 and step 5). In the vertex output process, first, the left side (Qu, QL1) of the convex polygon Q is set as the selected side, and the right side (PR1, PR2) and the left side (PL1, PL2) of the convex polygon P are set as the processing target side. It is set (step 61). Next, it is determined whether or not the selected side (Qu, QL1) of the convex polygon Q intersects the right side (PR1, PR2) of the convex polygon P (step 62). As shown in FIG. 3, since the selected side (Qu, QL1) of the convex polygon Q does not intersect the right side (PR1, PR2) of the convex polygon P, the selected side (Qu, Q, It is determined whether QL1) intersects the left side (PL1, PL2) of the convex polygon P (step 65). As shown in FIG. 3, the selected side (Qu, QL1) of the convex polygon Q does not intersect with the left side (PL1, PL2) of the convex polygon P. Next, the left side (selected side) of the convex polygon Q It is determined whether or not the attribute flag is ON (step 68). As shown in FIG. 4, since the attribute flag 8 on the left side of the convex polygon Q is in the OFF state, the coordinates of the vertex QL1 are not output.
[0082]
  Next, of the vertices of the convex polygons P and Q, the vertices PL2, PR1, QL2, and QR2 are selected as selection candidates. Further, the vertex PL2 is selected as the selected vertex from the four vertices, and the vertex output process is executed on the vertex PL2 (step 4 and step 5). In the vertex output process, first, the left side (PL1, PL2) of the convex polygon P is set as the selected side, and the right side (QR2, QR3) and the left side (QL1, QL2) of the convex polygon Q are set as the processing target side. It is set (step 41). Next, it is determined whether or not the selected side (PL1, PL2) of the convex polygon P intersects the right side (QR2, QR3) of the convex polygon Q (step 42). As shown in FIG. 3, since the selected side (PL1, PL2) of the convex polygon P intersects the right side (QR2, QR3) of the convex polygon Q at the intersection A, the coordinates of the intersection A are output. At the same time, the attribute flags 8 on the left side (selected side) of the convex polygon P and the right side of the convex polygon Q are inverted to the ON state (step 43 and step 44). Next, it is determined whether or not the selected side (PL1, PL2) of the convex polygon P intersects the left side (QL1, QL2) of the convex polygon Q (step 45). As shown in FIG. 3, since the selected sides (PL1, PL2) of the convex polygon P do not intersect the left sides (QL1, QL2) of the convex polygon Q, next, the left side (selected side) of the convex polygon P It is determined whether or not the attribute flag is ON (step 48). As shown in FIG. 4, since the attribute flag on the left side of the convex polygon Q is in the ON state, the coordinates of the vertex PL2 are output (step 49).
[0083]
  Similarly, vertices PR1, QL2, QR2, PL3, PL4, and QR1 are sequentially selected as selected vertices in this order, and the vertex output process is repeatedly executed. In the process, the coordinates of the vertex QR2, the coordinates of the vertex PL3, and the coordinates of the intersection B of the left side (PL3, PL4) of the convex polygon P and the right side (QR1, QR2) of the convex polygon Q are output. Thereafter, when the lower end point Pb is selected as the selected vertex, “YES” is determined in the step 6, the process proceeds to the step 7, and the cutting process is executed in the step 7. At this stage, the coordinates of all the vertices surrounding the overlapping portion R, that is, the coordinates of the vertex PL2, the vertex PL3, the vertex QR2, the intersection point A, and the intersection point B are output to a predetermined place in the recording area of the RAM 3. Therefore, the overlapping portion R is cut out based on these coordinates.
[0084]
  Thus, according to the graphic clipping device 10 according to the present embodiment, whether or not to output the coordinates of the selected vertex is determined based on the state of the attribute flag 8. The attribute flag 8 is ON when the selected vertex of one convex polygon is inside the other convex polygon, and the selected vertex of one convex polygon is outside the other convex polygon. Sometimes it is set to be in the OFF state.
[0085]
  For example, in the initial setting process, when the upper end point Qu of the convex polygon Q is located between the left side and the right side of the convex polygon P that includes the vertices PLi and PRj satisfying the above formula 2, the attribute flag 8 is ON. Set to state. The upper end point Qu of the convex polygon Q is located between the left side and the right side of the convex polygon P. That is, the upper end point Qu of the convex polygon Q is located inside the convex polygon P. Means. In the vertex output processing, when the side of one convex polygon including the selected vertex intersects either one of the left side and the right side of the other convex polygon, the state of the attribute flag is inverted. The side of one convex polygon that includes the selected vertex intersects the side of the other convex polygon means that the selected vertex of one convex polygon is inside the other convex polygon, or This means that the selected vertex of one convex polygon has gone out of the inside of the other convex polygon.
[0086]
  Thus, the attribute flag 8 is set to the ON state when the selected vertex of one convex polygon is located inside the other convex polygon. Therefore, when the coordinates of the selected vertex are output when the attribute flag is ON, the coordinates of the vertices surrounding the overlapping portion R of the convex polygons P and Q can be extracted. The overlapping portion R can be cut out based on the coordinates.
[0087]
  Thereby, in the initial setting process, when determining whether or not the upper end point Qu of the convex polygon Q is located between the left side and the right side of the convex polygon P, the outer product calculation is executed only once. Thereafter, the coordinates of each point surrounding the overlapping portion R of the convex polygons P and Q can be extracted by referring to the attribute flag 8 without performing any outer product calculation, and the overlapping portion R is cut out. be able to. Accordingly, it is possible to reduce the calculation processing time in the graphic clipping process and improve the workability of the graphic clipping work.
[0088]
  In the above embodiment, the graphic clipping process is executed in the Y-axis direction from the upper end point Qu of the convex polygon Q toward the lower end point Pb of the convex polygon P. However, the present invention is not limited to this, and the graphic clipping is not limited thereto. The process may be executed in the Y-axis direction from the lower end point Pb of the convex polygon P toward the upper end point Qu of the convex polygon Q, and the graphic clipping process may be executed in the X-axis direction.
[0089]
  In the above embodiment, the graphic clipping processing program is stored in the ROM 2. However, the present invention is not limited to this, and the graphic clipping processing program is read from the outside into the graphic clipping device 10 and stored in the RAM 3 or the like. It is good also as a structure. Further, the graphic clipping processing program may be recorded on a recording medium such as a CD-ROM or a floppy disk, and the graphic clipping processing program may be read by the computer via the recording medium so that the computer functions as a graphic clipping device.
[0090]
  Steps 11 to 17 in FIG. 6 are specific examples of the initial setting means. Step 4 in FIG. 5 is a specific example of the vertex selecting means, step 24, step 25 and step 28 in FIG. 7, step 41, step 42 and step 45 in FIG. 8, step 51 in FIG. 52 and step 55, and step 61, step 62 and step 65 in FIG. 10 are specific examples of the intersection determination means. Step 26, Step 27, Step 29 and Step 30 in FIG. 7, Step 43, Step 44, Step 46 and Step 47 in FIG. 8, Step 53, Step 54, Step 56 and Step 57 in FIG. Steps 63, 64, 66 and 67 in the middle are specific examples of the intersection coordinate output means. Step 31 in FIG. 7, step 48 in FIG. 8, step 58 in FIG. 9, and step 68 in FIG. 10 are specific examples of the attribute flag determination means. Step 32 in FIG. 7 and step in FIG. 49, step 59 in FIG. 9, and step 69 in FIG. 10 are specific examples of the vertex coordinate output means. Step 7 in FIG. 5 is a specific example of the cutting means.
[0091]
【The invention's effect】
  As described above in detail, according to the graphic clipping device of the first aspect of the present invention, when the selected vertex of one convex polygon is located inside the other convex polygon, it is set to the ON state, and one convex polygon Since the attribute flag that is set to the OFF state is provided when the selected vertex of the square is located outside the other convex polygon, the coordinates of the selected vertex are output when this attribute flag is ON. At the time of setting, when determining whether or not the initial vertex is located between the two sides of the other convex polygon, the outer product calculation is executed only once, but thereafter no outer product calculation is performed. The coordinates of the points surrounding the overlapping portions of the convex polygons can be extracted, and the overlapping portions can be cut out. Accordingly, it is possible to reduce the calculation processing time in the graphic clipping process and improve the workability of the graphic clipping work.
[0092]
  In particular, when a graphic to be subjected to graphic clipping processing includes a curve, processing is normally performed by approximating the curve to a number of short straight lines, and therefore the number of vertices to be processed becomes enormous. In such a case, the calculation processing time in the graphic clipping process can be greatly reduced, and the graphic clipping process can be speeded up.
[0093]
  Also, according to the graphic clipping method according to the second aspect of the present invention, similarly to the graphic clipping apparatus according to the first aspect of the present invention described above, it is possible to reduce the processing time in the graphic clipping process, and the workability of the graphic clipping work is improved. Can be improved.
[0094]
  Further, according to the invention of claim 3RecordRecording mediaRecorded programMake the computer read thisprogramBy causing the computer to execute, the computer can function as the graphic clipping device according to the first aspect of the present invention, and the same effect as the graphic clipping device according to the first aspect of the present invention can be obtained.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a configuration of a graphic clipping device according to an embodiment of the present invention.
FIG. 2 is an explanatory diagram showing attribute flags according to the embodiment of the present invention.
FIG. 3 is an explanatory diagram showing a convex polygon that is a target of graphic clipping processing according to the embodiment of the present invention;
FIG. 4 is an explanatory diagram showing a history of attribute flags in the embodiment of the present invention.
FIG. 5 is a flowchart showing a main routine of graphic clipping processing in the embodiment of the present invention.
FIG. 6 is a flowchart showing an initial setting process in the embodiment of the present invention.
FIG. 7 is a flowchart showing vertex output processing according to the embodiment of the present invention.
FIG. 8 is a flowchart showing vertex output processing according to the embodiment of the present invention.
FIG. 9 is a flowchart showing vertex output processing according to the embodiment of the present invention.
FIG. 10 is a flowchart showing vertex output processing according to the embodiment of the present invention.
FIG. 11 is an explanatory diagram showing a convex polygon that is a target of graphic clipping processing;
[Explanation of symbols]
  1 CPU
  2 ROM
  3 RAM
  8 attribute flags
  10 figure clipping device
  P, Q Convex polygon

Claims (3)

X軸方向を左右方向とし、かつ、Y軸方向を上下方向とするX−Y座標面上における2つの凸多角形の重なり合った部分に対応する図形を切り出す図形クリッピング装置であって、
れぞれの凸多角形の各辺のうち、それぞれの凸多角形の最上に位置する頂点である上端頂点から最下に位置する頂点である下端頂点までを右回りに辿ることができる辺である右辺についてそれぞれ設けられた属性フラグおよびそれぞれの凸多角形の前記上端頂点から前記下端頂点までを左回りに辿ることができる辺である左辺についてそれぞれ設けられた属性フラグと、
前記2つの凸多角形の前記上端頂点のうち、より下方に位置する上端頂点を初期頂点として選択し、前記初期頂点が当該初期頂点を含まない他方の凸多角形の前記左辺と前記右辺との間に位置するか否かを判定し、その判定の結果、前記初期頂点が前記他方の凸多角形の左辺と右辺との間に位置するときには、当該初期頂点の座標を出力し、かつ、前記初期頂点を含む方の凸多角形の前記右辺についての前記属性フラグおよび前記左辺についての前記属性フラグをそれぞれON状態にセットすると共に前記他方の凸多角形の前記右辺についての前記属性フラグおよび前記左辺についての前記属性フラグをそれぞれOFF状態にセットし、一方、前記初期頂点が前記他方の凸多角形の左辺と右辺の間に位置しないときには、前記初期頂点を含む方の凸多角形の前記右辺についての前記属性フラグおよび前記左辺についての前記属性フラグをそれぞれOFF状態にセットすると共に前記他方の凸多角形の前記右辺についての前記属性フラグおよび前記左辺についての前記属性フラグをそれぞれOFF状態にセットする初期設定手段と、
前記初期頂点の両隣にある2つの頂点と、当該初期頂点を通り、かつ、X軸に平行な線と交差する前記他方の凸多角形の2辺それぞれの端点である2つ頂点のうち、より下方に位置するそれぞれの頂点との4つの頂点、もしくは、前回の選択頂点に隣接し、かつ、当該選択頂点よりも下方に位置する頂点と、前記前回の選択頂点の候補である選択候補頂点から前記前回の選択頂点を除く3つの頂点との4つの頂点、のいずれか一方の4つの頂点今回の選択候補頂点とし、当該選択候補頂点のうち最上に位置する頂点を今回の前記選択頂点として選択する頂点選択手段と、
前記選択頂点を含む方の凸多角形の各辺のうち、当該選択頂点と当該選択頂点よりも上方に位置する頂点とを端点とする辺を選択辺とし、当該選択頂点を含まない方の凸多角形の各辺のうち、前記選択候補頂点と当該選択候補頂よりも上方に位置する頂点とを端点とする2つの辺と前記選択辺とがそれぞれ交差するか否かを判定する交差判定手段と、
前記交差判定手段による判定の結果、前記選択辺が前記選択頂点を含まない方の凸多角形の辺と交差するときには、その度に、その交点の座標を出力すると共に、互いに交差する辺についての前記属性フラグをそれぞれ反転させる交点座標出力手段と、
前記属性フラグのうち、前記選択辺に対応する属性フラグがON状態か否かを判定する属性フラグ判定手段と、
前記属性フラグ判定手段によって属性フラグがON状態と判定されたときに、前記選択頂点の座標を出力する頂点座標出力手段と、
前記頂点座標出力手段によって出力された前記選択頂点の座標、前記初期設定手段によって前記初期頂点の座標が出力された場合にはその座標、および、前記交点座標出力手段によって前記交点の座標が出力された場合にはその座標に基づいて前記2つの凸多角形の重なり合った部分に対応する図形を切り出す切出手段と
を備えてなる図形クリッピング装置。
A figure clipping device that cuts out a figure corresponding to an overlapping portion of two convex polygons on an XY coordinate plane having an X-axis direction as a horizontal direction and a Y-axis direction as a vertical direction ,
Its out of the sides of the convex polygon respectively, edges can be traced from the upper end vertex the vertex located on top of each convex polygon and the lower end vertex the vertex located in the lowermost clockwise and attribute flag provided respectively for the left side is a side of and attribute flag provided respectively from the upper apex of each convex polygon to said lower apex can be traced counterclockwise about the right-hand side is,
Among the upper apex of said two convex polygons, select the upper vertices located more downward as the initial vertex, the initial vertex of the left side and the right side of the other convex polygons do not contain the initial vertex Whether the initial vertex is located between the left side and the right side of the other convex polygon, and outputs the coordinates of the initial vertex, and the attribute flag and the left side of the said right-hand side of the other convex polygons as well as set the attribute flag to each oN state for the attribute flag and the left side for said right-hand side of the convex polygon of a direction which includes an initial vertex set the attribute flag to each OFF state for, whereas, when the initial vertex is not located between the left and right sides of the convex polygon of the other, including the initial vertex The attribute flag and the attributes of the left side of the right side of the other convex polygons as well as set the attribute flag to each OFF state for the attribute flag and the left side for said right-hand side of the convex polygon of square Initial setting means for setting each flag to an OFF state;
Two vertices on both sides of the initial vertex, Ri through the initial vertex and the two vertices are two sides respectively of the end points of the other convex polygons which intersect with a line parallel to the X axis, Four vertices with each of the vertices positioned below , or a vertex that is adjacent to the previous selected vertex and positioned below the selected vertex, and a selection candidate vertex that is a candidate for the previous selected vertex the four vertices one of the four vertices of the three vertices excluding the selected vertex of the previous and the current selected candidate vertices from this time of the selected vertex vertices located on top of the selected candidate vertices Vertex selection means to select as,
Of the sides of the convex polygon towards containing the selected vertices, the edges of the vertex which is located above the said selected vertex and the selected vertex and end points and the selected edge, convex towards not including the selected vertex of the sides of the polygon, the intersection determining means for determining whether the two sides with the selected edge to the vertex endpoints located above said selected candidate vertex and the selected candidate apex intersects each When,
As a result of the determination by the intersection determination means, when the selected side intersects with the side of the convex polygon that does not include the selected vertex, the coordinates of the intersection point are output each time, and the sides that intersect with each other are output. and the intersection point coordinate output means for inverting the attribute flag, respectively,
Among the attribute flags, attribute flag determination means for determining whether or not an attribute flag corresponding to the selected side is in an ON state;
Vertex coordinate output means for outputting the coordinates of the selected vertex when the attribute flag is determined to be ON by the attribute flag determination means;
The coordinates of the selected vertex output by the vertex coordinate output means, the coordinates of the initial vertex when the coordinates of the initial vertex are output by the initial setting means, and the coordinates of the intersection point are output by the intersection coordinate output means. A cutting means for cutting out a figure corresponding to the overlapping portion of the two convex polygons based on the coordinates ,
A figure clipping device comprising:
X軸方向を左右方向とし、かつ、Y軸方向を上下方向とするX−Y座標面上における2つの凸多角形の重なり合った部分に対応する図形を切り出す図形クリッピング方法であって、
制御手段が、前記2つの凸多角形それぞれ最上に位置する頂点である上端頂点のうち、より下方に位置する上端頂点を初期頂点として選択し、前記初期頂点が当該初期頂点を含まない他方の凸多角形の前記上端頂点から最下に位置する頂点である下端頂点までを左回りに辿ることができる辺である左辺と当該凸多角形の前記上端頂点から前記下端頂点までを右回りに辿ることができる辺である右辺との間に位置するか否かを判定し、その判定の結果、前記初期頂点が前記他方の凸多角形の左辺と右辺との間に位置するときには、前記2つの凸多角形それぞれの前記左辺についての属性フラグおよび前記右辺についての属性フラグと、前記2つの凸多角形の重なり合った部分に対応する図形の各頂点の座標と、を記憶する記憶手段に当該初期頂点の座標を出力し、かつ、前記初期頂点を含む方の凸多角形の前記右辺についての属性フラグおよび前記左辺についての属性フラグをそれぞれON状態にして前記記憶手段にセットすると共に前記他方の凸多角形の前記右辺についての属性フラグおよび前記左辺についての属性フラグをそれぞれOFF状態にして前記記憶手段にセットし、一方、前記初期頂点が前記他方の凸多角形の左辺と右辺の間に位置しないときには、前記初期頂点を含む方の凸多角形の前記右辺についての性フラグおよび前記左辺についての性フラグをそれぞれOFF状態にして前記記憶手段にセットすると共に前記初期頂点を含まない方の凸多角形の前記右辺についての性フラグおよび前記左辺についての性フラグをそれぞれOFF状態にして前記記憶手段にセットする初期設定ステップと、
前記制御手段が、前記初期頂点の両隣にある2つの頂点と、当該初期頂点を通り、かつ、X軸に平行な線と交差する前記他方の凸多角形の2辺それぞれの端点である2つ頂点のうち、より下方に位置するそれぞれの頂点との4つの頂点、もしくは、前回の選択頂点に隣接し、かつ、当該選択頂点よりも下方に位置する頂点と、前記前回の選択頂点の候補である選択候補頂点から前記前回の選択頂点を除く3つの頂点との4つの頂点、のいずれか一方の4つの頂点今回の選択候補頂点とし、当該選択候補頂点のうち最上に位置する頂点を今回の前記選択頂点として選択する頂点選択ステップと、
前記制御手段が、前記選択頂点を含む方の凸多角形の各辺のうち、当該選択頂点と当該選択頂点よりも上方に位置する頂点とを端点とする辺を選択辺とし、当該選択頂点を含まない方の凸多角形各辺のうち、前記選択候補頂点と当該選択候補頂よりも上方に位置する頂点とを端点とする2つの辺と前記選択辺とがそれぞれ交差するか否かを判定する交差判定ステップと、
前記制御手段が、前記交差判定ステップにおける判定の結果、前記選択辺が前記選択頂点を含まない方の凸多角形の辺と交差するときには、その度に、その交点の座標を前記記憶手段に出力すると共に、互いに交差する辺について前記記憶手段にセットされている属性フラグをそれぞれ反転させる交点座標出力ステップと、
前記制御手段が、前記記憶手段にセットされている属性フラグのうち、前記選択辺に対応する属性フラグがON状態か否かを判定する属性フラグ判定ステップと、
前記制御手段が、前記属性フラグ判定ステップにおいて属性フラグがON状態と判定されたときに、前記選択頂点の座標を前記記憶手段に出力する頂点座標出力ステップと、
前記制御手段が、前記頂点選択ステップ、交差判定ステップ、交点座標出力ステップおよび頂点座標出力ステップを繰り返し実行し、前記頂点座標出力ステップにおいて出力された前記選択頂点の座標、前記初期設定ステップにおいて前記初期頂点の座標が出力された場合にはその座標、および、前記交点座標出力ステップにおいて前記交点の座標が出力された場合にはその座標に基づいて前記2つの凸多角形の重なり合った部分に対応する図形を切り出す切出ステップと
を備えてなる図形クリッピング方法。
A graphic clipping method for cutting out a graphic corresponding to an overlapping portion of two convex polygons on an XY coordinate plane with the X-axis direction being the left-right direction and the Y-axis direction being the vertical direction ,
Control means, out of the upper end vertex is a vertex located at the two convex polygons each top, select the upper vertices located more downward as the initial vertex and the other of which the initial vertex does not include the initial vertex Trace the left side that can trace counterclockwise from the top vertex of the convex polygon to the bottom vertex that is the lowest vertex and the clockwise direction from the top vertex to the bottom vertex of the convex polygon It is determined whether or not the first vertex is located between the left side and the right side of the other convex polygon, as a result of the determination . and attribute flag of the attribute flag and the right side of the said left-hand side of a convex polygon, respectively, the initial storage means for storing a coordinate of each vertex of the figure corresponding to the two overlapping portions of a convex polygon And outputs coordinates of the point, and then the attribute flags for the attribute flag and the left side for said right-hand side of the convex polygon towards containing the initial vertex to the respective ON state of the other as well as set in the storage means the attribute flags for the attribute flag and the left side for said right-hand side of the convex polygon, respectively in the OFF state is set in the storage means, whereas, during the initial vertex of the left and right sides of the convex polygon of the other when not located in the include the initial vertex with set attributes flags and attributes flag for the left side in the storage means in the OFF state, respectively for the right side of the convex polygon towards containing the initial vertex no person for the right side of the convex polygon attribute flags and attributes flag for the left and each OFF state the storage And the initial setting step of setting the stage,
It said control means, and two vertices on both sides of the initial vertex, Ri through the initial vertex, and a second side respectively of the end points of the other convex polygons which intersect with a line parallel to the X axis 2 4 vertices with each of the vertices located below , or adjacent to the previous selected vertex and positioned below the selected vertex, and candidates for the previous selected vertex four vertices from the selection candidate vertices and three vertices excluding the selected vertex of the previous, the one of the four vertices of the current selected candidate vertices is, the vertices located on the top among the selected candidate vertices Vertex selection step for selecting as the selected vertex this time ,
It said control means, one of each side towards the convex polygon including the selected vertex and the sides to the apex end point which is located above the said selected vertex and the selected vertex and the selected edge, the selection vertices of convex polygon sides towards free, determining whether the two sides with the selected edge to the vertex endpoints located above said selected candidate vertex and the selected candidate apex intersects each An intersection determination step,
As a result of the determination in the intersection determination step , the control means outputs the coordinates of the intersection to the storage means each time the selected edge intersects the side of the convex polygon that does not include the selected vertex. And an intersection coordinate output step for inverting the attribute flags set in the storage means for the sides intersecting each other,
An attribute flag determination step in which the control means determines whether or not an attribute flag corresponding to the selected side among the attribute flags set in the storage means is ON;
A vertex coordinate output step of outputting the coordinates of the selected vertex to the storage means when the control means determines that the attribute flag is ON in the attribute flag determination step;
The control means repeatedly executes the vertex selection step, the intersection determination step, the intersection coordinate output step, and the vertex coordinate output step, and the coordinates of the selected vertex output in the vertex coordinate output step, the initial setting step in the initial setting step. When the coordinates of the vertex are output, and when the coordinates of the intersection are output in the intersection coordinates output step, the coordinates correspond to the overlapping portions of the two convex polygons based on the coordinates. A cutting step to cut out the figure ;
A figure clipping method comprising:
X軸方向を左右方向とし、かつ、Y軸方向を上下方向とするX−Y座標面上における2つの凸多角形の重なり合った部分に対応する図形を切り出す図形クリッピング処理を実行するコンピュータ
前記2つの凸多角形それぞれ最上に位置する頂点である上端頂点のうち、より下方に位置する上端頂点を初期頂点として選択し、前記初期頂点が当該初期頂点を含まない他方の凸多角形の前記上端頂点から最下に位置する頂点である下端頂点までを左回りに辿るこ とができる辺である左辺と当該凸多角形の前記上端頂点から前記下端頂点までを右回りに辿ることができる辺である右辺との間に位置するか否かを判定し、その判定の結果、前記初期頂点が前記他方の凸多角形の左辺と右辺との間に位置するときには、前記2つの凸多角形それぞれの前記左辺についての属性フラグおよび前記右辺についての属性フラグと、前記2つの凸多角形の重なり合った部分に対応する図形の各頂点の座標と、を記憶する記憶手段に当該初期頂点の座標を出力し、かつ、前記初期頂点を含む方の凸多角形の前記右辺についての属性フラグおよび前記左辺についての属性フラグをそれぞれON状態にして前記記憶手段にセットすると共に前記他方の凸多角形の前記右辺についての属性フラグおよび前記左辺についての属性フラグをそれぞれOFF状態にして前記記憶手段にセットし、一方、前記初期頂点が前記他方の凸多角形の左辺と右辺の間に位置しないときには、前記初期頂点を含む方の凸多角形の前記右辺についての性フラグおよび前記左辺についての性フラグをそれぞれOFF状態にして前記記憶手段にセットすると共に前記初期頂点を含まない方の凸多角形の前記右辺についての性フラグおよび前記左辺についての性フラグをそれぞれOFF状態にして前記記憶手段にセットする初期設定手段
前記初期頂点の両隣にある2つの頂点と、当該初期頂点を通り、かつ、X軸に平行な線と交差する前記他方の凸多角形の2辺それぞれの端点である2つ頂点のうち、より下方に位置するそれぞれの頂点との4つの頂点、もしくは、前回の選択頂点に隣接し、かつ、当該選択頂点よりも下方に位置する頂点と、前記前回の選択頂点の候補である選択候補頂点から前記前回の選択頂点を除く3つの頂点との4つの頂点、のいずれか一方の4つの頂点今回の選択候補頂点とし、当該選択候補頂点のうち最上に位置する頂点を今回の前記選択頂点として選択する頂点選択手段
前記選択頂点を含む方の凸多角形の各辺のうち、当該選択頂点と当該選択頂点よりも上方に位置する頂点とを端点とする辺を選択辺とし、当該選択頂点を含まない方の凸多角形各辺のうち、前記選択候補頂点と当該選択候補頂よりも上方に位置する頂点とを端点とする2つの辺と前記選択辺とがそれぞれ交差するか否かを判定する交差判定手段
前記交差判定手段による判定の結果、前記選択辺が前記選択頂点を含まない方の凸多角形の辺と交差するときには、その度に、その交点の座標を前記記憶手段に出力すると共に、互いに交差する辺について前記記憶手段にセットされている属性フラグをそれぞれ反転させる交点座標出力手段
前記記憶手段にセットされている属性フラグのうち、前記選択辺に対応する属性フラグがON状態か否かを判定する属性フラグ判定手段
前記属性フラグ判定手段によって属性フラグがON状態と判定されたときに、前記選択頂点の座標を前記記憶手段に出力する頂点座標出力手段および、
記頂点座標出力手段によって出力された前記選択頂点の座標、前記初期設定手段によって前記初期頂点の座標が出力された場合にはその座標、および、前記交点座標出力手段によって前記交点の座標が出力された場合にはその座標に基づいて前記2つの凸多角形の重なり合った部分に対応する図形を切り出す切出手段、
として機能させるプログラムがコンピュータ読み取り可能に記録されていることを特徴とする記録媒体。
A computer that executes a graphic clipping process for cutting out a graphic corresponding to an overlapping portion of two convex polygons on an XY coordinate plane in which the X-axis direction is the left-right direction and the Y-axis direction is the vertical direction ;
A vertex located at the two convex polygons each of the uppermost of the upper vertices, more the upper vertex located below selected as initial vertices, the initial vertices of the other convex polygons do not contain the initial vertex can be traced from the upper apex of the left side and the convex polygon is a side that can and this follow up bottom vertex is vertices located in the lowermost from the upper apex counterclockwise until the lower end apex clockwise It is determined whether or not it is positioned between the right side that is the side, and when the initial vertex is positioned between the left side and the right side of the other convex polygon as a result of the determination, the two convex polygons and attribute flag of the attribute flag and the right-hand side for each of the left, the coordinates of each vertex of the figure corresponding to the two convex polygons of overlapping portions, the initial coordinates of vertices in the storage means for storing And force, and, of the other convex polygons with setting the attribute flag in the storage means after each ON state for the attribute flag and the left side for said right-hand side of the convex polygon towards containing the initial vertex and the attribute flags for the attribute flag and the left side for said right side, respectively the OFF state is set in the storage means, whereas, when the initial vertex is not located between the left and right sides of the convex polygon of the other , convex towards not including the initial vertex with set attributes flags and attributes flag for the left side in the storage means in the OFF state, respectively for the right side of the convex polygon towards containing the initial vertex set in the storage means attribute flag for the attribute flag and the left side for said right-hand side of the polygon, respectively in the OFF state Initial setting means that,
Two vertices on both sides of the initial vertex, Ri through the initial vertex and the two vertices are two sides respectively of the end points of the other convex polygons which intersect with a line parallel to the X axis, Four vertices with each of the vertices positioned below , or a vertex that is adjacent to the previous selected vertex and positioned below the selected vertex, and a selection candidate vertex that is a candidate for the previous selected vertex the four vertices one of the four vertices of the three vertices excluding the selected vertex of the previous and the current selected candidate vertices from this time of the selected vertex vertices located on top of the selected candidate vertices Vertex selection means to select as,
Of the sides of the convex polygon towards containing the selected vertices, the edges of the vertex which is located above the said selected vertex and the selected vertex and end points and the selected edge, convex towards not including the selected vertex among polygonal sides, intersection determination means for determining whether the two sides with the selected edge to the vertex endpoints located above said selected candidate vertex and the selected candidate apex intersects respectively,
As a result of the determination by the intersection determination means , when the selected side intersects with the side of the convex polygon that does not include the selected vertex, the coordinates of the intersection point are output to the storage means and intersect each other. Intersection point coordinate output means for inverting the attribute flag set in the storage means for each side to be
Attribute flag determination means for determining whether or not an attribute flag corresponding to the selected side among the attribute flags set in the storage means is ON;
Vertex coordinate output means for outputting the coordinates of the selected vertex to the storage means when the attribute flag is determined to be ON by the attribute flag determination means ; and
Before SL vertex coordinate output means and said selecting vertices of coordinates output by the its coordinates if the initial setting unit by the coordinate of the initial vertex is output, and the coordinates of the intersection points outputted by the intersection coordinate output means A cutting means for cutting out a figure corresponding to the overlapping portion of the two convex polygons based on the coordinates when
A recording medium on which a program that functions as a computer is recorded so as to be readable by a computer .
JP11841098A 1998-04-28 1998-04-28 Graphic clipping device and graphic clipping method Expired - Fee Related JP4066103B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP11841098A JP4066103B2 (en) 1998-04-28 1998-04-28 Graphic clipping device and graphic clipping method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP11841098A JP4066103B2 (en) 1998-04-28 1998-04-28 Graphic clipping device and graphic clipping method

Publications (2)

Publication Number Publication Date
JPH11312240A JPH11312240A (en) 1999-11-09
JP4066103B2 true JP4066103B2 (en) 2008-03-26

Family

ID=14735964

Family Applications (1)

Application Number Title Priority Date Filing Date
JP11841098A Expired - Fee Related JP4066103B2 (en) 1998-04-28 1998-04-28 Graphic clipping device and graphic clipping method

Country Status (1)

Country Link
JP (1) JP4066103B2 (en)

Also Published As

Publication number Publication date
JPH11312240A (en) 1999-11-09

Similar Documents

Publication Publication Date Title
USRE48940E1 (en) Simulation of the machining of a workpiece
JP4568750B2 (en) Drawing apparatus, drawing program, and drawing method
WO2014002661A1 (en) Method for modifying a path of a cutter head of a laser cutting machine
US9117300B2 (en) Designing a modeled volume represented by dexels
US9248525B2 (en) Method and system for cutting features from sheet materials with a laser cutter according to a pattern
CN114429535A (en) Smooth cutting method and device for triangular mesh curved surface
JP4066103B2 (en) Graphic clipping device and graphic clipping method
JP6233034B2 (en) Substrate analysis program, information processing apparatus, and substrate analysis method
JP2010039680A (en) Image processor, image processing program, and image processing method
US5384907A (en) Method for carrying out scissoring -processing of stroke letters in a screen display
JP3305395B2 (en) Figure division device
JPH0723997B2 (en) Character / graphic drawing device
JPH10240790A (en) Method for instructing formation of fillet surface
JPH08185542A (en) Graphic processor
JP2614111B2 (en) A method for detecting the correlation between a straight line display element and a rectangular window
JP2006048172A (en) Clip processing system and clip processing method
JPH04174006A (en) Graphic drawing method
JP2019170427A (en) Program, information processing device, and movement region generation method
JPH07182402A (en) Cad device
JPH0490080A (en) Method and device for processing hidden line in two-dimensional cad system
JPH05120430A (en) Crossing judgment and intersection calculation system for polygon and straight line
JPH11283050A (en) Method for generating finite element data and device therefor
JP2006185126A (en) Sizing processor and its computer program
JPH1031760A (en) Graphic processor
JPH028960A (en) Method for extracting and processing common part in two polygons

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050324

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070925

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071120

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20071212

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071225

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

Free format text: PAYMENT UNTIL: 20110118

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20120118

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20120118

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20130118

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20140118

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees