📄 geom.html
字号:
2 or 3 from the dimension of the face.]<li> geom := (geoentity<sub>1</sub> ...geoentity<sub><em>m</em></sub>)<li> <a name = "geocorresp">geoentity := (<strong>vertex</strong> cpnum) |(<strong>bezier_curve</strong> deg cpnum<sub>1</sub> ... cpnum<sub><em>p</em></sub>) |(<strong>bezier_triangle</strong> deg cpnum<sub>1</sub> ... cpnum<sub><em>p</em></sub>) |(<strong>bezier_quad</strong> deg<sub>1</sub> deg<sub>2</sub> cpnum<sub>1</sub> ... cpnum<sub><em>p</em></sub>).[The <strong>vertex</strong> entity is allowed only for topologicalvertices, and a topological vertex must have exactly one suchentity. The <strong>bezier_curve</strong> entity is allowed only for edges. The<strong>bezier_triangle</strong> and <strong>bezier_quad</strong> entities are allowed only for surfaces.The degree entries are positive integers. The number ofcontrol points <em>p</em> is deg+1 for a curve, (deg+1)*(deg+2)/2for a triangle, and (deg<sub>1</sub>+1)*(deg<sub>2</sub>+1) for a quad. Eachcontrol point cpnum<sub>1</sub>, ..., cpnum<sub><em>p</em></sub> is a nonnegative integerthat is an index into the control point list.]</a></ul>The Ascii format for a mesh is:<ul><li>asciiMesh := code intrinsicDim embeddedDim globalPropVal vertexListbrepVertexListbrepEdgeList {brepSurfaceList {brepChamberList}} [The numberof brep entity lists must be the intrinsic dimension plus 1. In other words, if the mesh's intrinsic dimension is 1, thenit must possess a brepVertexList and a brepEdgeList but maynot possess a brepSurfaceList nor a brepChamberList.]<li>code := <strong>mesh_v2.01</strong><li>intrinsicDim := <strong> 1 </strong> |<strong> 2 </strong> | <strong> 3 </strong>[Intrinsic dim must be less than or equal to embedded dim.]<li>embeddedDim := <strong>2</strong> | <strong> 3 </strong><li>globalPropVal := ( prop<sub>1</sub> val<sub>1</sub> ... prop<sub><em>m</em></sub> val<sub><em>m</em></sub> )[The property/value pairs are arbitrary strings. Ifa property or value string contains spaces, then itshould be enclosed in an outer pair of parentheses.Currently, the only global property value with significance toQMG 2.0 is <strong>geo_global_id</strong>.]<li>vertexList := (globalId<sub>1</sub> xc<sub>1</sub> yc<sub>1</sub>{zc<sub>1</sub>} ... globalId<sub><em>n</em></sub> xc<sub><em>n</em></sub> yc<sub><em>n</em></sub>{zc<sub><em>n</em></sub>})[This is a list of the <em>n</em> nodes in the mesh. Eachentry consists of a global ID, which must be a nonnegativeinteger, followed by either 2 or 3 coordinates, which arereal numbers. The number of coordinates is equal to theembedded dimension (2 or 3). The global ID's do not haveto be in increasing order, but they must be distinct.]<li>brepVertexList := ((globalId<sub>1</sub>) ( ) (globalId<sub>2</sub>) ( ) ...(globalId<sub><em>m</em></sub>) ( )) [This is the list of mesh entitiesassociated with the brep's vertices. There is one globalId perbrep vertex.]<li>brepEdgeList := (edgeVlist<sub>1</sub> edgeSlist<sub>1</sub> ...edgeVlist<sub><em>m</em></sub> edgeSlist<sub><em>m</em></sub>)[This is the list of mesh entities associated with thebrep's edges. In particular, there is an edgeVlist and edgeSlistfor each brep edge, so <em>m</em> here denotes the number ofbrep edges.]<li> edgeVlist := (globalId<sub>1</sub> curveindex<sub>1</sub> paramcoord<sub>1</sub> ...globalId<sub><em>p</em></sub> curveindex<sub><em>p</em></sub> paramcoord<sub><em>p</em></sub>)[This is the list of mesh nodes lying on a particular brep edge.Each triple in this list specifies which mesh node, which geometriccurve within the brep edge, and the parametric coordinate (a real number in [0,1]) of the mesh node.]<li> edgeSlist :=(globalId<sub>1</sub> ... globalId<sub>2<em>r</em></sub>)[This is a list of global node ID's. They are arranged inpairs, for a total of <em>r</em> pairs. Each pair indicatesthe endpoints of a mesh edge that lies on the brep edge.The union of these mesh edges should equal the brep edge.Each global vertex ID lying in this list must also occurin edgeVlist.]<li>brepSurfaceList := (surfaceVlist<sub>1</sub> surfaceSlist<sub>1</sub> ...surfaceVlist<sub><em>m</em></sub> surfaceSlist<sub><em>m</em></sub>)[This is the list of mesh entities associated with thebrep's surfaces. In particular, there is a surfaceVlist and surfaceSlistfor each brep surface, so <em>m</em> here denotes the number ofbrep surfaces.]<li>surfaceVlist := ( ) | (globalId<sub>1</sub> patchindex<sub>1</sub> paramcoordU<sub>1</sub> paramcoordV<sub>1</sub> ...globalId<sub><em>p</em></sub> patchindex<sub><em>p</em></sub> paramcoordU<sub><em>p</em></sub>paramcoordV<sub><em>p</em></sub>)[This is the list of mesh nodes lying on a particular brep surface.If the embedded dimension is 2, then this list is required to beempty, that is, ( ). If the embedded dimension is 3, then this list is divided into four-tuples.Each four-tuple includes the global ID of the vertex, the indexof the geometric patch containing the mesh node, and the parametriccoordinates within the patch of the mesh node.]<li> surfaceSlist :=(globalId<sub>1</sub> ... globalId<sub>3<em>r</em></sub>)[This is a list of global node ID's. They are arranged intriples, for a total of <em>r</em> triples. Each triple indicatesthe endpoints of a mesh triangle that lies on the brep surface.The union of these mesh triangles should equal the brep surface.Each global vertex ID lying in this list must also occurin surfaceVlist.]<li>brepChamberList :=( ( ) chamberSlist<sub>1</sub> ... ( ) chamberSlist<sub><em>m</em></sub>)[This is the list of mesh entities associated with thebrep's chambers (assuming the intrinsic and embedded dimension are both 3). In particular, there is a chamberSlistfor each chamber, so <em>m</em> here denotes the number ofbrep chambers.]<li>chamberSlist := (globalId<sub>1</sub> .....globalId<sub>4<em>r</em></sub>)[This is a list of global node ID's. They are arranged infour-tuples, for a total of <em>r</em> four-tuples. Each four-tuple indicatesthe endpoints of a mesh tetrahedron that lies in the brep chamber.The union of these mesh tetrahedra should equal the brep chamber.]</ul><h2><a name="matrep">Matlab internal representation of objects</a></h2><a name = "zba">The Matlab internal representation of objects uses zero-based arrayaddressing. This implemented via a Matlab class called "zba". </a>In a zero-based array, rows and column numbering starts with 0instead of 1. Many array operations with which you are familiarhave been reimplemented for zba's. You can extend the operationsavailable for zba's by adding new routinesto the @zba subdirectory. To convert an array to a zba, use the <code>zba</code> function. To convertback, use the <code>double</code> function.<pre><code>>> z = zba([3,5,7]);>> z(0)ans = 3>> y = double(z);>> y(1)ans = 3</code></pre>The user can directly access entries of these objects toexamine and modify a brep or mesh. Breps or meshes can also becreated directly by the user or with m-files. (This is in contrastto QMG 1.0 and 1.1, in which the object was stored in 'chunk' formatand was accessible and modifiable only by using certainaccessor functions.)<p>The zba's in QMG are usually nested, with the outer level beinga cell array. Every level of indexing in a nested zba is zero-based.<p>A brep is represented by a zero-based cell column vector with 6+<em>i</em> entries,where <em>i</em> is the intrinsic dimension of the brep. (This documentation assumes that you are already familiar withsubscripting of vectors, matrices, and cell arrays in Matlab.)Say the brep is b. The entries of b are as follows.<ul><li>b{0} is a string which is always 'brep_v2.0'. <li>b{1}is the intrinsic dimension.<li> b{2} is the embedded dimension.<li>b{3} is the property-value list. This is a 2-by-k cellarray, where each cell entry is a string. In other words,b{3}{0,0} is the first property, b{3}{1,0} is its value, and so on.<li>Entry b{4} is the control-point table. This is an <em>e</em>-by-<em>m</em> matrix (withzero-based numbering), where <em>m</em> is the number of control points and <em>e</em>is the embedded dimension of the brep.<li>Entry b{5} holds vertices, b{6} holds edges, b{7} holds surfaces,and b{8} holds chambers. Not all of these entries are present; thenumber present depends on the intrinsic dimension of the brep.The format of these entries is as follows.Each of b{d+5}, for d=0,...,3, is a 5-by-<em>t</em> cellarray,where <em>t</em> denotes the number of faces of the particular dimension.The cells are as follows.<ul><li>b{d+5}{0,i} (for i between 0 and <em>t</em>-1) is the name of theith face (a string).<li>b{d+5}{1,i} is the property-value pair list of this face.It is a 2-by-<em>k</em> cell array of strings, where <em>k</em> is the numberof property values.<li>b{d+5}{2,i} is the list of subfaces of the ith face. This is a1-by-<em>r</em> cell array,where <em>r</em> is the number of subfaces. Each entry is a string with the name of the subface. This namemay optionally be preceded by + or - to indicate orientation(current not used).<li>b{d+5}{3,i}is the list of lower-dimensionalinternal boundaries. This is a 1-by-<em>s</em> cell array, where <em>s</em> is the numberof lower dimensional internal boundaries. Each entry is a stringwith the name of the subface.<li>bd{d+5}{4,i}is the cell array geometric entities making up theface. This cell array is 3-by-p, where p is the numberof entities. Entry {0,j} of this cell array isa string, either 'vertex', 'bezier_curve', 'bezier_triangle',or 'bezier_quad'. As mentioned <a href="#geocorresp">above</a>,the choice of entity type is restricted according to the face dimension.Entry {1,j} of the cell array is the degree, either empty (for a vertex),one integer (for a curve or triangle) or two integers (for a patch).Entry {2,j} of the cell array is a vector of control point indices.The length of this vector follows the rule mentioned <a href="#geocorresp">above</a>.</ul></ul>The matlab format for a mesh is as follows. A mesh m is a zbacell-vector with 6+<em>i</em> entries, where <em>i</em>is the embedded dimension. The entries as follows.<ul><li>m{0} is the string 'mesh_v2.01'.<li>m{1} is the mesh's intrinsic dimension.<li>m{2} is the mesh's embedded dimension.<li>m{3} is a 2-by-<em>k</em> cell array of strings, which holdthe property-value pairs of the mesh.<li>m{4} is the mesh's node list. This is a <em>k</em>-by-<em>r</em> matrix, where<em>k</em>=3 if the embedded dim is 2, else <em>k</em>=4 if the embedded dim is 3.The number of columns <em>r</em> is equal to the number of vertices inthe complex. The first entry of each column is the vertex's globalID, which must be a nonnegative integer (stored as a double though).The remaining entries in each column are the vertex's real-spacecoordinates.<li>Entry m{5} holds mesh entitiesassociated with brep vertices, m{6} holds mesh entities associated with brep edges, m{7} holds mesh entities associated with brep surfaces, andand m{8} holds mesh entities associated with brep chambers. Not all of these entries are present; thenumber present depends on the intrinsic dimension of the brep.The format of these entries is as follows.Each of m{d+5}, for d=0,...,3, is a 2-by-<em>t</em> cellarray,where <em>t</em> denotes the number of brepfaces of the particular dimension.The cells are as follows.<ul><li>m{d+5}{0,i} is the list of vertices associated with theith topological entity of dimension d. This list of verticesis a <em>k</em>-by-<em>r</em> matrix defined as follows.If d=0, then <em>k</em>=<em>r</em>=1, and the single entryis the global id of the mesh vertex lying on topological vertex.If d=1, then <em>k</em>=3, and each column of this array correspondsto a mesh node lying on the topological edge. The first entry in thecolumn is the mesh's global ID (a nonnegative integerstored as a double), the second entry is the curve index of thecurve of the edge that contains the vertex (a nonnegativeinteger stored as a double), and the third entry is the parametriccoordinate (a double in [0,1]) of the point within the curve.<p>If d=2, then <em>k</em>=<em>r</em>=0 when the embedded dimension is 2.<p>If d=2 and the embedded dimension is 3, then <em>k</em>=4. Each columnof m{d+5}{0,i} is a vertex lying on the ith topological surface.The first entry is the vertex global ID, the next entry isthe index of the patch within the topological surface, and thelast two entries are the parametric coordinates of the mesh nodewithin that patch.<p>If d=3, then <em>k</em>=<em>r</em>=0.<li>m{d+5}{1,i} is a matrix of mesh nodes (nonnegative global ID's, whichare integers but are stored as doubles) making up the mesh entitieslying on the face. If d=0, this matrix is empty.If d=1, then m{d+5}{1,i} is a 2-by-<em>r</em>matrix of mesh nodes; each column in this matrix is a mesh edgelying on the brep edge. If d=2, then m{d+5}{1,i} is a 3-by-<em>r</em>matrix; each column is a mesh triangle lying on the brep surface.If d=3, then m{d+5}{1,i} is a 4-by-<em>r</em> matrix; eachcolumn is a tetrahedron.</ul></ul><p>Two file-formats for meshes and breps can be used inMatlab/QMG. Thefirst is Ascii format: to read a brep or mesh froma file in Ascii format, use <code>gm_read</code>. To write itout to a file, use <code>gm_write</code>.Breps and meshes can also be saved in Matlab's native mat-fileformat using the <code>save</code> and <code>load</code>commands.<h2><a name = "tclrep">Tcl representation of objects</a></h2>In Tcl/Tk, breps and meshes are represented internally using C data structures. This data structure is not documentedhere; refer to the source-code files GeoFmt.hand MshFmt2.h in the QMGROOT/src/tcl directory and the commentsin those files.<p>Breps and meshes are Tcl dual-ported objects, which means thatthey stay in the C data structures until a command is executedon the object that is unable to directly handle breps or meshes,for instance, the concat function. Then the object isconverted to its string representation, which is theAscii format described <a href="#asciirep">above</a>.Converting a large object to Ascii can be veryexpensive, so you should avoid Tcl operations that causea conversion unless you need them.<p>To make it easier to manipulate geometric objects in Tcl, there are also the two functions <code>gm_obj2list</code>and its inverse <code>gm_list2obj</code>. The formeris roughly equivalent to converting the object to Ascii formatand then replacing all parentheses that occur at outer levelswith curly braces so that entries can be indexed and modified using the<code>lindex</code> and <code>lreplace</code> functions of Tcl. (The <code>gm_obj2list</code> function does notactually convert to a string on an intermediate step. Instead,it converts directly to Tcl's internal list representation, whichis more efficient.)The <code>gm_list2obj</code> operation inverts this procedure.<p>Two file-formats for meshes and breps are available inTcl/QMG. Thefirst is Ascii format. To read a brep or mesh froma file in Ascii format, use <code>gm_read</code>. To write itout to a file, use <code>gm_write</code>.Breps and meshes can also be saved in a binary file formatbased on the XDR standards. The functions for this purpose are<code>gmxdr_read</code> and <code>gmxdr_write</code>.This XDR format is platform independent because the XDR routineshandle byte-order issues.<hr><p>This documentation is written by <a href="http://www.cs.cornell.edu/home/vavasis/vavasis.html">Stephen A. Vavasis</a> and iscopyright ©1999 by <a href="http://www.info.cornell.edu/CUHomePage.html">Cornell University</a>.Permission to reproduce this documentation is granted provided thisnotice remains attached. There is no warranty of any kind onthis software or its documentation. See the accompanying file<a href="copyright.html">'copyright'</a>for a full statement of the copyright.<p><address>Stephen A. Vavasis, Computer Science Department, Cornell University,Ithaca, NY 14853, vavasis@cs.cornell.edu</address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -