JP4028979B2 - 3D graphic data generator - Google Patents

3D graphic data generator Download PDF

Info

Publication number
JP4028979B2
JP4028979B2 JP2001371077A JP2001371077A JP4028979B2 JP 4028979 B2 JP4028979 B2 JP 4028979B2 JP 2001371077 A JP2001371077 A JP 2001371077A JP 2001371077 A JP2001371077 A JP 2001371077A JP 4028979 B2 JP4028979 B2 JP 4028979B2
Authority
JP
Japan
Prior art keywords
character
data
point sequence
outer periphery
shape
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
JP2001371077A
Other languages
Japanese (ja)
Other versions
JP2002260008A5 (en
JP2002260008A (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.)
Panasonic Corp
Panasonic Holdings Corp
Original Assignee
Panasonic Corp
Matsushita Electric Industrial Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Panasonic Corp, Matsushita Electric Industrial Co Ltd filed Critical Panasonic Corp
Priority to JP2001371077A priority Critical patent/JP4028979B2/en
Publication of JP2002260008A publication Critical patent/JP2002260008A/en
Publication of JP2002260008A5 publication Critical patent/JP2002260008A5/ja
Application granted granted Critical
Publication of JP4028979B2 publication Critical patent/JP4028979B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Controls And Circuits For Display Device (AREA)
  • Image Generation (AREA)

Description

【0001】
【発明の属する技術分野】
本発明は、2次元平面上の輪郭線で構成される文字等の任意の2次元形状を表すデータから、3次元形状を表すデータを生成するための3次元形状データ生成装置に関し、特に文字や図形についての3次元文字データ生成装置及び3次元図形データ生成装置に関する。
【0002】
【従来の技術】
従来の3次元文字データ生成装置としては、例えば第1の従来例として、特開昭63−103380号公報に開示された「3次元文字の作成装置」がある。この従来例について、図27を参照しながら説明する。2次元文字は2次元文字入力装置140により入力され、xy平面上の2次元文字が記憶装置120内に定義される。次に、表示装置110の表示を見ながら行われる、操作者のz方向修正装置130の操作によって、3次元文字の形状設計が進められる。この際、xz投影面112またはyz投影面113上で、各点のz座標値の変更が行なわれ、入力された2次元文字は3次元文字に修整される。修整中の3次元文字の立体像は立体像投影面114で確認することが可能である。次に、領域背景入力装置150から入力された絵柄の画像データに基づいて、記憶装置120内の3次元文字の表面に絵柄を付した状態の画像データが生成され、これが立体像投影面114に表示される。但し、この発明における3次元文字形状の生成は、xz投影面112またはyz投影面113を利用して操作者が調整を行うものであり、自動生成ではない。
【0003】
また、3次元文字形状の自動生成を目指したものとしては、例えば第2の従来例として、特開平11−53578号公報に開示された「形状変換方法、該方法の処理手順を記録した記録媒体、及び形状変換装置」がある。これは、2次元平面上での文字形状を表すアウトラインデータから文字の側面形状のみを生成するものである。従って、この従来例は、3次元形状の一部を生成するだけであり、文字の完全な3次元形状が得られるわけではない。
【0004】
また、第3の従来例としては、特開平11−53579号公報に開示された「形状変換方法およびその変換手順を記録した記録媒体、ならびに形状変換装置」がある。これは、与えられた2次元のビットマップフォント文字を入力し、このビットマップフォント文字を構成する各ビットデータを3次元形状に対応させ、それらを合成することで文字全体としての3次元形状を生成するものである。しかし、ビットマップフォントは、輪郭においてジャギーが発生しやすく、このジャギーを目立たなくするためには、文字を構成するビット数の多い精緻なビットマップフォントを用いる必要がある。
【0005】
【発明が解決しようとする課題】
しかしながら、上記の第1の従来例では、操作者が手動で3次元文字形状の生成を行うため、操作者の処理負担が大きく、また処理時間も多大に掛かり実時間での生成は不可能である。上記の第2の従来例は、3次元文字形状の自動での生成を目指したものではあるが、生成されるデータは側面のデータだけであり、特に重要な文字そのものの形状を表す表面、裏面がない不完全なもので、実用上役に立たないデータと言わざるを得ない。上記の第3の従来例では、とりあえず3次元文字形状は生成できるものの、ビットマップデータから生成するため、文字形状の輪郭部分にジャギーが発生する。従って、これを利用してCG等で描画した場合には、更に描画時のジャギーが加わり、文字の品位は非常に低いものとなる。また、全てのビットマップ文字を3次元形状に対応させるため、ある程度の品位の3次元形状を実現しようとすると、非常に多くのデータ量が必要となる。
【0006】
本発明は、上記問題に鑑みてなされたものであり、容易に高品位の3次元形状データの生成が可能な装置を提供することを目的とする。すなわち、操作者の手を煩わせることなく、与えられた2次元の文字や図形のアウトラインデータから、3次元形状を表すデータを自動かつ実時間で生成し、文字や図形の品位もビットマップフォントをベースに生成したものに比べ、はるかに高品位な3次元形状のデータ生成が可能な装置を提供する。また、3次元化した文字や図形の表面に様々なテクスチャ模様を施したり、文字形状の台座の据え付けや刻印板化することを可能とすることで、様々な3次元的文字表現に対応し得る3次元形状データ装置を提供する。
【0007】
【課題を解決するための手段】
上記課題を解決するために、本発明に係る3次元図形データ生成装置は、文字コードと刻印板コードを入力するための文字刻印板コード入力手段と、前記文字コードに対応する文字のアウトラインデータと前記刻印板コードに対応する刻印板のアウトラインデータを記憶する外周データ記憶手段と、前記文字刻印板コード入力手段によって入力された文字コードと刻印板コードに基づいて、前記外周データ記憶手段から文字及び刻印板のアウトラインデータを取得する文字外周刻印板形状取得手段と、前記文字外周刻印板形状取得手段において取得された文字のアウトラインデータに基づいて、前記文字の外周と当該文字に形成されている穴の外周の包含関係を解析して文字を構成する構成要素を特定し、前記刻印板の中に前記文字が存置し得る条件を算出し、その条件に基づいて刻印板のアウトラインデータを変換し、変換後の刻印板のアウトラインデータに基づいて、前記刻印板の外周と当該刻印板に形成されている穴の外周の包含関係を解析して刻印板下面を構成する構成要素を特定し、文字の外形を表す外周の点列を文字の穴を表す点列に変換し、文字の穴を表す外周の点列を文字の外形を表す点列に変換し、これら変換された点列に基づく新たな文字のアウトラインデータと前記変換後の刻印板のアウトラインデータとを合併したアウトラインデータを生成し、当該合併されたアウトラインデータに基づいて、前記変換後のアウトラインデータに係る刻印板の外周と前記新たなアウトラインデータに係る文字の外周の包含関係を解析して刻印板上面を構成する構成要素を特定する文字刻印板形状構造解析手段と、前記文字刻印板形状構造解析手段において特定された文字と刻印板上面及び下面の構成要素ごとに、凸ポリゴンに分割する文字刻印板形状面凸ポリゴン分割手段と、前記文字刻印板形状面凸ポリゴン分割手段においてポリゴン分割された刻印板の各構成要素を空間的に移動して刻印板の上面、下面及び側面を生成し、文字の上面の構成要素を所定の深さ分だけ空間的に移動して刻印板の堀込み部の下面と側面を生成する文字刻印板形状側面生成手段とを備える。
【0010】
なお、上記目的を達成するために、本発明は、上記3次元図形データ生成装置の特徴的な構成手段をステップとする3次元図形データ生成方法として実現したり、それらのステップを含むプログラムとして実現することもできる。そして、そのプログラムは、3次元図形データ生成装置が備えるROM等に格納しておくだけでなく、CD−ROM等の記録媒体や通信ネットワーク等の伝送媒体を介して流通させることもできる。
【0011】
【発明の実施の形態】
以下、本発明に係る実施の形態1〜6について、図面を用いながら詳細に説明する。
(実施の形態1)
図1は、実施の形態1における3次元文字データ生成装置101の機能構成を示すブロック図である。3次元文字データ生成装置101は、文字コード入力部1、文字外周データ取得部2、文字外周データ記憶部3、文字形状構造解析部4、文字形状上下面凸ポリゴン分割部5、文字形状側面生成部6及び文字形状データ出力部7から構成されている。
【0012】
文字コード入力部1は、いわゆるキーボードやマウスなどの入力装置で、これらの入力信号を変換し、ASCIIコードやJISコードなどの文字コード、図形コードを生成する。文字コード入力部1で生成された文字コードは、文字外周データ取得部2に出力される。
【0013】
文字外周データ取得部2は、文字コード入力部1から入力した文字コードに対応する文字の、いわゆる外郭線データ(以下、「アウトラインデータ」ともいう。)を、文字外周データ記憶部3から取得する。
【0014】
文字外周データ記憶部3には、予め、文字のアウトラインデータが、文字コードに対応して記憶されている。この場合、文字としては同一であってもフォントの種類が異なっている場合は、アウトラインデータも異なったものとなる。従って、文字外周データ記憶部3には、アウトラインデータが、文字コード及びフォントの種類に対応付けられて記憶されている。文字外周データ取得部2において取得されたアウトラインデータは、文字形状構造解析部4に出力される。
【0015】
なお、一般にアウトラインデータは、点の総個数、曲線のタイプの識別子、開始点の座標データ(アウトラインデータにおける座標は、2次元xy座標とする。以下同じ。)、点間の接続方法(例えば、直線による接続方法や曲線による接続方法がある。)を表す識別子、文字の外周を構成する点列(または制御点列)の座標データ(以下、「点列座標データ」という。)などの1セットのデータが、1文字を構成する後述の文字部品の数だけ集まって構成されている。
【0016】
通常、点間の接続は、直線または2次元のB−Spline曲線を用いることによって行われ、それら点間の接続をさらに接続することによって連続曲線が生成される。そのため、直線による接続方法においては、点列の位置データは端点を表し、曲線による接続方法においては、点列の位置データは曲線を生成する際の制御点を表す。また、点列の開始点と終点とを結ぶことで閉曲線を構成することができ、この閉曲線が文字の外周を表す曲線となる。なお、本実施の形態では、文字のアウトラインデータの中の点列座標データはxy座標の値を示すものとし、文字を3次元で表す場合の高さ方向の座標軸はz軸とする。
【0017】
さらに、文字によっては穴のあるトーラス構造を持つ場合があるため、アウトラインデータの点列には、文字の外形の外周を構成する点列(以下、「文字外周点列」という。)と、文字の穴の外周を構成する点列(以下、「穴外周点列」という。)の2種類が存在する。
【0018】
漢字の「回」のように、文字の中には、複数の文字部品によって1文字が構成される場合がある。ここで、「文字部品」とは、文字を構成する、互いに非接続の要素をいう。上記の「回」の場合は、外側の「口」の文字部品と内側の「ロ」の文字部品から構成されている。また、ロシア語の「ё」の場合は、「・」、「・」及び「e」の3つの文字部品から構成されている。従って、個々の文字部品は、文字外周点列を1つ有する。また、文字部品によっては、1つまたは複数の穴外周点列を有するものがある。
【0019】
上記の文字外周点列と穴外周点列とを区別を実現するため、通常は、文字外周点列の個々の点を定義する際の各点の並べられる方向(即ち、各点を順に辿るときの回り方)と、穴外周点列における各点の並べられる方向とは、双方逆の関係にしている。ここでは、文字外周点列を辿る時の回り方は「時計回り」に、また、穴外周点列を辿る時の回り方は「反時計回り」になるように点列座標データが文字外周データ記憶部3に記憶されているものとする。但し、この回り方の決め方には、特別な理由はない。なお、明示的に文字外周と穴外周とを区別する識別子を設けても良いが、その場合は、文字外周データ記憶部3で記憶すべきデータ量が増大する。
【0020】
図2は、上述のように、文字外周点列及び穴外周点列をたどるときの回り方を示したものである。図2では、文字外周点列を時計回りの黒点P0〜P9で表し、穴外周点列を反時計回りの白点P10〜P15で表している。
【0021】
文字形状構造解析部4では、まず、受け取った文字のアウトラインデータの点列座標データに対して、文字外周点列なのか、穴外周点列なのかの判別を行う。この判別の手順について、図2を用いながら説明する。
【0022】
(1)アウトラインデータから得られる点列をP0,P1,・・・,Pnとするとき、これらの点列から生成される2つの隣り合うベクトルPiPi+1とベクトルPi+1Pi+2に対して、内積をなす角θi+1を求める(但し、i=0,1,・・・,nであり、Pn+1=P0とする。以下、同じ)。例えば、ベクトルP0P1とベクトルP1P2の場合の内積をなす角はθ1である。
【0023】
(2)その内積をなす角θi+1に係る2つのベクトルの外積を求め、その値が正ならば正の符合を、負ならば負の符合を付加する。以上の内積をなす角θi+1を順次算出し、それらを合計した値が±2πである。
【0024】
(3)上記(1)(2)で求めた符合付きの内積をなす角θi+1の合計を求め、その合計が−2πならば時計回りでたどる文字外周点列であると判別し、2πならば反時計回りでたどる穴外周点列であると判別する。
【0025】
次に、上記(3)の判別の結果、文字外周点列だけで構成される文字の場合は、以下のバウンダリーボックスを求める処理を行った後、後述する構造解析結果情報とアウトラインデータとを文字形状上下面凸ポリゴン分割部5に出力する。文字外周点列と穴外周点列とが混在する場合は(即ち、穴外周点列が存在する場合)、以下で説明する構造解析(包含関係の解析)処理を行う。
【0026】
以下では、図2に示されるように、数字の"0"を用いながら、文字外周点列の対するバウンダリーボックスを求める方法について説明する。
(1)文字外周点列から、x座標の最小値(xo-min)と最大値(xo-max)、y座標の最小値(yo-min)と最大値(yo-max)を求める。
(2)(1)で求められた最小値及び最大値に基づいて作成した4つの点A(xo-min,yo-max)、点B(xo-max,yo-max)、点C(xo-max,yo-min)、点D(xo-min,yo-min)による、四角形ABCDをバウンダリーボックスとする。但し、通常の数学表記の場合、反時計回りに頂点を指定していくが、本実施の形態では、文字外周点列の順序表記に合わせ、時計回りに頂点を指定している。
【0027】
(3)バウンダリーボックスABCDの各辺の長さの総和の半分(以下、「長さL」という。)を、長さL=(辺AB)+(辺BC)より算出する。
この処理後、点列座標データ、バウンダリーボックスの個数、バウンダリーボックスの4つの頂点の座標(または、xo-min,xo-max,yo-min,yo-max)、各辺の長さの総和を文字外周データ記憶部3に記憶する。穴外周点列に対しても、上記と同様のバウンダリーボックスabcdを構成する4つの座標値(以下「4座標値」という。)のxh-min,xh-max,yh-min,yh-maxを求め、同様に文字外周データ記憶部3に記憶する。
【0028】
以上のことより、例えば「回」という文字の場合は、外側の「口」の文字部品の文字外周点列と内側の「ロ」の文字部品の文字外周点列によって文字外周点列のグループを構成し、外側の「口」の文字部品と内側の「ロ」の文字部品の2つの文字穴の穴外周点列により穴外周点列のグループを構成する。従って、2つの文字外周点列に基づいて2つのバウンダリーボックスABCDが作成され、2つの穴外周点列に基づいて2つのバウンダリーボックスabcdが作成されることとなる。
【0029】
次に、文字外周点列のグループと、穴外周点列のグループの間の包含関係を明らかにするために、文字外周点列のバウンダリーボックス毎に、全ての穴外周点列のバウンダリーボックスを構成する4座標値に対して、次の包含関係の判定を行う。
【0030】
(包含関係の判定)
「"xo-min<xh-min<xh-max<xo-max"かつ"yo-min<yh-min<yh-max<yo-max"ならば、当該穴外周は当該文字外周に含まれる。それ以外の場合は含まれない。」
【0031】
上記の包含関係の判定では、1つの文字穴の穴外周点列が、複数の文字部品の文字外周点列に含まれたり、実際は含まれていないのに、見かけ上、含まれてしまっているという状態が起こり得る。例えば、「固」や「店」などの場合が、そのような場合に該当する。従って、このような場合は包含関係を修正する必要が有るが、それは以下の修正ルールによって実行し得る。
【0032】
(修正ルール)
「一つの文字穴の外周が、複数の文字部品の外周に含まれている場合、その穴は最も内側の文字部品の外周に含まれる。」
以下では、この修正ルールを具体的に実施する2つの方法について述べる。まず第1の方法は下記の通りである。
(第1の方法)
2つの文字同士における文字外周間の内外判定は、先に求めておいた、文字外周点列のバウンダリーボックスの長さLを比較することによって代替し、Lの値の小さい方が内側の文字であると判定する。この第1の方法は計算時間が短く、高速に包含関係が判定可能である。しかし、例外的なフォントの場合は、包含関係の判定が上手く行かないことがある。そこで、計算時間は掛かるものの、安定的に包含関係の判定ができる第2の方法ついて、以下で述べる。
【0033】
(第2の方法)
(1)文字外周点列のバウンダリーボックスに対して、包含関係の判定を行う。つまり、「ある穴を含むと判定された複数の文字のうち、一の文字の文字外周点列のバウンダリーボックスの座標をxoj-min,xoj-max,yoj-min,yoj-maxとすると(但し、jは文字穴を含む文字外形の添字であり、j=1〜n)、あるkに対して次の条件が成り立つならば、文字穴は添字kの文字の穴であると判定する。」
(条件)
「任意のj≠kに対して、xoj-min<xok-min"かつ"yoj-min<yok-min"かつ"xok-max<xoj-max"かつ"yok-max<yoj-max"」
【0034】
この条件が成り立たないときは、次の(2)の判定を行う。なお、上の条件が成り立つときは、
xok-min=max(xoj-min)
yok-min=max(yoj-min)
xok-max=min(xoj-max)
yok-max=min(yoj-max)
である。従って、判定の手順としては、まず、max(xoj-min)=xok-minよりkを求め(バウンダリーボックスのx座標の最小値について、任意のバウンダリーボックス同士で比較し、その中で最大値を有するjをkとする)、そのkに対して、残り3つの条件が成り立つかどうか調べれば良い。
【0035】
(2)(1)の条件が成り立たないときは、穴外周点列ののバウンダリーボックスの重心から各文字外形の外周までの距離の最小値を算出し、それら最小距離の中で最小となる文字外形の外周にその穴は属すると判定する。但し、「文字穴のバウンダリーボックスの重心から文字外形の外周までの最小距離」とは、文字外周上の点までの距離の最小値と文字外周の辺までの距離の最小値を算出して、それら2つのうちの小さい方のことである。
【0036】
文字外周上の点までの距離は、通常のユークリッド距離(2乗和のルート)を用いて算出する。文字外周の辺までの距離は以下のように求める。但し、文字外周点列をP0(p0x,p0y),P1(p1x,p1y),・・・,Pn(pnx,pny)とし、文字穴のバウンダリーボックスの重心をC(cx,cy)、Cから辺PkPk+1に下ろした垂線の足をH(hx,hy)とする。
a=pk+1x−pkx,b=pk+1y−pky,d=Cx−pkx
e=Cy−pky
α=(a×d+b×e)/(a**2+b**2)
hx=α×a+pkx
hy=α×a+pky
但し、k=0,1,2,・・・,nであり、Pn+1=P0とする(ここで、「X**Y」はXのY乗を表すものとする。以下、同様。)。
【0037】
次に、min(pkx,pk+1x)≦hx≦max(pkx,pk+1x)かつmin(pky,pk+1y)≦hy≦max(pky,pk+1y)ならば、辺までの距離|CH|を以下の式で算出する。この条件が成り立たなければ、辺までの距離は存在しないので、次の辺の処理に移る。

Figure 0004028979
【0038】
文字の構造解析結果情報は、文字の構造について、階層を有する木構造の情報(例えば、点列「LB」が点列「LA」に包含される場合は、"LA−LB"など)として表記することが可能である。この木構造で表された情報は、文字構造解析結果情報として、文字形状上下面凸ポリゴン分割部5に出力される。
【0039】
以上のように構成される文字形状構造解析部4における処理について、漢字の「回」を例として挙げた図3及び図4を参照しながら詳細に説明する。
【0040】
図3は、漢字の「回」について文字形状構造解析を実施した場合の模式図である。また、図4は、図3における包含関係解析処理における詳細な処理の流れを示すフローチャートである。なお、図3に示されるように、「回」の点列は、外側の「口」の部分の外周の点列401、外側の「口」の部分の穴の外周の点列402、内側の「ロ」の部分の外周の点列403及び内側の「ロ」の部分の穴の外周の点列404によって構成されている。
【0041】
最初に、文字形状構造解析部4は、文字外周データ取得部2から受け取った「回」の点列に対して、上述の方法により、それが文字外周点列を表すのか、穴外周点列を表すのかについての判別を行う(S405)。その結果、点列401(Lo-1)及び点列403(Lo-2)が文字外周点列に該当し(406)、点列402(Lh-1)及び点列404(Lh-2)が穴外周点列に該当すると判別される(407)。この後、文字外周点列401、403についてはバウンダリーボックス及び長さLが算出され(S408)、穴外周点列402、404についてはバウンダリーボックスが算出される(S409)。
【0042】
次に、上記の穴外周点列402(Lh-1)及び穴外周点列404(Lh-2)が、どの文字外周点列に含まれるのかについての包含関係解析処理が実行される(S410)。
【0043】
包含関係解析処理(S410)では、まず、解析対象とする文字外周点列(Lo-1、Lo-2)のバウンダリーボックスと穴外周点列(Lh-1、Lh-2)のバウンダリーボックスが特定され(S501)、穴外周点列のバウンダリーボックスが文字外周点列のバウンダリーボックスに包含されているか否かについて判定がなされる(S502、S503)。この判定は、すべての文字外周点列のバウンダリーボックスと穴外周点列のバウンダリーボックスとの組合せについて実施される(S504、S501〜S503)。「回」の場合であれば、文字外周点列Lo-1が穴外周点列Lh-1及びLh-2を包含し、文字外周点列Lo-2が穴外周点列Lh-2を包含していると判定される(411)。
【0044】
上記の判定において、1つの穴外周点列が複数の文字外周点列に含まれていると判定された場合は、その穴外周点列を包含する唯一の文字外周点列を特定する必要があるため、以下のような包含関係の修正を行う必要がある(S412、S413、S505)。
【0045】
まず、1つの穴外周点列を特定し、これを包含する文字外周点列を全て(例えば、N個)特定し、さらに、前述の第1または第2(1)の方法によってN個の中から最も内側にある文字外周点列を特定する(S506、S509)。
【0046】
もし、特定できなかった場合は(S507)、前述の第2(2)の方法によって、最も内側にある文字外周点列を特定する(S508、S510)。
【0047】
以上により、「回」についての包含関係の判定は、内側の「ロ」の部分の穴外周点列(Lh-2)は、その「ロ」の部分の文字外周点列(Lo-2)のみに包含されるように修正され、この構造解析結果情報を木構造で表すことが可能となる(414)。
【0048】
なお、文字(または文字部品)に穴がない場合は、その構造は階層のないフラットな構造であるとするという構造解析結果情報が、穴のある場合と同様に文字形状上下面凸ポリゴン分割部5に出力される。このように、文字(または文字部品)は、文字形状構造解析部4から得られる構造解析結果情報により、その構成要素を"外形のみ"または"外形+文字穴"という木構造で表現することができる。ここで、「構成要素」とは、文字又は文字部品において後述のポリゴン分割の対象となる、文字外周点列によって定義される文字外周の内部領域(文字外周点列を含む)、又は文字外周点列によって定義される文字外周の内部領域から穴外周点列によって定義される穴の内側の内部領域を除いた領域(文字外周点列と穴外周点列とを含む)をいう。
【0049】
文字形状上下面凸ポリゴン分割部5は、上述した構成要素に対して、それぞれ凸ポリゴン分割を行う。なお、本実施の形態では、凸ポリゴンの一例として三角形をとりあげ、これによってポリゴン分割を行う場合について説明する。
【0050】
まず、文字形状上下面凸ポリゴン分割部5では、分割を行う構成要素に穴外周点列が含まれている場合に、三角形ポリゴン分割を行うための前処理として、文字外周点列と穴外周点列とを接続する処理を行い(以下「接続化」という。)、一つの外周の点列に変換する。同時に、点列番号(点列の並びの順序を表す番号)の付け替え処理を行う。この接続化は、上記のアウトラインデータに基づいて文字外周と穴外周とを接続して、いわゆる一筆書きが可能な並び方の点列座標データを生成する処理である。接続化は、以下の2つの方法により実現が可能である。
【0051】
図5は、第1の接続化の方法を漢字の「田」に適用し、さらに点列番号の付け替えを実施した様子を示す図である。以下、第1の接続化の方法について図5を参照しながら説明する。なお、図5においては、各点列の点列番号のみを示している。
【0052】
(第1の接続化の方法)
(1)全ての文字穴について、各文字穴の穴外周点列に基づいて、x、y座標の最大値x−max,y−maxと最小値x−min,y−minを求め、各文字穴の中心座標((x−max+x−min)/2,(y−max+y−min)/2)を求める。
【0053】
(2)各文字穴の中心座標から最も近い文字外周点を求める(以下、「近接点」という。)。但し、この場合の距離は、計算量を減らすため、x、y座標の2乗和で代替し、ルートは取らないこととする。複数の文字穴がある場合は、近接点に重複がないよう、一つの文字穴に対して近接点を求めた後は、次の文字穴に対してはその近接点を除いた文字外周点から近接点を選択する。図5の例では、文字穴615についての近接点を文字外周点列の中の点「4」とする。
【0054】
(3)上記の近接点に最も近い文字穴の穴外周点を求め、その点が始点となるように穴外周点列の順序を並べ変える(即ち、点列番号の付け替えを行う)。例えば、元の穴外周点列を{P0,P1,・・・,Pk,・・・,Pm}とし、近接点に最も近い文字穴の外周上の点がPkのときは、{Pk,・・・,Pm,P0,P1,・・・,Pk-1}の順になるように点列番号を付け替える。図5の例であれば、文字穴615の穴外周点列{0,1,2,3}のうち、近接点に最も近い穴外周上の点は、点「2」であるため、{2,3,0,1}の順になるように点列番号を付け替える。
【0055】
(4)文字外周点列に穴外周点列を埋め込み、点列番号の付け替えを行う。例えば、元の文字外周点列の点列番号が{Q0,Q1,Q2,・・・,Qi,Qi+1,・・・,Qn}であり、上記(3)の付け替えを行った後の新たな穴外周点列が{P0,P1,・・・,Pm}で、近接点が「Qi」のときは、穴外周点列の埋め込みは、{Q0,Q1,Q2,・・・,Qi,{P0,P1,・・・,Pm,P0},Qi,Qi+1,・・・,Qn}のように行う。このように埋め込まれた点列に、新たに点列番号を付け替えると、それらは{0,1,2,・・・,i,i+1,・・・,i+m+1,i+m+2,i+m+3,・・・,n+m+3}となる。複数の文字穴がある場合は、上記の近接点の点列番号の小さい方から、順次埋め込みを行って接続化を行う。図5の例の場合、便宜上、文字穴615の穴外周点列のみを埋め込むこととすると、文字外周点列の順序番号が{0,1,・・・,4,・・・,11}であり、上記(3)の並べ替えを行った後の新たな穴外周点列を{0,1,2,3}とするときは、文字穴615についての近接点が点「4」であるので、穴外周点列を埋め込むと、{0,1,・・・,4,{0,1,2,3,0},4,・・・,11}となる。さらに、新たに点列番号を付け替えると、{0,1,・・・,4,5,・・・,9,10,・・・,17}となる。図5に示されるように、以上の接続化を他の文字穴616〜618についても適用すると、最終的には、新たに生成された外周の点列の点列番号は、{0,1,・・・,35}となる。
【0056】
この後、文字形状上下面凸ポリゴン分割部5は、この接続化によって新たに生成された外周の点列と接続化を行う前の文字外周点列及び穴外周点列とを対応付けて(例えば、テーブル形式で)文字外周データ記憶部3に記憶する。なお、この接続化によって生成された外周の点列には重複点が含まれているため、重複点であることを示す識別子についても合わせて文字外周データ記憶部3に記憶する。
【0057】
次に、例外的な文字(または文字部品)に対しても処理が可能なように、上記第1の接続化の方法のアルゴリズムを強化修正した第2の接続化の方法について述べる。
【0058】
(第2の接続化の方法)
(1)1つ処理対象とする文字穴に着目し、その穴外周点列の各点から文字外周点列の各点までの距離を算出し、その中から最小のもの(最小距離)を特定する。また、上記の穴外周点列の各点から文字外周の辺までの距離を算出し、その中から最小距離を特定する。
【0059】
(2)上記(1)により特定された最小距離のうち、より小さい方を上記着目した文字穴の最小距離として採用し、その穴外周点列の点と文字外周点列の点(または、穴外周点列の点と文字外周の辺に下ろした垂線の足の点)の2つの点を決定する。
【0060】
(3)上記(2)で決定した穴外周点列の点を始点とする順序に穴外周点列の点列番号の付け替えを行う。例えば、元の穴外周点列が{0,1,・・・,k,・・・,m}で、近接点に最も近い穴外周点が点「k」のとき、{k,・・・,m,0,1,・・・,k−1}の順になるように点列番号の付け替えを行う。
【0061】
(4)文字外周までの最小距離の最小値を満たすものが文字外周点列の点の場合は、文字外周点列に穴外周点列を埋め込み、点列番号の付け替えを行う。例えば、元の文字外周点列の点列番号が{0,1,2,・・・,i,i+1,・・・,n}であり、上記(3)の並べ替えを行った後の穴外周点列の点列番号を{0,1,・・・,m}とするとき、穴外周点列の始点に最も近い点がiの場合の埋め込みは、{0,1,2,・・・,i,{0,1,・・・,m,0},i,i+1,・・・,n}となり、これに対してシリアルに点列番号を付け替えるので、{0,1,2,・・・,i,i+1,・・・,i+m+1,i+m+2,i+m+3,・・・,n+m+3}となる。これを新たな外周の点列とする。このとき、新たな外周の点列の他に、穴外周点列の始点と接続化前の文字外周点列及び穴外周点列、さらに、i,i+1,i+m+1,i+m+2を重複点として文字外周データ記憶部3に記憶する。
【0062】
一方、外周までの最小距離の最小値を満たすものが文字外形の辺に下ろした垂線の足の点の場合は、文字外周点列にこの垂線の足の点を埋め込み、点列番号の付け替えを行う。例えば、垂線の足が文字外周点列の点kとk+1で生成される辺上にある場合は、kとk+1の間にこの点を埋め込む。次に、この埋め込みが終わった文字外周点列に対して、上記と同様に穴外周点列を埋め込み、点列番号の付け替えを行うが、接続化は、上記の垂線の足の点(新たに埋め込まれた文字外周点k+1)を近接点として埋め込みを行う。この場合も、新たな外周の点列の他に、穴外周点列の始点と接続化前の文字外周点列及び穴外周点列、さらに、k+1,k+2,k+m+3,k+m+4を重複点として文字外周データ記憶部3に記憶する。
【0063】
(5)複数の文字穴がある場合は、次の文字穴に対して上記(1)から(4)の処理を行う。但し、(4)において一旦重複点となった点については、(1)における最小距離の算出対象から除外する。
【0064】
次に、構成要素の三角形分割の方法について、2通りの方法について説明する。
まず、第1の三角形分割方法について説明する。平面上の点列に対する凸包の三角形分割のアルゴリズムとしては、計算幾何学の分野で研究が行われており、著名なものとしては、Dulaunayの三角形分割アルゴリズムがある。また、点列に対する凸包の算出アルゴリズムとしては、Grahamのアルゴリズムや、Quickhullのアルゴリズムがある。従って、構成要素が、文字外周のみで、しかも文字の外形が凸形ならばDulaunayのアルゴリズムを適用することで三角形分割が完了する。しかし一般には、上記の説明からも判るように、構成要素には穴が存在したり、文字の外形は、例えば「あ」のように凹多角形であることが多い。そのため、以下で述べるような、これらのアルゴリズムを組合せ改良した方法によって、構成要素に対する三角形分割を行う。
【0065】
(1)前述の接続化によって生成した外周の点列から、その後方に位置する重複点を除いた点列を新たに生成して(これを「点列B」とし)、その対応関係を文字外周データ記憶部3にテーブル形式で記憶する。つまり、このテーブルには、接続化した外周の点列と接続化する前の点列とが対応付けられており、接続化した外周の点列とそこから後方の重複点を除去した点列Bとが対応付けられている。
【0066】
(2)点列Bに対して、GrahamまたはQuickhullの方法で、凸包を生成する。
(3)構成要素の外周の点列が1つの文字外形の点列で、しかも生成した凸包の外形の点列が、接続化する前の外周の点列と一致するならば識別子0を、そうでないものは識別子1を与える。
【0067】
(4)Dulaunayのアルゴリズムにより、(2)で生成した凸包を三角形分割する。もし、識別子が0ならば次の構成要素に対して、上記(1)から処理を行い、識別子が1ならば(5)の処理に移る。
(5)(4)で生成した三角形の重心を算出する。
【0068】
(6)前記接続化によって得られた外周の点列をP0,P1,・・・,Pmとすると、Pi、Pi+1に対応する点列Bの点を上記のテーブルを参照して求め、それをQ,Rとすると、QRを1つの辺として三角形を構成した場合のそれらの三角形の重心Ciに対して(このCiは最多であっても2つである)、ベクトルPiPi+1とベクトルPiCiとの外積を計算する。但し、QRを辺として含む三角形が2つある場合は、それぞれの重心に対して外積計算を行う。
【0069】
このとき、文字形状が定義される空間の座標系が右手系であって、外積の計算結果が正の場合、その三角形は、文字外形の凹部に作られた三角形であるか、もしくは文字穴の内部の三角形であるので、棄却する。左手系の場合は、外積の結果が負の場合に棄却する。以上の処理をi=0,・・・,m−1に対して順次行う。このとき、Pi,Pi+1が共に重複点の場合は、それに対応するPj-1(Piに対応する重複点),Pj(Pi+1に対応する重複点)が点列Bの後方に存在する(つまり、i<j−1)ことになるので、辺PiPi+1に対する三角形の除去判定が終了したら、後方の辺Pj−1Pjの判定は行わないように終了識別子をテーブルに設定する。i=m−1まで処理が終了したら、次の構成要素に対して、上記(1)から全ての構成要素に対して処理を繰り返す。
【0070】
以上の第1の三角形分割方法を「田」について適用した場合の処理結果の例を、図6(a)に示す。但し、図中の番号は点列Bの点列番号を示している。三角形分割されたときの結果は、点列Bの3点の組で表される。一般に、右手系の場合、上記3点の並びが反時計回りとなる面が上面で、逆に時計回りとなる面を下面と定義される(反時計回りを下面、時計回りを上面としても何ら問題はない)。また、この並びの回転方向の判定は三角形を構成する3点をPQRとすると、ベクトルPQとベクトルPRの外積を計算し、その符合によって判定できる。例えば、座標系が右手系で外積計算結果が正ならばPQRの並びが反時計回りで、PRQの並びが時計回りである。左手系の場合も同様に判定が行える(但し、時計回りが一般には表面と定義される)。
【0071】
次に、第2の三角形分割方法について説明する。前処理で得られた接続化した外周の点列をP0,P1,・・・,Pmとすると、第2の方法では以下のように処理を行う。但し、ここでは先のテーブルにおいて、文字外形の外周の凹部の点と文字穴の外周の点に対して識別子1を保持する。凹部の点の検出は文字外形の外周の点列から生成される2つのベクトルPiPi+1とベクトルPi+1Pi+2の外積を計算し、右手系の場合ならばその符合が正の時、Pi+1が凹部の点である(左手系の場合は逆)。
【0072】
(1)ベクトルP0P1とP1P2の外積を計算し、その符合を算出する(ここでは右手系として話を進めるが、左手系の場合も符合が逆なだけで同様に行える)。但し、下記(2b)で点の除去が行われているので、最終的に点列の残りの点の個数が3つになったならば、外積は行わず、その3点をその順序で保持する。その3点によって構成される三角形が分割処理の最後の三角形であるため、そこで処理を終了する。
【0073】
(2a)(1)の外積の結果が負ならば、三角形P0P1P2の内部に、テーブルに保持した文字穴の外周又は文字外形の凹部の点列Bの点が含まれていないかチェックする。このチェックは、ベクトルP0P1とP0とチェックを行う点を結んでできるベクトルの外積の符合が正で、ベクトルP1P2とP1とチェックを行う点を結んでできるベクトルの外積の符合が正で、ベクトルP2P0とP2とチェックを行う点を結んでできるベクトルの外積の符合が正の場合には、そのチェックした点は三角形の内部にあると判定される。
【0074】
(2b)(2a)の判定で三角形の内部に点が含まれていない場合は、3点P0P1P2をこの並びで保持し(この並びは時計回りに相当)、P1を点列Bから除去した新たな点列を生成し、三角形P0P2P3に対して引続き上記(1)から処理を行う。
【0075】
(2c)(2a)の判定で三角形の内部に点が含まれている場合は、P0を点列Bの最後部に移動した新たな点列を生成し、三角形P1P2P3に対して引続き上記(1)から処理を行う。
【0076】
(2d)(1)の外積の結果が正または0ならば、P0を点列Bの最後部に移動した新たな点列を生成し、三角形P1P2P3に対して引続き上記(1)から処理を行う。
【0077】
以上の第2の三角形分割方法を「田」に適用した場合の処理結果の例を、図6(b)に示す。但し、図中の番号は前処理で接続化を行った外周の点列の点列番号を示している。なお、上記の分割において生成された、辺と三角形とを複数組み合わせることにより、一般の多角形の形による分割が可能になる。
【0078】
さらに、上記の第2の三角形分割方法をロシア語の「ё」に適用した場合の処理結果の例を、図7に示す。
各構成要素に対して、第1の三角形分割方法を適用することにより、点列Bの座標データ(ここでは2次元)と、分割された各三角形を表す3点の並びを表すデータ(点列Bにおける3つのインデックスにより表されるデータ)が生成される。一般に、右手系のデータ形式では、文字を3次元で表示する場合の下面の構成要素における上記3点の並び方は時計回り、上面の構成要素における上記3点の並び方は反時計回りとなる。また、第2の三角形分割方法を適用することにより、前記接続化した外周の点列の座標データ(ここでは2次元)と、同様に各三角形の3点の並びを表すデータ(接続化した外周の点列における3つのインデックスにより表されるデータ)が生成される。ここで、「インデックス」とは、分割された三角形の各頂点を表すための識別子をいう。例えば、三角形がP1P2P3で構成されている場合の「1」、「2」「3」がインデックスである。
以上の第1の三角形分割方法又は第2の三角形分割方法によって生成されたデータの形式は、一般にインデックスドサーフェースデータと呼ばれる。但し、左手系の場合の点列の並び方は、上記右手系の場合と逆になる。このように、文字形状上下面凸ポリゴン分割部5において、1つの文字に対する上面の各構成要素のインデックスドサーフェースデータと、下面の各構成要素のインデックスドサーフェースデータが生成され、文字形状側面生成部6に出力される。
【0079】
文字形状側面生成部6は、文字形状上下面凸ポリゴン分割部5から出力されたインデックスドサーフェースデータを入力し、文字外周データ記憶部3から各構成要素に関する元の外周の点列(接続化される以前の形式の文字外周点列と穴外周点列)のデータを取得する。さらに、文字形状側面生成部6は、上記インデックスドサーフェースデータを三次元に拡張する。以下では、文字形状側面生成部6におけるインデックスドサーフェースデータを三次元に拡張する文字形状側面生成処理について、図8及び図9を参照しながら説明する。
【0080】
図8は、文字形状側面生成処理における処理の流れを示すフローチャートである。図9(a)〜(d)は、インデックスドサーフェースデータを三次元に拡張する際に必要となる、文字の上面を高さ方向に移動する4種類の方法について、それらの概要を示した図である。
【0081】
最初に、文字形状側面生成部6は、初期化処理として、上記下面の各構成要素のインデックスドサーフェースデータのうち、点列座標データを3次元に拡張し、z座標値に相当する部分を全て0にする。同様に、上記の元の外周の点列を3次元に拡張した下面における点列(以下「下点列」という。)の点列座標データのz座標値に相当する部分を全て0にする(S901)。
【0082】
次に、文字の上面を高さ方向に移動する方法を特定し、それぞれの方法に基づいて(S902)、文字の上面の各構成要素のインデックスドサーフェースデータのうちの点列座標データのz座標値、及び元の外周の点列を3次元に拡張した上面における点列(以下「上点列」という。)の点列座標データのz座標値とを決定する。
【0083】
図9(a)は、第1の方法の概要を示す図である。第1の方法は、文字の上面を高さ方向に垂直に持ち上げる方法である(持ち上げた高さをhとする)。この場合は、文字の上面の各構成要素のインデックスドサーフェースデータのうち、点列座標データのz座標値を全てhにする。同様に、元の外周の点列の点列座標データを3次元に拡張して上点列を生成し、そのz座標値に相当する部分を全てhにする(S903)。
【0084】
図9(b)は、第2の方法の概要を示す図である。第2の方法は、基準ベクトルv(vx,vy,vz)の方向に平行移動する方法である。この場合は、文字の上面の各構成要素のインデックスドサーフェースデータのうち、点列座標データのz座標値を0として3次元に拡張し、これらに基準ベクトル分の座標値を加算する。同様に、元の外周の点列の点列座標データのz座標値を0にして3次元に拡張した上点列を生成し、これらに基準ベクトル分の座標値を加算する(S904)。
【0085】
図9(c)は、第3の方法の概要を示す図である。第3の方法は、文字を縮小変換または拡大変換した後に高さ方向へ移動する方法である(高さをhとする)。この場合は、文字の上面の各構成要素のインデックスドサーフェースデータのうち、点列座標データに対して縮小または拡大変換を行い、z座標値をhとして3次元に拡張する。同様に、元の外周の点列の点列座標データに対して縮小又は拡大変換を行い、z座標値をhにして3次元に拡張した上点列を生成する(S905)。
【0086】
図9(d)は、第4の方法の概要を示す図である。第4の方法は、回転変換により移動する方法であり、適当な回転軸ベクトルと回転角θが予め与えられる。この場合は、文字の上面の各構成要素のインデックスドサーフェースデータのうち、点列座標データのz座標値を0として3次元に拡張し、これらの座標値に対して、予め与えられた回転軸ベクトルと回転角θによって定義される回転変換を施し、変換後の座標値を算出する。同様に、元の外周の点列の点列座標データのz座標値を0にして3次元に拡張した上点列を生成し、この座標値に対して、予め与えられた回転軸ベクトルと回転角によって定義される回転変換を施し、変換後の座標値を算出する(S906)。
【0087】
なお、以上の処理からも判るように、3次元に拡張した上記元の外周の下点列と上点列は、点列番号が一致している。以上のように、文字形状側面生成部6において、3次元に拡張された文字上下面の各構成要素のインデックスドサーフェースデータが生成され(S907)、文字形状データ出力部7に出力される。
【0088】
3次元に拡張した各構成要素の外周の下点列を{P'n}、上点列を{Pn}とすると、右手系の場合、側面は四角形PiP'iP'i+1Pi+1として生成できる(反時計回りの順で、左手系の場合は時計回りに並べ変えれば良い)。インデックスドサーフェースデータの形式の側面データとするためには、上点列の後に下点列を付加した点列(ここでは{Q2n})の点列座標データに、QiQi+nQi+1Qi+n+1の並びのインデックスデータを並べる。このように生成された、各構成要素の側面のインデックスドサーフェースデータは、文字形状データ出力部7に出力される。
【0089】
文字形状データ出力部7では、文字形状側面生成部6から出力されてきた、文字の各構成要素の上下面のインデックスドサーフェースデータと、各構成要素の側面のインデックスドサーフェースデータを階層的な記述によって一まとめにして、外部(例えば、3次元図形表示装置等)へ出力する。なお、データ形式を変換する場合には、当該データ形式へ変換してから出力を行う。
【0090】
以上のように、穴が含まれている文字について、文字や文字部品の外形と文字穴との包含関係を明確にすることにより、文字部品の単位までに分割した3次元表示を可能とすることができる。
【0091】
(実施の形態2)
上記の実施の形態1では、文字の上面を高さ(z軸)方向に直線的に持ち上げることによって、3次元文字の側面を直線的に形成し、3次元の文字を生成する実施例について述べたが、実施の形態2では、3次元の文字の側面に任意の中間外周を設け、その中間外周に基づいて種々のべベル形状の側面を形成する実施例について述べる。なお、本実施の形態では、上記実施の形態1と同じ構成部分についての説明は省略する。
【0092】
図10は、本実施の形態における3次元文字データ生成装置201の機能構成を示すブロック図である。本装置201は、前記文字形状側面生成部6に代えてべベル形状側面生成部11を備え、前記文字形状データ出力部7に代えて文字形状データ出力部12を備える。以上のように構成される3次元文字データ生成装置201について、以下詳細に説明を行う。
【0093】
べベル形状側面生成部11では、上記文字形状上下面凸ポリゴン分割部5の出力結果のほかに、上記実施の形態1と同様に元の外周の点列のデータを文字外周データ記憶部3から入力する。文字下面の各構成要素のインデックスドサーフェースデータのうち、点列座標データを3次元に拡張し、z座標値に相当する部分を全て0にする。同様に、元の外周の点列の点列座標データを3次元に拡張した下点列を生成し、そのz座標値に相当する部分を全て0にする。
【0094】
次に、高さ方向に垂直に持ち上げ(持ち上げた高さをhとする)、文字上面の各構成要素のインデックスドサーフェースデータのうち、点列座標データを3次元に拡張し、z座標値に相当する部分を全てhにする。同様に、元の外周の点列の点列座標データを3次元に拡張した上点列を生成し、z座標値に相当する部分を全てhにする。3次元に拡張した上面及び下面の各構成要素のインデックスドサーフェースデータは文字形状データ出力部12に出力される(但し、最後に述べる鋳型タイプのべベル形状を除く)。
【0095】
図11は、べベル形状の外形及びべベル形状の中間外周の生成方法を説明するための図である。
図11(a)は、最も単純なベベル形状の外形を示した図である。図11(a)では、文字の上下面の間に中間外周1220を生成し、文字の側面を斜めに切ったときの断面が凸六角形となるようにして、べベル形状を成形させている。この場合、文字の外側の中間外周1220は、文字の上面(または下面)の外周1210(又は1230)を拡大して生成し、文字穴の中間外周は、文字の上面(または下面)の穴外周を縮小して生成する。
【0096】
その他のべベル形状としては、上記図11(a)とは逆に、文字の側面を斜めに内側に切り、その断面が窪んだ凹六角となるようにしてべベル形状を成形させる場合が考えられる。この場合、文字の外側の中間外周は、文字の上面(または下面)の外周1210(又は1230)を縮小して生成し、文字穴の中間外周は、文字の上面(または下面)の穴外周を拡大して生成する。文字の外側の中間外周と文字穴の中間外周との組合せとしては、他に、文字外形、文字穴ともに拡大して生成した場合、文字外形、文字穴ともに縮小して生成した場合などがある。
【0097】
以下では、中間外周を生成する方法について、図11(b)及び図12のフローチャートを参照しながら説明する。
【0098】
上記のように、中間外周を生成するためには、各構成要素の外周を拡大または縮小して生成する必要がある。中間外周は、構成要素の外周の法線ベクトルを求め、構成要素の外周の点列の点を法線方向へ移動(拡大の場合は、法線ベクトルを正の方向へ、縮小の場合は負の方向へ移動)することによって得られる。構成要素の外周上の点を、P0,P1,・・・,Pnとした場合の中間外周の生成方法を以下で説明する。
【0099】
(1)ベクトルpi=PiPi+11340(添字iの点を始点とし、次の添字i+1の点を終点としたベクトル)を求める。但し、最後に求まるベクトルは、pn=PnP0(添字が最後の外周上の点を始点とし、最初の点を終点としたベクトル)とする(S1301)。
【0100】
(2)各ベクトルpi=(pix,piy)の法線ベクトルNi=(Nix,Niy)1341を求める(S1302)。法線ベクトルの求め方は以下の通りである。但し、法線ベクトルは2通りある。
(pix*piy≠0のとき):
Nix=±1/(1+(pix/piy)**2)**(1/2),
−Niy=±(pix/piy)×1/(1+(pix/piy)**2)**(1/2)
(pix=0,piy≠0のとき):
Nix=±1,Niy=0
(pix≠0,piy=0のとき):
Nix=0,Niy=±1
上記で求めた、2通りの法線ベクトルのうち、以下の条件を満たす方を選択する。
(条件式):pix*Niy−piy*Nix>0
【0101】
(3)外周の各点Piに対して、法線ベクトルNPi=(NPxi,NPyi)を以下の式によって求める(S1303)。
NPi=(Ni-1+Ni)/||Ni-1+Ni||
=((Ni-1x+Nix)/((Ni-1x+Nix)**2+(Ni-1y+Niy)
**2))**(1/2),(Ni-1y+Niy)/((Ni-1x+Nix)**2
+(Ni-1y+Niy)**2))**(1/2)
但し、NP0については、以下の通りとする。
NP0=(Nn+N0)/||Nn+N0||
=((Nnx+N0x)/((Nnx+N0x)**2
+(Nny+N0y)**2))**(1/2),
(Nny+N0y)/((Nnx+N0x)**2+(Nny+N0y)**2))
**(1/2))
【0102】
(4)外周を拡大/縮小する量をLとしたとき、次のαiを算出する(S1304)。但し、具体的な拡大/縮小量Lについては後述する。
αi=L/cosθi=L/(NpixNix+NpiyNiy)
但し、構成要素の外周の場合,上式の分母が0以下になることはない。従って、もし0以下になった場合は、異常が起こっている。
【0103】
(5)外周の各点Piに対応する中間外周の点をPi'1242とすると、Pi'を以下の式によって求める。これらが拡大した中間外周を構成する点列になる(S1306)。
Pi'=Pi+αiNPi
縮小の場合の中間外周の点をPi'については、
Pi'=PiαiNPi
によって求める(S1307)。
【0104】
このように生成された中間外周の点列と上点列、下点列を用いて、側面形状の生成方法を図11(a)を参照しながら説明する。まず、中間外周の点列を3次元に拡張し、z座標値をここでは半分のh/2とする(この場合、z座標値を0とhの間の任意の値に設定することが可能である)。次に、上点列Pn,Pn+1に対応する中間外周の点列をPcn,Pcn+1,下点列をPn',Pn+1'とすると、上面の外周と中間外周を接続することによって生成される側面は、反時計回りの場合「PnPn+1Pcn+1Pcn」で、中間外周と下面の外周の接続で生じる側面は、「PcnPcn+1Pn+1'Pn'」となる。
【0105】
従って、上面の外周と中間外周から生成される側面のインデックスドサーフェースデータは、上点列(個数n)に中間外周の点列をアペンドした点列Q1,・・・,Qn,Qn+1,・・・,Q2nを構成し、反時計回りの場合は、インデックスをQi,Qi+1,Qi+n+1,Qi+nとして順次構成する。同様に、中間外周と下面の外周から生成される側面のインデックスドサーフェースデータについても生成できる。
【0106】
次に、上記の中間外周を生成する場合の発展形として、中間外周を2つ生成し、文字外周の上面及び下面の端の角を削った形状、いわゆる典型的なベベル形状の生成方法について、図13を参照しながら説明する。なお、この場合の中間外周の生成方法も、基本的には上記の生成方法と同様である。
【0107】
図13(a)は、文字の上面及び下面よりも側面が突き出している、いわゆる凸状の側面を形成する2つの中間外周を生成する場合の概要を示す図である。図13(a)において、生成する2つの中間外周のうち、上面に近い方を第1中間外周1411、下面に近い方を第2中間外周1412とする。次に、ベベル形状の削ぎ落とし角度を、図13(a)に示したように、上面外周に対する削ぎ落とし角度をθ1、下面外周に対する削ぎ落とし角度をθ2とする。この場合、2つの中間外周1411、1412は、ともに上面の文字外周1410に対して拡大を行うこととなる。
【0108】
図13(a)から分かるように、上面の文字外周1410を拡大して中間外周を生成する場合は、tanθi=hi/Liであるので、hi=Litanθiとなる。但し、この場合は、i=1または2である。以上の計算を行った後、h0=h−(h1+h2)を算出し、第1中間外周1411の点列のz座標値をh0+h2(=h−h1)とし、第2中間外周1412の点列のz座標値をh2として3次元化した点列を生成する。側面の生成については、中間外周が1つ増えたことに注意すれば、上記で説明した、中間外周が1つの場合の側面を生成する方法と同様に行うことが可能となる。
【0109】
図13(b)は、上記図13(a)とは逆に、凹状の側面を形成する2つの中間外周を生成する場合の概要を示す図である。この場合は、上面の文字外周1420に対して縮小を行うことによって2つの中間外周を生成することとなるが、基本的には、上記図13(a)と同様の方法によって生成が可能である。
【0110】
次に、側面の形状が曲線の場合に、この曲線を多角形で近似し、その多角形に合わせて多数の中間外周を発生させて側面を生成する方法について、図14に基づいて説明する。ここでは中間外周の生成を制御する曲線は、基本的には2次曲線とし、例えば円や放物線、スプライン曲線を想定して説明する。
【0111】
まず、図14(a)に示したように、側面の形状が半円状に凸となっている場合について説明する。なお、拡大をL、立ち上げる高さをh(≧2L)、生成する中間外周の数を2n+1とする。なお、図14(a)の例では、n=2とする。
【0112】
図14(a)から分かるように、生成される中間外周は、高さh/2における中央の中間外周1511に関して対称となる。従って、中央の中間外周1511より上側(または下側)の中間外周を生成すれば、下側(または上側)の中間外周は対称性を利用して生成すれば良い。側面の生成については、上記に述べた方法によって生成する。中間外周の生成で問題となるのは、中央の中間外周1511以外の拡大量とそのz座標値を算出することである。これについて、図14(c)を参照しながら、その算出方法について説明する。
【0113】
図14(c)において、中央の中間外周1511を中間外周0とし、以降その両側に離れる順に、中間外周1,2,・・・とする。中間外周iの拡大量Li、z座標値ziは、以下の式により算出することができる(ここで、べベル円の半径をrとする)。
Li=L−r(1−cos(2iθ/(n+1)))
zi=h/2±hi=h/2±rsin(2iθ/(n+1))
r=1/2L(L**2+h**2/4)
θ=arctan(2L/h)
但し、i=0,1,・・・,nで、ziはプラスのときが上側の中間外周のz座標で、マイナスのときが下側の中間外周のz座標を示す。
【0114】
図14(b)は、側面の形状が凹の場合のべベル形状の外観を示す。側面の形状が凹の場合は、Liについては符号をマイナスにして縮小量とするが、ziについては、上記図14(a)の凸の場合と同じである。
【0115】
次に、側面のべベル形状が放物線の場合について説明する。円の場合と同様に、生成する中間外周の個数を2n+1、中間外周iの拡大/縮小量をLi、z座標値をzi,i=0,1,・・・,n,とすると、凸の場合は、
Li=L(1−i**2/(n+1)**2)
zi=h/2±ih/2(n+1)=h(1±i/(n+1))/2
但し、ziは、その値がプラスのときが上側の中間外周のz座標、マイナスのときが下側の中間外周のz座標を示す。なお、以上は凸の場合だが、凹の場合は、Liについては符号をマイナスにして縮小量とするが、ziについては凸の場合と同じである。
【0116】
2次スプライン曲線を用いる場合は、下面と上面との間に仮想的にz座標値が0〜hのパラメータを導入することとする。本装置201の操作者によって入力された上面と下面との間の適当な制御点と、上記パラメータとに基づいてスプライン曲線を発生させる。但し、上面と下面部の端点は0に固定する。スプライン曲線によって凸/凹となった量が拡大/縮小量で、パラメータが有するz座標値が中間外周のz座標値となる。以上のように、2次スプライン曲線に合わせて中間外周を発生させ、文字の側面を上記と同様の方法で生成する。
【0117】
最後に、鋳型タイプのベベル形状の側面を生成させる場合について、図15に基づいて説明する。鋳型タイプのベベル形状の側面を生成させる場合も、上述した中間外周を2つ発生させる方法を変形して適用することによって生成が可能である。以下では、3段の鋳型タイプのべベル形状の側面を生成する場合の手順を示す。
【0118】
(1)元の構成要素の外周と同一(但し、z座標値は同一ではない。)の中間外周1610,1611と、元の外周を縮小した2つの中間外周1620、1621と、元の外周を拡大した2つの中間外周1630、1631を上記に述べた方法で生成する。
【0119】
(2)立ち上げ高さをh(このhは、外部より入力するかデフォルト値を使用する)としたとき、縮小した2つの中間外周のz座標値をそれぞれh、2h/3とし、元の外周と同一の2つの中間外周1610、1611のz座標値をそれぞれ2h/3、h/3とし、拡大した2つの中間外周のz座標値をそれぞれh/3、0とする。
【0120】
(3)縮小して生成した中間外周のうち、上位の中間外周により構成される面を構成要素の上面とし、それらの中間外周の点列のz座標値をhにする(z座標値がhの縮小した中間外周によって上面を生成する)。
(4)拡大して生成した中間外周のうち、下位の中間外周により構成される面を構成要素の下面とし、それらの中間外周の点列のz座標値を0にする(z座標値が0の拡大した中間外周によって下面を生成する)。
【0121】
(5)縮小して生成した2つの中間外周間において対応するそれぞれの点を結ぶことにより、上記と同様の方法で最上位の段の側面1622を生成する。
(6)縮小して生成した中間外周(z座標値が2h/3)と、元の外周と同一の中間外周のうち上位の中間外周(z座標値が2h/3)との対応点を結ぶことによって、上記と同様の方法で、中段の上面(水平面)を生成する。
【0122】
(7)元の外周と同一の2つの中間外周間において対応それぞれの点をむすぶことにより、上記と同様の方法で中段の側面1612を生成する。
(8)元の外周と同一の中間外周のうち下位の中間外周(z座標h/3)と拡大して生成した中間外周(z座標値がh/3)との対応点を結ぶことにより、上記の方法と同様の方法で下段の上面(水平面)を生成する。
(9)拡大して生成した2つの中間外周間において対応するそれぞれの点を結ぶことにより、上記と同様の方法で最下位の段の側面1632を生成する。
【0123】
なお、上記方法により上面と下面を生成する際は、元の構成要素に対する三角形分割を行っておけば、外周のインデックスの対応関係自体は変化しないので、インデックスドサーフェースデータの点列座標データ部分だけに対して縮小、または拡大するだけで良い。また、この場合は、上記、元の構成要素の上面と下面のインデックスドサーフェースデータは、文字形状データ出力部12には出力せず、ここで生成されたインデックスドサーフェースデータを生成後にまとめて送る。
【0124】
文字形状データ出力部12では、べベル形状側面生成部11から送られてきた、文字の各構成要素の上下面のインデックスドサーフェースデータと、各構成要素のべベル形状側面のインデックスドサーフェースデータを階層的な記述によって一まとめにして、外部へ出力する。なお、データ形式を変換する場合には、当該データ形式へ変換してから出力する。
【0125】
図16(a)〜(d)は、本実施の形態に係る4種類のべベル形状の例を示す。図16(a)は、前記実施の形態1において、第1の方法として文字の上面を高さ方向に垂直に持ち上げた場合の側面の形状であり、「べベルなし」の場合である。図16(b)は、上記図13(a)の形状と同様に、側面の断面が凸六角形状に突き出たべベル形状を生成した例である。図16(c)は、中間外周を2つ生成し、文字の上面及び下面の外周に対する削ぎ落とし角度が等しい場合の側面の断面が凸台形状のべベル形状を生成した例である。図16(d)は、上記図15に示した「鋳型タイプ」のべベル形状の例である。
以上のように、中間外周を生成し、これに基づいて側面を生成するため、自動的により多様な3次元文字の側面形状を実現することが可能となる。
【0126】
(実施の形態3)
実施の形態3では、上記の文字外周点列や穴外周点列の点間を適当な点で補間することにより、より精細な3次元形状を可能とする場合の実施例について述べる。なお、本実施の形態では、上述した実施の形態と同じ構成部分についての説明は省略する。
【0127】
図17は、本実施の形態3における3次元文字データ生成装置301の機能構成を示すブロック図である。3次元文字データ生成装置301は、文字外周データ補間部21及び文字形状上下面凸ポリゴン再分割部22及びテクスチャ座標生成部24を新たに備え、前記文字形状側面生成部6に代えて文字形状側面生成部23を、文字形状データ出力部7に代えて文字形状データ出力部25を備える。以上のように構成される3次元文字データ生成装置301について、以下、詳細に説明する。
【0128】
文字外周データ補間部21は、文字形状構造解析部4から出力される、各構成要素の文字外周点列や穴外周点列に、適当な点を補間して3次元で表現する文字の形状の精細化を行う。文字外周点列または穴外周点列に点を補間する方法は以下の通りである。
【0129】
(1)文字形状構造解析部4から送られてくる、各構成要素の文字外周点列、穴外周点列に対して、連続する2つの点を接続した場合の距離の総和である総和距離を算出する。また、その場合の点列の総個数を算出する。
(2)上記総和距離をその総個数で割り、平均距離を算出し、算出した平均距離を任意の細分化レベルに応じた数で除することにより基準距離を算出する。
(3)元の文字外周点列または穴外周点列のうち、連続する2つの点の間の距離が基準距離より大きい場合は、基準距離以下となるように中間に点を発生させる。発生させる点は、文字外周データ記憶部3に記憶されているアウトラインデータに指定されている、上述した直線によって接続したライン、又は曲線によって接続したライン上に発生させる。なお、既存の点列の間に新たに点を付加した場合であっても、その並びを保持しながら(新たな点の点列番号を最後にするのではなく)点列番号を修正する。
【0130】
図18は、「回」に対して、点列の間に新たに点を補間した場合の一例である。図18においては、文字外周点列1911に対して1辺あたり3つの点を補間し、穴外周点列1912に対して1辺あたり2つの点を補間している。以下同様に、文字外周点列1913及び穴外周点列1914においては、1辺あたり1つの点を補間している。
【0131】
以上の方法のように、文字外周データ補間部21において、点が補間され修正された各構成要素の外周データが文字形状上下面凸ポリゴン分割部5に送られる。文字形状上下面凸ポリゴン再分割部22では、文字形状上下面凸ポリゴン分割部5で、各構成要素を上記のように三角形分割した三角形を、更に分割する。この再分割は、文字形状上下面凸ポリゴン分割部5で生成される三角形ポリゴンの頂点は文字の外周上にあるため、形状を曲げたりねじったりする場合に、外周の変形が直線的になってしまい、不自然な状況が生じる可能性が高い。このような不自然さを防ぐために再分割を行う。
【0132】
次に、三角ポリゴンを再分割する方法について、図19〜図21を参照しながら説明する。
図19は、元の三角形を4つに再分割する方法における処理の流れを示すフローチャートである。
図21(a)は、三角形の辺の中点を用いて内分割を行う方法を説明するための図である。
本実施の形態では、図21(a)に示したような三角形の辺の中点を用いた内分割法によって行う。この内分割法は、三角形の各辺の中点を算出し、中点間を結んだ3つの線分によって、元の三角形を4つに分割するというものである。従って、三角形の個数は、分割する毎に4倍で増えていく。
【0133】
ここで、各構成要素に対して、文字形状上下面凸ポリゴン分割部5の前処理で接続化された外周の点列を{P[0],P[1],・・・,P[n]}とし、文字外形の外周の点列を{Po[0],Po[1],・・・,Po[l]}、文字穴の外周の点列を{Ph[x][0],Ph[x][1],・・・,Ph[x][kx]とする。
以下、インデックスの並びが、{a,b,c}の三角形ポリゴンに対する内分割法についてそのアルゴリズムを説明する。
【0134】
(1)|a−b|,|b−c|,|c−a|の値を計算する。
(2)|a−b|=1ならば、P[a]P[b]の中点Pabを求め、Pab=P[last+1]として点列の最後に加え、インデックスlast+1=αを保持する。
(3)|a−b|≠1かつ(a,b)≠(lastorg,0)&(a,b)≠(0,lastorg)ならば(但し、lastorgは、分割操作前の点列のインデックスの最後の値)、P[a]P[b]の中点が求められていないかチェックする。チェックの結果、求められていたらそのインデックスをαとして保持し、後述のチェックリストからその中点のデータを除去する。求められていない場合は、P[a]P[b]の中点Pabを求め、Pab=P[last+1]として点列の最後に加え、インデックスlast+1=αを保持する。同時に、チェックリストにインデックスの組番号(a,b)とαを保持する。従って、チェックリストは、インデックスの組番号とそれによって生成されたインデックスで構成され、チェックにおいてはインデックスの組番号を順不同で比較する。
【0135】
(4)|b−c|,|c−a|についても、上記(2)、(3)を同様に行い、|b−c|についてはインデックスβ、|c−a|についてはインデックスγを保持する。
(5)三角形を規定するインデックス列{a,b,c}を除去し、4つの三角形を規定するインデックス列{a,α,γ},{b,β,α},{c,γ,β},{α,β,γ}を代わりに挿入する。
【0136】
次に、三角形の再分割に伴う、文字外形の外周の点列の再構成について説明する。元の文字外形の外周の点列に対して次の操作を行う。
(1){Po[0],Po[1],・・・,Po[n]}に対して、Po[I]Po[I+1]の中点を求め、それらをW[I]とする。但し、I=0,1,・・・,nでPo[n+1]=Po[0]とする。
(2){Po[0],Po[1],・・・,Po[n]}のインデックスの数を2倍して、{Po[0],Po[2],Po[4],Po[6],・・・,Po[2n]}に変更し、W[I]をPo[2I+1]として挿入する。このようにしてできた新たな点列{Po[0],Po[1],Po[2]・・・,Po[2n],Po[2n+1]}が、再分割された3角形により生成される新たな文字の外周の点列である。なお、文字穴の外周の点列場合も、文字外形の外周の点列の場合と同様の処理によって、再分割された3角形により生成される新たな文字穴の外周の点列が求められる。
【0137】
上記の内分割法は、元の三角形を4つに分割するというものなので、三角形の個数は4倍で増えていく。再分割を一度も行っていない最初の状態をレベル0とし、1度の再分割でレベルが1ずつあがるとすると、レベル0に対して、レベルrでは三角形が4r倍に増加する。
【0138】
上記の内分割法の処理では、三角形の再分割のレベルをrにしようとすると、r回の処理が必要になる。そこで、一気に2レベル以上、上げることができる方法について、図20及び図21(b)を参照しながら説明する。
【0139】
図20は、三角形の再分割のレベルをrにしようとする場合の再分割方法における処理の流れを示すフローチャートである。
図21(b)は、三角形の再分割のレベルをレベル0からレベルrに一気に上げた場合の様子を示す図である。
図21(b)において、α[I]はP[a]P[b]の内分点Pab[α[I]]のインデックス(I=0,1,・・・,2**r−2)であり、Pab[α[I]]は、
Pab[α[I]]
={(I+1)P[b]+(2**r−I−1)P[a]}/2**r
から算出できる。同様に、β[I]はP[b]P[c]の内分点Pbc[β[I]]のインデックス(I=0,1,・・・,2r−2)であり、Pbc[β[I]]は、
Pbc[β[I]]
={(I+1)P[c]+(2**r−I−1)P[b]}/2**r
から算出できる。また、γ[I]はP[c]P[a]の内分点Pca[γ[I]]のインデックス(I=0,1,・・・,2r−2)であり、Pca[γ[I]]は、
Pca[γ[I]]
={(I+1)P[a]+(2**r−I−1)P[c]}/2**r
から算出できる。ξ[I][k]はP[α]P[γ]の内分点Pαγ[ξ[I][k]]のインデックス(I=0,1,・・・,2**r−3,0≦k≦I,)であり、Pαγ[ξ[I][k]]は、
Pαγ[ξ[I][k]]
={(I+1−k)P[α[I+1]]
+(k+1)P[γ[2**r−I−3]]}/(I+2)
から算出できる。以上の内分点の発生に基づいて、アルゴリズムを説明する。
【0140】
(1)|a−b|,|b−c|,|c−a|の値を計算する。
(2)|a−b|=1ならば、P[a]P[b]の上記の内分点Pab[α[I]](I=0,1,・・・,2**r−2)を求め、Pab=P[last+1+I]として点列の最後に加えていき、インデックスlast+1+I=α[I]を保持する。
(3)|a−b|≠1かつ(a,b)≠(lastorg,0)&(a,b)≠(0,lastorg)ならば(但し、lastorgは、分割操作前の点列のインデックスの最後の値)、P[a]P[b]の内分点が求められていないかチェックする。チェックの結果、求められていたらそのインデックスをα[I]として保持し、後述のチェックリストからその内分点のデータを除去する。求められていない場合は、P[a]P[b]の上記の内分点Pab[α[I]](I=0,1,・・・,2**r−2)を求め、Pab=P[last+1+I]として点列の最後に加えていき、インデックスlast+1+I=α[I]を保持する。同時に、チェックリストにインデックスの組番号(a,b)とα[I]を保持する。従って、チェックリストは、インデックスの組番号とそれによって生成されたインデックスで構成され、チェックにおいてはインデックスの組番号を順不同で比較する。
【0141】
(4)|b−c|,|c−a|についても,上記(2)、(3)を同様に行い、P[b]P[c]の内分点とP[c]P[a]の内分点を求め、点列座標データに必要な場合は加えていく。また必要に応じて、チェックリストにインデックスの組番号(b,c)とβ[I]、インデックスの組番号(c,a)とγ[I]を保持する。
(5)r>1のときは、上記のP[α]P[γ]の内分点Pαγ[ξ[I][k]]を求めて点列の最後に加えていき、インデックスlast+1+I(I+1)/2+k=ξ[I][k]を保持する。但し、I=0,1,・・・,2**r−3,0≦k≦Iである。
【0142】
(6)r=1のときは、三角形を規定するインデックス列{a,b,c}を除去し、4個の三角形を規定するインデックス列{a,α[0],γ[0]},{b,β[0],α[0]},{c,γ[0],β[0]},{α[0],β[0],γ[0]}を代わりに挿入する。
【0143】
(7)r>1のときは、三角形を規定するインデックス列{a,b,c}を除去し、以下の4r個の三角形を規定するインデックス列を代わりに挿入する。但し、I=0,1,・・・,2**r−1で、Iに応じて処理を行う。
・I=0のときは、{a,α[0],γ[2**r−2]}を代わりに挿入する。
・I=1のときは、{α[0],α[1],ξ[0][0]},{α[0],ξ[0][0],γ[2**r−2]},{γ[2**r−2],ξ[0][0],γ[2**r−3]}。
・I=2のときは、{α[1],α[2],ξ[1][0]},{α[1],ξ[1][0],ξ[0][0]},{ξ[0][0],ξ[1][0],ξ[1][1]},{ξ[0][0],ξ[1][1],γ[2**r−3]},{γ[2**r−3],ξ[1][1],γ[2**r−4]}を代わりに挿入する。
・3≦I≦2r−2のときは、{α[I−1],α[I],ξ[I−1][0]},{α[I−1],ξ[I−1][0],ξ[I−2][0]}の後、{ξ[I−2][k],ξ[I−1][k],ξ[I−1][k+1]}と{ξ[I−2][k],ξ[I−1][k+1],ξ[I−2][k+1]}の組(但し,0≦k≦I−3)の繰り返しの後(つまり、繰り返しはI−2回起こる)、{ξ[I−2][I−2],ξ[I−1][I−2],ξ[I−1][I−1]},{ξ[I−2][I−2],ξ[I−1][I−1],γ[2**r−1−I]},{γ[2**r−1−I],ξ[I−1][I−1],γ[2**r−2−I]}で終わるインデックス列を代わりに挿入する。
【0144】
・I=2**r−1のときは、{α[2**r−2],b,β[0]},{α[2**r−2],β[0],ξ[2**r−3][0]}の後、{ξ[2**r−3][k],β[k],β[k+1]}と{ξ[2**r−3][k],β[k+1],ξ[2**r−3][k+1]}の組(但し、0≦k≦2**r−4)の繰り返しの後(つまり、繰り返しは2**r−3回起こる)、{ξ[2**r−3][2**r−3],β[2**r−3],β[2**r−2]}{ξ[2**r−3][2**r−3],β[2**r−2],γ[0]},{γ[0],ξβ[2**r−2],c}で終わるインデックス列を代わりに挿入する。
【0145】
次に、文字外形の外周の点列の再生成について以下に説明する。
(1){Po[0],Po[1],・・・,Po[n]}に対して、これを2**r分割したときのPo[I]Po[I+1]の内分点を求め、それらをW[I][k]とする。但し、I=0,1,・・・,nで、特に、Po[n+1]=Po[0]とする。また、k=0,1,・・・,2**r−2で、W[I][k]は以下の式によって求める。
Figure 0004028979
【0146】
(2){Po[0],Po[1],・・・,Po[n]}のインデックスを2**r倍して、{Po[0],Po[2**r],Po[2×2**r],Po[3×2**r],・・・,Po[n×2**r]}に変更し、W[I][k]をPo[I×2**r+k+1]として挿入する(但し、I=0,1,・・・,n,k=0,1,・・・,2**r−2)。
【0147】
このようにしてできた新たな点列{Po[0],Po[1],Po[2],Po[3],Po[4]・・・,Po[n×2**r],Po[n×2**r+1],Po[(n+1)×2**r−1]}が、再分割された3角形により生成される新たな文字外形の外周の点列である。文字穴の外周の点列の場合も、同様の処理によって、再構成できる。
【0148】
文字形状上下面凸ポリゴン再分割部22は、元の0レベルのデータを保持しておけば、常に0レベルから再分割を行うことで、一旦分割した三角形を粗い三角形に戻すという可逆的な分割が可能である。例えば、rレベルに上げた時、pレベルに下げたいならば、rレベルのデータを破棄して、新たに0レベルからpレベルのデータを生成すれば、見かけ上はrレベルからpレベルに移行したことになる。
【0149】
文字形状側面生成部23は、前記実施の形態1における文字形状側面生成部6、及び実施の形態2のべベル形状側面生成部11と同様の処理により、文字の各構成要素の上下面と側面のインデックスドサーフェースデータを生成し、このデータをテクスチャ座標生成部24に出力する。
【0150】
テクスチャ座標生成部24は、各構成要素を下面と上面に対し、これを含む最小の正方形を生成する。この正方形の最下点と構成要素の下面の最下点とが原点で重なるように平行移動し、これらの平行移動後の点列の座標を求め、求められた座標値を正方形の辺の長さで除し、その結果をマッピング座標とする。これは、外包正方形を正規化したときの座標に相当する。側面に対しては、外周形状や穴形状を構成する閉曲線に対して周回長(点列における連続する2点間の距離の総和)を求め、開始点から各点までの2点間の距離と周回長の比を、その開始点か各点までの距離を表すパラメータ(0≦s≦1)として割り振る(開始点は0と1が割り振られる)。高さ方向に関しては、下面に対してはt=0で上面にはt=1を割り付ける。
【0151】
なお、各構成要素(または全ての構成要素)を含む円筒を設け、この円筒に円筒座標系を定義し、構成要素の頂点を円筒の中心座標から投影し円筒座標系における座標を用いて、テクスチャ座標を決定できる。但し、円筒座標系は正規化をする必要がある。また、各構成要素(または全ての構成要素)を含む球を設け、この球に極座標系を定義し、構成要素の頂点を球の中心から投影した極座標系における座標値を用いてもテクスチャ座標を決定できる。但し、極座標系は正規化する必要がある。
【0152】
以上のように求めたテクスチャ座標については、インデックスドサーフェースデータの外周の点列座標データの順序と一致するように当該インデックスドサーフェースデータに各々付加し、文字形状データ出力部25へ出力する。文字形状データ出力部25では、テクスチャ座標生成部24から送られてきた、文字の各構成要素の上下面のテクスチャ座標付のインデックスドサーフェースデータと、各構成要素の側面のテクスチャ座標付のインデックスドサーフェースデータを階層的な記述によって一まとめにして、外部へ出力する。なお、データ形式を変換する場合には、当該データ形式へ変換してから出力する。
以上のように、文字外周点列や穴外周点列の点間を適当な点で補間し、これに基づいてポリゴン分割を行うので、より精細な3次元文字を作成することが可能となる
【0153】
(実施の形態4)
上記の実施の形態1では、3次元の文字を生成する実施例について述べたが、実施の形態4では、3次元の文字の下部に円柱状等の台座を設ける場合の実施例について述べる。なお、本実施の形態では、上記実施の形態1と同じ構成部分についての説明は省略する。
【0154】
図22は、実施の形態4における3次元文字データ生成装置401の機能構成を示すブロック図である。3次元文字データ生成装置401は、台座形状生成部35を新たに備え、文字コード入力部1に代えて文字台座コード入力部31を、文字外周データ取得部2に代えて文字外周台座形状取得部32を、文字外周データ記憶部3に代えて文字外周台座形状記憶部33を、文字形状構造解析部4に代えて文字台座形状構造解析部34を、文字形状側面生成部6に代えて文字形状側面生成部36を、文字形状データ出力部7に代えて文字台座形状データ出力部37を備える。以上のように構成される3次元文字データ生成装置401について、以下、詳細に説明を行う。
【0155】
文字台座コード入力部31は、実施の形態1の文字コード入力部1と同様に、いわゆるキーボードやマウスなどの入力装置で、これらの入力信号を変換し、ASCIIコードやJISコードなどの文字コードのほか、台座の形状を指定するための台座コードを生成する。文字台座コード入力部31で生成された文字コードと台座コードは、文字外周台座形状取得部32へ出力される。
【0156】
文字外周台座形状取得部32は、文字台座コード入力部31から受信した文字コードに対応する文字のアウトラインデータと、台座コードに対応する台座の3次元形状データを文字外周台座形状記憶部33から取得する。上記実施の形態1の文字外周データ記憶部3と同様に、文字のアウトラインデータは、予め文字外周台座形状記憶部33に文字コードに対応して記憶されている。また、台座の3次元形状データに関しても、台座コードに対応した台座の3次元形状データが、文字外周台座形状記憶部33に予め記憶されている。文字外周台座形状取得部32で取得された文字のアウトラインデータと台座の3次元形状データは、文字台座形状構造解析部34に出力される。なお、台座の3次元形状データには、どの面が台座の上面(以下、「台座上面」という。)であるが定義されているものとする。
【0157】
文字台座形状構造解析部34では、文字に関しては、上記の実施の形態1の文字形状構造解析部4と同様に、文字の構造解析結果情報を生成する。文字の構造解析結果情報としては、文字穴毎にその穴を包含する唯一の文字部品が特定され、その包含関係を表す情報が、上記実施の形態1と同様の方法によって作成される。
【0158】
文字外周台座形状構造解析部34では、その他に文字全体のバウンダリーボックスとその中心座標(以下「文字中心座標」という。)、及び台座の3次元形状のバウンダリーボックス(直方体形状とする)と台座上面に対応するバウンダリーボックスの中心座標(以下「台座中心座標」という。)を求め、文字のバウンダリーボックスの中心と台座上面に対応するバウンダリーボックスの中心とが一致するように移動する。さらに、予め定めた余白量を文字のバウンダリーボックスに加算した拡大長方形を求め、これが移動された台座上面に対応するバウンダリーボックスの面に含まれるように、最小の台座スケーリング量を算出する。文字の構造解析結果情報は、文字形状上下面凸ポリゴン分割部5に送られ、実施の形態1と同様に処理される。また、文字のバウンダリーボックスの中心座標と台座中心座標、及び台座スケーリング量が、台座形状生成部35に出力される。
【0159】
台座形状生成部35では、文字台座形状構造解析部34から出力される台座スケーリング量で台座の3次元形状データをスケーリング変換し、その変換後に得られる台座中心座標が、文字中心座標と一致するように、台座を平行移動し、移動後の台座の3次元の座標値を修正する。これらの変換後のデータは文字台座形状データ出力部37に出力される。
【0160】
文字形状側面生成部36では、上記実施の形態1の文字形状側面生成部6、及び実施の形態2のべベル形状側面生成部11と同様に、各構成要素に基づいて、上面、下面、側面及びべベル形状側面を生成し、文字台座形状データ出力部37に送られる。
【0161】
文字台座形状データ出力部37では、台座形状生成部35と文字形状側面生成部36から送られてきた、台座の3次元形状データと文字の各構成要素に基づく上面及、下面及び側面のインデックスドサーフェースデータを階層的な記述によって一まとめにして、外部へ出力する。その際、データ形式を変換する必要がある場合であっても、一旦当該データ形式に変換を行い、これを変換する。
【0162】
図23は、本実施の形態4によって生成された台座つきの3次元の漢字「田」の外観を示す。
以上のように、台座の3次元形状データに基づいて3次元文字の下部に円柱状等の台座を設けることを可能にしたので、より多彩な装飾を施した3次元文字を表示することができる。
【0163】
(実施の形態5)
上記実施の形態4では、台座の3次元形状データに基づいて台座付きの3次元文字を生成する場合について示したが、実施の形態5では、台座のアウトラインデータに基づいて台座付きの3次元文字を生成する場合の実施例について述べる。なお、本実施の形態では、上記実施の形態4と重複する構成部分についての説明は省略する。
【0164】
図24は、本実施の形態5における3次元文字データ生成装置501の機能構成を示すブロック図である。3次元文字データ生成装置501は、文字台座コード入力部41、文字台座外周データ取得部42、外周データ記憶部43、文字台座形状構造解析部44、文字台座形状面凸ポリゴン分割部45、文字台座形状側面生成部46、文字台座形状データ出力部47によって構成される。以上のように構成される3次元文字データ生成装置501について、以下、詳細に説明を行う。
【0165】
文字台座コード入力部41は、実施の形態1の文字コード入力部1と同様に、いわゆるキーボードやマウスなどの入力装置で、これらの入力信号を変換し、ASCIIコードやJISコードなどの文字コードのほか、台座のアウトラインデータを指定するための台座コードを生成する。文字台座コード入力部41で生成された文字コードと台座コードは、文字台座外周データ取得部42へ送られる。
【0166】
文字台座外周データ取得部42は、文字台座コード入力部41から受け取った文字コードに対応する文字のアウトラインデータと、台座コードに対応する台座のアウトラインデータを、外周データ記憶部43から取得する。文字のアウトラインデータに関しては、実施の形態1の文字外周データ記憶部3と同様に、予め外周データ記憶部43に文字コードに対応付けられて記憶されている。また、台座のアウトラインデータに関しても、台座コードに対応付けられて外周データ記憶部43に予め記憶されている。文字台座外周データ取得部42で取得された文字のアウトラインデータと台座のアウトラインデータは、文字台座形状構造解析部44に出力される。ここで、台座に穴が形成されている場合は、その穴を表すアウトラインデータが、予め外周データ記憶部43に記憶されている。
【0167】
文字台座形状構造解析部44は、文字のアウトラインデータ、台座のアウトラインデータの各々に関して、実施の形態1の文字形状構造解析部4と同様に、文字と台座の構造解析結果情報を生成する。文字の構造解析結果情報としては、文字穴毎にその穴を包含する唯一の文字部品が特定され、また、台座に穴が形成されている場合は、台座の構造解析結果情報として、台座の穴を包含する台座が特定され、これらの包含関係を表す情報が、上記実施の形態1と同様の方法によって作成される。文字台座形状構造解析部44は、その他に、上記実施の形態4と同様に、文字中心座標、及び台座全体のバウンダリーボックスと台座中心座標を求め、文字の中心と台座の中心とが一致するように移動する。さらに、予め定めた余白量を文字のバウンダリーボックスに加算した拡大長方形を求め、これが台座上面に対応するバウンダリーボックスの面に含まれるように、最小の台座スケーリング量を算出する。文字と台座の構造解析結果情報、文字中心座標と台座中心座標、及び台座スケーリング量が、文字台座形状面凸ポリゴン分割部45に出力される。
【0168】
文字台座形状面凸ポリゴン分割部45は、文字の構成要素に対して、上記実施の形態1と同様に処理を行い、台座の構成要素に対しては、台座スケーリング量でスケーリング変換し、文字のバウンダリーボックスの中心座標と台座のバウンダリーボックスの中心座標が一致するように平行移動したデータに対して、文字と同様に処理を行う。処理結果である文字と台座の各構成要素のインデックスドサーフェースデータは、文字台座形状側面生成部46に出力される。
【0169】
文字台座形状側面生成部46では、上記実施の形態1の文字形状側面生成部6、及び実施の形態2のべベル形状側面生成部11と同様に、文字と台座の各構成要素の上下面、側面またはべベル形状の側面を生成する。生成された台座の構成要素に関しては、生成後更に、立ち上げ量に相当する量だけ、z軸の下方向へ平行移動する。但し、台座の側面が回転変換で生成された場合は、その際の回転量の分だけ逆回転変換を行う。以上の処理で生成された文字と台座の各構成要素の上下面、側面のインデックスドサーフェースデータの文字台座形状データ出力部47に出力される。
【0170】
文字台座形状データ出力部47では、文字台座形状側面生成部46から送られた文字と台座の各構成要素の上下面、側面のインデックスドサーフェースデータを階層的な記述によって一まとめにして、外部へ出力する。データ形式を円筒座標または極座標等に変換する必要がある場合は、当該データ形式へ変換してから出力する。
なお、実施の形態4、実施の形態5において、文字の3次元形状の下面については、台座に接続されるので不可視なため省略が可能で、この省略によりデータ量の削減が行える。
【0171】
以上のように、台座のアウトラインデータに基づいて3次元文字の下部に円柱状等の台座を設けることを可能にしたので、より多様に装飾を施した3次元文字を表示することができる。
【0172】
(実施の形態6)
実施の形態6では、3次元の刻印板を生成する場合の実施例について述べる。なお、本実施の形態では、上記の実施の形態と同じ構成部分についての説明は省略する。
【0173】
図25は、本実施の形態6における3次元文字データ生成装置601の機能構成を示すブロック図である。3次元文字データ生成装置601は、文字刻印板コード入力部51、文字刻印板外周データ取得部52、外周データ記憶部53、文字刻印板形状構造解析部54、文字刻印板形状面凸ポリゴン分割部55、文字刻印板形状側面生成部56、文字刻印板形状データ出力部57によって構成される。以上のように構成される3次元文字データ生成装置601について、以下、詳細に説明を行う。
【0174】
文字刻印板コード入力部51は、実施の形態1の文字コード入力部1と同様に、いわゆるキーボードやマウスなどの入力装置で、これらの入力信号を変換し、ASCIIコードやJISコードなどの文字コードのほか、刻印板のアウトラインデータを指定するための刻印板コードを生成する。文字刻印板コード入力部51で生成された文字コードと刻印板コードは、文字刻印板外周データ取得部52へ出力される。
【0175】
文字刻印板外周データ取得部52は、文字刻印板コード入力部51から受信した文字コードに対応する文字のアウトラインデータと、刻印板コードに対応する刻印板のアウトラインデータを、外周データ記憶部43から取得する。文字のアウトラインデータに関しては、上記実施の形態1の文字外周データ記憶部3と同様に、文字のアウトラインデータは、予め外周データ記憶部53に文字コードに対応して記憶されている。また、刻印板のアウトラインデータに関しても、刻印板コードに対応した刻印板のアウトラインデータが、外周データ記憶部53に予め記憶されている。文字刻印板外周データ取得部52で取得された文字のアウトラインデータと刻印板のアウトラインデータは、文字刻印板形状構造解析部54に出力される。ここで、刻印板に穴が形成されている場合は、その穴に対応するアウトラインデータが、予め外周データ記憶部53に記憶されている。
【0176】
文字刻印板形状構造解析部54では、まず、文字全体の長方形バウンダリーボックスとその長方形中心座標、及び刻印板全体の長方形バウンダリーボックスとその長方形中心座標を求め、文字のバウンダリーボックスの中心と刻印板のバウンダリーボックスの中心とが一致するように移動する。さらに、予め定めた余白量を文字のバウンダリーボックスに加算した拡大長方形を求め、これが刻印板の上面に対応するバウンダリーボックスの面に含まれるように、最小の刻印板スケーリング量を算出する。次に、刻印板の外周の点列を刻印板スケーリング量でスケーリング変換し、文字の長方形中心座標とスケーリング変換後の刻印板長方形中心座標が一致するように平行移動したものを、刻印板の新たなアウトラインデータとする。
【0177】
文字のアウトラインデータ、新たな刻印板のアウトラインデータ、各々に関して、実施の形態1の文字形状構造解析部4と同様に、文字と刻印板の構造解析結果情報を生成する。文字の構造解析結果情報としては、文字穴毎にその穴を包含する唯一の文字部品が特定される。また、刻印板の構造解析結果情報としては、刻印板に穴がある場合は、その穴を包含する刻印板が特定され、これらの包含関係を表す情報が、上記実施の形態1と同様の方法によって作成される。但し、ここで生成される刻印板の構造解析結果情報は、刻印板形状の下面(これを「刻印板下面」という。)に適用される情報である。更に、刻印板の新たなアウトラインデータと、文字のアウトラインデータのうち、文字外形外周の点列と文字穴の外周の点列の順序を逆転したもの(文字外形を文字穴に、文字穴を文字外形に相当するような並びに変更することに相当する)とを合併したデータについても、実施の形態1の文字形状構造解析部4と同様に、構造解析結果情報を生成する。但し、ここで生成される刻印板の構造解析結果情報は、刻印板形状の上面に適用される情報である。
【0178】
文字刻印板形状面凸ポリゴン分割部55では、文字、刻印板上下面の各構成要素に対して実施の形態1の文字形状上下面凸ポリゴン分割部5と同様に処理を行う。図26(a)〜(c)は、この分割を行った後の状態を示した例である(この例では、文字、刻印板上下面の構成要素が、各々1つ存在している)。処理結果の文字と刻印板上下面の各構成要素のインデックスドサーフェースデータは、文字刻印板形状側面生成部56に送られる。
【0179】
文字刻印板形状側面生成部56では、上記実施の形態1の文字形状側面生成部6、及び実施の形態2のべベル形状側面生成部11と同様に、刻印板の各構成要素の上下面、側面またはべベル形状側面を生成する。次に、刻印板上面のz軸の位置に対して、文字上面の各部分構造をz軸の下方向(堀込みの深さに相当し、立ち上げの高さより小さいことが必要)へ移動し、刻印板上面の堀込み部の下面を生成する。最後に、堀込み部下面と刻印板上面の対応点を、上記実施の形態1の文字形状側面生成部6と同様の処理によって堀込み部の側面を生成するが、その際、インデックスの並びは、上記実施の形態1とは逆にする。
以上の処理で生成された文字と刻印板の各構成要素の上下面、側面のインデックスドサーフェースデータの文字刻印板形状データ出力部57に出力される。
【0180】
文字刻印板形状データ出力部57では、文字刻印板形状側面生成部56から出力された文字と刻印板の各構成要素の上下面、側面のインデックスドサーフェースデータを階層的な記述によって一まとめにして、外部へ出力する。データ形式を円筒座標または極座標等に変換する必要がある場合は、当該データ形式へ変換してから出力する。
【0181】
以上のように、刻印板のアウトラインデータに基づいて3次元文字を含む刻印板の生成を可能にしたので、凹状のより複雑な3次元文字についても表示することができる。
なお、上記の実施の形態1から実施の形態6において、順次1文字ずつ処理を繰り返すことにより、連続した文字列に対する処理も可能である。また、文字列に対して1つの台座もしくは1つの刻印板で対応するためには、文字のバウンダリーボックスを文字列全体のバウンダリーボックスに拡大して処理を行えば良い。
【0182】
さらに、上記の実施の形態では、主に穴を含む文字を対象として説明したが、穴を有する一般の図形(図形を構成する図形部品を含む。)に対しても、上記と同様の構成により、自動的に高品位の3次元図形を表示し得る3次元データを生成することができる。
【0183】
【発明の効果】
以上のように、本発明に係る3次元文字データ生成装置は、2次元文字データから3次元文字データを生成する装置であって、2次元文字データを用いて、文字を構成する文字部品の外周及び当該文字に形成されている穴の外周を決定する外周決定手段と、前記外周決定手段により決定された穴の外周と包含関係を有し、且つ、当該穴の外周から直近の位置にある文字部品の外周を特定する包含関係特定手段と、前記包含関係特定手段により特定された文字部品の外周の内部領域から、その文字部品と包含関係にある穴の外周の内部領域を除いた領域をポリゴン分割し、特定されない文字部品の外周については、その内部領域をポリゴン分割する分割手段と、前記分割手段によりポリゴン分割された領域に係る文字部品の複製を移動し、前記文字部品と前記複製された文字部品との頂点から側面を生成する側面生成手段とを備えることを特徴とする。
【0184】
これにより、操作者の手を煩わせることなく、与えられた2次元の文字の輪郭線データから、3次元文字データを自動かつ実時間で生成し、ビットマップフォントをベースに生成した3次元文字に比べて、はるかに高品位な3次元文字の生成が可能となる。
【0185】
また、本発明に係る3次元文字データ生成装置における前記2次元文字データは、前記文字の輪郭や穴の輪郭を表す2次元平面で定義されたアウトラインデータであり、前記外周決定手段は、前記アウトラインデータを取得し、当該アウトラインデータを前記文字の輪郭を表す第1アウトラインデータと前記穴の輪郭を表す第2アウトラインデータとに分類し、分類された第1アウトラインデータに基づいて前記文字部品の外周を決定し、分類された第2アウトラインデータに基づいて前記穴の外周を決定することを特徴とする。
【0186】
また、前記包含関係特定手段は、前記文字部品の外周を囲う矩形を決定する第1決定部と、前記穴の外周を囲う矩形を決定する第2決定部と、前記第1決定部によって決定された矩形と前記第2決定部によって決定された矩形とを比較することにより、当該穴の外周を囲う矩形を包含する1又は複数の文字部品の外周を囲う矩形を特定する第1特定部と、前記第1特定部により特定された矩形のうち、最も内側の矩形に係る文字部品の外周を特定する第2特定部と、前記第2特定部により特定された文字部品の外周を、前記穴の外周を包含する唯一の文字部品の外周であると特定し、当該包含関係を表す情報を作成する包含情報作成部とを備えることを特徴とする。
【0187】
なお、前記包含関係特定手段は、前記文字部品の外周を囲う矩形を決定する第1決定部と、前記穴の外周を囲う矩形を決定する第2決定部と、前記第2決定部によって決定された穴の外周に係る矩形の重心と前記第1決定部によって決定された文字部品の外周に係る矩形の各辺との距離、又は前記重心と当該文字部品に係る前記点列のうちの一の点との距離のうち、短い方を当該文字部品についての最短距離と決定する最短距離決定部と、前記最短距離決定部により決定された最短距離を、全ての文字部品について比較し、最も短い最短距離に係る文字部品を前記穴の外周を包含する唯一の文字部品の外周であると判定し、当該包含関係を表す情報を作成する包含情報作成部とを備えるように構成することもできる。
【0188】
これにより、アウトラインデータによって表される文字に対して幾何学的な構造解析を行うので、文字に文字穴が形成されているか否かなどの文字の構造が明確となり、文字を構成する各文字部品に対しても3次元表示が可能となる。つまり、生成される3次元文字については、階層構造を有しているか否かが明確となるので、文字形状の編集などをする場合やアニメーションを行う場合に、文字部品の単位まで分割した、きめ細かな3次元表示が可能となる。
【0189】
また、前記3次元文字データ生成装置は、さらに、前記文字部品の構成要素の下面と上面に対し、これを含む最小の正方形を生成し、前記構成要素の上面及び下面を規定する点列が前記正方形に含まれるように当該正方形を平行移動して前記構成要素における個々の座標値を特定し、これらの座標値を前記正方形の辺の長さをで除した座標値をマッピング座標とし、前記生成された側面を規定する外周の点列の2点間の距離の総和と開始点から各点までの距離との比と、下面から上面までの高さと前記外周の点列における各点の高さとの比に基づいて、テクスチャ座標を生成するテクスチャ座標生成手段を備えるように構成することもできる。
【0190】
これにより、テクスチャ座標を生成するので、3次元化した文字表面に様々なテクスチャ模様を施すことが可能となる。
【0191】
また、前記3次元文字データ生成装置は、さらに、前記第1アウトラインデータ又は第2アウトラインデータに含まれる点列に対して、連続する2点間の平均距離を所定の値で除することによって基準距離を算出し、連続する2点間の距離が基準距離以上の場合に基準距離以下となるように、前記2点の間に新たに1又は複数の点を補間するデータ補間手段を備えるように構成しても良い。
【0192】
さらに、3次元文字データ生成装置は、前記分割手段により分割された凸ポリゴンを再分割する再分割手段を備えることとしても良い。
【0193】
これにより、文字外周点列や穴外周点列に対して点を補間し、また、分割されたポリゴンを再分割して、より精細なにポリゴン分割を行うので、3次元形状のさらなる高品位化を図ることが可能となる。
【0194】
また、本発明に係る3次元文字データ生成装置は、文字コードに対応する文字のアウトラインデータと台座コードに対応する台座の3次元形状データや台座コードに対応する台座のアウトラインデータとに基づいて、台座の上に3次元文字を据え付けたり、文字コードに対応する文字のアウトラインデータと刻印板コードに対応する刻印板のアウトラインデータとに基づいて、逆に3次元に凹状に掘り込ませた文字を表示するように構成することもできる。さらに、これらの3次元文字の側面の形状としてべベル形状を生成するように構成することもできる。
【0195】
これにより、台座に文字を据え付けたり文字の刻印板化を可能とし、側面形状についても種々のべベル形状を生成し得るので、文字の3次元表示に対する様々な要求に柔軟に対応することが可能となる。
【0196】
また、本発明に係る3次元図形データ生成装置は、2次元図形データから3次元図形データを生成する装置であって、2次元図形データを用いて、図形を構成する図形部品の外周及び当該図形に形成されている穴の外周を決定する外周決定手段と、前記外周決定手段により決定された穴の外周と包含関係を有し、且つ、当該穴の外周から直近の位置にある図形部品の外周を特定する包含関係特定手段と、前記包含関係特定手段により特定された図形部品の外周の内部領域から、その図形部品と包含関係にある穴の外周の内部領域を除いた領域をポリゴン分割し、特定されない図形部品の外周については、その内部領域をポリゴン分割する分割手段と、前記分割手段によりポリゴン分割された領域に係る図形部品の複製を移動し、前記図形部品と前記複製された図形部品との頂点から側面を生成する側面生成手段とを備えることを特徴とする。
【0197】
これにより、穴が形成された図形に対しても、操作者の手を煩わせることなく、与えられた2次元の図形の輪郭線データから、3次元データを自動かつ実時間で生成し、ビットマップフォントをベースに生成した3次元図形に比べて、はるかに高品位な3次元図形の生成が可能となる。
以上のことより、本発明による効果は絶大で、新たな恩恵をもたらすものと考える。
【図面の簡単な説明】
【図1】実施の形態1における3次元文字データ生成装置の機能構成を示すブロック図である。
【図2】文字外周点列及び穴外周点列をたどるときの回り方を示す図である。
【図3】漢字の「回」について文字形状構造解析を実施した場合の模式図である。
【図4】図3における包含関係解析処理における詳細な処理の流れを示すフローチャートである。
【図5】第1の接続化の方法を漢字の「田」に適用し、さらに点列番号の付け替えを実施した様子を示す図である。
【図6】(a)は、第1の三角形分割方法を「田」に適用した場合の処理結果の例を示す図である。
(b)は、第2の三角形分割方法を「田」に適用した場合の処理結果の例を示す図である。
【図7】第2の三角形分割方法をロシア語の「ё」に適用した場合の処理結果の例を示す図である。
【図8】文字形状側面生成部における文字形状側面生成処理の流れを示すフローチャートである。
【図9】(a)は、文字の上面を高さ方向に移動する第1の方法の概要を示す図である。
(b)は、文字の上面を高さ方向に移動する第2の方法の概要を示す図である。
(c)は、文字の上面を高さ方向に移動する第3の方法の概要を示す図である。
(d)は、文字の上面を高さ方向に移動する第4の方法の概要を示す図である。
【図10】実施の形態2における3次元文字データ生成装置の機能構成を示すブロック図である。
【図11】(a)は、最も単純なベベル形状の外形を示した図である。
(b)は、べベル形状の中間外周の生成方法を説明するための図である。
【図12】中間外周生成処理における処理の流れを示すフローチャートである。
【図13】(a)は、凸状の側面を形成するために、2つの中間外周を生成する場合の概要を示す図である。
(b)は、凹状の側面を形成するために、2つの中間外周を生成する場合の概要を示す図である。
【図14】(a)は、半円状に凸となっている側面の形状を示す図である。
(b)は、半円状に凹となっている側面の形状を示す図である。
(c)は、半円状に凸となっている側面の中間外周における各値の算出方法を説明するための図である。
【図15】、鋳型タイプのベベル形状の側面を生成させる場合について説明するための図である。
【図16】(a)は、上記実施の形態1における文字の上面を高さ方向に垂直に持ち上げた場合の側面の形状を示す図である。
(b)は、その断面が凸六角形状に突き出たべベル形状の側面を生成した例である。
(c)は、中間外周を2つ生成し、文字の上面及び下面の外周に対する削ぎ落とし角度が等しい場合の側面の断面を凸台形状のべベル形状とした例である。
(d)は、側面の形状を鋳型タイプのべベル形状とした例である。
【図17】実施の形態3における3次元文字データ生成装置の機能構成を示すブロック図である。
【図18】漢字の「回」に対して、2つの点の間に新たに点を補間した場合の一例を示す図である。
【図19】元の三角形を4つに再分割する方法における処理の流れを示すフローチャートである。
【図20】三角形の再分割のレベルをrにしようとする場合の再分割方法における処理の流れを示すフローチャートである。
【図21】(a)は、三角形の辺の中点を用いて内分割を行う方法を説明するための図である。
(b)は、三角形の再分割のレベルをレベル0からレベルrに一気に上げる場合の様子を示す図である。
【図22】実施の形態4における3次元文字データ生成装置の機能構成を示すブロック図である。
【図23】台座付き文字形状を説明するための図である。
【図24】実施の形態5における3次元文字データ生成装置の機能構成を示すブロック図である。
【図25】実施の形態6における3次元文字データ生成装置の機能構成を示すブロック図である。
【図26】(a)刻印板上面を説明するための図である。
(b)刻印板の文字彫り込み部下面を説明するための図である。
(c)刻印板下面を説明するための図である。
【図27】従来例における3次元文字の作成装置の機能ブロック図である。
【符号の説明】
101、102、 3次元文字データ生成装置
103、104、
105、106
1 文字コード入力部
2 文字外周データ取得部
3 文字外周データ記憶部
4 文字形状構造解析部
5 文字形状上下面凸ポリゴン分割部
6、36 文字形状側面生成部
7、12、25 文字形状データ出力部
11 べベル形状側面生成部
21 文字外周データ補間部
22 文字形状上下面凸ポリゴン再分割部
23 文字形状側面生成部
24 テクスチャ座標生成部
31、41 文字台座コード入力部
32 文字外周台座形状取得部
33 文字外周台座形状記憶部
34、44 文字台座形状構造解析部
35 台座形状生成部
37、47 文字台座形状データ出力部
42 文字台座外周データ取得部
43、53 外周データ記憶部
45 文字台座形状面凸ポリゴン分割部
46 文字台座形状側面生成部
51 文字刻印板コード入力部
52 文字刻印板外周データ取得部
54 文字刻印板形状構造解析部
55 文字刻印板形状面凸ポリゴン分割部
56 文字刻印板形状側面生成部
57 文字刻印板形状データ出力部[0001]
BACKGROUND OF THE INVENTION
The present invention relates to a three-dimensional shape data generation apparatus for generating data representing a three-dimensional shape from data representing an arbitrary two-dimensional shape such as a character composed of a contour line on a two-dimensional plane. The present invention relates to a three-dimensional character data generation apparatus and a three-dimensional graphic data generation apparatus for a graphic.
[0002]
[Prior art]
As a conventional three-dimensional character data generation device, for example, as a first conventional example, there is a “three-dimensional character creation device” disclosed in JP-A-63-103380. This conventional example will be described with reference to FIG. The two-dimensional character is input by the two-dimensional character input device 140, and the two-dimensional character on the xy plane is defined in the storage device 120. Next, the shape design of the three-dimensional character is advanced by the operation of the operator's z-direction correcting device 130 performed while viewing the display on the display device 110. At this time, the z coordinate value of each point is changed on the xz projection plane 112 or the yz projection plane 113, and the input two-dimensional character is modified to a three-dimensional character. A stereoscopic image of the three-dimensional character being corrected can be confirmed on the stereoscopic image projection plane 114. Next, based on the image data of the pattern input from the area background input device 150, image data in a state where a pattern is attached to the surface of the three-dimensional character in the storage device 120 is generated, and this is generated on the stereoscopic image projection plane 114. Is displayed. However, the generation of the three-dimensional character shape in the present invention is performed by the operator using the xz projection plane 112 or the yz projection plane 113, and is not automatic generation.
[0003]
Further, as an object for automatic generation of a three-dimensional character shape, for example, as a second conventional example, “a shape conversion method and a recording medium on which a processing procedure of the method is recorded” disclosed in JP-A-11-53578 And a shape conversion device ”. In this method, only the side shape of a character is generated from outline data representing the character shape on a two-dimensional plane. Therefore, this conventional example only generates a part of a three-dimensional shape and does not provide a complete three-dimensional shape of characters.
[0004]
Further, as a third conventional example, there is “a shape conversion method, a recording medium recording the conversion procedure, and a shape conversion device” disclosed in Japanese Patent Laid-Open No. 11-53579. This is done by inputting a given two-dimensional bitmap font character, making each bit data constituting this bitmap font character correspond to a three-dimensional shape, and synthesizing them to obtain a three-dimensional shape as a whole character. Is to be generated. However, the bitmap font is susceptible to jaggies in the outline, and in order to make the jaggy inconspicuous, it is necessary to use a precise bitmap font having a large number of bits constituting the character.
[0005]
[Problems to be solved by the invention]
However, in the first conventional example described above, since the operator manually generates the three-dimensional character shape, the processing burden on the operator is heavy, and the processing time is enormous and cannot be generated in real time. is there. The second conventional example described above is intended to automatically generate a three-dimensional character shape, but the generated data is only side data, and the front and back surfaces represent the shape of the particularly important character itself. I have to say that the data is incomplete and has no practical use. In the above third conventional example, although a three-dimensional character shape can be generated for the time being, since it is generated from bitmap data, jaggy occurs in the contour portion of the character shape. Therefore, when drawing with CG or the like using this, jaggy at the time of drawing is further added, and the quality of characters becomes very low. Further, in order to make all the bitmap characters correspond to a three-dimensional shape, a very large amount of data is required to achieve a three-dimensional shape with a certain quality.
[0006]
The present invention has been made in view of the above problems, and an object thereof is to provide an apparatus capable of easily generating high-quality three-dimensional shape data. In other words, data representing a three-dimensional shape is automatically and generated in real time from the outline data of a given two-dimensional character or figure without bothering the operator, and the quality of the character or figure is also bitmap font. A device capable of generating data of a three-dimensional shape with a much higher quality than those generated based on the above is provided. In addition, by applying various texture patterns to the surface of three-dimensional characters and figures, and by making it possible to install character-shaped pedestals and make stamped plates, it is possible to support various three-dimensional character expressions. A three-dimensional shape data device is provided.
[0007]
[Means for Solving the Problems]
In order to solve the above-described problems, a three-dimensional graphic data generation apparatus according to the present invention includes: Character stamp plate code input means for inputting a character code and a stamp plate code, outer data storage means for storing outline data of a character corresponding to the character code, and outline data of a stamp plate corresponding to the stamp plate code A character outer periphery stamping plate shape acquisition means for acquiring outline data of the characters and the stamping plate from the outer periphery data storage means based on the character code and the stamping plate code input by the character stamping plate code input means, and the character outer periphery Based on the outline data of the character acquired in the stamping plate shape acquisition means, identify the component constituting the character by analyzing the inclusion relationship between the outer periphery of the character and the outer periphery of the hole formed in the character, Calculate the conditions under which the characters can be placed on the stamp plate, and change the outline data of the stamp plate based on the conditions. Then, based on the outline data of the stamped plate after the conversion, the inclusion relationship between the outer periphery of the stamped plate and the outer periphery of the hole formed in the stamped plate is analyzed to identify the constituent elements constituting the lower surface of the stamped plate, Based on the converted point sequence, the outer point sequence representing the outer shape of the character is converted into a point sequence representing the hole in the character, the outer point sequence representing the hole in the character is converted to the point sequence representing the outer shape of the character. Generating outline data by merging the outline data of the new character and the outline data of the stamped board after the conversion, and based on the merged outline data, the outer circumference of the stamp board according to the converted outline data and the Character engraving plate shape structure analyzing means for analyzing components included in the upper surface of the engraving plate by analyzing the inclusion relation of the outer periphery of the character related to the new outline data, and the character engraving plate shape structure analyzing means A character marking plate-shaped surface convex polygon dividing means for dividing into a convex polygon for each of the character specified in step 1 and the constituent elements of the upper and lower surfaces of the marking plate, and the marking plate divided into polygons in the character marking plate-shaped surface convex polygon dividing means The top surface, the bottom surface, and the side surface of the engraving plate are generated by spatially moving each of the components, and the bottom surface of the engraving portion of the marking plate by spatially moving the top surface components of the character by a predetermined depth And a character engraving plate shape side surface generating means for generating a side surface; Is provided.
[0010]
In order to achieve the above object, the present invention provides 3D graphic data generator The characteristic configuration means of 3D graphic data generation method Or can be realized as a program including those steps. And the program is 3D graphic data generator In addition to being stored in a ROM or the like included in the storage medium, it can be distributed via a recording medium such as a CD-ROM or a transmission medium such as a communication network.
[0011]
DETAILED DESCRIPTION OF THE INVENTION
Hereinafter, Embodiments 1 to 6 according to the present invention will be described in detail with reference to the drawings.
(Embodiment 1)
FIG. 1 is a block diagram illustrating a functional configuration of the three-dimensional character data generation apparatus 101 according to the first embodiment. The three-dimensional character data generation apparatus 101 includes a character code input unit 1, a character outer periphery data acquisition unit 2, a character outer periphery data storage unit 3, a character shape structure analysis unit 4, a character shape upper / lower convex polygon dividing unit 5, and a character shape side surface generation. And a character shape data output unit 7.
[0012]
The character code input unit 1 is an input device such as a so-called keyboard or mouse and converts these input signals to generate character codes such as ASCII codes and JIS codes and graphic codes. The character code generated by the character code input unit 1 is output to the character outer periphery data acquisition unit 2.
[0013]
The character outer periphery data acquisition unit 2 acquires so-called outline data (hereinafter also referred to as “outline data”) of the character corresponding to the character code input from the character code input unit 1 from the character outer periphery data storage unit 3. .
[0014]
In the character outer periphery data storage unit 3, character outline data is stored in advance corresponding to the character code. In this case, even if the characters are the same, if the font type is different, the outline data will also be different. Accordingly, the outline data is stored in the character outer periphery data storage unit 3 in association with the character code and the font type. The outline data acquired by the character outer periphery data acquisition unit 2 is output to the character shape structure analysis unit 4.
[0015]
In general, outline data includes the total number of points, a curve type identifier, start point coordinate data (coordinates in outline data are two-dimensional xy coordinates, and the same applies hereinafter), a method for connecting points (for example, A set of identifiers representing a connection method using a straight line or a connection method using a curve, and coordinate data (hereinafter referred to as “point sequence coordinate data”) of a point sequence (or control point sequence) constituting the outer periphery of a character. This data is collected by the number of character parts to be described later constituting one character.
[0016]
Usually, the connection between points is made by using a straight line or a two-dimensional B-Spline curve, and a continuous curve is generated by further connecting the connections between the points. Therefore, in the connection method using a straight line, the position data of the point sequence represents an end point, and in the connection method using a curve, the position data of the point sequence represents a control point when generating the curve. Further, a closed curve can be formed by connecting the start point and the end point of the point sequence, and this closed curve becomes a curve representing the outer periphery of the character. In the present embodiment, the point sequence coordinate data in the outline data of the character indicates the value of the xy coordinate, and the coordinate axis in the height direction when the character is represented in three dimensions is the z axis.
[0017]
Furthermore, since a character may have a torus structure with a hole, the dot sequence of outline data includes a point sequence (hereinafter referred to as a “character outer peripheral point sequence”) that forms the outer periphery of the outer shape of the character, and a character. There are two types of point sequences (hereinafter referred to as “hole outer peripheral point sequences”) that constitute the outer periphery of each hole.
[0018]
There are cases in which a single character is composed of a plurality of character parts, such as “twice” of the Chinese character. Here, the “character part” refers to elements that are not connected to each other and that constitute a character. In the case of the above “time”, it is composed of an outer “mouth” character part and an inner “b” character part. In addition, the Russian word “ё” is composed of three character parts “•”, “•” and “e”. Therefore, each character part has one character outer peripheral point sequence. Some character parts have one or a plurality of hole peripheral point sequences.
[0019]
In order to distinguish between the character outer peripheral point sequence and the hole outer peripheral point sequence, usually, the direction in which each point is arranged when defining the individual points of the character outer peripheral point sequence (that is, when tracing each point in order) And the direction in which the points in the hole outer peripheral point sequence are arranged are opposite to each other. Here, the point sequence coordinate data is the character outer periphery data so that the direction when tracing the character outer periphery point sequence is “clockwise” and the direction when following the hole outer periphery point sequence is “counterclockwise”. It is assumed that it is stored in the storage unit 3. However, there is no special reason for how to decide how to go around. Although an identifier for explicitly distinguishing between the character outer periphery and the hole outer periphery may be provided, in this case, the amount of data to be stored in the character outer periphery data storage unit 3 increases.
[0020]
FIG. 2 shows how to follow the character outer peripheral point sequence and the hole outer peripheral point sequence as described above. In FIG. 2, the character outer peripheral point sequence is represented by clockwise black points P0 to P9, and the hole outer peripheral point sequence is represented by counterclockwise white points P10 to P15.
[0021]
The character shape structure analysis unit 4 first determines whether the received character outline data is a character outer peripheral point sequence or a hole outer peripheral point sequence with respect to the point sequence coordinate data of the outline data of the received character. The determination procedure will be described with reference to FIG.
[0022]
(1) When the point sequence obtained from the outline data is P0, P1,..., Pn, for two adjacent vectors PiPi + 1 and Pi + 1Pi + 2 generated from these point sequences. The angle θi + 1 forming the inner product is obtained (where i = 0, 1,..., N, Pn + 1 = P0, the same applies hereinafter). For example, the angle forming the inner product in the case of the vector P0P1 and the vector P1P2 is θ1.
[0023]
(2) The outer product of two vectors related to the angle θi + 1 forming the inner product is obtained, and if the value is positive, a positive sign is added, and if it is negative, a negative sign is added. The angle θi + 1 forming the inner product is calculated sequentially, and the sum of these is ± 2π.
[0024]
(3) The sum of the angles θi + 1 forming the signed inner product obtained in (1) and (2) above is obtained, and if the sum is −2π, it is determined that the character outer peripheral point sequence is traced clockwise. If so, it is determined that the hole peripheral point sequence is traced counterclockwise.
[0025]
Next, as a result of the determination in (3) above, in the case of a character composed only of a character outer peripheral point sequence, the following boundary box is processed, and then structural analysis result information and outline data described later are obtained. The character shape is output to the upper and lower convex polygon dividing unit 5. When the character outer periphery point sequence and the hole outer periphery point sequence coexist (that is, when the hole outer periphery point sequence exists), the structure analysis (inclusion relationship analysis) process described below is performed.
[0026]
In the following, as shown in FIG. 2, a method of obtaining a boundary box for a character outer peripheral point sequence while using the numeral “0” will be described.
(1) The minimum value (xo-min) and maximum value (xo-max) of the x coordinate, and the minimum value (yo-min) and maximum value (yo-max) of the y coordinate are obtained from the character outer peripheral point sequence.
(2) Four points A (xo-min, yo-max), point B (xo-max, yo-max), and point C (xo) created based on the minimum and maximum values obtained in (1) A quadrangle ABCD with -max, yo-min) and a point D (xo-min, yo-min) is defined as a boundary box. However, in the case of normal mathematical notation, vertices are designated counterclockwise, but in this embodiment, vertices are designated clockwise in accordance with the order notation of the character outer peripheral point sequence.
[0027]
(3) Half the sum of the lengths of the sides of the boundary box ABCD (hereinafter referred to as “length L”) is calculated from the length L = (side AB) + (side BC).
After this process, the point coordinate data, the number of boundary boxes, the coordinates of the four vertices of the boundary box (or xo-min, xo-max, yo-min, yo-max), the length of each side The sum is stored in the character outer periphery data storage unit 3. Also for the hole perimeter point sequence, xh-min, xh-max, yh-min, yh-max of four coordinate values (hereinafter referred to as “four coordinate values”) constituting the same boundary box abcd as described above. Is similarly stored in the character outer periphery data storage unit 3.
[0028]
From the above, for example, in the case of the character “times”, the group of character outer peripheral points is defined by the character outer peripheral point sequence of the outer “mouth” character part and the character outer peripheral point sequence of the inner “b” character part. A group of hole outer peripheral point sequences is formed by a hole outer peripheral point sequence of two character holes of the outer “mouth” character part and the inner “B” character part. Therefore, two boundary boxes ABCD are created based on the two character outer peripheral point sequences, and two boundary boxes abcd are created based on the two hole outer peripheral point sequences.
[0029]
Next, in order to clarify the inclusion relationship between the group of character outer peripheral point sequences and the group of hole outer peripheral point sequences, the boundary boxes of all the outer peripheral point sequences are separated for each boundary box of the character outer peripheral point sequence. The following inclusion relationship is determined for the four coordinate values constituting
[0030]
(Judgment of inclusion relationship)
If "" xo-min <xh-min <xh-max <xo-max "" and "yo-min <yh-min <yh-max <yo-max", the hole periphery is included in the character periphery. Otherwise it is not included. "
[0031]
In the determination of the inclusion relationship, the hole outer peripheral point sequence of one character hole is included in the character outer peripheral point sequence of a plurality of character parts, or is not included in the actual appearance, but is included in appearance. This can happen. For example, the case of “hard” or “store” corresponds to such a case. Therefore, in such a case, it is necessary to correct the inclusion relationship, but this can be executed by the following correction rule.
[0032]
(Correction rule)
“When the outer periphery of one character hole is included in the outer periphery of a plurality of character parts, the hole is included in the outer periphery of the innermost character part.”
In the following, two methods for concretely implementing this correction rule will be described. First, the first method is as follows.
(First method)
The inside / outside determination between the outer peripheries of two characters is replaced by comparing the length L of the boundary box of the character outer perimeter dot sequence obtained earlier, and the smaller L value is the inner character. It is determined that This first method has a short calculation time and can determine the inclusion relation at high speed. However, in the case of exceptional fonts, the determination of the inclusion relationship may not be successful. Therefore, a second method capable of stably determining the inclusion relation will be described below although it takes a long calculation time.
[0033]
(Second method)
(1) The inclusion relation is determined for the boundary box of the character outer peripheral point sequence. That is, “If the coordinates of the boundary box of the character outer peripheral point sequence of one character among a plurality of characters determined to include a certain hole are xoj-min, xoj-max, yoj-min, yoj-max ( However, j is a subscript of a character outline including a character hole, j = 1 to n), and if the following condition is satisfied for a certain k, it is determined that the character hole is a character hole of the subscript k. "
(conditions)
“For any j ≠ k, xoj-min <xok-min” and “yoj-min <yok-min” and “xok-max <xoj-max” and “yok-max <yoj-max” ”
[0034]
When this condition is not satisfied, the following determination (2) is performed. When the above conditions are met,
xok-min = max (xoj-min)
yok-min = max (yoj-min)
xok-max = min (xoj-max)
yok-max = min (yoj-max)
It is. Accordingly, as a determination procedure, first, k is obtained from max (xoj-min) = xok-min (the minimum value of the x coordinate of the boundary box is compared between arbitrary boundary boxes, and the maximum of them is J having a value is k), and whether or not the remaining three conditions are satisfied with respect to that k may be examined.
[0035]
(2) When the condition of (1) is not satisfied, the minimum value of the distance from the center of gravity of the boundary box of the hole peripheral point sequence to the outer periphery of each character outline is calculated, and becomes the minimum among these minimum distances. It is determined that the hole belongs to the outer periphery of the character outline. However, the "minimum distance from the center of gravity of the boundary box of the character hole to the outer periphery of the character outline" is the minimum value of the distance to the point on the outer periphery of the character and the minimum value of the distance to the edge of the character outer periphery. The smaller of the two.
[0036]
The distance to the point on the outer periphery of the character is calculated using a normal Euclidean distance (root of square sum). The distance to the outer edge of the character is obtained as follows. However, the character peripheral point sequence is P0 (p0x, p0y), P1 (p1x, p1y),..., Pn (pnx, pny), and the center of gravity of the boundary box of the character hole is C (cx, cy), C Let H (hx, hy) be the leg of the perpendicular line from the side to the side PkPk + 1.
a = pk + 1x-pkx, b = pk + 1y-pky, d = Cx-pkx
e = Cy-pky
α = (a × d + b × e) / (a ** 2 + b ** 2)
hx = α × a + pkx
hy = α × a + pky
However, k = 0, 1, 2,..., N, and Pn + 1 = P0 (where “X ** Y” represents X to the Yth power. The same applies hereinafter. ).
[0037]
Next, if min (pkx, pk + 1x) ≤hx≤max (pkx, pk + 1x) and min (pky, pk + 1y) ≤hy≤max (pky, pk + 1y), the distance to the side | CH | is calculated by the following equation. If this condition does not hold, there is no distance to the side, and the process moves to the next side.
Figure 0004028979
[0038]
Character structure analysis result information is expressed as hierarchical tree structure information (for example, when the point sequence “LB” is included in the point sequence “LA”), the character structure is expressed as “LA-LB”. Is possible. The information represented by the tree structure is output to the character shape upper and lower convex polygon dividing unit 5 as character structure analysis result information.
[0039]
The processing in the character shape structure analysis unit 4 configured as described above will be described in detail with reference to FIG. 3 and FIG.
[0040]
FIG. 3 is a schematic diagram when the character shape structure analysis is performed on the “twice” of the Chinese character. FIG. 4 is a flowchart showing a detailed processing flow in the inclusion relationship analysis processing in FIG. As shown in FIG. 3, the “time” point sequence includes an outer point sequence 401 of the outer “mouth” portion, an outer peripheral point sequence 402 of the outer “mouth” portion hole, and an inner It is constituted by a point sequence 403 on the outer periphery of the “B” portion and a point sequence 404 on the outer periphery of the hole of the inner “B” portion.
[0041]
First, the character shape structure analysis unit 4 determines whether or not the “round” point sequence received from the character periphery data acquisition unit 2 represents the character periphery point sequence by the above-described method. It is determined whether it is represented (S405). As a result, the point sequence 401 (Lo-1) and the point sequence 403 (Lo-2) correspond to the character outer peripheral point sequence (406), and the point sequence 402 (Lh-1) and the point sequence 404 (Lh-2). It is determined that it corresponds to the hole outer peripheral point sequence (407). Thereafter, a boundary box and a length L are calculated for the character outer peripheral point sequences 401 and 403 (S408), and a boundary box is calculated for the hole outer peripheral point sequences 402 and 404 (S409).
[0042]
Next, an inclusion relation analysis process is performed as to which character outer peripheral point sequence includes the hole outer peripheral point sequence 402 (Lh-1) and the hole outer peripheral point sequence 404 (Lh-2) (S410). .
[0043]
In the inclusion relation analysis process (S410), first, the boundary box of the character outer peripheral point sequence (Lo-1, Lo-2) and the hole outer peripheral point sequence (Lh-1, Lh-2) to be analyzed. Is determined (S501), and it is determined whether or not the boundary box of the hole outer peripheral point sequence is included in the boundary box of the character outer peripheral point sequence (S502, S503). This determination is performed for combinations of the boundary boxes of all character outer peripheral point sequences and the hole outer peripheral point sequence boundary boxes (S504, S501 to S503). In the case of “times”, the character outer peripheral point sequence Lo-1 includes the hole outer peripheral point sequences Lh-1 and Lh-2, and the character outer peripheral point sequence Lo-2 includes the hole outer peripheral point sequence Lh-2. (411).
[0044]
In the above determination, when it is determined that one hole outer peripheral point sequence is included in a plurality of character outer peripheral point sequences, it is necessary to specify a single character outer peripheral point sequence including the hole outer peripheral point sequence. Therefore, it is necessary to correct the following inclusion relationship (S412, S413, S505).
[0045]
First, one hole outer peripheral point sequence is specified, and all character outer peripheral point sequences including this (for example, N) are specified, and further, the N number of medium outer peripheral point sequences are determined by the above-described first or second (1) method. The character outer periphery point sequence located in the innermost side is identified (S506, S509).
[0046]
If it cannot be specified (S507), the innermost character outer peripheral point sequence is specified by the second method (2) described above (S508, S510).
[0047]
As described above, the determination of the inclusion relation with respect to “times” indicates that the hole outer peripheral point sequence (Lh-2) of the inner “B” part is only the character outer peripheral point sequence (Lo-2) of the “B” part. The structure analysis result information can be represented by a tree structure (414).
[0048]
If there is no hole in the character (or character part), the structure analysis result information that the structure is a flat structure with no hierarchy is the character shape top and bottom convex polygon division part as in the case with a hole. 5 is output. As described above, the character (or character part) can be expressed by a tree structure of “outer shape only” or “outer shape + character hole” based on the structural analysis result information obtained from the character shape structure analyzing unit 4. it can. Here, the “component” refers to the internal area (including the character outer peripheral point sequence) of the character outer periphery defined by the character outer peripheral point sequence or the character outer peripheral point, which is the target of polygon division described later in the character or character part. An area (including a character outer peripheral point sequence and a hole outer peripheral point sequence) obtained by excluding an internal region inside a hole defined by a hole outer peripheral point sequence from an internal region of the character outer peripheral defined by the sequence.
[0049]
The character shape upper / lower surface convex polygon dividing unit 5 performs convex polygon division on the above-described components. In the present embodiment, a case will be described in which a triangle is taken as an example of a convex polygon and polygon division is performed using this triangle.
[0050]
First, the character shape upper and lower surface convex polygon dividing unit 5 performs character polygonal point sequences and hole outer peripheral points as preprocessing for performing triangular polygon division when the component to be divided includes a hole outer peripheral point sequence. A process of connecting the columns is performed (hereinafter referred to as “connection”), and converted into a point sequence of one outer periphery. At the same time, replacement processing of point sequence numbers (numbers indicating the sequence of the sequence of point sequences) is performed. This connection is a process of connecting the character outer periphery and the hole outer periphery on the basis of the outline data, and generating point-sequence coordinate data in an arrangement that allows so-called one-stroke writing. Connection can be realized by the following two methods.
[0051]
FIG. 5 is a diagram showing a state in which the first connection method is applied to the Chinese character “field” and the point sequence number is changed. Hereinafter, the first connection method will be described with reference to FIG. In FIG. 5, only the point sequence number of each point sequence is shown.
[0052]
(First connection method)
(1) For all character holes, the maximum values x-max and y-max and the minimum values x-min and y-min of the x and y coordinates are determined based on the hole outer peripheral point sequence of each character hole, and each character is determined. The center coordinates ((x−max + x−min) / 2, (y−max + y−min) / 2) of the hole are obtained.
[0053]
(2) Find the nearest character outer peripheral point from the center coordinates of each character hole (hereinafter referred to as “proximity point”). However, in this case, in order to reduce the amount of calculation, the distance is replaced with the sum of squares of the x and y coordinates, and no route is taken. When there are multiple character holes, after finding the proximity point for one character hole so that there is no overlap in the proximity point, for the next character hole, from the character outer point excluding the proximity point Select a proximity point. In the example of FIG. 5, the proximity point with respect to the character hole 615 is set as a point “4” in the character outer peripheral point sequence.
[0054]
(3) The hole outer peripheral point of the character hole closest to the above proximity point is obtained, and the order of the hole outer peripheral point sequence is rearranged so that the point becomes the starting point (that is, the point sequence number is changed). For example, if the original hole peripheral point sequence is {P0, P1,..., Pk,..., Pm} and the point on the outer periphery of the character hole closest to the proximity point is Pk, {Pk,. .., Pm, P0, P1,..., Pk-1} are changed in order of the point sequence numbers. In the example of FIG. 5, the point on the hole outer periphery closest to the proximity point in the hole outer peripheral point sequence {0, 1, 2, 3} of the character hole 615 is the point “2”. , 3, 0, 1}, the point sequence numbers are changed.
[0055]
(4) The hole outer peripheral point sequence is embedded in the character outer peripheral point sequence, and the point sequence numbers are changed. For example, the dot sequence number of the original character outer peripheral dot sequence is {Q0, Q1, Q2,..., Qi, Qi + 1,..., Qn}, and after the replacement of (3) above is performed When the new hole perimeter point sequence is {P0, P1,..., Pm} and the proximity point is “Qi”, embedding of the hole perimeter point sequence is {Q0, Q1, Q2,. , {P0, P1,..., Pm, P0}, Qi, Qi + 1,. When the point sequence numbers are newly assigned to the embedded point sequence, they are {0, 1, 2,..., I, i + 1,..., I + m + 1, i + m + 2, i + m + 3,. n + m + 3}. When there are a plurality of character holes, connection is performed by sequentially embedding from the smaller point sequence number of the adjacent point. In the case of the example of FIG. 5, if only the hole outer peripheral point sequence of the character hole 615 is embedded for convenience, the sequence number of the character outer peripheral point sequence is {0, 1,..., 4,. Yes, when the new hole perimeter point sequence after the rearrangement of (3) is {0, 1, 2, 3}, the proximity point for the character hole 615 is the point “4”. If the hole outer peripheral point sequence is embedded, {0, 1,..., 4, {0, 1, 2, 3, 0}, 4,. Furthermore, when a new point sequence number is assigned, {0, 1,..., 4, 5,. As shown in FIG. 5, when the above connection is applied to the other character holes 616 to 618, the dot sequence numbers of the newly generated outer peripheral dot sequences are {0, 1, ..., 35}.
[0056]
Thereafter, the character shape upper and lower convex polygon dividing unit 5 associates the outer peripheral point sequence newly generated by the connection with the character outer peripheral point sequence and the hole outer peripheral point sequence before the connection (for example, (In the form of a table) is stored in the character circumference data storage unit 3. Since the outer peripheral point sequence generated by the connection includes overlapping points, an identifier indicating the overlapping point is also stored in the character outer periphery data storage unit 3.
[0057]
Next, a second connection method is described in which the algorithm of the first connection method is enhanced and corrected so that processing can be performed even for exceptional characters (or character parts).
[0058]
(Second connection method)
(1) Paying attention to one character hole to be processed, calculate the distance from each point of the hole outer peripheral point sequence to each point of the character outer peripheral point sequence, and specify the smallest one (minimum distance) from among them To do. Moreover, the distance from each point of said hole perimeter point sequence to the edge | side of a character outer periphery is calculated, and the minimum distance is specified from the inside.
[0059]
(2) The smaller one of the minimum distances specified in (1) above is adopted as the minimum distance of the focused character hole, and the point of the hole outer peripheral point sequence and the point of the character outer peripheral point sequence (or the hole) Two points are determined: a point of the outer peripheral point sequence and a point of a leg of a perpendicular line drawn to the side of the outer periphery of the character.
[0060]
(3) The point sequence numbers of the hole perimeter point sequence are changed in the order starting from the point of the hole perimeter point sequence determined in (2) above. For example, when the original hole outer peripheral point sequence is {0, 1,..., K,..., M} and the hole outer peripheral point closest to the adjacent point is the point “k”, {k,. , M, 0, 1,..., K−1}, the sequence of point sequences is changed.
[0061]
(4) When the character outer peripheral point sequence satisfies the minimum distance to the character outer periphery, the hole outer peripheral point sequence is embedded in the character outer peripheral point sequence, and the point sequence numbers are changed. For example, the dot sequence number of the original character outer peripheral dot sequence is {0, 1, 2,..., I, i + 1,..., N}, and the holes after performing the rearrangement of (3) above. When the point sequence number of the outer peripheral point sequence is {0, 1,..., M}, embedding when the point closest to the starting point of the hole outer peripheral point sequence is i is {0, 1, 2,. .., I, {0, 1,..., M, 0}, i, i + 1,..., N}. ..., i, i + 1, ..., i + m + 1, i + m + 2, i + m + 3, ..., n + m + 3}. This is a new outer peripheral point sequence. At this time, in addition to the new outer peripheral point sequence, the character outer periphery data with the start point of the hole outer peripheral point sequence, the character outer peripheral point sequence and the hole outer peripheral point sequence before connection, and i, i + 1, i + m + 1, i + m + 2 as overlapping points Store in the storage unit 3.
[0062]
On the other hand, if the point that meets the minimum value of the minimum distance to the outer periphery is a perpendicular foot point that is drawn down to the edge of the character outline, embed this perpendicular foot point into the outer character point sequence and change the point sequence number. Do. For example, when the perpendicular foot is on the side generated by the points k and k + 1 of the character outer peripheral point sequence, this point is embedded between k and k + 1. Next, the hole outer periphery point sequence is embedded into the character outer periphery point sequence after the embedding and the point sequence number is reassigned in the same manner as described above. Embedding is performed using the embedded character outer peripheral point k + 1) as a proximity point. Also in this case, in addition to the new outer peripheral point sequence, the outer peripheral character sequence using the starting point of the outer peripheral point sequence, the character outer peripheral point sequence and the hole outer peripheral point sequence before connection, and k + 1, k + 2, k + m + 3, k + m + 4 as overlapping points Store in the data storage unit 3.
[0063]
(5) When there are a plurality of character holes, the processes (1) to (4) are performed on the next character hole. However, points that once become overlapping points in (4) are excluded from the minimum distance calculation targets in (1).
[0064]
Next, two methods will be described for the method of triangulating the constituent elements.
First, the first triangulation method will be described. As an algorithm for triangulation of a convex hull for a sequence of points on a plane, research has been conducted in the field of computational geometry, and a prominent one is the Duraunay triangulation algorithm. As a convex hull calculation algorithm for a point sequence, there are Graham's algorithm and Quickhull's algorithm. Therefore, if the constituent elements are only the outer periphery of the character and the outer shape of the character is convex, the triangulation is completed by applying the Duraunay algorithm. However, generally, as can be seen from the above description, there are many holes in the constituent elements, and the outer shape of the characters is often a concave polygon such as “A”. Therefore, the components are triangulated by a method improved by combining these algorithms as described below.
[0065]
(1) A new point sequence excluding overlapping points located behind it is generated from the outer peripheral point sequence generated by the above-mentioned connection (this is referred to as “point sequence B”), and the correspondence is expressed as a character string. Stored in the outer periphery data storage unit 3 in a table format. That is, in this table, the connected outer peripheral point sequence and the pre-connected point sequence are associated with each other, and the connected outer peripheral point sequence and the point sequence B from which the rear overlapping point is removed therefrom. Are associated with each other.
[0066]
(2) A convex hull is generated for the point sequence B by the Graham or Quickkull method.
(3) If the point sequence on the outer periphery of the component is a point sequence of one character outline and the generated point sequence of the convex hull matches the outer peripheral point sequence before connection, identifier 0 is set. Otherwise it gives identifier 1.
[0067]
(4) The convex hull generated in (2) is triangulated by the Duraunay algorithm. If the identifier is 0, the processing from the above (1) is performed for the next component, and if the identifier is 1, the processing proceeds to (5).
(5) The center of gravity of the triangle generated in (4) is calculated.
[0068]
(6) If the outer peripheral point sequence obtained by the connection is P0, P1,..., Pm, the points of the point sequence B corresponding to Pi and Pi + 1 are obtained by referring to the above table. Assuming that Q and R are triangles with QR as one side, the vector PiPi + 1 and the vector PiPi + 1 with respect to the centroids Ci of these triangles (the maximum is two). Calculate the outer product with PiCi. However, when there are two triangles that include QR as an edge, the outer product is calculated for each centroid.
[0069]
At this time, if the coordinate system of the space in which the character shape is defined is a right-handed system and the calculation result of the outer product is positive, the triangle is a triangle formed in the concave portion of the character outline, or the character hole Because it is an internal triangle, reject it. For left-handed systems, reject if the result of the outer product is negative. The above processing is sequentially performed for i = 0,. At this time, if Pi and Pi + 1 are both overlapping points, Pj-1 (overlapping point corresponding to Pi) and Pj (overlapping point corresponding to Pi + 1) corresponding thereto exist behind the point sequence B. Therefore (i <j-1), when the triangle removal determination for the side PiPi + 1 ends, the end identifier is set in the table so that the rear side Pj-1Pj is not determined. When the process is completed up to i = m−1, the process is repeated for all the constituent elements from (1) for the next constituent element.
[0070]
FIG. 6A shows an example of a processing result when the above first triangulation method is applied to “field”. However, the numbers in the figure indicate the point sequence numbers of the point sequence B. The result of the triangulation is represented by a set of three points in the point sequence B. In general, in the case of a right-handed system, the surface where the arrangement of the three points is counterclockwise is defined as the upper surface, and conversely, the surface which is clockwise is defined as the lower surface (counterclockwise is the lower surface and clockwise is the upper surface) No problem). Further, the determination of the rotation direction of this arrangement can be made by calculating the outer product of the vector PQ and the vector PR, assuming that three points constituting the triangle are PQR, and the sign. For example, if the coordinate system is a right-handed system and the cross product calculation result is positive, the PQR sequence is counterclockwise and the PRQ sequence is clockwise. The same determination can be made for the left-handed system (however, clockwise is generally defined as the surface).
[0071]
Next, the second triangulation method will be described. If the connected peripheral point sequences obtained in the preprocessing are P0, P1,..., Pm, the second method performs the following processing. However, here, in the previous table, the identifier 1 is held for the concave point on the outer periphery of the character outline and the outer peripheral point of the character hole. The detection of the concave point is performed by calculating the outer product of two vectors PiPi + 1 and Pi + 1Pi + 2 generated from a point sequence on the outer periphery of the character outline, and in the case of the right-handed system, when the sign is positive, Pi +1 is the point of the recess (the opposite is true for the left-handed system).
[0072]
(1) The cross product of the vectors P0P1 and P1P2 is calculated, and the sign is calculated (here, the talk proceeds as a right-handed system, but in the case of the left-handed system, it can be similarly performed only by the sign being reversed). However, since the points are removed in the following (2b), if the number of remaining points in the point sequence finally becomes three, the outer product is not performed and the three points are held in that order. To do. Since the triangle constituted by the three points is the last triangle of the division process, the process is ended there.
[0073]
(2a) If the result of the outer product of (1) is negative, it is checked whether the triangle P0P1P2 contains a point sequence B point of the outer periphery of the character hole held in the table or the concave portion of the character outer shape. In this check, the sign of the vector cross product formed by connecting the points to be checked with the vectors P0P1 and P0 is positive, the sign of the vector cross product formed by connecting the points to be checked with the vectors P1P2 and P1 is positive, and the vector P2P0 If the sign of the outer product of the vectors formed by connecting the points to be checked and P2 is positive, it is determined that the checked point is inside the triangle.
[0074]
(2b) When the point is not included in the triangle in the determination of (2a), the three points P0P1P2 are held in this sequence (this sequence corresponds to clockwise), and P1 is removed from the sequence B A point sequence is generated, and the processing from (1) is continued for the triangle P0P2P3.
[0075]
(2c) When a point is included in the triangle in the determination of (2a), a new point sequence is generated by moving P0 to the last part of the sequence of points B, and the above (1) is continued for the triangle P1P2P3. ).
[0076]
(2d) If the result of the outer product of (1) is positive or 0, a new point sequence in which P0 is moved to the last part of the point sequence B is generated, and the processing from (1) is continued for the triangle P1P2P3. .
[0077]
FIG. 6B shows an example of the processing result when the above-described second triangulation method is applied to “rice”. However, the numbers in the figure indicate the point sequence numbers of the outer peripheral point sequences connected in the preprocessing. In addition, the division | segmentation by the shape of a general polygon is attained by combining multiple sides and triangles which were produced | generated in said division | segmentation.
[0078]
Furthermore, FIG. 7 shows an example of the processing result when the second triangulation method is applied to the Russian word “ё”.
By applying the first triangulation method to each component, the coordinate data (two-dimensional here) of the point sequence B and the data (point sequence) representing the arrangement of three points representing each divided triangle Data represented by three indexes in B) is generated. In general, in the right-handed data format, when the characters are displayed three-dimensionally, the arrangement of the three points in the lower component is clockwise, and the arrangement of the three points in the upper component is counterclockwise. In addition, by applying the second triangulation method, the coordinate data (in this case, two-dimensional) of the connected outer peripheral point sequence and the data representing the arrangement of the three points of each triangle (connected outer periphery) Data represented by three indexes in the point sequence). Here, the “index” refers to an identifier for representing each vertex of the divided triangle. For example, when the triangle is composed of P1P2P3, “1”, “2”, and “3” are indexes.
The format of the data generated by the first triangulation method or the second triangulation method is generally called indexed surface data. However, the arrangement of the point sequence in the case of the left-handed system is opposite to that in the case of the right-handed system. In this way, the character shape upper / lower convex polygon dividing unit 5 generates indexed surface data of each component on the upper surface and indexed surface data of each component on the lower surface for one character, and the character shape side surface generating unit 6 is output.
[0079]
The character shape side surface generation unit 6 receives the indexed surface data output from the character shape upper / lower surface convex polygon division unit 5, and the original outer periphery point sequence (connected) from the character outer periphery data storage unit 3. Data of the character outer peripheral point sequence and hole outer peripheral point sequence in the previous format. Further, the character shape side surface generation unit 6 expands the indexed surface data in three dimensions. Hereinafter, the character shape side surface generation processing for expanding the indexed surface data in the character shape side surface generation unit 6 in three dimensions will be described with reference to FIGS.
[0080]
FIG. 8 is a flowchart showing the flow of processing in the character shape side surface generation processing. FIGS. 9A to 9D are diagrams showing an outline of four types of methods for moving the upper surface of a character in the height direction, which are necessary when the indexed surface data is expanded in three dimensions. It is.
[0081]
First, as an initialization process, the character shape side surface generation unit 6 expands the point sequence coordinate data to three dimensions among the indexed surface data of each component on the lower surface, and all the portions corresponding to the z coordinate values are obtained. Set to zero. Similarly, all the portions corresponding to the z coordinate value of the point sequence coordinate data of the point sequence (hereinafter referred to as “lower point sequence”) on the lower surface obtained by three-dimensionally expanding the original outer peripheral point sequence are set to 0 ( S901).
[0082]
Next, a method of moving the upper surface of the character in the height direction is specified, and based on each method (S902), the z coordinate of the point sequence coordinate data in the indexed surface data of each component on the upper surface of the character And the z-coordinate value of the point sequence coordinate data of the point sequence (hereinafter referred to as “upper point sequence”) on the upper surface obtained by expanding the original outer peripheral point sequence in three dimensions.
[0083]
FIG. 9A is a diagram showing an outline of the first method. The first method is a method in which the upper surface of the character is lifted vertically in the height direction (the raised height is assumed to be h). In this case, among the indexed surface data of each component on the upper surface of the character, all the z coordinate values of the point sequence coordinate data are set to h. Similarly, the upper point sequence is generated by extending the point sequence coordinate data of the original outer peripheral point sequence to three dimensions, and all the parts corresponding to the z coordinate value are set to h (S903).
[0084]
FIG. 9B is a diagram showing an outline of the second method. The second method is a method of translating in the direction of the reference vector v (vx, vy, vz). In this case, among the indexed surface data of each component on the upper surface of the character, the z-coordinate value of the point sequence coordinate data is expanded to three, and the coordinate values for the reference vector are added to these. Similarly, an upper point sequence expanded to three dimensions by setting the z coordinate value of the point sequence coordinate data of the original outer peripheral point sequence to 0 is generated, and the coordinate values for the reference vector are added to these (S904).
[0085]
FIG. 9C is a diagram showing an outline of the third method. The third method is a method of moving the character in the height direction after reducing or enlarging the character (the height is h). In this case, among the indexed surface data of each component on the upper surface of the character, the point sequence coordinate data is reduced or enlarged, and the z coordinate value is expanded to three dimensions. Similarly, reduction or enlargement conversion is performed on the point sequence coordinate data of the original outer peripheral point sequence, and an upper point sequence expanded in three dimensions with the z coordinate value set to h is generated (S905).
[0086]
FIG. 9D is a diagram showing an outline of the fourth method. The fourth method is a method of moving by rotation conversion, and an appropriate rotation axis vector and rotation angle θ are given in advance. In this case, among the indexed surface data of each component on the upper surface of the character, the z-coordinate value of the point sequence coordinate data is expanded to three dimensions, and a rotation axis given in advance is applied to these coordinate values. The rotation transformation defined by the vector and the rotation angle θ is performed, and the coordinate value after the transformation is calculated. Similarly, an upper point sequence is generated in which the z coordinate value of the point sequence coordinate data of the original outer peripheral point sequence is set to 0 and expanded in three dimensions, and the rotation axis vector and rotation given in advance are generated with respect to this coordinate value. The rotation transformation defined by the corner is performed, and the coordinate value after the transformation is calculated (S906).
[0087]
As can be seen from the above processing, the lower point sequence and the upper point sequence of the original outer periphery expanded three-dimensionally have the same point sequence number. As described above, the character shape side surface generation unit 6 generates indexed surface data of each component of the upper and lower surfaces of the character expanded three-dimensionally (S907) and outputs it to the character shape data output unit 7.
[0088]
In the case of a right-handed system, the side surface is generated as a quadrangle PiP'iP'i + 1Pi + 1, where {P'n} is the lower dot sequence of the outer periphery of each component expanded in three dimensions and {Pn} is the upper dot sequence. Yes (in counterclockwise order, if left-handed, rearrange clockwise). In order to obtain side surface data in the form of indexed surface data, QiQi + nQi + 1Qi + n + is added to the point sequence coordinate data of a point sequence (here, {Q2n}) with a lower point sequence added after the upper point sequence. Arrange the index data of 1 sequence. The indexed surface data of the side surface of each component generated in this way is output to the character shape data output unit 7.
[0089]
The character shape data output unit 7 hierarchically describes the indexed surface data of the upper and lower surfaces of each component of the character and the indexed surface data of the side of each component output from the character shape side surface generation unit 6. Are collectively output to the outside (for example, a three-dimensional graphic display device). In addition, when converting a data format, it outputs after converting into the said data format.
[0090]
As described above, by clarifying the inclusion relationship between the outer shape of a character or character part and the character hole for a character including a hole, three-dimensional display divided into units of the character part can be performed. Can do.
[0091]
(Embodiment 2)
In the first embodiment described above, an example is described in which a three-dimensional character is generated by linearly forming a side surface of a three-dimensional character by linearly lifting the upper surface of the character in the height (z-axis) direction. However, in the second embodiment, an example will be described in which an arbitrary outer periphery is provided on the side surface of a three-dimensional character, and various bevel-shaped side surfaces are formed based on the intermediate periphery. In the present embodiment, description of the same components as those in the first embodiment is omitted.
[0092]
FIG. 10 is a block diagram showing a functional configuration of the three-dimensional character data generation apparatus 201 in the present embodiment. The apparatus 201 includes a bevel-shaped side surface generation unit 11 instead of the character shape side surface generation unit 6, and includes a character shape data output unit 12 instead of the character shape data output unit 7. The three-dimensional character data generation apparatus 201 configured as described above will be described in detail below.
[0093]
In the bevel-shaped side surface generation unit 11, in addition to the output result of the character shape upper and lower surface convex polygon division unit 5, the original outer peripheral point sequence data is read from the character outer periphery data storage unit 3 as in the first embodiment. input. Of the indexed surface data of each component on the lower surface of the character, the point sequence coordinate data is expanded to three dimensions, and all the portions corresponding to the z coordinate value are set to zero. Similarly, a lower point sequence in which the point sequence coordinate data of the original outer peripheral point sequence is expanded to three dimensions is generated, and all the portions corresponding to the z coordinate value are set to zero.
[0094]
Next, it is lifted perpendicularly to the height direction (the lifted height is assumed to be h), and the point sequence coordinate data of the indexed surface data of each component on the upper surface of the character is expanded three-dimensionally to the z coordinate value. Set all corresponding parts to h. Similarly, an upper point sequence in which the point sequence coordinate data of the original outer peripheral point sequence is expanded to three dimensions is generated, and all the portions corresponding to the z coordinate values are set to h. The indexed surface data of each of the upper and lower components expanded in three dimensions is output to the character shape data output unit 12 (except for the mold type bevel shape described last).
[0095]
FIG. 11 is a diagram for explaining a method for generating a bevel-shaped outer shape and a bevel-shaped intermediate outer periphery.
FIG. 11A is a diagram illustrating the simplest bevel-shaped outer shape. In FIG. 11A, an intermediate outer periphery 1220 is generated between the upper and lower surfaces of the character, and the bevel shape is formed so that the cross section when the side surface of the character is cut obliquely becomes a convex hexagon. . In this case, the outer periphery 1220 outside the character is generated by enlarging the outer periphery 1210 (or 1230) of the upper surface (or lower surface) of the character, and the intermediate outer periphery of the character hole is the outer periphery of the hole on the upper surface (or lower surface) of the character. Reduce to generate.
[0096]
As another bevel shape, conversely to FIG. 11 (a), the bevel shape may be formed by cutting the side of the character diagonally inward and forming a concave hexagon in the cross section. It is done. In this case, the outer periphery of the character is generated by reducing the outer periphery 1210 (or 1230) of the upper surface (or lower surface) of the character, and the intermediate outer periphery of the character hole is the hole outer periphery of the upper surface (or lower surface) of the character. Generate by expanding. Other combinations of the outer outer periphery of the character and the intermediate outer periphery of the character hole include a case where the character outer shape and the character hole are both enlarged and generated, and a case where the character outer shape and the character hole are both reduced and generated.
[0097]
Hereinafter, a method for generating the intermediate outer periphery will be described with reference to the flowcharts of FIGS. 11B and 12.
[0098]
As described above, in order to generate the intermediate outer periphery, it is necessary to expand or reduce the outer periphery of each component. For the middle circumference, find the normal vector of the component's outer circumference and move the point sequence points on the component's outer circumference in the normal direction (in the case of enlargement, the normal vector is moved in the positive direction; It is obtained by moving in the direction of A method of generating an intermediate outer periphery when the points on the outer periphery of the component are P0, P1,..., Pn will be described below.
[0099]
(1) A vector pi = PiPi + 11340 (a vector having the point of the subscript i as the start point and the next point of the subscript i + 1 as the end point) is obtained. However, the vector finally obtained is pn = PnP0 (the subscript is a vector having the last point on the outer periphery as the start point and the first point as the end point) (S1301).
[0100]
(2) A normal vector Ni = (Nix, Niy) 1341 of each vector pi = (pix, piy) is obtained (S1302). The normal vector is obtained as follows. However, there are two normal vectors.
(When pix * piy ≠ 0):
Nix = ± 1 / (1+ (pix / piy) ** 2) ** (1/2),
-Nii = ± (pix / piy) * 1 / (1+ (pix / piy) ** 2) ** (1/2)
(When pix = 0, piy ≠ 0):
Nix = ± 1, Niy = 0
(When pix ≠ 0, piy = 0):
Nix = 0, Niy = ± 1
Of the two normal vectors obtained above, the one satisfying the following condition is selected.
(Conditional expression): pix * Niy−piy * Nix> 0
[0101]
(3) The normal vector NPi = (NPxi, NPyi) is obtained by the following equation for each of the outer peripheral points Pi (S1303).
NPi = (Ni-1 + Ni) / || Ni-1 + Ni ||
= ((Ni-1x + Nix) / ((Ni-1x + Nix) ** 2+ (Ni-1y + Niy)
** 2)) ** (1/2), (Ni-1y + Niy) / ((Ni-1x + Nix) ** 2
+ (Ni-1y + Nii) ** 2)) ** (1/2)
However, NP0 is as follows.
NP0 = (Nn + N0) / || Nn + N0 ||
= ((Nnx + N0x) / ((Nnx + N0x) ** 2
+ (Nny + N0y) ** 2)) ** (1/2),
(Nny + N0y) / ((Nnx + N0x) ** 2+ (Nny + N0y) ** 2))
** (1/2))
[0102]
(4) When the amount of enlargement / reduction of the outer periphery is L, the next αi is calculated (S1304). However, a specific enlargement / reduction amount L will be described later.
αi = L / cos θi = L / (NpixNix + NpiyNiy)
However, in the case of the outer periphery of the component, the denominator of the above formula does not become 0 or less. Therefore, if it becomes 0 or less, an abnormality has occurred.
[0103]
(5) Assuming that Pi′1242 is a point on the intermediate periphery corresponding to each point Pi on the periphery, Pi ′ is obtained by the following equation. These become the point sequence constituting the enlarged intermediate outer periphery (S1306).
Pi ′ = Pi + αiNPi
For Pi ′, the points on the intermediate circumference in the case of reduction
Pi '= PiαiNPi
(S1307).
[0104]
A method for generating the side surface shape will be described with reference to FIG. 11A by using the intermediate outer peripheral point sequence, the upper point sequence, and the lower point sequence generated as described above. First, the point sequence on the intermediate outer periphery is expanded to three dimensions, and the z coordinate value is set to half of h / 2 here (in this case, the z coordinate value can be set to any value between 0 and h). Is). Next, if the point sequence of the intermediate outer periphery corresponding to the upper point sequence Pn, Pn + 1 is Pcn, Pcn + 1, and the lower point sequence is Pn ′, Pn + 1 ′, the upper periphery and the intermediate periphery are connected. The side surface generated by is “PnPn + 1Pcn + 1Pcn” in the case of counterclockwise rotation, and the side surface generated by the connection between the intermediate outer periphery and the outer periphery of the lower surface is “PcnPcn + 1Pn + 1′Pn ′”.
[0105]
Accordingly, the indexed surface data of the side surface generated from the outer periphery of the upper surface and the intermediate outer periphery is a point sequence Q1,..., Qn, Qn + 1, where the intermediate outer peripheral point sequence is appended to the upper point sequence (number n). .., Q2n are configured, and in the case of counterclockwise rotation, the indexes are sequentially configured as Qi, Qi + 1, Qi + n + 1, and Qi + n. Similarly, the indexed surface data of the side surface generated from the intermediate outer periphery and the lower surface outer periphery can also be generated.
[0106]
Next, as a development form when generating the above intermediate periphery, a method of generating two intermediate periphery and cutting the corners of the upper and lower surfaces of the character periphery, so-called typical bevel shape, This will be described with reference to FIG. In this case, the method for generating the intermediate outer periphery is basically the same as the above-described generation method.
[0107]
FIG. 13A is a diagram showing an outline in the case of generating two intermediate outer peripheries that form so-called convex side surfaces in which the side surfaces protrude beyond the upper and lower surfaces of the character. In FIG. 13A, of the two generated intermediate outer peripheries, the one closer to the upper surface is the first intermediate outer periphery 1411 and the one closer to the lower surface is the second intermediate outer periphery 1412. Next, as shown in FIG. 13A, the bevel-shaped scraping angle is θ1 as the scraping angle with respect to the outer periphery of the upper surface and θ2 as the scraping angle with respect to the outer periphery of the lower surface. In this case, both of the two intermediate outer peripheries 1411 and 1412 are enlarged relative to the character outer perimeter 1410 on the upper surface.
[0108]
As can be seen from FIG. 13A, when the character outer periphery 1410 on the upper surface is enlarged to generate the intermediate outer periphery, tan θi = hi / Li, so hi = Litanθi. However, in this case, i = 1 or 2. After the above calculation, h0 = h− (h1 + h2) is calculated, the z coordinate value of the point sequence of the first intermediate outer periphery 1411 is set to h0 + h2 (= h−h1), and the point sequence of the second intermediate outer periphery 1412 A three-dimensional point sequence is generated with the z coordinate value as h2. If attention is paid to the fact that the number of intermediate peripheries is increased by one, the side surface can be generated in the same manner as described above for generating the side surface in the case of one intermediate outer periphery.
[0109]
FIG. 13B is a diagram showing an outline in the case of generating two intermediate outer peripheries that form concave side surfaces, contrary to FIG. 13A. In this case, two intermediate outer peripheries are generated by reducing the character outer perimeter 1420 on the upper surface, but basically it can be generated by the same method as in FIG. 13 (a). .
[0110]
Next, when the shape of the side surface is a curve, a method of approximating the curve with a polygon and generating a plurality of intermediate outer peripheries according to the polygon will be described with reference to FIG. Here, the curve for controlling the generation of the intermediate outer periphery is basically a quadratic curve, and will be described assuming a circle, a parabola, or a spline curve, for example.
[0111]
First, as shown in FIG. 14A, a case where the shape of the side surface is convex in a semicircular shape will be described. It is assumed that the enlargement is L, the rising height is h (≧ 2L), and the number of intermediate outer circumferences to be generated is 2n + 1. In the example of FIG. 14A, n = 2.
[0112]
As can be seen from FIG. 14A, the generated intermediate outer periphery is symmetric with respect to the central intermediate outer periphery 1511 at the height h / 2. Therefore, if an intermediate outer periphery on the upper side (or lower side) of the central intermediate outer periphery 1511 is generated, the lower (or upper) intermediate outer periphery may be generated using symmetry. The side surface is generated by the method described above. A problem in the generation of the intermediate outer periphery is to calculate an enlargement amount other than the central intermediate outer periphery 1511 and its z coordinate value. The calculation method will be described with reference to FIG. 14 (c).
[0113]
In FIG. 14 (c), the central intermediate outer periphery 1511 is set as the intermediate outer periphery 0, and thereafter the intermediate outer periphery 1, 2,... The enlargement amount Li and the z coordinate value zi of the intermediate outer periphery i can be calculated by the following formula (here, the radius of the bevel circle is r).
Li = L−r (1−cos (2iθ / (n + 1)))
zi = h / 2 ± hi = h / 2 ± rsin (2iθ / (n + 1))
r = 1 / 2L (L ** 2 + h ** 2/4)
θ = arctan (2 L / h)
However, when i = 0, 1,..., N and z i is positive, it indicates the z coordinate of the upper intermediate outer periphery, and when z i is negative, it indicates the z coordinate of the lower intermediate outer periphery.
[0114]
FIG. 14B shows a bevel-shaped appearance when the side surface shape is concave. When the shape of the side surface is concave, the sign of Li is set to be a minus amount and the amount of reduction is set, but z i is the same as the convex case of FIG. 14A.
[0115]
Next, a case where the side bevel shape is a parabola will be described. Similarly to the case of the circle, if the number of intermediate outer circumferences to be generated is 2n + 1, the enlargement / reduction amount of the intermediate outer circumference i is Li, and the z coordinate values are z i, i = 0, 1,. If
Li = L (1-i ** 2 / (n + 1) ** 2)
zi = h / 2 ± ih / 2 (n + 1) = h (1 ± i / (n + 1)) / 2
However, z i indicates the z coordinate of the upper intermediate circumference when the value is positive, and z coordinate of the lower intermediate circumference when the value is negative. Although the above is a case of convexity, in the case of concaveness, the sign of Li is set to a minus amount to reduce the amount, but zi is the same as the case of convexity.
[0116]
When a quadratic spline curve is used, a parameter having a z coordinate value of 0 to h is virtually introduced between the lower surface and the upper surface. A spline curve is generated based on an appropriate control point between the upper and lower surfaces input by the operator of the apparatus 201 and the above parameters. However, the end points of the upper surface and the lower surface are fixed to zero. The amount convex / concave by the spline curve is the enlargement / reduction amount, and the z coordinate value of the parameter is the z coordinate value of the intermediate outer periphery. As described above, the intermediate outer periphery is generated in accordance with the quadratic spline curve, and the side surface of the character is generated by the same method as described above.
[0117]
Finally, the case where a mold-type bevel-shaped side surface is generated will be described with reference to FIG. Even when generating a bevel-shaped side surface of a mold type, it can be generated by modifying and applying the above-described method of generating two intermediate outer peripheries. In the following, a procedure for generating a three-stage mold-type bevel-shaped side surface will be described.
[0118]
(1) Intermediate outer peripheries 1610 and 1611 that are the same as the outer peripheries of the original components (however, the z coordinate values are not the same), two intermediate outer peripheries 1620 and 1621 that are reduced from the original outer peripheries, and the original outer peripheries Two enlarged intermediate perimeters 1630, 1631 are generated in the manner described above.
[0119]
(2) When the launch height is h (this h is input from the outside or the default value is used), the z coordinate values of the two reduced intermediate outer circumferences are set to h, 2h / 3, respectively, The z coordinate values of two intermediate outer peripheries 1610 and 1611 that are the same as the outer peripheries are 2h / 3 and h / 3, respectively, and the z coordinate values of the two enlarged intermediate outer peripheries are h / 3 and 0, respectively.
[0120]
(3) Of the intermediate peripheries generated by reduction, the surface constituted by the upper intermediate perimeter is defined as the upper surface of the component, and the z coordinate value of the point sequence of those intermediate outer peripheries is set to h (z coordinate value is h The top surface is generated by the reduced intermediate circumference of
(4) Of the intermediate peripheries generated by enlargement, the surface formed by the lower intermediate perimeter is used as the lower surface of the component, and the z coordinate value of the point sequence of those intermediate outer peripheries is set to 0 (z coordinate value is 0 The lower surface is generated by an enlarged intermediate outer circumference of
[0121]
(5) By connecting the corresponding points between the two intermediate outer peripheries generated by reduction, the uppermost step side surface 1622 is generated in the same manner as described above.
(6) Corresponding points between the intermediate outer circumference (z coordinate value 2h / 3) generated by reduction and the upper intermediate outer circumference (z coordinate value 2h / 3) of the same intermediate outer circumference as the original outer circumference are connected. Thus, the upper surface (horizontal plane) of the middle stage is generated by the same method as described above.
[0122]
(7) The middle side surface 1612 is generated in the same manner as described above by connecting corresponding points between two intermediate outer peripheries identical to the original outer peripheries.
(8) By connecting corresponding points between a lower intermediate outer periphery (z coordinate h / 3) and an intermediate outer periphery (z coordinate value is h / 3) generated by enlarging the same intermediate outer periphery as the original outer periphery, A lower upper surface (horizontal plane) is generated in the same manner as described above.
(9) By connecting the corresponding points between two intermediate outer peripheries generated by enlarging, the side surface 1632 of the lowest step is generated in the same manner as described above.
[0123]
Note that when generating the upper and lower surfaces by the above method, if the original component is triangulated, the correspondence relationship of the outer peripheral index itself does not change, so only the point sequence coordinate data portion of the indexed surface data It is only necessary to reduce or enlarge. In this case, the above-described indexed surface data of the upper and lower surfaces of the original component is not output to the character shape data output unit 12, but the indexed surface data generated here is sent together after generation. .
[0124]
The character shape data output unit 12 receives the indexed surface data of the upper and lower surfaces of each component of the character and the indexed surface data of the bevel shape side of each component sent from the bevel shape side surface generation unit 11. Collectively output by hierarchical description and output to the outside. When the data format is converted, the data format is output after conversion.
[0125]
FIGS. 16A to 16D show examples of four types of bevel shapes according to the present embodiment. FIG. 16A shows the shape of the side surface when the upper surface of the character is lifted vertically in the height direction as the first method in the first embodiment, and is the case of “no bevel”. FIG. 16B shows an example in which a bevel shape in which the cross section of the side surface protrudes into a convex hexagonal shape is generated, similar to the shape of FIG. FIG. 16C is an example in which two intermediate outer peripheries are generated and a bevel shape having a convex trapezoidal cross section is generated when the scraping angles with respect to the outer peripheries of the upper and lower surfaces of the character are equal. FIG. 16D is an example of the “template type” bevel shape shown in FIG.
As described above, since the intermediate outer periphery is generated and the side surface is generated based on the intermediate outer periphery, various side surface shapes of three-dimensional characters can be automatically realized.
[0126]
(Embodiment 3)
In the third embodiment, an example will be described in which a finer three-dimensional shape is made possible by interpolating between the character outer peripheral point sequence and the hole outer peripheral point sequence with appropriate points. Note that in this embodiment, description of the same components as those in the above-described embodiment is omitted.
[0127]
FIG. 17 is a block diagram illustrating a functional configuration of the three-dimensional character data generation apparatus 301 according to the third embodiment. The three-dimensional character data generation apparatus 301 newly includes a character outer periphery data interpolation unit 21, a character shape upper / lower surface convex polygon subdivision unit 22, and a texture coordinate generation unit 24, and replaces the character shape side surface generation unit 6 with a character shape side surface. The generation unit 23 includes a character shape data output unit 25 instead of the character shape data output unit 7. The three-dimensional character data generation apparatus 301 configured as described above will be described in detail below.
[0128]
The character outer periphery data interpolating unit 21 interpolates appropriate points to the character outer peripheral point sequence and the hole outer peripheral point sequence of each component output from the character shape structure analyzing unit 4 to represent the shape of the character expressed in three dimensions. Refine. A method of interpolating points to the character outer peripheral point sequence or the hole outer peripheral point sequence is as follows.
[0129]
(1) A total distance that is a sum of distances when two consecutive points are connected to a character outer peripheral point sequence and a hole outer peripheral point sequence of each component sent from the character shape structure analyzing unit 4 calculate. In addition, the total number of point sequences in that case is calculated.
(2) The reference distance is calculated by dividing the total distance by the total number, calculating an average distance, and dividing the calculated average distance by a number corresponding to an arbitrary subdivision level.
(3) If the distance between two consecutive points in the original character outer peripheral point sequence or hole outer peripheral point sequence is greater than the reference distance, a point is generated in the middle so that it is equal to or less than the reference distance. The points to be generated are generated on the lines connected by the above-mentioned straight lines or the lines connected by the curves specified in the outline data stored in the character outer periphery data storage unit 3. Even when a new point is added between the existing point sequences, the point sequence number is corrected while maintaining the arrangement (not the last point sequence number of the new point).
[0130]
FIG. 18 shows an example in which a new point is interpolated between the point sequences for “times”. In FIG. 18, three points per side are interpolated for the character outer peripheral point sequence 1911, and two points per side are interpolated for the hole outer peripheral point sequence 1912. Similarly, in the character outer peripheral point sequence 1913 and the hole outer peripheral point sequence 1914, one point is interpolated per side.
[0131]
As described above, the character outer periphery data interpolation unit 21 sends the outer periphery data of each component whose points have been interpolated and corrected to the character shape upper / lower convex polygon dividing unit 5. In the character shape upper / lower surface convex polygon subdivision unit 22, the character shape upper / lower surface convex polygon subdivision unit 5 further divides the triangle obtained by dividing each component into triangles as described above. In this subdivision, the apex of the triangular polygon generated by the character shape upper and lower convex polygon dividing unit 5 is on the outer periphery of the character, so that when the shape is bent or twisted, the deformation of the outer periphery becomes linear. Therefore, there is a high possibility that an unnatural situation will occur. Subdivision is performed to prevent such unnaturalness.
[0132]
Next, a method for subdividing the triangular polygon will be described with reference to FIGS.
FIG. 19 is a flowchart showing the flow of processing in the method of subdividing the original triangle into four.
FIG. 21A is a diagram for explaining a method of performing inner division using the midpoints of triangle sides.
In the present embodiment, the inner division method using the midpoints of the sides of the triangle as shown in FIG. This inner division method calculates the midpoint of each side of a triangle and divides the original triangle into four by three line segments connecting the midpoints. Therefore, the number of triangles increases by a factor of 4 for each division.
[0133]
Here, for each component, {P [0], P [1],..., P [n] are connected to the peripheral point sequence connected by the preprocessing of the character shape upper / lower convex polygon dividing unit 5. ]}, The point sequence of the outer periphery of the character outline is {Po [0], Po [1],..., Po [l]}, and the point sequence of the outer periphery of the character hole is {Ph [x] [0], Ph [x] [1],..., Ph [x] [kx].
In the following, the algorithm of the inner division method for triangular polygons whose indices are {a, b, c} will be described.
[0134]
(1) The values of | a−b |, | b−c |, and | c−a | are calculated.
(2) If | a−b | = 1, the midpoint Pab of P [a] P [b] is obtained, and Pab = P [last + 1] is added to the end of the point sequence, and the index last + 1 = α is held.
(3) If | a−b | ≠ 1 and (a, b) ≠ (lastorg, 0) & (a, b) ≠ (0, lastorg) (where lastorg is the index of the point sequence before the division operation) It is checked whether the midpoint of P [a] P [b] has been obtained. If it is obtained as a result of the check, the index is held as α, and the midpoint data is removed from the check list described later. If not obtained, the midpoint Pab of P [a] P [b] is obtained, and Pab = P [last + 1] is added to the end of the point sequence, and the index last + 1 = α is held. At the same time, the index set number (a, b) and α are held in the check list. Accordingly, the check list is composed of index set numbers and indexes generated thereby, and the check sets compare the index set numbers in any order.
[0135]
(4) Also for | b−c | and | c−a |, the above (2) and (3) are performed in the same manner, and index β for | b−c | and index γ for | c−a |. Hold.
(5) The index sequence {a, b, c} defining the triangle is removed, and the index sequence {a, α, γ}, {b, β, α}, {c, γ, β defining the four triangles }, {Α, β, γ} are inserted instead.
[0136]
Next, a description will be given of the reconstruction of the point sequence on the outer periphery of the character outline accompanying the triangle subdivision. The following operation is performed on the outer peripheral point sequence of the original character outline.
(1) For {Po [0], Po [1],..., Po [n]}, find the midpoint of Po [I] Po [I + 1] and set them as W [I]. However, when I = 0, 1,..., N, Po [n + 1] = Po [0].
(2) The number of indexes of {Po [0], Po [1],..., Po [n]} is doubled, and {Po [0], Po [2], Po [4], Po [6],..., Po [2n]}, and W [I] is inserted as Po [2I + 1]. A new point sequence {Po [0], Po [1], Po [2]..., Po [2n], Po [2n + 1]} thus generated is generated by the subdivided triangle. This is a point sequence around the outer periphery of a new character. In the case of the point sequence on the outer periphery of the character hole, a new point sequence on the outer periphery of the character hole generated by the re-divided triangle is obtained by the same processing as the case of the point sequence on the outer periphery of the character outline.
[0137]
Since the above inner division method is to divide the original triangle into four, the number of triangles increases four times. Assuming that the first state in which the subdivision has never been performed is level 0 and the level is incremented by one in one subdivision, the triangle increases 4r times at level r with respect to level 0.
[0138]
In the above inner division processing, if the triangle subdivision level is set to r, r processing is required. Therefore, a method that can increase the level by two or more at a stretch will be described with reference to FIG. 20 and FIG.
[0139]
FIG. 20 is a flowchart showing the flow of processing in the subdivision method when the level of triangle subdivision is to be set to r.
FIG. 21B is a diagram illustrating a state in which the level of triangle subdivision is increased from level 0 to level r at a stroke.
In FIG. 21B, α [I] is the index (I = 0, 1,..., 2 ** r−2) of the internal dividing point Pab [α [I]] of P [a] P [b]. ) And Pab [α [I]] is
Pab [α [I]]
= {(I + 1) P [b] + (2 ** r-I-1) P [a]} / 2 ** r
It can be calculated from Similarly, β [I] is an index (I = 0, 1,..., 2r−2) of the internal dividing point Pbc [β [I]] of P [b] P [c], and Pbc [β [I]] is
Pbc [β [I]]
= {(I + 1) P [c] + (2 ** r-I-1) P [b]} / 2 ** r
It can be calculated from Γ [I] is an index (I = 0, 1,..., 2r−2) of the internal dividing point Pca [γ [I]] of P [c] P [a], and Pca [γ [ I]]
Pca [γ [I]]
= {(I + 1) P [a] + (2 ** r-I-1) P [c]} / 2 ** r
It can be calculated from ξ [I] [k] is the index (I = 0, 1,..., 2 ** r−3,) of the internal dividing point Pαγ [ξ [I] [k]] of P [α] P [γ]. 0 ≦ k ≦ I,) and Pαγ [ξ [I] [k]] is
Pαγ [ξ [I] [k]]
= {(I + 1−k) P [α [I + 1]]
+ (K + 1) P [γ [2 ** r-I-3]]} / (I + 2)
It can be calculated from The algorithm will be described based on the occurrence of the above internal dividing points.
[0140]
(1) The values of | a−b |, | b−c |, and | c−a | are calculated.
(2) If | a−b | = 1, the internal dividing point Pab [α [I]] of P [a] P [b] (I = 0, 1,..., 2 ** r− 2) is obtained and added to the end of the point sequence as Pab = P [last + 1 + I], and the index last + 1 + I = α [I] is held.
(3) If | a−b | ≠ 1 and (a, b) ≠ (lastorg, 0) & (a, b) ≠ (0, lastorg) (where lastorg is the index of the point sequence before the division operation) It is checked whether the internal dividing point of P [a] P [b] has been obtained. If it is obtained as a result of the check, the index is held as α [I], and the data of the internal dividing point is removed from the check list described later. If not obtained, the above internal dividing point Pab [α [I]] (I = 0, 1,..., 2 ** r−2) of P [a] P [b] is obtained, and Pab = P [last + 1 + I] is added to the end of the point sequence, and the index last + 1 + I = α [I] is held. At the same time, the index set number (a, b) and α [I] are held in the check list. Accordingly, the check list is composed of index set numbers and indexes generated thereby, and the check sets compare the index set numbers in any order.
[0141]
(4) For | b−c | and | c−a |, the above (2) and (3) are performed in the same manner, and the internal dividing point of P [b] P [c] and P [c] P [a ], And if necessary, add it to the point sequence coordinate data. If necessary, the index set number (b, c) and β [I], and the index set number (c, a) and γ [I] are held in the check list.
(5) When r> 1, the internal dividing point Pαγ [ξ [I] [k]] of the above P [α] P [γ] is obtained and added to the end of the point sequence, and the index last + 1 + I (I + 1 ) / 2 + k = ξ [I] [k]. However, I = 0, 1,..., 2 ** r−3, 0 ≦ k ≦ I.
[0142]
(6) When r = 1, the index sequence {a, b, c} that defines the triangle is removed, and the index sequence {a, α [0], γ [0]} that defines four triangles, {B, β [0], α [0]}, {c, γ [0], β [0]}, {α [0], β [0], γ [0]} are inserted instead.
[0143]
(7) When r> 1, the index sequence {a, b, c} defining the triangle is removed, and the following index sequence defining the 4r triangles is inserted instead. However, processing is performed according to I with I = 0, 1,..., 2 ** r−1.
When I = 0, insert {a, α [0], γ [2 ** r-2]} instead.
When I = 1, {α [0], α [1], ξ [0] [0]}, {α [0], ξ [0] [0], γ [2 ** r-2 ]}, {Γ [2 ** r-2], ξ [0] [0], γ [2 ** r-3]}.
When I = 2, {α [1], α [2], ξ [1] [0]}, {α [1], ξ [1] [0], ξ [0] [0]} , {Ξ [0] [0], ξ [1] [0], ξ [1] [1]}, {ξ [0] [0], ξ [1] [1], γ [2 ** r -3]}, {γ [2 ** r-3], ξ [1] [1], γ [2 ** r-4]} are inserted instead.
When 3 ≦ I ≦ 2r−2, {α [I−1], α [I], ξ [I−1] [0]}, {α [I−1], ξ [I−1] After [0], ξ [I-2] [0]}, {ξ [I-2] [k], ξ [I-1] [k], ξ [I-1] [k + 1]} and { After repetition of a set of ξ [I−2] [k], ξ [I−1] [k + 1], ξ [I−2] [k + 1]} (where 0 ≦ k ≦ I-3) (that is, The repetition occurs I-2 times), {ξ [I-2] [I-2], ξ [I-1] [I-2], ξ [I-1] [I-1]}, {ξ [ I-2] [I-2], ξ [I-1] [I-1], γ [2 ** r-1-I]}, {γ [2 ** r-1-I], ξ [ I-1] [I-1], γ [2 ** r-2-I]} ending index sequence is inserted instead.
[0144]
When I = 2 ** r−1, {α [2 ** r-2], b, β [0]}, {α [2 ** r-2], β [0], ξ [ After 2 ** r-3] [0]}, {ξ [2 ** r-3] [k], β [k], β [k + 1]} and {ξ [2 ** r-3] [ k], β [k + 1], ξ [2 ** r−3] [k + 1]} (where 0 ≦ k ≦ 2 ** r−4) after repetition (that is, repetition is 2 ** r -3 times), {ξ [2 ** r-3] [2 ** r-3], β [2 ** r-3], β [2 ** r-2]} {ξ [2 * * r-3] [2 ** r-3], β [2 ** r-2], γ [0]}, {γ [0], ξβ [2 ** r-2], c} Insert index column instead.
[0145]
Next, regeneration of a point sequence on the outer periphery of the character outline will be described below.
(1) For {Po [0], Po [1],..., Po [n]}, the internal dividing point of Po [I] Po [I + 1] when this is divided by 2 ** r And determine them as W [I] [k]. However, I = 0, 1,..., N, and in particular, Po [n + 1] = Po [0]. Further, when k = 0, 1,..., 2 ** r−2, W [I] [k] is obtained by the following equation.
Figure 0004028979
[0146]
(2) The index of {Po [0], Po [1],..., Po [n]} is multiplied by 2 ** r, and {Po [0], Po [2 ** r], Po [ 2 × 2 ** r], Po [3 × 2 ** r],..., Po [n × 2 ** r]}, and W [I] [k] is changed to Po [I × 2 * * r + k + 1] (where I = 0, 1,..., n, k = 0, 1,..., 2 ** r-2).
[0147]
New dot sequences {Po [0], Po [1], Po [2], Po [3], Po [4]..., Po [n × 2 ** r], Po [N × 2 ** r + 1], Po [(n + 1) × 2 ** r−1]} is a point sequence of the outer periphery of the new character outline generated by the subdivided triangle. In the case of the point sequence on the outer periphery of the character hole, it can be reconstructed by the same processing.
[0148]
The character shape upper / lower convex polygon subdivision unit 22 reversibly divides the triangle once divided into coarse triangles by always performing subdivision from the 0 level if the original 0 level data is retained. Is possible. For example, when the level is raised to the r level, if it is desired to lower the level to the p level, the data at the r level is discarded and new data at the p level is generated from the 0 level. It will be done.
[0149]
The character-shaped side surface generation unit 23 performs processing similar to that of the character-shaped side surface generation unit 6 in the first embodiment and the bevel-shaped side surface generation unit 11 in the second embodiment, so Indexed surface data is generated, and this data is output to the texture coordinate generation unit 24.
[0150]
The texture coordinate generation unit 24 generates a minimum square including each component for the lower surface and the upper surface. Translate so that the lowest point of this square and the lowest point of the lower surface of the component overlap at the origin, find the coordinates of the point sequence after these parallel movements, and calculate the obtained coordinate value as the length of the side of the square The result is divided into mapping coordinates. This corresponds to the coordinates when the envelope square is normalized. For the side surface, the circumference (the sum of the distances between two consecutive points in the point sequence) is calculated for the closed curve that forms the outer periphery shape or hole shape, and the distance between the two points from the starting point to each point The lap length ratio is assigned as a parameter (0 ≦ s ≦ 1) indicating the distance from the starting point to each point (0 and 1 are assigned to the starting point). Regarding the height direction, t = 0 is assigned to the lower surface and t = 1 is assigned to the upper surface.
[0151]
A cylinder including each component (or all components) is provided, a cylindrical coordinate system is defined for this cylinder, the vertex of the component is projected from the center coordinate of the cylinder, and the coordinates in the cylindrical coordinate system are used to create a texture. Coordinates can be determined. However, the cylindrical coordinate system needs to be normalized. Also, a sphere including each component (or all components) is provided, a polar coordinate system is defined for this sphere, and texture coordinates can also be obtained using coordinate values in the polar coordinate system obtained by projecting the vertex of the component from the center of the sphere. Can be determined. However, the polar coordinate system needs to be normalized.
[0152]
The texture coordinates obtained as described above are added to the indexed surface data so as to coincide with the order of the point sequence coordinate data on the outer periphery of the indexed surface data, and are output to the character shape data output unit 25. In the character shape data output unit 25, the indexed surface data with texture coordinates on the upper and lower surfaces of each component of the character and the indexed surface with texture coordinates on the side surface of each component sent from the texture coordinate generation unit 24. The face data is grouped by hierarchical description and output to the outside. When the data format is converted, the data format is output after conversion.
As described above, interpolation between the points of the character outer peripheral point sequence and the hole outer peripheral point sequence is performed at an appropriate point, and polygon division is performed based on the interpolated point. Therefore, it becomes possible to create a more detailed three-dimensional character.
[0153]
(Embodiment 4)
In the first embodiment, an example of generating a three-dimensional character has been described. In the fourth embodiment, an example in which a columnar base or the like is provided below the three-dimensional character will be described. In the present embodiment, description of the same components as those in the first embodiment is omitted.
[0154]
FIG. 22 is a block diagram illustrating a functional configuration of the three-dimensional character data generation apparatus 401 in the fourth embodiment. The three-dimensional character data generation device 401 is newly provided with a pedestal shape generation unit 35, a character pedestal code input unit 31 instead of the character code input unit 1, and a character outer pedestal shape acquisition unit instead of the character outer periphery data acquisition unit 2. 32, the character outer periphery pedestal shape storage unit 33 instead of the character outer periphery data storage unit 3, the character pedestal shape structure analysis unit 34 instead of the character shape structure analysis unit 4, and the character shape instead of the character shape side surface generation unit 6. The side face generation unit 36 includes a character pedestal shape data output unit 37 instead of the character shape data output unit 7. The three-dimensional character data generation apparatus 401 configured as described above will be described in detail below.
[0155]
As with the character code input unit 1 of the first embodiment, the character pedestal code input unit 31 is an input device such as a so-called keyboard or mouse, converts these input signals, and converts character codes such as ASCII codes and JIS codes. In addition, a pedestal code for designating the shape of the pedestal is generated. The character code and pedestal code generated by the character pedestal code input unit 31 are output to the character outer pedestal shape acquisition unit 32.
[0156]
The character outer pedestal shape acquisition unit 32 acquires, from the character outer pedestal shape storage unit 33, the outline data of the character corresponding to the character code received from the character pedestal code input unit 31 and the three-dimensional shape data of the pedestal corresponding to the pedestal code. To do. Similar to the character outer periphery data storage unit 3 of the first embodiment, character outline data is stored in advance in the character outer periphery pedestal shape storage unit 33 corresponding to the character code. As for the three-dimensional shape data of the pedestal, the three-dimensional shape data of the pedestal corresponding to the pedestal code is stored in advance in the character outer pedestal shape storage unit 33. The outline data of the character acquired by the character outer periphery pedestal shape acquisition unit 32 and the three-dimensional shape data of the pedestal are output to the character pedestal shape structure analysis unit 34. In the three-dimensional shape data of the pedestal, it is assumed that which surface is the upper surface of the pedestal (hereinafter referred to as “pedestal upper surface”).
[0157]
The character pedestal shape structure analysis unit 34 generates character structure analysis result information for characters, as in the character shape structure analysis unit 4 of the first embodiment. As the character structure analysis result information, for each character hole, a unique character part that includes the hole is specified, and information indicating the inclusion relationship is created by the same method as in the first embodiment.
[0158]
In the character outer pedestal shape structure analysis unit 34, a boundary box of the entire character and its center coordinates (hereinafter referred to as “character center coordinates”), and a three-dimensional boundary box of the pedestal (hereinafter referred to as a rectangular parallelepiped shape) The center coordinate of the boundary box corresponding to the pedestal top surface (hereinafter referred to as the “pedestal center coordinate”) is obtained, and the center of the boundary box of the character and the center of the boundary box corresponding to the pedestal top surface are moved to coincide. . Further, an enlarged rectangle obtained by adding a predetermined margin amount to the character boundary box is obtained, and the minimum pedestal scaling amount is calculated so as to be included in the boundary box surface corresponding to the moved pedestal upper surface. The character structure analysis result information is sent to the character shape upper / lower convex polygon dividing unit 5 and processed in the same manner as in the first embodiment. In addition, the center coordinates and pedestal center coordinates of the character boundary box and the pedestal scaling amount are output to the pedestal shape generation unit 35.
[0159]
The pedestal shape generation unit 35 performs scaling conversion of the pedestal three-dimensional shape data with the pedestal scaling amount output from the character pedestal shape structure analysis unit 34, and the pedestal center coordinates obtained after the conversion are matched with the character center coordinates. Next, the pedestal is moved in parallel, and the three-dimensional coordinate value of the pedestal after the movement is corrected. These converted data are output to the character pedestal shape data output unit 37.
[0160]
In the character-shaped side surface generation unit 36, similarly to the character-shaped side surface generation unit 6 in the first embodiment and the bevel-shaped side surface generation unit 11 in the second embodiment, an upper surface, a lower surface, and a side surface are based on each component. And a bevel-shaped side surface is generated and sent to the character pedestal shape data output unit 37.
[0161]
In the character pedestal shape data output unit 37, the indexed surface of the upper surface, the lower surface, and the side surface based on the three-dimensional shape data of the pedestal and each component of the character sent from the pedestal shape generation unit 35 and the character shape side surface generation unit 36. The face data is grouped by hierarchical description and output to the outside. At that time, even if it is necessary to convert the data format, the data format is once converted and converted.
[0162]
FIG. 23 shows the appearance of a three-dimensional kanji “da” with a pedestal generated according to the fourth embodiment.
As described above, since it is possible to provide a base such as a columnar shape below the 3D character based on the 3D shape data of the pedestal, it is possible to display 3D characters with more various decorations. .
[0163]
(Embodiment 5)
In the fourth embodiment, the case where a three-dimensional character with a pedestal is generated based on the three-dimensional shape data of the pedestal has been described. In the fifth embodiment, the three-dimensional character with a pedestal is generated based on the outline data of the pedestal. An embodiment in the case of generating In the present embodiment, the description of the same components as those in the fourth embodiment is omitted.
[0164]
FIG. 24 is a block diagram illustrating a functional configuration of the three-dimensional character data generation apparatus 501 according to the fifth embodiment. The three-dimensional character data generation device 501 includes a character pedestal code input unit 41, a character pedestal outer periphery data acquisition unit 42, an outer periphery data storage unit 43, a character pedestal shape structure analysis unit 44, a character pedestal shape surface convex polygon dividing unit 45, a character pedestal. A shape side face generation unit 46 and a character pedestal shape data output unit 47 are included. The three-dimensional character data generation device 501 configured as described above will be described in detail below.
[0165]
As with the character code input unit 1 of the first embodiment, the character pedestal code input unit 41 is an input device such as a so-called keyboard or mouse, converts these input signals, and converts character codes such as ASCII codes and JIS codes. In addition, a pedestal code for designating pedestal outline data is generated. The character code and pedestal code generated by the character pedestal code input unit 41 are sent to the character pedestal outer circumference data acquisition unit 42.
[0166]
The character pedestal outer periphery data acquisition unit 42 acquires character outline data corresponding to the character code received from the character pedestal code input unit 41 and pedestal outline data corresponding to the pedestal code from the outer periphery data storage unit 43. The character outline data is stored in advance in the outer periphery data storage unit 43 in association with the character code, similarly to the character outer periphery data storage unit 3 of the first embodiment. Further, the outline data of the pedestal is also stored in advance in the outer periphery data storage unit 43 in association with the pedestal code. The character outline data and the pedestal outline data acquired by the character pedestal outer periphery data acquisition unit 42 are output to the character pedestal shape structure analysis unit 44. Here, when a hole is formed in the pedestal, outline data representing the hole is stored in the outer periphery data storage unit 43 in advance.
[0167]
The character pedestal shape structure analysis unit 44 generates character and pedestal structure analysis result information for each of the character outline data and the pedestal outline data, as in the character shape structure analysis unit 4 of the first embodiment. As the character structure analysis result information, the only character part that includes the hole is specified for each character hole, and when a hole is formed in the pedestal, the pedestal structural analysis result information is And the information representing the inclusion relationship is created by the same method as in the first embodiment. In addition, the character pedestal shape structure analysis unit 44 obtains the character center coordinates, the boundary box of the entire pedestal, and the pedestal center coordinates in the same manner as in the fourth embodiment, and the center of the character matches the center of the pedestal. To move. Further, an enlarged rectangle obtained by adding a predetermined margin amount to the character boundary box is obtained, and the minimum pedestal scaling amount is calculated so that this is included in the boundary box surface corresponding to the pedestal upper surface. Character and pedestal structural analysis result information, character center coordinates and pedestal center coordinates, and pedestal scaling amounts are output to the character pedestal-shaped surface convex polygon dividing unit 45.
[0168]
The character pedestal-shaped surface convex polygon dividing unit 45 performs processing on the character components in the same manner as in the first embodiment, and performs scaling conversion on the pedestal components by the pedestal scaling amount, The same processing as for characters is performed on the data that has been translated so that the center coordinates of the boundary box and the center coordinates of the pedestal boundary box coincide. The indexed surface data of each component of the character and the pedestal as the processing result is output to the character pedestal shape side surface generation unit 46.
[0169]
In the character pedestal side surface generation unit 46, similar to the character shape side surface generation unit 6 of the first embodiment and the bevel shape side surface generation unit 11 of the second embodiment, the upper and lower surfaces of each component of the character and the pedestal, Produce side or bevel-shaped sides. The generated pedestal components are further translated in the downward direction of the z-axis by an amount corresponding to the rising amount after the generation. However, when the side surface of the base is generated by rotation conversion, reverse rotation conversion is performed by the amount of rotation at that time. The character generated by the above processing and the pedestal components are output to the character pedestal shape data output unit 47 of the indexed surface data of the upper, lower, and side surfaces of the constituent elements.
[0170]
In the character pedestal shape data output unit 47, the characters sent from the character pedestal shape side surface generation unit 46 and the indexed surface data of the upper and lower surfaces and side surfaces of each component of the pedestal are combined into a hierarchical description, and then sent to the outside. Output. When it is necessary to convert the data format to cylindrical coordinates or polar coordinates, the data format is output after conversion to the data format.
In the fourth and fifth embodiments, the lower surface of the three-dimensional shape of the character is not visible because it is connected to the pedestal, so it can be omitted, and the data amount can be reduced by this omission.
[0171]
As described above, since it is possible to provide a pedestal such as a columnar shape below the three-dimensional character based on the outline data of the pedestal, it is possible to display a three-dimensional character with more various decorations.
[0172]
(Embodiment 6)
In the sixth embodiment, an example of generating a three-dimensional stamp plate will be described. Note that in this embodiment, description of the same components as those in the above embodiment is omitted.
[0173]
FIG. 25 is a block diagram illustrating a functional configuration of the three-dimensional character data generation apparatus 601 according to the sixth embodiment. The three-dimensional character data generation device 601 includes a character stamp plate code input unit 51, a character stamp plate outer periphery data acquisition unit 52, an outer periphery data storage unit 53, a character stamp plate shape structure analysis unit 54, and a character stamp plate shape surface convex polygon dividing unit. 55, a character stamped plate shape side surface generation unit 56 and a character stamped plate shape data output unit 57. The three-dimensional character data generation device 601 configured as described above will be described in detail below.
[0174]
Similar to the character code input unit 1 of the first embodiment, the character engraving plate code input unit 51 is an input device such as a so-called keyboard and mouse, converts these input signals, and character codes such as ASCII code and JIS code. In addition to the above, a stamp plate code for designating the outline data of the stamp plate is generated. The character code and the stamp plate code generated by the character stamp plate code input unit 51 are output to the character stamp plate outer periphery data acquisition unit 52.
[0175]
The character stamp plate outer periphery data acquisition unit 52 receives the character outline data corresponding to the character code received from the character stamp plate code input unit 51 and the stamp plate outline data corresponding to the stamp plate code from the outer periphery data storage unit 43. get. As for the character outline data, the character outline data is stored in advance in the outer periphery data storage unit 53 corresponding to the character code, as in the character outer periphery data storage unit 3 of the first embodiment. As for the outline data of the marking plate, the outline data of the marking plate corresponding to the marking plate code is stored in the outer circumference data storage unit 53 in advance. The character outline data and the stamp outline data acquired by the character stamp outer peripheral data acquisition unit 52 are output to the character stamp plate shape structure analysis unit 54. Here, when a hole is formed in the marking plate, outline data corresponding to the hole is stored in the outer circumference data storage unit 53 in advance.
[0176]
First, the character engraving plate shape structure analysis unit 54 obtains the rectangular boundary box of the entire character and its rectangular center coordinates, and the rectangular boundary box of the entire engraving plate and its rectangular center coordinate, and determines the center of the character boundary box. Move so that the center of the stamping board's boundary box matches. Further, an enlarged rectangle obtained by adding a predetermined margin amount to the character boundary box is obtained, and the minimum stamping plate scaling amount is calculated so that this is included in the boundary box surface corresponding to the upper surface of the stamping plate. Next, the point sequence on the outer periphery of the stamp plate is scaled with the stamp plate scaling amount, and the character plate's rectangular center coordinate and the translated plate's rectangular center coordinate after the scaling conversion are translated to match the new stamp plate. Outline data.
[0177]
Similar to the character shape structure analysis unit 4 of the first embodiment, the character outline data and the new stamp plate outline data are generated for the character outline data and the new stamp plate outline data. As the character structure analysis result information, for each character hole, the only character part that includes the hole is specified. Further, as the structure analysis result information of the stamp plate, when the stamp plate has a hole, the stamp plate including the hole is specified, and the information representing the inclusion relationship is the same method as in the first embodiment. Created by. However, the structure analysis result information of the stamp plate generated here is information applied to the lower surface of the stamp plate shape (this is referred to as “the lower surface of the stamp plate”). In addition, the new outline data of the stamped board and the outline data of the character, the order of the dot sequence on the outer periphery of the character outline and the dot sequence on the outer periphery of the character hole (character outline is used as a character hole, and character hole is used as a character As with the character shape structure analysis unit 4 of the first embodiment, the structure analysis result information is also generated for the data obtained by merging the data with the combination of the shape corresponding to the outer shape and the like. However, the structure analysis result information of the stamp plate generated here is information applied to the upper surface of the stamp plate shape.
[0178]
The character marking plate-shaped surface convex polygon dividing unit 55 performs processing on the components of the character and the marking plate upper and lower surfaces in the same manner as the character shape upper and lower surface convex polygon dividing unit 5 of the first embodiment. FIGS. 26A to 26C are examples showing the state after the division (in this example, there are one character and one component on the upper and lower surfaces of the stamp plate). The processed character and the indexed surface data of each component on the upper and lower surfaces of the stamp plate are sent to the character stamp plate shape side surface generation unit 56.
[0179]
In the character marking plate shape side surface generation unit 56, similar to the character shape side surface generation unit 6 of the first embodiment and the bevel shape side surface generation unit 11 of the second embodiment, the upper and lower surfaces of each component of the marking plate, Produce side or bevel shaped sides. Next, move each partial structure on the upper surface of the character to the lower side of the z-axis (corresponding to the depth of the digging and must be smaller than the height of the start) with respect to the z-axis position on the upper surface of the stamping plate. Then, the lower surface of the engraved portion on the upper surface of the marking plate is generated. Finally, the side surface of the digging portion is generated by the same processing as that of the character-shaped side surface generation unit 6 of the first embodiment, with the corresponding points on the lower surface of the digging portion and the upper surface of the engraving plate. This is the reverse of the first embodiment.
The characters generated by the above processing and the components of the stamp plate are output to the character stamp plate shape data output unit 57 for the indexed surface data of the upper, lower, and side surfaces of the components.
[0180]
The character stamped plate shape data output unit 57 combines the characters output from the character stamped plate shape side surface generating unit 56 with the indexed surface data of the upper and lower surfaces and side surfaces of each component of the stamped plate by a hierarchical description. Output to the outside. When it is necessary to convert the data format to cylindrical coordinates or polar coordinates, the data format is output after conversion to the data format.
[0181]
As described above, since it is possible to generate a stamp plate including a three-dimensional character based on the outline data of the stamp plate, it is possible to display a more complicated three-dimensional character having a concave shape.
In the first to sixth embodiments described above, it is also possible to process a continuous character string by sequentially repeating the processing one character at a time. Further, in order to correspond to a character string with one pedestal or one stamping plate, the character boundary box may be expanded to the boundary box of the entire character string.
[0182]
Furthermore, in the above embodiment, the description has been made mainly for characters including holes. However, general shapes having holes (including graphic parts constituting the shapes) are also configured in the same manner as described above. 3D data that can automatically display a high-quality 3D figure can be generated.
[0183]
【The invention's effect】
As described above, the three-dimensional character data generation device according to the present invention is a device that generates three-dimensional character data from two-dimensional character data. And an outer periphery determining means for determining the outer periphery of the hole formed in the character, and a character having an inclusive relationship with the outer periphery of the hole determined by the outer periphery determining means, and in a position closest to the outer periphery of the hole An inclusion relation specifying means for specifying the outer periphery of the part, and an area obtained by removing the inner area of the outer periphery of the hole in the inclusion relation with the character part from the inner area of the outer periphery of the character part specified by the inclusion relation specifying means. For the outer periphery of the character part that is not specified and divided, the dividing means for dividing the inner area into polygons, and the copy of the character part related to the area divided by the dividing means are moved, Characterized in that it comprises a side surface generating means for generating a side from the apex of the shaped component and the cloning character parts.
[0184]
As a result, 3D character data is generated automatically and in real time from the contour data of the given 2D character without bothering the operator, and the 3D character generated based on the bitmap font. Compared to the above, it becomes possible to generate a three-dimensional character with much higher quality.
[0185]
In the three-dimensional character data generation device according to the present invention, the two-dimensional character data is outline data defined by a two-dimensional plane representing the outline of the character or the outline of the hole, and the outer periphery determining means includes the outline Data is obtained, and the outline data is classified into first outline data representing the outline of the character and second outline data representing the outline of the hole, and the outer periphery of the character part is based on the classified first outline data. And the outer periphery of the hole is determined based on the classified second outline data.
[0186]
The inclusion relationship specifying means is determined by a first determining unit that determines a rectangle that surrounds the outer periphery of the character part, a second determining unit that determines a rectangle that surrounds the outer periphery of the hole, and the first determining unit. A first specifying unit that specifies a rectangle surrounding the outer periphery of one or more character parts including the rectangle surrounding the outer periphery of the hole by comparing the rectangle determined by the second determining unit and the rectangle determined by the second determining unit; Among the rectangles specified by the first specifying unit, the second specifying unit that specifies the outer periphery of the character part related to the innermost rectangle, and the outer periphery of the character part specified by the second specifying unit are An inclusion information creating unit that identifies the circumference of the only character part including the circumference and creates information representing the inclusion relation is provided.
[0187]
The inclusion relationship specifying means is determined by a first determination unit that determines a rectangle that surrounds the outer periphery of the character part, a second determination unit that determines a rectangle that surrounds the outer periphery of the hole, and the second determination unit. One of the distance between the center of gravity of the rectangle related to the outer periphery of the hole and each side of the rectangle related to the outer periphery of the character part determined by the first determining unit, or one of the point sequence related to the center of gravity and the character part Compare the shortest distance determined by the shortest distance determiner with the shortest distance determined by the shortest distance determiner for all character parts, and determine the shortest shortest A character component related to the distance may be determined to be the only character component outer periphery including the outer periphery of the hole, and an inclusion information creating unit that creates information representing the inclusion relationship may be provided.
[0188]
As a result, a geometric structure analysis is performed on the character represented by the outline data, so the character structure such as whether or not a character hole is formed in the character is clarified, and each character component constituting the character 3D display is also possible. In other words, since it is clear whether or not the generated three-dimensional character has a hierarchical structure, it is finely divided into character parts when editing the character shape or performing animation. 3D display is possible.
[0189]
Further, the three-dimensional character data generation device further generates a minimum square including the lower surface and the upper surface of the component of the character part, and a sequence of points defining the upper surface and the lower surface of the component Translating the square so that it is included in the square, the individual coordinate values in the component are specified, the coordinate value obtained by dividing the coordinate value by the length of the side of the square is the mapping coordinate, and the generation The ratio of the sum of the distances between the two points in the outer peripheral point sequence that defines the side face and the distance from the starting point to each point, the height from the lower surface to the upper surface, and the height of each point in the outer peripheral point sequence Based on the ratio, texture coordinate generation means for generating texture coordinates can be provided.
[0190]
Thereby, since texture coordinates are generated, various texture patterns can be applied to the three-dimensional character surface.
[0191]
Further, the three-dimensional character data generation apparatus further includes a reference by dividing an average distance between two consecutive points by a predetermined value with respect to the point sequence included in the first outline data or the second outline data. A data interpolating unit for newly interpolating one or a plurality of points between the two points is provided so that the distance is calculated and the distance between two consecutive points is equal to or smaller than the reference distance when the distance is equal to or larger than the reference distance. It may be configured.
[0192]
Furthermore, the three-dimensional character data generation device may include a subdivision unit that subdivides the convex polygon divided by the division unit.
[0193]
As a result, points are interpolated with respect to the character outer peripheral point sequence and hole outer peripheral point sequence, and the divided polygons are subdivided to perform polygon division more finely, thus further improving the quality of the three-dimensional shape. Can be achieved.
[0194]
Further, the three-dimensional character data generation device according to the present invention is based on the outline data of the character corresponding to the character code, the three-dimensional shape data of the pedestal corresponding to the pedestal code, and the pedestal outline data corresponding to the pedestal code, Based on the outline data of the character corresponding to the character code and the outline data of the engraving plate corresponding to the engraving plate code, the character which has been dug in a concave shape in 3D is installed on the pedestal. It can also be configured to display. Further, a bevel shape can be generated as the shape of the side surface of these three-dimensional characters.
[0195]
As a result, it is possible to install characters on the pedestal and to make a character stamped plate, and to generate various bevel shapes for the side surface shape, so it is possible to flexibly respond to various requirements for three-dimensional display of characters. It becomes.
[0196]
The three-dimensional graphic data generating apparatus according to the present invention is an apparatus for generating three-dimensional graphic data from two-dimensional graphic data. The two-dimensional graphic data is used to create an outer periphery of a graphic component constituting the graphic and the graphic. An outer periphery determining means for determining the outer periphery of the hole formed on the outer periphery of the graphic component having an inclusive relationship with the outer periphery of the hole determined by the outer periphery determining means and at a position closest to the outer periphery of the hole Including an inclusion relation specifying means for identifying the area, and dividing the area from the inner area of the outer periphery of the graphic part specified by the inclusion relation specifying means by excluding the inner area of the outer periphery of the hole in the inclusion relation with the graphic part, For the outer periphery of the graphic part that is not specified, a dividing unit that divides the internal region into polygons, and a copy of the graphic part related to the region divided by the dividing unit are moved, and the graphic part is moved. Characterized in that it comprises a side surface generating means for generating a side from the apex of said replicated figure component.
[0197]
As a result, even for a figure in which a hole is formed, three-dimensional data is automatically generated in real time from the contour data of the given two-dimensional figure without bothering the operator. Compared to a three-dimensional graphic generated based on a map font, a much higher quality three-dimensional graphic can be generated.
From the above, it is considered that the effects of the present invention are enormous and bring new benefits.
[Brief description of the drawings]
FIG. 1 is a block diagram showing a functional configuration of a three-dimensional character data generation apparatus according to Embodiment 1. FIG.
FIG. 2 is a diagram showing how to follow a character outer periphery point sequence and a hole outer periphery point sequence;
FIG. 3 is a schematic diagram in a case where a character shape structure analysis is performed with respect to a Chinese character “times”.
4 is a flowchart showing a detailed processing flow in the inclusion relationship analysis processing in FIG. 3; FIG.
FIG. 5 is a diagram showing a state in which the first connection method is applied to the Chinese character “field” and the point sequence number is changed.
FIG. 6A is a diagram illustrating an example of a processing result when the first triangulation method is applied to “field”.
(B) is a figure which shows the example of the processing result at the time of applying the 2nd triangulation method to "field".
FIG. 7 is a diagram illustrating an example of a processing result when the second triangulation method is applied to a Russian word “ё”;
FIG. 8 is a flowchart showing a flow of character shape side surface generation processing in a character shape side surface generation unit;
FIG. 9A is a diagram showing an outline of a first method for moving the upper surface of a character in the height direction;
(B) is a figure which shows the outline | summary of the 2nd method of moving the upper surface of a character to a height direction.
(C) is a figure which shows the outline | summary of the 3rd method of moving the upper surface of a character to a height direction.
(D) is a figure which shows the outline | summary of the 4th method of moving the upper surface of a character to a height direction.
10 is a block diagram showing a functional configuration of a three-dimensional character data generation device according to Embodiment 2. FIG.
FIG. 11A is a diagram showing the simplest bevel-shaped outer shape.
(B) is a figure for demonstrating the production | generation method of a bevel-shaped intermediate | middle outer periphery.
FIG. 12 is a flowchart showing a flow of processing in intermediate outer periphery generation processing.
FIG. 13A is a diagram showing an outline when two intermediate outer peripheries are generated in order to form a convex side surface.
(B) is a figure which shows the outline | summary in the case of producing | generating two intermediate | middle outer periphery in order to form a concave side surface.
FIG. 14A is a diagram showing the shape of a side surface that is convex in a semicircular shape.
(B) is a figure which shows the shape of the side surface which is concave in semicircle shape.
(C) is a figure for demonstrating the calculation method of each value in the intermediate | middle outer periphery of the side surface convex in a semicircle shape.
FIG. 15 is a diagram for explaining a case where a bevel-shaped side surface of a mold type is generated.
FIG. 16A is a diagram showing a shape of a side surface when the upper surface of the character in the first embodiment is lifted vertically in the height direction.
(B) is the example which produced | generated the side surface of the bevel shape which the cross section protruded in the convex hexagonal shape.
(C) is an example in which two intermediate outer peripheries are generated, and the cross section of the side surface in the case where the scraping angles with respect to the outer peripheries of the upper and lower surfaces of the character are equal is a convex bevel shape.
(D) is an example in which the shape of the side surface is a mold-type bevel shape.
FIG. 17 is a block diagram illustrating a functional configuration of the three-dimensional character data generation device according to the third embodiment.
FIG. 18 is a diagram illustrating an example of a case where a new point is interpolated between two points for the Kanji “times”.
FIG. 19 is a flowchart showing a flow of processing in a method for re-dividing an original triangle into four parts.
FIG. 20 is a flowchart showing a flow of processing in a re-division method when the level of triangle re-division is to be set to r.
FIG. 21A is a diagram for explaining a method of performing inner division using a midpoint of a triangle side;
(B) is a figure which shows a mode in the case of raising the subdivision level of a triangle from the level 0 to the level r at a stretch.
FIG. 22 is a block diagram illustrating a functional configuration of the three-dimensional character data generation device according to the fourth embodiment.
FIG. 23 is a diagram for explaining a character shape with a base.
FIG. 24 is a block diagram showing a functional configuration of a three-dimensional character data generation apparatus according to Embodiment 5.
FIG. 25 is a block diagram illustrating a functional configuration of the three-dimensional character data generation device according to the sixth embodiment.
FIG. 26A is a view for explaining the upper surface of the marking plate.
(B) It is a figure for demonstrating the character engraving part lower surface of a stamping board.
(C) It is a figure for demonstrating the marking plate lower surface.
FIG. 27 is a functional block diagram of a conventional three-dimensional character creation device.
[Explanation of symbols]
101, 102, 3D character data generator
103, 104,
105, 106
1 Character code input part
2-character circumference data acquisition unit
3 Character circumference data storage
4 Character shape structure analysis part
5 Character shape top and bottom convex polygon division
6, 36 Character side face generator
7, 12, 25 Character shape data output section
11 Bevel-shaped side generator
21 Character circumference data interpolation part
22 Character shape top and bottom convex polygon subdivision section
23 Character shape side face generator
24 Texture coordinate generator
31, 41 Character pedestal code input section
32 character outer pedestal shape acquisition part
33 Character outer periphery pedestal shape storage
34, 44 Character base shape structure analysis part
35 Base shape generator
37, 47 Character base shape data output section
42 Character base outer circumference data acquisition part
43, 53 Peripheral data storage unit
45 Character pedestal shaped surface convex polygon division
46 Character pedestal side view generator
51 character stamp board code input section
52 Character stamping board outer circumference data acquisition part
54 Character stamping plate shape structure analysis part
55 Character stamping plate shape surface convex polygon division
56 Character engraving plate shape side face generator
57 Character stamp plate shape data output section

Claims (1)

文字コードと刻印板コードを入力するための文字刻印板コード入力手段と、
前記文字コードに対応する文字のアウトラインデータと前記刻印板コードに対応する刻印板のアウトラインデータを記憶する外周データ記憶手段と、
前記文字刻印板コード入力手段によって入力された文字コードと刻印板コードに基づいて、前記外周データ記憶手段から文字及び刻印板のアウトラインデータを取得する文字外周刻印板形状取得手段と、
前記文字外周刻印板形状取得手段において取得された文字のアウトラインデータに基づいて、前記文字の外周と当該文字に形成されている穴の外周の包含関係を解析して文字を構成する構成要素を特定し、前記刻印板の中に前記文字が存置し得る条件を算出し、その条件に基づいて刻印板のアウトラインデータを変換し、変換後の刻印板のアウトラインデータに基づいて、前記刻印板の外周と当該刻印板に形成されている穴の外周の包含関係を解析して刻印板下面を構成する構成要素を特定し、文字の外形を表す外周の点列を文字の穴を表す点列に変換し、文字の穴を表す外周の点列を文字の外形を表す点列に変換し、これら変換された点列に基づく新たな文字のアウトラインデータと前記変換後の刻印板のアウトラインデータとを合併したアウトラインデータを生成し、当該合併されたアウトラインデータに基づいて、前記変換後のアウトラインデータに係る刻印板の外周と前記新たなアウトラインデータに係る文字の外周の包含関係を解析して刻印板上面を構成する構成要素を特定する文字刻印板形状構造解析手段と、
前記文字刻印板形状構造解析手段において特定された文字と刻印板上面及び下面の構成要素ごとに、凸ポリゴンに分割する文字刻印板形状面凸ポリゴン分割手段と、
前記文字刻印板形状面凸ポリゴン分割手段においてポリゴン分割された刻印板の各構成要素を空間的に移動して刻印板の上面、下面及び側面を生成し、文字の上面の構成要素を所定の深さ分だけ空間的に移動して刻印板の堀込み部の下面と側面を生成する文字刻印板形状側面生成手段と
を備えることを特徴とする3次元図形データ生成装置。
A character stamp plate code input means for inputting a character code and a stamp plate code;
Outer circumference data storage means for storing outline data of characters corresponding to the character code and outline data of a stamp plate corresponding to the stamp plate code;
Based on the character code and the stamp plate code input by the character stamp plate code input means, the character outer periphery stamp plate shape acquisition means for acquiring outline data of the characters and the stamp plate from the outer periphery data storage means,
Based on the outline data of the character acquired by the character outer peripheral stamping plate shape acquisition means, the component constituting the character is identified by analyzing the inclusion relation between the outer periphery of the character and the outer periphery of the hole formed in the character Calculating the conditions under which the characters can be placed in the stamp plate, converting the outline data of the stamp plate based on the conditions, and based on the outline data of the stamp plate after conversion, the outer circumference of the stamp plate The components that make up the lower surface of the stamping plate are identified by analyzing the inclusive relationship of the outer periphery of the hole formed on the stamping plate, and the point sequence of the outer periphery representing the outer shape of the character is converted into the point sequence representing the hole of the character Then, the point sequence on the outer periphery representing the hole of the character is converted into a point sequence representing the outer shape of the character, and the outline data of the new character based on the converted point sequence and the outline data of the stamped plate after the conversion are merged. did Generate outline data, and based on the merged outline data, analyze the inclusion relation between the outer periphery of the stamp plate related to the converted outline data and the outer periphery of the character related to the new outline data, and the upper surface of the stamp plate A character-stamped plate shape structure analyzing means for specifying the constituent elements constituting
Character marking plate shape surface convex polygon dividing means for dividing the character identified in the character stamp plate shape structure analyzing means and each component of the marking plate upper surface and lower surface into convex polygons;
The character marking plate shape surface convex polygon dividing means spatially moves each component of the marking plate divided into polygons to generate an upper surface, a lower surface, and a side surface of the stamp plate, and the components on the upper surface of the character are moved to a predetermined depth. A three-dimensional graphic data generation apparatus comprising character marking plate-shaped side surface generation means for generating a lower surface and a side surface of a stamped plate by moving spatially .
JP2001371077A 2000-12-05 2001-12-05 3D graphic data generator Expired - Fee Related JP4028979B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2001371077A JP4028979B2 (en) 2000-12-05 2001-12-05 3D graphic data generator

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
JP2000369563 2000-12-05
JP2000-369563 2000-12-05
JP2001371077A JP4028979B2 (en) 2000-12-05 2001-12-05 3D graphic data generator

Publications (3)

Publication Number Publication Date
JP2002260008A JP2002260008A (en) 2002-09-13
JP2002260008A5 JP2002260008A5 (en) 2005-07-21
JP4028979B2 true JP4028979B2 (en) 2008-01-09

Family

ID=26605239

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2001371077A Expired - Fee Related JP4028979B2 (en) 2000-12-05 2001-12-05 3D graphic data generator

Country Status (1)

Country Link
JP (1) JP4028979B2 (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4693660B2 (en) 2006-03-10 2011-06-01 株式会社東芝 Drawing apparatus, drawing method, and drawing program
US7719531B2 (en) * 2006-05-05 2010-05-18 Microsoft Corporation Editing text within a three-dimensional graphic
US8643644B2 (en) 2008-03-20 2014-02-04 Qualcomm Incorporated Multi-stage tessellation for graphics rendering
US8896593B2 (en) * 2011-06-06 2014-11-25 Monotype Imaging Inc. Producing three-dimensional graphics
CN110414645B (en) * 2018-04-28 2023-05-30 深圳果力智能科技有限公司 Pattern recognition method based on element matching
CN110136247B (en) * 2019-05-17 2023-03-24 杭州电子科技大学 Quick splicing and cutting method for three-dimensional model of digital city
CN117893637B (en) * 2024-03-15 2024-06-11 杭州广立微电子股份有限公司 Data processing method and device

Also Published As

Publication number Publication date
JP2002260008A (en) 2002-09-13

Similar Documents

Publication Publication Date Title
US6850239B2 (en) 3-D character data generating device and a 3-D graphics data generating device
JP5562075B2 (en) Method and apparatus for creating surface processing data
Gregory et al. Interactive surface decomposition for polyhedral morphing
EP0950988B1 (en) Three-Dimensional image generating apparatus
US5774124A (en) Finite element modeling method and computer system for converting a triangular mesh surface to a quadrilateral mesh surface
KR100219072B1 (en) Font transformation and rasterizing method using medial axis transform
KR20070110198A (en) System and method for mesh and body hybrid modeling using 3d scan data
CN103679627A (en) Tile based computer graphics
JP4679757B2 (en) 3D graphic generation apparatus and 3D graphic generation method
JPH08110950A (en) Plotting device and method utilizing hierarchical approximation system for graphic data
KR20080107963A (en) System and method for calculating loft surfaces using 3d scan data
Lin et al. Metamorphosis of 3d polyhedral models using progressive connectivity transformations
CN108876868B (en) Computerized generation of decorative designs by placing instances of simple shapes according to direction guidance
Olsen et al. Image-assisted modeling from sketches.
JP4028979B2 (en) 3D graphic data generator
JP2009301284A (en) Drawing device and method
JP2017045138A (en) Polygon model structuring apparatus and three-dimensional object shaping data reduction apparatus
CN108897912B (en) Hole decorative plate design and arrangement method based on circular piles
CN115082640A (en) Single image-based 3D face model texture reconstruction method and equipment
KR101098830B1 (en) Surface texture mapping apparatus and its method
CN110853146A (en) Relief modeling method and system and relief processing equipment
JP2021033375A (en) Apparatus for editing three-dimensional shape data and program for editing three-dimensional shape data
KR100450210B1 (en) System and method for compositing three dimension scan face model and recording medium having program for three dimension scan face model composition function
JP6388489B2 (en) Method and apparatus for creating data for surface processing
CN114154259B (en) Three-dimensional pole tower modeling method based on contour input

Legal Events

Date Code Title Description
A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20041201

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20041201

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070615

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070626

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070827

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: 20070918

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071015

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

Free format text: PAYMENT UNTIL: 20101019

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Ref document number: 4028979

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

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

Free format text: PAYMENT UNTIL: 20111019

Year of fee payment: 4

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

Free format text: PAYMENT UNTIL: 20121019

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20131019

Year of fee payment: 6

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees