JPH01239676A - Polyhedron inside/outside setting method - Google Patents
Polyhedron inside/outside setting methodInfo
- Publication number
- JPH01239676A JPH01239676A JP63066504A JP6650488A JPH01239676A JP H01239676 A JPH01239676 A JP H01239676A JP 63066504 A JP63066504 A JP 63066504A JP 6650488 A JP6650488 A JP 6650488A JP H01239676 A JPH01239676 A JP H01239676A
- Authority
- JP
- Japan
- Prior art keywords
- polyhedron
- straight line
- point
- plane
- setting
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims description 9
- 239000013598 vector Substances 0.000 claims abstract description 13
- 239000000470 constituent Substances 0.000 claims description 13
- 230000002950 deficient Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 5
- 230000005484 gravity Effects 0.000 description 5
- 230000000694 effects Effects 0.000 description 2
- 230000008030 elimination Effects 0.000 description 1
- 238000003379 elimination reaction Methods 0.000 description 1
- 239000012528 membrane Substances 0.000 description 1
Landscapes
- Processing Or Creating Images (AREA)
- Image Generation (AREA)
Abstract
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、コンピュータ・グラフィクスやCAD/CA
Mなどにおける多面体内外設定方法に関する。[Detailed Description of the Invention] [Field of Industrial Application] The present invention is applicable to computer graphics, CAD/CA
This paper relates to a method for setting the inside and outside of a polyhedron in M, etc.
多面体の表わし方には様々なものがあるが、基本的には
頂点、辺、面を設定すればよい。この際、面の表裏を設
定することにより、多面体の内部と外部が識別でき、体
猜や質量計算、断面図作成、有限要素法のメツシュ分割
などに役立つ。また、コンピュータ・グラフィクスにお
いては効率のため、表を向いている面のみ表示すること
が多い。There are various ways to represent a polyhedron, but basically you just need to set vertices, edges, and faces. At this time, by setting the front and back sides of the faces, the inside and outside of the polyhedron can be identified, which is useful for body size and mass calculations, cross-sectional diagram creation, mesh division using finite element methods, etc. Furthermore, in computer graphics, for efficiency, only the face facing forward is often displayed.
面の表裏は、その面を構成する頂点または辺の順序づけ
により設定される。たとえば、第2図のように、面の各
頂点を物体の外から見て反時計回りになるように順序づ
けて並べ、各頂点をたどって右ネジの進む方向を面の表
側と約束する方法などがある。The front and back sides of a surface are determined by the ordering of the vertices or edges that make up the surface. For example, as shown in Figure 2, the vertices of the surface are arranged in order in a counterclockwise direction when viewed from the outside of the object, and each vertex is traced to ensure that the direction in which the right-handed screw advances is the front side of the surface. There is.
従来は、面の表裏の設定のための頂点または辺の順序づ
けは、多面体作成の際に、作業者が手作業で行なってい
た。Conventionally, an operator manually orders the vertices or edges to set the front and back sides of a surface when creating a polyhedron.
上記のような頂点または辺の順序づけは、面を構成する
ための隣接関係をもった頂点列(または辺の列)゛の設
定と、その頂点列の向き、すなわち時計回りか反時計回
りかの設定の2つの作業に分けられる。隣接関係をもっ
た頂点列とは、たとえば第2図で面で1については、v
l、v2.v3゜v4またはその道順のv4.v3.v
2.vlである。面の表裏を設定するにはこのうちどち
らがを選ばなければならない。The ordering of vertices or edges as described above involves the setting of a vertex row (or edge row) with adjacency to form a surface, and the direction of the vertex row, i.e., clockwise or counterclockwise. The settings can be divided into two tasks. A vertex sequence with an adjacency relationship is, for example, for the surface 1 in Figure 2, v
l, v2. v3゜v4 or its directions v4. v3. v
2. It is vl. To set the front and back sides of a face, you must choose one of these.
このような作業は、作業者が3次元空間を想定して行な
わねばならない。頂点列の隣接関係の設定は比較的容易
であるが、頂点列の向きの設定は誤りが多く、注意を要
するという問題点があった。Such work requires the operator to imagine a three-dimensional space. Although it is relatively easy to set the adjacency relationship between vertex rows, there are many errors in setting the orientation of vertex rows, which requires caution.
本発明は、上記の問題点を解決するために、頂点列の向
きを自動的に設定することを目的としている。The present invention aims to automatically set the orientation of a vertex sequence in order to solve the above problems.
本発明の方法は、上記多面体上に存在する任意の点を出
発点として上記多面体と交差するような方向に直線をの
ばして、上記多面体と上記直線の交点のうち上記出発点
から最も距離の遠い点を内部に含む上記多面体の構成面
を求め、上記構成面の表の方向を上記直線の方向ベクト
ルにもとづいて設定し、上記構成面を基準にして上記多
面体の他のすべての面の表の方向を設定することを特徴
とする。The method of the present invention starts from an arbitrary point existing on the polyhedron and extends a straight line in a direction that intersects the polyhedron, and the distance from the point of intersection of the polyhedron and the straight line that is the farthest from the starting point is Find the constituent faces of the polyhedron containing points inside, set the direction of the face of the constituent faces based on the direction vector of the straight line, and calculate the faces of all other faces of the polyhedron based on the constituent faces. It is characterized by setting the direction.
まず、多面体に交差する直線を用意する。そのためには
、第4図に示すように、多面体上に存在する点Pを設定
し、点Pを通りy軸に平行な直線をのばす。このような
直線は多面体と交差する確率が高い。First, prepare a straight line that intersects the polyhedron. To do this, as shown in FIG. 4, a point P existing on the polyhedron is set, and a straight line passing through the point P and parallel to the y-axis is extended. Such a straight line has a high probability of intersecting a polyhedron.
次に、上記直線と多面体の交点のうち、y座環値が最大
となる交点Qを選び、その交点Qにおいて上記直線と交
差する多面体の構成面をRとする。交点Qが多面体の辺
上にあったり、点Pが多面体のy軸に平行な側面上にあ
って多面体とうまく交差しない場合などは、点PのXま
たは2座標値にゆらぎを与え、上記直線が多面体の面と
交差するようにする。Next, from among the intersections of the above straight line and the polyhedron, the intersection Q where the y-located ring value is maximum is selected, and the constituent face of the polyhedron that intersects the above straight line at the intersection Q is set as R. If the intersection point Q is on a side of the polyhedron, or if the point P is on a side parallel to the y-axis of the polyhedron and does not intersect the polyhedron well, the intersect with the faces of the polyhedron.
次に、面Rの法線ベクトルのy成分が正となるように、
面Rの法線ベクトルを定め、その向きを而Rの表側とす
る。面Rを基準に多面体のすべての面の法線ベクトルを
決定していく、すべての面の表の方向がわかれば、多面
体の内部と外部が設定できたことになる。Next, so that the y component of the normal vector of surface R is positive,
Determine the normal vector of surface R, and set its direction as the front side of R. Determine the normal vectors of all the faces of the polyhedron based on the surface R. If you know the direction of the front of all the faces, you can set the inside and outside of the polyhedron.
第3図は、多面体の構成情報の一例を示す説明図である
。多面体の各頂点のx、y、z座標値(第3図(a))
、各辺を構成する頂点の組(第3図(b))および各面
を構成する頂点列(第3図(C))により多面体の形状
が表現される。FIG. 3 is an explanatory diagram showing an example of configuration information of a polyhedron. x, y, z coordinate values of each vertex of the polyhedron (Figure 3 (a))
, the shape of a polyhedron is expressed by a set of vertices forming each side (FIG. 3(b)) and a row of vertices forming each face (FIG. 3(C)).
面の情報として頂点列ではなく、面を構成する辺の列を
用いてもよいし、また、この他にもウィングド・エツジ
・データ構造(PIXEL Nα13 rCAD/C
AMユーザーのための形状モデリング入門」参照)など
様々なデータ構造があるが、どのデータ構造を用いても
、面の表裏を決定するのは面を構成する頂点くまたは辺
)の並ぶ順序である。したがって、ここでは第3図に示
すデータ構造に基づいて説明するが、これは−膜性を失
うものではない。Instead of the vertex sequence, a sequence of edges constituting the surface may be used as information about the surface. In addition, the winged edge data structure (PIXEL Nα13 rCAD/C
There are various data structures such as "Introduction to Shape Modeling for AM Users"), but no matter which data structure is used, what determines the front and back of a surface is the order in which the vertices or edges that make up the surface are arranged. . Therefore, although explanation will be given here based on the data structure shown in FIG. 3, this does not mean that it loses its membrane properties.
第2図は、面の表裏の設定の取り決め方を示す概念図で
ある。面f1の表裏を決めるのに、多面体の外から見て
各頂点が反時計回りになるように並べ(vl、v2.v
3.v4の順になる)、各頂点をたどる際に右ネジの進
む方向を面f1の表側と約束している。もちろん、頂点
(または辺)のある順序に対して一意に面の表裏が決定
できればどのように約束を設定してもよい。FIG. 2 is a conceptual diagram showing how to decide on the front and back sides of a surface. To determine the front and back sides of the face f1, arrange the vertices counterclockwise when viewed from the outside of the polyhedron (vl, v2, v
3. v4), and when tracing each vertex, the direction in which the right-hand screw advances is guaranteed to be the front side of the surface f1. Of course, the convention can be set in any way as long as the front and back sides of a face can be uniquely determined for a certain order of vertices (or edges).
本発明は、面を構成する頂点の隣接関係は与えられると
して、その向きを自動的に設定するものである。たとえ
ば、面f1の表方向を設定する構成頂点の並べ方がvl
、v2.v3.v4であるか、その逆順のv4.v3.
v2.vlであるがを決定するものである。The present invention automatically sets the orientation of vertices forming a surface, given the adjacency relationship between them. For example, the arrangement of the constituent vertices that sets the front direction of the face f1 is vl
, v2. v3. v4 or its reverse order v4. v3.
v2. This is what determines vl.
第1図は、本発明の多面体表裏設定方法の手順を示す流
れ図である。FIG. 1 is a flowchart showing the steps of the method for setting the front and back sides of a polyhedron according to the present invention.
まず、ステップS1において、多面体上の任意の1点を
求める。このためには、多面体を構成する面のうち、任
意の1つ(面Fと呼ぶ)を選び、第5図に示すように、
面Fを構成する頂点のうち連続する3点よりなる三角形
(第5図ではvlv2v3)の重心Gを求めればよい。First, in step S1, an arbitrary point on a polyhedron is found. To do this, select any one of the faces that make up the polyhedron (referred to as face F), and as shown in Figure 5,
The center of gravity G of a triangle (vlv2v3 in FIG. 5) consisting of three consecutive points among the vertices constituting the surface F can be found.
ただし、面Fが凹角形である場合には、第5図(b)に
示すように、重心Gが面Fの外側に存在し、多面体上に
存在する保証がない。したがって、求めた重心Gが面F
の内部にあるかどうかの検査を行なう必要がある。However, if the surface F is a concave shape, as shown in FIG. 5(b), the center of gravity G exists outside the surface F, and there is no guarantee that it will exist on the polyhedron. Therefore, the obtained center of gravity G is the surface F
It is necessary to check whether it is inside the .
ある点が多角形の内部にあるかどうか判定するには、た
とえば、その点から多角形の各頂点を見回して1周した
ときに、その点と頂点をむすぶ線分の首振りの角度の総
和を計算すればよい(PIXEL N11.30「コン
ピュータによる幾何図形処理」参照)。重心が面Fの内
部に存在するようになるまで、連続する3頂点を1つず
つずらしながら(第5図(b)ではv2v3v4、v3
v4v5など)上記の操作を行なう。このようにして求
めた多面体上の点をPと呼ぶことにする。To determine whether a point is inside a polygon, for example, when looking around each vertex of the polygon from that point once, calculate the sum of the swing angles of the line segments connecting that point and the vertex. (Refer to PIXEL N11.30 "Geometric figure processing by computer"). Shift three successive vertices one by one until the center of gravity is inside the surface F (in Fig. 5(b), v2v3v4, v3
v4v5, etc.) Perform the above operations. The point on the polyhedron obtained in this way will be called P.
次に、ステップS2において、点Pを通りy軸に平行な
直線と多面体の回転を求め、そのうちy座標値が最大と
なる交点を選ぶ(第4図)。もし、この交点が多面体の
面の境界線上に存在する場合には、点PLy′)xまた
は2成分に微少なゆらぎを与えて、上記と同様の操作を
行い、y座標値が最大となる交点が面の境界線を除く内
部に含まれるようにする。Next, in step S2, the rotation of the polyhedron with a straight line passing through point P and parallel to the y-axis is determined, and the intersection point with the maximum y-coordinate value is selected (FIG. 4). If this intersection exists on the boundary line of the face of the polyhedron, give a slight fluctuation to the point PLy') is included inside the surface excluding the boundary.
この交点を含む多面体の面をRと呼ぶことにする。この
ような面Rの表側を示す法線ベクトルのy成分は必ず正
の値となる。もしそうでないとすると、面Rの上(y方
向)に別の面がなければ多面体は閉じなくなり、これは
上記の処理に矛盾する。Let us call the face of the polyhedron containing this intersection point R. The y component of the normal vector indicating the front side of such surface R is always a positive value. If this is not the case, the polyhedron will not be closed unless there is another surface above the surface R (in the y direction), which contradicts the above process.
なお、ここでy軸に平行な直線を用いるのは便宜上のも
のであり、どのような直線を用いてもよい。その際は、
y座標値が最大の交点ではなく、点Pからの距離が最大
となる交点を含む面をRとする。しかし、処理効率のた
めには、x、y、zのどれかの軸に平行な直線を用いる
のがよい。Note that the use of straight lines parallel to the y-axis here is for convenience, and any straight line may be used. In that case,
Let R be a surface that includes not the intersection with the maximum y-coordinate value but the intersection with the maximum distance from the point P. However, for processing efficiency, it is preferable to use a straight line parallel to any one of the x, y, and z axes.
次に、ステップS3において、面Rの頂点の順序を決定
する。そのためには、まず与えられたままの構成頂点の
順序から面Rの法線ベクトルNを求める(基本的には、
面の各辺をベクトルと見てその外積の総和を求めればよ
い。詳しくは、PIXELNQ、25rデプス・バッフ
ァを用いた多面体の隠面消去」参照)。Next, in step S3, the order of the vertices of the surface R is determined. To do this, first find the normal vector N of the surface R from the given order of the constituent vertices (basically,
All you have to do is consider each side of the surface as a vector and find the sum of its cross products. For details, see "Hidden Surface Elimination of Polyhedra Using PIXELNQ, 25r Depth Buffer").
ステップS2から、面Rの表向きの法線ベクトルのy成
分の値は正となるため、構成頂点の順序は、法線ベクト
ルNのy成分の値が正なら与えられたまま、法線ベクト
ルNのy成分の値が負なら与えられたものの逆順にすれ
ばよい。法線ベクトルNのy成分の値が0の場合は、面
Rがy軸に平行であり、ステップS2で交点が面の境界
線上に存在する場合に含まれるため、すでに除かれてい
る。From step S2, since the value of the y component of the surface normal vector of the surface R is positive, the order of the constituent vertices remains as given if the value of the y component of the normal vector N is positive; If the value of the y component of is negative, the given order can be reversed. If the value of the y component of the normal vector N is 0, the surface R is parallel to the y-axis and is included when the intersection point is on the boundary line of the surface in step S2, so it has already been excluded.
最後に、ステップS4において面Rの頂点順序を基準に
して、多面体のすべての面の頂点順序を決定する。その
なめには、隣接する面の共有する頂点の順序が互いに逆
向きになることを利用する。Finally, in step S4, the vertex order of all the faces of the polyhedron is determined based on the vertex order of the face R. To do this, use the fact that the order of the vertices shared by adjacent faces is opposite to each other.
たとえば、第2図で面で1と面f2の共有する頂点はv
3.v4であり、その向きは面f1から見るとv3−>
v4、面f2から見るとv4−〉v3である。このよう
に、面Rから出発して、多面体のすべての面に関して、
隣接する面と共有する頂点が逆向きになるように構成頂
点の順序を設定していけばよい。For example, in Figure 2, the shared vertex of surface 1 and surface f2 is v
3. v4, and its direction is v3-> when viewed from plane f1.
v4, and when viewed from the plane f2, v4->v3. In this way, starting from surface R, for all surfaces of the polyhedron,
The order of the constituent vertices can be set so that vertices shared with adjacent faces are in opposite directions.
このようにして、すべての面の構成頂点列の順序が定ま
り、面の表裏が設定されれば、多面体の内部および外部
が設定できたことになる。In this way, if the order of the constituent vertex rows of all the faces is determined and the front and back sides of the faces are set, the inside and outside of the polyhedron have been set.
本発明によれば、多面体の各面の表裏を正しく設定する
ような構成頂点を自動的に決定するなめ、作業者の労力
が軽減され、また、作業誤りをなくすことができる。According to the present invention, since constituent vertices that correctly set the front and back sides of each face of a polyhedron are automatically determined, the labor of the operator is reduced and work errors can be eliminated.
第1図は本発明の手順を示す流れ図、第2図は多面体の
面の表裏の設定の取り決め方を示す説明図、第3図は多
面体の構成情報を示す説明図、第4図は多面体上の点P
を通りy軸に平行な直線と多面体が交わる様子を示す説
明図、第5図は多角形内の点を求める様子を示す説明図
である。
第2図で、1は多面体、fl、f2は面、vl。
v2.v3.v4.v5.v6は頂点を表わす。
第4図で、2は多面体、Pは多面体上の点、QはPを通
りy軸に平行な直線と多面体2の交点のうち最もy座標
値の大きな点、RはQを含む面を表わす。第5図で3.
4は平面(多角形)、vl。
V2.v3.v4.v5は頂点、Gはvl、v2゜V3
からなる三角形の重心を表わす。Fig. 1 is a flowchart showing the procedure of the present invention, Fig. 2 is an explanatory drawing showing how to set the front and back sides of the faces of a polyhedron, Fig. 3 is an explanatory drawing showing configuration information of the polyhedron, and Fig. 4 is an explanatory drawing showing the configuration information of the polyhedron. point P
FIG. 5 is an explanatory diagram showing how a polyhedron intersects with a straight line passing through and parallel to the y-axis, and FIG. 5 is an explanatory diagram showing how to find points within the polygon. In Fig. 2, 1 is a polyhedron, fl, and f2 is a surface, vl. v2. v3. v4. v5. v6 represents the vertex. In Figure 4, 2 represents a polyhedron, P represents a point on the polyhedron, Q represents the point with the largest y-coordinate value among the intersections of polyhedron 2 with a straight line passing through P and parallel to the y-axis, and R represents the surface containing Q. . 3 in Figure 5.
4 is a plane (polygon), vl. V2. v3. v4. v5 is the vertex, G is vl, v2゜V3
represents the center of gravity of a triangle consisting of
Claims (1)
いられる多面体の各面の内外を設定する方法において、
上記多面体上に存在する任意の点を出発点として上記多
面体と交差するような方向に直線をのばして、上記多面
体と上記直線の交点のうち上記出発点から最も距離の遠
い点を内部に含む上記多面体の構成面を求め、上記構成
面の表の方向を上記直線の方向ベクトルにもとづいて設
定し、上記構成面を基準にして上記多面体の他のすべて
の面の表の方向を設定することを特徴とする多面体内外
設定方法。In the method of setting the inside and outside of each face of a polyhedron used in computer graphics, CAD/CAM, etc.
Starting from an arbitrary point existing on the polyhedron, extend a straight line in a direction that intersects the polyhedron, and forming a straight line that includes the point furthest from the starting point among the intersections of the polyhedron and the straight line. Find the constituent faces of the polyhedron, set the front direction of the constituent faces based on the direction vector of the straight line, and set the front directions of all other faces of the polyhedron based on the constituent faces. Characteristic polyhedral interior and exterior setting method.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63066504A JPH01239676A (en) | 1988-03-18 | 1988-03-18 | Polyhedron inside/outside setting method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP63066504A JPH01239676A (en) | 1988-03-18 | 1988-03-18 | Polyhedron inside/outside setting method |
Publications (1)
Publication Number | Publication Date |
---|---|
JPH01239676A true JPH01239676A (en) | 1989-09-25 |
Family
ID=13317728
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP63066504A Pending JPH01239676A (en) | 1988-03-18 | 1988-03-18 | Polyhedron inside/outside setting method |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPH01239676A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008112252A (en) * | 2006-10-30 | 2008-05-15 | Yamazaki Mazak Corp | Method for converting two-dimensional drawing into three-dimensional solid model, and method for converting attribute |
-
1988
- 1988-03-18 JP JP63066504A patent/JPH01239676A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2008112252A (en) * | 2006-10-30 | 2008-05-15 | Yamazaki Mazak Corp | Method for converting two-dimensional drawing into three-dimensional solid model, and method for converting attribute |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5003498A (en) | Graphic display method | |
US8130221B2 (en) | Method and system for repairing triangulated surface meshes | |
JPH05342310A (en) | Method and device for three-dimensional conversion of linear element data | |
US6952204B2 (en) | 3D computer modelling apparatus | |
US20110267347A1 (en) | Systems and methods for primitive intersection in ray tracing | |
JPH03176784A (en) | Polygon decomposition method and apparatus in computer graphics | |
JPH0550030B2 (en) | ||
US20170061036A1 (en) | Modeling a three-dimensional object having multiple materials | |
Piegl | Geometric method of intersecting natural quadrics represented in trimmed surface form | |
JPH087126A (en) | Projection drawing preparing method | |
JPH01239676A (en) | Polyhedron inside/outside setting method | |
JPS62162173A (en) | Graphic display method | |
JP6025615B2 (en) | Image drawing device | |
JP2671652B2 (en) | 3D shape modeling device | |
JPS61265677A (en) | System for calculating and processing hidden outline and hidden surface | |
JPS63118982A (en) | Arithmetic processing method for deciding whether points are inside or outside on polygon | |
JPH04155585A (en) | Face kind deciding system for three-dimensional wire frame | |
JPH03209499A (en) | Forming method for outline font and drawing device for the same | |
JPH06259567A (en) | Method for interpolating free curve | |
JPS63251870A (en) | Graphic processor | |
JP2602492B2 (en) | Surface display method | |
JP2828759B2 (en) | Free-form surface division method | |
JP2013088825A (en) | System and method for extracting tangent-plane continuous boundary in cad mesh | |
JPH08287286A (en) | Plane image mapping method | |
TWI486905B (en) | System and method for importing curved faces from an iges document |