X if(wtobj->face[fcount]->bevel!=bindx) { X /* if not, change current bevel flag */ X bindx=wtobj->face[fcount]->bevel; X /* and output bevel directive */ X if(bindx==0) { X fprintf(outfildes,"bevel off\n"); X } X else { X fprintf(outfildes,"bevel on\n"); X } X } X /* see if face material is current material */ X if(wtobj->face[fcount]->mtl!=mtlindx) { X /* if not, change current mtl and ouput new "usemtl" */ X mtlindx=wtobj->face[fcount]->mtl; X if(!strcmp(wtobj->mtl[mtlindx]->mtlnam,"# no materials used")) { X if(verbflg>9) { X fprintf(stderr, "%s\n",wtobj->mtl[mtlindx]->mtlnam); X } X fprintf(outfildes,"%s\n",wtobj->mtl[mtlindx]->mtlnam); X } X else { X if(verbflg>9) { X fprintf(stderr, "usemtl %s\n",wtobj->mtl[mtlindx]->mtlnam); X } X fprintf(outfildes,"usemtl %s\n",wtobj->mtl[mtlindx]->mtlnam); X } X } X /* see if face mapping is current mapping */ X if(wtobj->face[fcount]->map!=mapindx) { X /* if not, change current map and ouput new "usemap" */ X mapindx=wtobj->face[fcount]->map; X if(mapindx==(-1)) { X if(verbflg>9) { X fprintf(outfildes,"usemap off\n"); X } X fprintf(outfildes,"usemap off\n"); X } X else { X if(!strcmp(wtobj->map[mapindx]->mapnam,"# no mappings used")) { X if(verbflg>9) { X fprintf(stderr, "%s\n", wtobj->map[mapindx]->mapnam); X } X fprintf(outfildes,"%s\n", wtobj->map[mapindx]->mapnam); X } X else { X if(verbflg>9) { X fprintf(stderr, "usemap %s\n", X wtobj->map[mapindx]->mapnam); X } X fprintf(outfildes,"usemap %s\n", X wtobj->map[mapindx]->mapnam); X } X } X } X if(wtobj->face[fcount]->mapflg==MAP) { X if(verbflg>9) { X fprintf(stderr,"f"); X } X fprintf(outfildes,"f"); X } X else { X if(verbflg>9) { X fprintf(stderr,"fo"); X } X fprintf(outfildes,"fo"); X } X for(fvcnt=0;fvcntface[fcount]->vertc;fvcnt++) { X if(wtobj->face[fcount]->map>(-1)) { X if(verbflg>9) { X fprintf(stderr," %d/%d", X wtobj->face[fcount]->vertno[fvcnt], X wtobj->face[fcount]->tvertno[fvcnt]); X } X fprintf(outfildes," %d/%d", X wtobj->face[fcount]->vertno[fvcnt], X wtobj->face[fcount]->tvertno[fvcnt]); X } X else { X if(verbflg>9) { X fprintf(stderr," %d", X wtobj->face[fcount]->vertno[fvcnt]); X } X fprintf(outfildes," %d", X wtobj->face[fcount]->vertno[fvcnt]); X } X } X if(verbflg>9) { X fprintf(stderr,"\n"); X } X fprintf(outfildes,"\n"); X } X } X Xfprintf(outfildes,"\n\# %d faces\n\n",wtobj->size.nofaces); X X/* output meta-elements of type 'sphere' */ X Xif(verbflg>1) { X fprintf(stderr,"wt_obj: writing %d meta-elements of type 'sphere'\n", X wtobj->size.nosphrs); X } X Xfprintf(outfildes,"\n! spheres %d\n",wtobj->size.nosphrs); Xfor(sphcnt=0;sphcntsize.nosphrs;sphcnt++) { X /* see if sphere group is current group */ X if(wtobj->spher[sphcnt]->group!=grpindx) { X /* if not, change current group and ouput new group */ X grpindx=wtobj->spher[sphcnt]->group; X if(verbflg>9) { X fprintf(stderr, "g %s\n",wtobj->group[grpindx]->grpnam); X } X fprintf(outfildes, "g %s\n",wtobj->group[grpindx]->grpnam); X } X /* see if sphere smoothing group is current smoothing group */ X if(wtobj->spher[sphcnt]->smooth!=sindx) { X /* if not, change current smoothing group */ X sindx=wtobj->spher[sphcnt]->smooth; X /* and output smoothing directive */ X if(sindx<=(-1)) { X fprintf(outfildes,"s off\n"); X } X else { X fprintf(outfildes, X "s %d\n",wtobj->spher[sphcnt]->smooth); X } X } X /* see if sphere material is current material */ X if(wtobj->spher[sphcnt]->mtl!=mtlindx) { X /* if not, change current mtl and ouput new "usemtl" */ X mtlindx=wtobj->spher[sphcnt]->mtl; X if(!strcmp(wtobj->mtl[mtlindx]->mtlnam,"# no materials used")) { X if(verbflg>9) { X fprintf(stderr,"%s\n",wtobj->mtl[mtlindx]->mtlnam); X } X fprintf(outfildes,"%s\n",wtobj->mtl[mtlindx]->mtlnam); X } X else { X if(verbflg>9) { X fprintf(stderr,"usemtl %s\n",wtobj->mtl[mtlindx]->mtlnam); X } X fprintf(outfildes,"usemtl %s\n",wtobj->mtl[mtlindx]->mtlnam); X } X } X /* see if sphere mapping is current mapping */ X if(wtobj->spher[sphcnt]->map!=mapindx) { X /* if not, change current map and ouput new "usemap" */ X mapindx=wtobj->spher[sphcnt]->map; X if(mapindx==(-1)) { X if(verbflg>9) { X fprintf(outfildes,"usemap off\n"); X } X fprintf(outfildes,"usemap off\n"); X } X else { X if(!strcmp(wtobj->map[mapindx]->mapnam,"# no mappings used")) { X if(verbflg>9) { X fprintf(stderr, X "%s\n",wtobj->map[mapindx]->mapnam); X } X fprintf(outfildes,"%s\n",wtobj->map[mapindx]->mapnam); X } X else { X if(verbflg>9) { X fprintf(stderr, "usemap %s\n",wtobj->map[mapindx]->mapnam); X } X fprintf(outfildes,"usemap %s\n",wtobj->map[mapindx]->mapnam); X } X } X } X /* meta-element directive for sphere: '*s center radius resolution' */ X fprintf(outfildes,"*s %d %3.6f %d\n", X wtobj->spher[sphcnt]->vertno, X wtobj->spher[sphcnt]->rad, X wtobj->spher[sphcnt]->res); X } Xfprintf(outfildes,"\n\# %d spheres\n\n",wtobj->size.nosphrs); X X/* output elements of type 'bicubic patch' */ X Xif(verbflg>1) { X fprintf(stderr, X "wt_obj: writing %d bicubic patches\n", wtobj->size.noptchs); X } X Xfprintf(outfildes,"\n! bicubes %d\n",wtobj->size.noptchs); Xfor(bicuct=0;bicuctsize.noptchs;bicuct++) { X /* see if patch group is current group */ X if(wtobj->bicub[bicuct]->group!=grpindx) { X /* if not, change current group and ouput new group */ X grpindx=wtobj->bicub[bicuct]->group; X if(verbflg>9) { X fprintf(stderr, X "g %s\n",wtobj->group[grpindx]->grpnam); X } X fprintf(outfildes, X "g %s\n",wtobj->group[grpindx]->grpnam); X } X /* see if patch smoothing group is current smoothing group */ X if(wtobj->bicub[bicuct]->smooth!=sindx) { X /* if not, change current smoothing group */ X sindx=wtobj->bicub[bicuct]->smooth; X /* and output smoothing directive */ X if(sindx<=(-1)) { X fprintf(outfildes,"s off\n"); X } X else { X fprintf(outfildes, X "s %d\n",wtobj->bicub[bicuct]->smooth); X } X } X /* see if patch material is current material */ X if(wtobj->bicub[bicuct]->mtl!=mtlindx) { X /* if not, change current mtl and ouput new "usemtl" */ X mtlindx=wtobj->bicub[bicuct]->mtl; X if(!strcmp(wtobj->mtl[mtlindx]->mtlnam,"# no materials used")) { X if(verbflg>9) { X fprintf(stderr,"%s\n",wtobj->mtl[mtlindx]->mtlnam); X } X fprintf(outfildes,"%s\n",wtobj->mtl[mtlindx]->mtlnam); X } X else { X if(verbflg>9) { X fprintf(stderr,"usemtl %s\n",wtobj->mtl[mtlindx]->mtlnam); X } X fprintf(outfildes,"usemtl %s\n",wtobj->mtl[mtlindx]->mtlnam); X } X } X /* see if patch mapping is current mapping */ X if(wtobj->bicub[bicuct]->map!=mapindx) { X /* if not, change current map and ouput new "usemap" */ X mapindx=wtobj->bicub[bicuct]->map; X if(mapindx==(-1)) { X if(verbflg>9) { X fprintf(outfildes,"usemap off\n"); X } X fprintf(outfildes,"usemap off\n"); X } X else { X if(!strcmp(wtobj->map[mapindx]->mapnam,"# no mappings used")) { X if(verbflg>9) { X fprintf(stderr,"%s\n", wtobj->map[mapindx]->mapnam); X } X fprintf(outfildes,"%s\n",wtobj->map[mapindx]->mapnam); X } X else { X if(verbflg>9) { X fprintf(stderr,"usemap %s\n", wtobj->map[mapindx]->mapnam); X } X fprintf(outfildes,"usemap %s\n",wtobj->map[mapindx]->mapnam); X } X } X } X /* see if patch resolution is current resolution */ X if(wtobj->bicub[bicuct]->u_res!=u_res || X wtobj->bicub[bicuct]->v_res!=v_res) { X /* if not, change current res and ouput new "res" */ X u_res=wtobj->bicub[bicuct]->u_res; X v_res=wtobj->bicub[bicuct]->v_res; X if(verbflg>9) { X fprintf(stderr,"wt_obj: res %d %d\n",u_res,v_res); X } X fprintf(outfildes,"res %d %d\n",u_res,v_res); X } X /* meta-element directive for bicubic patch: X '[bsp | bzp | bcp] [vertex matrix]' */ X switch(wtobj->bicub[bicuct]->type) { X case BSPLINE: { X fprintf(outfildes,"bsp"); X break; X } X case BEZIER: { X fprintf(outfildes,"bzp"); X break; X } X case CARDINAL: { X fprintf(outfildes,"bcp"); X break; X } X } X for(row=0;row<4;row++) { X for(col=0;col<4;col++) { X if(wtobj->bicub[bicuct]->map>(-1)) { X /* output vertex indices with texture */ X fprintf(outfildes," %d/%d", X wtobj->bicub[bicuct]->vertno[row][col], X wtobj->bicub[bicuct]->tvertno[row][col]); X } X else { X fprintf(outfildes," %d", X wtobj->bicub[bicuct]->vertno[row][col]); X } X } X } X fprintf(outfildes,"\n"); X } X Xfprintf(outfildes,"\n\# %d bicubic patches\n",wtobj->size.noptchs); X Xfprintf(stderr,"wt_obj: done\n"); X} !EOR! echo extracting man/man1/poly2obj.sl echo mkdir ./man mkdir ./man echo mkdir ./man/man1 mkdir ./man/man1 sed 's/^X//' > man/man1/poly2obj.sl << '!EOR!' X.TH POLY2OBJ 1 "25 Jan 1989" X.UC 4 X.SH NAME X.B poly2obj X\- converts Hume's '.poly' object files to Wavefront '.obj' object files. X.SH SYNOPSIS X.B poly2obj \[options\] X.B \[input_file.poly\] X XASCII object description is delivered to X.B standard output. X.in -4 X.SH OPTIONS X.B -h\[elp\] X\- prints command usage. X X.B -v \[level\] X\- runs the command verbosely. Levels begin at 1 (default). Levels higher Xthan 5 print out more information than is necessary for all but very intensive Xprogram debugging. X X.in -4 X.SH DESCRIPTION X.ad n X.fi X.B poly2obj X\- converts '.poly' ASCII object files of the type used by Andrew Hume's Xcatalogue of polyhedra to Wavefront '.obj' object files. X X.SH AUTHOR X.nf XStewart Dickson Xcelia!tpg!dickson@tis.llnl.gov X.SH FILES X.nf X$SPD_DIR/src/cmds/poly2obj.c X$SPD_DIR/src/obj_lib/alloc_obj.c X$SPD_DIR/src/obj_lib/app_obj.c X$SPD_DIR/src/obj_lib/rd_poly.c X$SPD_DIR/src/obj_lib/wt_obj.c X X.SH SEE ALSO X.nf Xobjects(5 local) Xpoly(5 local) X !EOR! echo extracting man/man1/Make.poly2obj echo mkdir ./man mkdir ./man echo mkdir ./man/man1 mkdir ./man/man1 sed 's/^X//' > man/man1/Make.poly2obj << '!EOR!' X# file: $SPD_DIR/man/man1/Make.poly2obj X# X# description: instructions for printing manual section 1 of the Stewart X# Dickson computer modeling package. X# X Xpoly2obj: poly2obj.sl X troff -man -t poly2obj.sl |lpr -t !EOR! echo extracting man/man3/alloc_obj.sl echo mkdir ./man mkdir ./man echo mkdir ./man/man3 mkdir ./man/man3 sed 's/^X//' > man/man3/alloc_obj.sl << '!EOR!' X.TH ALLOC_OBJ 3 "9 Oct 1988" X.UC 4 X.SH NAME X.nf Xalloc_obj, Xdef_parms, Xcopy_alc, Xcopy_siz, Xfree_obj, Xrealc_obj X.fi X\- functions for allocating, freeing and Xreallocating memory for geometrical object description structures. X.SH SYNOPSIS X#include X X.nf Xstruct topology *alloc_obj(alloc) Xstruct sizes *alloc; X Xstruct topology *alloc_hdr(hdrobj,hdralc) Xstruct topology *hdrobj; Xstruct sizes *hdralc; X Xstruct topology *alloc_verts(vertobj,vertalc) Xstruct topology *hdrobj; Xstruct sizes *hdralc; X Xstruct topology *alloc_tverts(tvertobj,tvertalc) Xstruct topology tvertobj; Xstruct sizes *tvertalc; X Xstruct topology *alloc_faces(facobj,facalc) Xstruct topology *facobj; Xstruct sizes *facalc; X Xstruct topology *alloc_lines(linobj,linalc) Xstruct topology *linobj; Xstruct sizes *linalc; X Xstruct topology *alloc_edges(edgobj,edgalc) Xstruct topology *edgobj; Xstruct sizes *edgalc; X Xstruct topology *alloc_circs(crcobj,crcalc) Xstruct topology *crcobj; Xstruct sizes *crcalc; X Xstruct topology *alloc_points(pntobj,pntalc) Xstruct topology *pntobj; Xstruct sizes *pntalc; X Xstruct topology *alloc_sphrs(sphobj,sphalc) Xstruct topology *sphobj; Xstruct sizes *sphalc; X Xstruct topology *alloc_ptchs(pchobj,pchalc) Xstruct topology *pchobj; Xstruct sizes *pchalc; X Xstruct topology *alloc_mdefs(mdfobj,mdfalc) Xstruct topology *mdfobj; Xstruct sizes *mdfalc; X Xstruct topology *alloc_mrefs(mrfobj,mrfalc) Xstruct topology *mrfobj; Xstruct sizes *mrfalc; X Xstruct topology *alloc_moprs(mopobj,mopalc) Xstruct topology *mopobj; Xstruct sizes *mopalc; X Xstruct sizes *copy_alc(object,alloc) Xstruct topology *object; Xstruct sizes *alloc; X Xstruct sizes *copy_siz(object,alloc) Xstruct topology *object; Xstruct sizes *alloc; X Xstruct sizes *def_parms(alloc) Xstruct sizes *alloc; X Xvoid free_obj(object) Xstruct topology *object; X Xstruct topology *realc_obj(object,alloc) Xstruct topology *object; Xstruct sizes *alloc; X.fi X X.SH DESCRIPTION X.ad n X.fi X.B alloc_obj Xdynamically allocates memory for geometrical object description structures. XAllocation parameters are passed in the structure 'alloc'. If 'alloc' is XNULL, default parameters are used. X X.B def_parms Xsets default allocation size parameters for an object. X.B def_parms Xreads the environment for object size specification variables. If these Xvariables are not set, internal defaults are used. X X.in 4 XThe following environment variables used by Wavefront Technologies are Xrecognized: X X.B WF_MVRT X\- sets the number of vertices to allocate - default 5000 X X.B WF_MTVS X\- sets the number of texture vertices to allocate - default 100 X X.B WF_MVPE X\- sets the number of vertices per element to allocate - default 200 XNote: since Wavefront Technologies does not distinguish between element types Xwhen allocating objects, all elements are allocated the same number of vertices. X X.B WF_MMTL X\- sets the number of materials to allocate - default 100 X X.B WF_MTEX X\- sets the number of textures to allocate - default 100 X X XThe following local environment variables are recognized and if set override Xthe WF_* variables: X X.B SPD_VERTS X\- sets the number of vertices to allocate - default 5000 X X.B SPD_TVERTS X\- sets the number of texture vertices to allocate - default 100 X X.B SPD_MTLS X\- sets the number of materials to allocate - default 100 X X.B SPD_TEX X\- sets the number of textures to allocate - default 100 X X.B SPD_LIBS X\- sets the number of material/mapping libraries to allocate - default 100 X X.B SPD_GROUPS X\- sets the number of element grouping lists to allocate - default 10 X X.B SPD_LINES X\- sets the number of elements of type 'line' to allocate - default 100 X X.B SPD_POINTS X\- sets the number of elements of type 'point' to allocate - default 100 X X.B SPD_FACES X\- sets the number of elements of type 'face' to allocate - default 5000 X X.B SPD_CIRCS X\- sets the number of 'meta-elements' of type 'circle' to allocate - default 100 X X.B SPD_SPHRS X\- sets the number of 'meta-elements' of type 'sphere' to allocate - default 100 X X.B SPD_PTCHS X\- sets the number of 'meta-elements' of type 'bicubic patch' to allocate - default 10 X X.B SPD_EDGES X\- sets the number of connections between vertices to allocate default - 100 X X.B SPD_GROUPS X\- sets the number of element groups to allocate - default 1 X X.B SPD_VPLIN X\- sets the number of vertices per line to allocate - default 100 X X.B SPD_VPFAC X\- sets the number of vertices per face to allocate - default 20 X X.B SPD_VALEN X\- sets the number of edges-per-vertex and faces-per-vertex to allocate - default 10 X.in -4 X X.B copy_alc Xreturns a pointer to a structure containing the allocation parameters for the Xstructure 'object'. X X.B copy_siz Xreturns a pointer to a structure containing the current population parameters Xfor the structure 'object'. X X.B free_obj Xfrees memory previously allocated for geometrical object description Xstructures. X X.B realc_obj Xdynamically reallocates memory for any part of a geometrical object description Xstructure. Allocation parameters are passed in structure 'alloc'. Any Xparameter in 'alloc' exceeding the current value of the corresponding Xparameter in 'object->alloc' will cause the memory to be reallocated for that Xparameter. A NULL value for 'alloc' will cause the process to exit(2). X X X.SH AUTHOR XStewart Dickson X.SH FILES X.nf X$SPD_DIR/include/topology.h X$SPD_DIR/src/obj_lib/alloc_obj.c X$SPD_DIR/src/obj_lib/rd_obj.c X$SPD_DIR/src/obj_lib/app_obj.c X X.SH SEE ALSO X.nf Xrd_obj(3 local) Xobjects(5 local) !EOR! echo extracting man/man3/app_obj.sl echo mkdir ./man mkdir ./man echo mkdir ./man/man3 mkdir ./man/man3 sed 's/^X//' > man/man3/app_obj.sl << '!EOR!' X.TH APP_OBJ 3 "27 Nov 1988" X.UC 4 X.SH NAME X.Bapp_obj X.br X.B copy_obj X XTopological object concatenate and copy. X.SH SYNOPSIS X.nf X\#include X X.B struct topology *app_obj(dstobj,srcobj,actgrp,flag) Xstruct topology *dstobj,*srcobj; Xint actgrp; Xchar flag; X X.B int add_group(object,grp_name) Xstruct topology *object; Xchar *grp_name; X X.B int add_lib(object,lib_name) Xstruct topology *object; Xchar *lib_name; X X.B int add_map(object,map_name) Xstruct topology *object; Xchar *map_name; X X.B int add_mtl(object,mtl_name) Xstruct topology *object; Xchar *mtl_name; X X.B struct topology *copy_obj(dstobj,srcobj,flag) Xstruct topology *dstobj,*srcobj; Xchar flag; X.fi X X.in -4 X.SH DESCRIPTION X.ad n X.fi X.B app_obj Xreturns the destination object which has had the contents of the source object Xappended to it. Elements in the X.B srcobj Xare placed in the group indicated by X.B actgrp. XIf X.B actgrp Xis \-1, the groups defined in X.B srcobj Xare transferred intact to X.B dstobj. XObjec attributes such as material, texture mapping, geometrical smoothing, etc. Xare preserved and, if necessary, re-indexed to retain the uniqueness indicated Xin the X.B srcobj. X X.B flag Xis a character 'e', 'm' or 'h', indicating whether only simple elements, Xgraphical meta-elements and simple elements or only object header information Xare to be copied to the destination object. X X.B add_group, add_lib, add_map Xand X.B add_mtl Xrespectively add group, library, texture map and material names to the Xcorresponding list of such items in the X.B object. XIf the X.B grp_, lib_, map_ Xor X.B mtl_name Xalready exists in the corresponding list, the index to the existing named Xitem is returned. If the name does not already exist, allocation is checked, Xincreased if necessary, the named item is added to the list and its index is Xreturned. X X.B copy_obj Xreturns the source object verbatim, copied to a new structure in core. XThe previous contents of X.B dstobj, Xif any, are destroyed. X X.SH AUTHOR XStewart Dickson X.SH FILES X.nf X$SPD_DIR/src/obj_lib/app_obj.c X$SPD_DIR/include/topology.h X X X !EOR! echo extracting man/man3/rd_poly.sl echo mkdir ./man mkdir ./man echo mkdir ./man/man3 mkdir ./man/man3 sed 's/^X//' > man/man3/rd_poly.sl << '!EOR!' X.TH RD_POLY 3 "25 Jan 1989" X.UC 4 X.SH NAME Xrd_poly() - Hume's ASCII object description input. X.SH SYNOPSIS X#include X X.nf Xstruct topology *rd_poly(object,fildes) Xstruct topology *object; XFILE *fildes; X.fi X.in -4 X.SH DESCRIPTION X.ad n X.fi X.B rd_poly Xreads an input ASCII object description into a data structure in core. XIf 'object' is a NULL pointer, X.B rd_poly Xcalls X.B alloc_obj(3 local) Xto allocate space for this structure. X X.B rd_poly Xunderstands ASCII object description conventions used by XAndrew Hume's catalogue of polyhedra. (See also X.B POLY(5 local)). X X.fi X.SH EXAMPLES X.nf X#include X#include X XFILE *file; Xchar *filename; Xstruct topology *object,*rd_poly(); X Xif((file=fopen(filename,"r"))==NULL) { X fprintf(stderr,"cannot open %s\\n",filename); X exit(-1); X } X/* read 'filename' into structure 'object' of default size */ Xobject=rd_poly(object,file); Xfclose(file); X X.fi X.SH AUTHOR XStewart Dickson X.SH FILES X.nf X$SPD_DIR/src/alloc_obj.c X$SPD_DIR/src/app_obj.c X$SPD_DIR/src/rd_poly.c X$SPD_DIR/include/topology.h X X.SH SEE ALSO X.nf Xalloc_obj(3 local) Xapp_obj(3 local) Xwt_obj(3 local) Xobjects (5 local) Xpoly(5 local) !EOR! echo extracting man/man3/wt_obj.sl echo mkdir ./man mkdir ./man echo mkdir ./man/man3 mkdir ./man/man3 sed 's/^X//' > man/man3/wt_obj.sl << '!EOR!' X.TH WT_OBJ 3 "8 Mar 1988" X.UC 4 X.SH NAME Xwt_obj() - ASCII object description output. X.SH SYNOPSIS X#include X.nf X Xvoid wt_obj(fildes,object) XFILE *fildes; Xstruct topology *object; X.in -4 X.SH DESCRIPTION X.ad n X.fi X.B wt_obj Xwrites an input ASCII object description from a data structure in core. X X.B wt_obj Xuses ASCII object description conventions used by XWavefront Technologies, 'model', 'pv' and 'image', plus a few Xenhancements. Object description directives include the following: X X.nf X# comment X X# object description file inclusion Xcall filename.obj X# material description file inclusion Xmtllib filename.mtl X# texture map description file inclusion Xmaplib filename.map X X# material application directive Xusemtl mtl_name X# texture map application directive Xusemap map_name Xusemap off X X# element grouping directive Xg name X X# allocation specification for vertices (comment to Wavefront) X! vertices 5000 X X# 3D geometrical vertex specification (without topology) Xv 1.000 2.000 3.000 X X# allocation specification for texture vertices (comment to Wavefront) X! tverts 5000 X X# texture map index specification Xvt 0.0 [0.05] [1.0] X X# allocation specification for vertices per point element and points X# (comment to Wavefront) X! pverts 500 X! points 100 X X# topological element type 'point' Xp [single-space separated integer vertex indeces] X X# allocation specification for vertices per line element and lines X# (comment to Wavefront) X! lverts 500 X! lines 100 X X# topological element type 'line' Xl [single-space separated integer vertex indeces] X X# allocation specification for vertices per face element and faces X# (comment to Wavefront) X! fverts 500 X! faces 100 X X# topological element type 'filled face' Xf 7 8 9 10 X X# topological element type 'face outline' with texture indeces Xfo 11/1 12/4 13/5 14/2 X X# geometrical smoothing directive Xs 1 Xs off X X# parametric surface patch resolution specifier Xres u_res v_res X X# allocation directive for bicubic patches X! patches 500 X X# parametric surface element type 'B-Spline Patch' Xbsp [set of 16 control vertex indices] X X# parametric surface element type 'Bezier Patch' Xbzp [set of 16 control vertex indices] X X# graphical meta-element type circle X*c [center vertex index] [radius] [resolution] X X# graphical meta-element type sphere X*s [center vertex index] [radius] [resolution] X X# graphical meta-element type 'bicubic patch' X*b [set of 16 control vertex indeces] [resolution] X X# begin the definition of a user-defined object meta-element X*defmeta name X X# lines of object description language follow X# NOTE: defmeta is recursive and may be nested X X# terminate the definition of a user-defined object meta-element X*enddef name X X# reference to (instance of) a user-defined object meta-element X*refmeta name vec1.x vec1.y vec1.z X vec2.x vec2.y vec2.z X base2.x base2.y base2.z X scale2.x scale2.y scale2.z X X.fi Xuse alloc_obj(3 local), rd_obj(3 local), etc. to allocate and fill object Xdescription structures. X X.SH EXAMPLES X.nf X#include X#include X XFILE *file; Xchar *filename; Xstruct topology *object; X Xif((file=fopen(filename,"w"))==NULL) { X fprintf(stderr,"cannot open %s\n",filename); X exit; X } X/* write 'object' to 'filename' */ Xwt_obj(file,object); Xfclose(file); X X.fi X.SH AUTHOR XStewart Dickson X.SH FILES X$SPD_DIR/src/wt_obj.c X$SPD_DIR/include/objects.h X X.SH SEE ALSO Xobjects (5 local) Xrd_obj() (3 local) !EOR! echo extracting man/man3/Make.poly2obj echo mkdir ./man mkdir ./man echo mkdir ./man/man3 mkdir ./man/man3 sed 's/^X//' > man/man3/Make.poly2obj << '!EOR!' X# file: $(SPD_DIR)/man/man3/Make.poly2obj X X# description: Instructions for printing manual section 3 of the Stewart X# Dickson computer modeling package. X Xalloc_obj: alloc_obj.sl X troff -man -t alloc_obj.sl |rsh tpg lpr -t X Xapp_obj: app_obj.sl X troff -man -t app_obj.sl |rsh tpg lpr -t X Xrd_poly: rd_poly.sl X troff -man -t rd_poly.sl |lpr -t X Xwt_obj: wt_obj.sl X troff -man -t wt_obj.sl |rsh tpg lpr -t !EOR! echo extracting man/man5/objects.sl echo mkdir ./man mkdir ./man echo mkdir ./man/man5 mkdir ./man/man5 sed 's/^X//' > man/man5/objects.sl << '!EOR!' X.TH OBJECTS 5 "27 Jul 1988" X.UC 4 X.SH NAME Xobjects - ASCII object description formats and data structure. X.SH SYNOPSIS X#include X.in -4 X.SH DESCRIPTION X.ad n X.fi X X.B WAVEFRONT ASCII OBJECT DESCRIPTION X XThis system adheres to ASCII object description conventions used by XWavefront Technologies, 'model', 'pv' and 'image' and the Stewart Dickson Xenhancements. Files using this convention should be named using the '.obj' Xsuffix. Object description directives include the following: X X# comment X X# object description file inclusion X.br Xcall filename.obj X X.br X# material description file inclusion X.br Xmtllib filename.mtl X X.br X# texture map description file inclusion X.br Xmaplib filename.map X X# material application directive X.br Xusemtl mtl_name X X.br X# texture map application directive X.br Xusemap map_name X.br Xusemap off X X.br X# element grouping directive X.br Xg name X X.br X# allocation specification for vertices (comment to Wavefront) X.br X! vertices 5000 X X.br X# 3D geometrical vertex specification (without topology) X.br Xv 1.000 2.000 3.000 X X.br X# allocation specification for texture vertices (comment to Wavefront) X.br X! tverts 5000 X X.br X# texture map index specification X.br Xvt 0.0 [0.05] [1.0] X X.br X# allocation specification for vertices per point element and point elements X.br X# (comment to Wavefront) X.br X! pverts 200 X.br X! points 100 X X# topological element type 'point' X.br Xp 11 12 13 14 15 X X.br X# allocation specification for vertices per line element and line elements X.br X# (comment to Wavefront) X.br X! lverts 200 X.br X! lines 100 X X# topological element type 'line' X.br Xl 2 3 4 5 6 X X.br X# allocation specification for vertices per face element and face elements X.br X# (comment to Wavefront) X.br X! fverts 4 X.br X! faces 10000 X X# topological element type 'filled face' X.br Xf 7 8 9 10 X X# topological element type 'face outline' with texture indices X.br Xfo 11/1 12/4 13/5 14/2 X X# allocation specification for parametric surface patches X.br X# (comment to Wavefront) X! patches 500 X X# parametric surface patch resolution (default is 4 X 4) X.br Xres u_res v_res X X# parametric surface element type 'B-Spline Patch' X.br Xbsp [set of 16 control vertex indices] X X# parametric surface element type 'Bezier Patch' X.br Xbzp [set of 16 control vertex indices] X X# geometrical smoothing directive X.br Xs 0 X.br Xs off X X# ray tracing directive X.br Xtrace_object object_name X X# shadow casting directive X.br Xshadow_object object_name X X.nf X# The following graphical 'meta-elements' are not implemented in X# Wavefront Technologies software. They must be expanded using X# 'expmeta(1 local)'. Files containing 'meta-elements' should be named X# using the file suffix ".meta". X X# allocation directive for circles (comment to Wavefront) X! circles 1000 X X# graphical meta-element type circle X.br X*c [center vertex index] [radius] [resolution] X X# allocation directive for spheres (comment to Wavefront) X! spheres 1000 X X# graphical meta-element type sphere X.br X*s [center vertex index] [radius] [resolution] X X# graphical meta-element type 'Cardinal Spline Patch' X.br Xbcp [set of 16 control vertex indices] X X.fi X X XObject files adhering to the '.obj' format are supported by all of the Xprograms in the locally-developed graphics tool package via the functions X.B rd_obj(3) Xand X.B wt_obj(3). X X X.B IGES X XThe IGES (Initial Graphics Exchange Standard) Version 2.0 graphical object Xdescription format is supported through object file conversion programs X\(see X.B wf2IGES(1) IGES2wf(1) rd_IGES(3) Xand X.B wt_IGES(3) X\). This is the ANSI graphics format defined by the National Bureau of XStandards. More information about IGES can be found in U.S. Department of XCommerce document number PB83-137884, available from the National Technical XInformation Service, Springfield, VA 22161. X XThe IGES entity types supported are: connected line segments organized as X.B copious data Xentities; 'node' entities; and 'finite element' entities of type 'linear Xtriangle' and 'linear quadrilateral'. Files using IGES conventions Xshould be named using the '.igs' extension. X X.B MOVIE.BYU X XObject files of the type used by MOVIE.BYU are supported through object file Xconversion programs (see X.B byu2obj(1) obj2byu(1) rd_byu(3) Xand X.B wt_byu(3) X\). X X.B GRASS X XObject files of the type used by Tom DeFanti's GRASS system are supported Xthrough object file conversion programs (see X.B vg2sg(1) X\). This object description is a simple vector list composed of lines of Xinteger vertices ordered X Y Z separated by spaces followed by a carriage Xreturn. Vertices are connected unless separated by a line consisting of 'J'. X X.B SKIDMORE, OWINGS AND MERRILL X XBinary object files of the type used by Skidmore, Owings and Merrill drafting Xprograms are supported through object conversion programs (see X.B gr2obj(1) X\). Files using this format are named using the file extension '.gr'. XThe binary file is of the following form: X X.nf X.B HEADER X(data type char *) the string "GRAPHICS\\0": 9 bytes X(data type short) header length : 2 bytes X(data type short) header type : 2 bytes Xvariable length header Xif header type = 1: id name X short length ; char *string X 2: time X short length ; long time X 3: comment X short length ; char *comment X -1: end of header X X.fi XGraphical Entity Type X.B NODE X(vertex) X.nf X(data type char) entity type = 8 : 1 byte X(data type short) length of entry to follow = 25 : 2 bytes X(data type double float) X coordinate : 8 bytes X(data type double float) Y coordinate : 8 bytes X(data type double float) Z coordinate : 8 bytes X(data type char) group number : 1 byte X X.fi XGraphical Entity Type X.B LINE SEGMENT X.nf X(data type char) entity type = 16 : 1 byte X(data type short) length of entry to follow = 15 : 2 bytes X(data type long) color : 4 bytes X(data type long) node (endpoint) 1 index : 4 bytes X(data type long) node (endpoint) 2 index : 4 bytes X(data type short) plot data (compressed pen/vector type) : 2 bytes X(data type char) group number : 1 byte X X.fi XGraphical Entity Type X.B POLYGON X.nf X(data type char) entity type = 24 : 1 byte X(data type short) length of entry to follow = 42 + strlen(key) + 4*nodes : 2 bytes X(data type double float) X coordinate of centroid of polygon : 8 bytes X(data type double float) Y coordinate of centroid of polygon : 8 bytes X(data type double float) Z coordinate of centroid of polygon : 8 bytes X(data type long) color : 4 bytes X(data type long) compressed polygon fill indicators : 4 bytes X(data type long) binary time stamp : 4 bytes X(data type short) plot data (compressed pen/vector type) : 2 bytes X(data type short) number of nodes in polygon : 2 bytes X(data type char) group number : 1 byte X(data type char) string length : 1 byte X(data type char) key : variable Xa number of node references: X (data type long) node (endpoint) 1 index : 4 bytes X X.fi XGraphical Entity Type X.B TEXT X.nf X(data type char) entity type = 32 : 1 byte X(data type short) length of entry to follow = 67 + strlen(font) + strlen(text) : 2 bytes X(data type double float) X coordinate of start of text : 8 bytes X(data type double float) Y coordinate of start of text : 8 bytes X(data type double float) Z coordinate of start of text : 8 bytes X(data type double float) height of text : 8 bytes X(data type double float) angle of text : 8 bytes X(data type double float) spacing of text : 8 bytes X(data type long) color : 4 bytes X(data type long) compressed text fill indicators : 4 bytes X(data type long) binary time stamp : 4 bytes X(data type short) plot data (compressed pen/vector type) : 2 bytes X(data type short) justification (right/left) : 2 bytes X(data type char) group number : 1 byte X(data type short) string length : 2 bytes X(data type char*) font : variable X(data type short) string length : 2 bytes X(data type char*) text : variable X X.fi XGraphical Entity Type X.B SYMBOL X.nf X(data type char) entity type = 40 : 1 byte X(data type short) length of entry to follow = 79 + strlen(name) + strlen(key) : 2 bytes X(data type double float) X translation of symbol : 8 bytes X(data type double float) Y translation of symbol : 8 bytes X(data type double float) Z translation of symbol : 8 bytes X(data type double float) X scale of symbol : 8 bytes X(data type double float) Y scale of symbol : 8 bytes X(data type double float) Z scale of symbol : 8 bytes X(data type double float) X rotation of symbol : 8 bytes X(data type double float) Y rotation of symbol : 8 bytes X(data type double float) Z rotation of symbol : 8 bytes X(data type long) binary time stamp : 4 bytes X(data type char) group number : 1 byte X(data type short) string length : 2 bytes X(data type char*) name : variable X(data type short) string length : 2 bytes X(data type char*) key : variable X.fi X XFunctions for reading and writing geometrical object description files are Xinterfaced to graphical programs through the data structure X.B $SPD_DIR/include/topology.h. XCompilation instructions should include 'cc -I$(SPD_DIR)/include ...' X X.SH DATA STRUCTURE X X.nf X/* file: topology.h X X description: Data structure for linking topological aspects of a 3-D X graphical object. Objects are described via the ASCII X object description language as being composed of vertices X and topological elements of several types with material X attributes. This system provides sufficient information X for determining the complete geometry, topology and material X properties of the object. This data structure provides the X framework for a complete linkage of these object attributes. X X Additionally is supported the recursive definition of X 'graphical meta-elements' which enable the efficient X specification of object hierarchical morphology (detail). X X author: Stewart Dickson X*/ X X/* define a 32-bit Magic Number for portability */ X#define SPD_MAGIC 0xff5500aa X X/* define values of object-to-polygon mapping directives */ X#define MAP 1 X#define NOMAP 0 X X/* define several types of parametric surfaces */ X#define BSPLINE 0 X#define BEZIER 1 X#define CARDINAL 2 X Xstruct sizes { X char notraces; X char noshados; X char nocalls; X char nolibs; X char nomaps; X char valence; X char nosgrps; X short nolverts; X short nofverts; X short nopverts; X short nogroups; X int nolines; X int nofaces; X int nopoints; X int noverts; X int notverts; X int noedges; X int nomtls; X int nocircs; X int nosphrs; X int noptchs; X int nogverts; X int nogfaces; X int nogpoints; X int noglines; X int nogsphrs; X int nogcircs; X int nogptchs; X int nomdefs; X int nomrefs; X int nomops; X X char objname[128]; X }; X Xstruct topology { X X struct sizes size; X X struct sizes alloc; X X struct bounding_box { X float minx; X float maxx; X float miny; X float maxy; X float minz; X float maxz; X } b_box; X X struct tracobj { X char objname[128]; X } **trace_obj; X X struct shadobj { X char objname[128]; X } **shad_obj; X X struct caldfile { X char filnam[128]; X } **call; X X struct library { X char libnam[128]; X } **lib; X X struct material { X char mtlnam[128]; X int illum; X struct RGB { X float red, green, blue; X } Ka, Kd, Ks, Ni, Tf; X float Ns, dissolve; X float mass_dens, surf_elast, surf_stiff; X float damping, visc_drag; X } **mtl; X X struct mapping { X char mapnam[128]; X } **map; X X struct objgrps { X int noverts; X int nopoints; X int nolines; X int nofaces; X int nocircs; X int nosphrs; X int noptchs; X X char grpnam[128]; X X int *vertno; X int *pointno; X int *lineno; X int *faceno; X int *circno; X int *sphrno; X int *ptchno; X } **group; X X struct vertex { X char facec; X char edgec; X short group; X int mtl; X float x; X float y; X float z; X struct Vector_struct { X float x; X float y; X float z; X } normal; X int *faceno; X int *edgeno; X } **vertex; X X struct faces { X char bevel; X char mapflg; X short map; X short smooth; X short group; X short vertc; X short edgec; X int mtl; X int *vertno; X int *tvertno; X int *edgeno; X struct Vector_struct normal; X } **face; X X struct textur { X float u; X float v; X float w; X } **texver; X X struct lines { X short vertc; X short group; X int mtl; X int *vertno; X } **line; X X struct edges { X int vertno[2]; X int faceno[2]; X float length; X float theta; X } **edge; X X struct points { X short vertc; X short group; X int *vertno; X } **point; X X struct circles { X short group; X short res; X int vertno; X float beg_ang; X float end_ang; X float rad; X struct Vector_struct x, y; X } **circl; X X struct spheres { X short map; X short smooth; X short group; X short res; X int vertno; X int mtl; X float rad; X } **spher; X X struct bicubes { X char type; X char u_res; X char v_res; X short map; X short smooth; X short group; X int mtl; X int vertno[4][4]; X int tvertno[4][4]; X } **bicub; X X struct topology **metadef; X X struct meta_reference { X float orient[4][4][4]; X struct topology *meta; X } **metaref; X X struct meta_oper { X char opname[128]; X struct topology *(*function)(); X struct param_iface *objarg; X } **metaop; X X }; X.fi X XThe motivation behind the design of this data structure is to make available Xto an application program an explicit description of the entire topology of Xan object. The following description of the elements of this structure will Xfurther elucidate its utility. X XDesigning the object as single structure enables programs to deal with Xobjects as named entities, with no prior assumptions about their contents. XThe contents are expressed in an explicit enough fashion that all information Xabout the object is completely contained. X X.B object->alloc Xis the structure containing the current allocation for the object. X.B alloc_obj(3 local), X.B rd_obj(3 local) Xand X.B realc_obj(3 local) Xpopulate the X.B alloc Xstructure upon completion. X X.B object->size Xis the structure containing the the current population of the structure. XThe value of each population element must be less than its corresponding Xallocation parameter. X.B rd_obj(3 local) Xand all other functions which create object structures populate the X.B size Xstructure upon completion. X X.B object->b_box Xcontains the positive and negative extrema of the object along each of the XX, Y and Z Cartesian axes. Thus, the extrema are reduced to six values. XThe object always is completely contained by its bounding cube, therefore Xprograms which scan many objects may first test whether the scan falls Xwithin each object's bounding cube before processing the object. X X.B object->trace_obj Xspecifies the (possibly alternate) object file to use in ray tracing Xillumination calculations. X X.B object->shad_obj Xspecifies the (possibly alternate) object file to use in shadow casting Xillumination calculations. X X.B object->call Xis a list of files called by this object. X X.B object->lib Xis a list of material and texture-mapping libraries used by this object. X.B rd_mtl(3 local) Xmay be used to read the material libraries. X X.Bobject->mtl Xis a list of materials used by the object. X X.B object->mtl->mtlnam Xis a string containing the name of the material as specified in the Xmaterial library and referenced in the object. X X.B object->mtl->Ka, X.B object->mtl->Kd, X.B object->mtl->Ks, X.B object->mtl->Ni X.B object->mtl->Ns Xand X.B object->mtl->Tf Xspecify the X.B ambient illumination, X.B diffuse scattering, X.B specular reflection, X.B index of refraction, X.B directional exponent of specular reflection Xand X.B transmission filter Xoptical properties of the material being used by the object. Note that X.B index of refraction Xis defined as a spectral curve, as occurs naturally, which permits glass to Xhave prismatic properties. Wavefront does not support this. X X.B object->mtl->mass_dens, X.B object->mtl->surf_elast Xand X.B object->mtl->surf_stiff Xspecify the mechanical properties of the material. These parameters permit Xthe treatment of objects as physical surfaces or, if constructed suitably, Xphysical volumes. This permits the modeling of surfaces which deform and Xanimate under the influence of 'real' Newtonian forces. X X.B object->map Xis a list of texture or other maps used by the object. X X.B object->group Xis a list of the vertex and element groups defined in the object and their Xmembership. X X.B object->vertex Xis the geometric vertex or node database for the object. X X.B object->vertex->x, X.B object->vertex->y Xand X.B object->vertex->z Xspecify the coordinate in Cartesian three-space for the vertex. X X.B object->vertex->mtl Xis the index of the material (as listed in the X.B object->mtl Xarray of structures) to be used at this vertex. X X.B object->vertex->facec, X.B object->vertex->edgec, X.B object->vertex->faceno Xand X.B object->vertex->edgeno Xlist the number of faces and edges containing this vertex and the indices to Xthese faces and edges as listed in the X.B object->face Xand X.B object->edge Xarrays of structures. The faces and edges are listed in a counter-clockwise Xorder about the vertex (according to the right-hand rule) relative to the Xeffective surface normal at the vertex. This ordering assures a topologically Xhomogeneous surface. This is one-third of the specification of the Xtopological connectivity of the object. X X.B object->normal Xcontains the effective normal to the surface located at the vertex. This is Xdefined as the sum of normal vectors to the polygons intersecting at this Xvertex. As this is redundant, this structure is also used in mechanical Xsimulations to store the X.B directed velocity Xof the vertex. This plus the X.B mass density Xof the vertex gives the X.B momentum Xfor the calculation of physical interactions of the object. X X.B object->face Xis the polygon or connected topological two-cell database for the object. XThis specifies the connectivity of the vertices in forming surfaces and Xvolumes. X X.B object->face->map Xand X.B object->face->mtl Xspecify the indices to texture or other mapping and material to be applied Xto this polygon, as listed in the X.B object->map Xand X.B object->mtl Xarrays of structures. X X.B object->face->smooth Xand X.B object->face->bevel Xspecify the membership in an illumination modeling geometric smoothing group Xand the specification of bevel geometric interpolation of the surface across Xthis polygon. This technique is an interpolation of the normal vector to the Xsurface across the polygon in two different flavors, used by rendering Xprograms to eliminate the polygonal 'faceting' artifice caused by the Xapproximation of a continuous curved surface by a finite number of polygons. X X.B object->face->group Xspecify the membership in a modeling element group of the polygon. X X.B object->face->mapflg Xis used to distinguish between a 'face outline' and a 'filled face' in Xinteractive display programs. This is also used by X.B objmap(1 local) Xto determine which elements to use as specification of the orientation of Xinstances of other objects. X X.B object->face->vertc, X.B object->face->edgec, X.B object->face->vertno, X.B object->face->tvertno Xand X.B object->face->edgeno Xspecify the number of X.B vertices Xand X.B edges Xand the list of indices to X.B vertices, X.B texture vertices Xand X.B edges Xin the object as listed in the X.B object->vertex, X.B object->texver Xand X.B object->edge Xarrays of structures. Faces close themselves. The first vertex is listed Xonly once and the last vertex is assumed to close the polygon. The ordering Xof the polygon specifies the direction of the normal vector to the surface at Xthe polygon, X.B object->face->normal. X XThe normal is constructed as the vector cross-product of the Xsecond edge of the polygon into the first. The sense of ordering of the Xvertices is counter-clockwise about the centroid of the polygon when the Xpositive sense of the normal indicates the 'outward' direction from a closed Xsurface. X XThe above convention is used by rendering/shading algorithms to economize on Xcalculations assuming polygons whose normal vectors are directed away from Xthe viewpoint will not be seen. This leads to 'directionally invisible' Xsurfaces when the inside of surfaces is exposed. The option of not culling Xbackward-facing polygons is useful in these situations, because the user is Xnot then obligated to create a double surface, one half of whose polygons are Xsimply ordered in reverse from the other half. X XErroneously backward-facing polygons are often difficult to detect in Xmodeling programs. The specification of connectivity to vertices and edges Xof polygons is the second one-third of the complete specification of the Xtopological connectivity of the object. The complete connectivity may be used Xto detect and correct polygons which deviate from the homogeneity of the Xsurface. X X.B object->texver Xis the list of texture vertices used by the object. A texture vertex is an Xindex into a texture map which may be a rectangular or cubic binary array or Xa stochastic or algorithmic texture generation scheme. X X.B object->line Xis the list of connected line segment elements in the object. The elements Xin this structure are similar in meaning to those in X.B object->face. XConnected line segment elements are not assumed to connect themselves. X X.B object->edge Xis the list of edges or intersections between pairs of adjacent polygons in Xthe object. X X.B object->edge->vertno Xand X.B object->edge->faceno Xspecify the indices of the two vertices in this edge and the polygons which Xintersect at this edge, as listed in the X.B object->vertex Xand X.B object->face Xarrays of structures. This is the last one-third which completes the Xspecification of the topological connectivity of the object. X X.B object->edge->length Xand X.B object->edge->theta Xare the length of the edge and the dihedral angle between the two polygons Xintersecting at this edge. These two values are used to simulate Xelasticity of the surface, calculated as a force proportional to the Xelongation of an edge from an at-rest length, and stiffness, calculated as a Xtorque about the edge proportional to the change in angle (moment of Xbending) between the two polygons at this edge, compared to an at-rest Xvalue. X XThe sense (sign) of the dihedral angle is defined as positive if the vector Xcross-product of the normal vector to polygon 0 into the normal vector to Xpolygon 1 has the same direction as the vector from vertex 0 to vertex 1 of Xthe edge and negative otherwise. X X.B object->point Xis the list of point elements in the object. X X.B object->circl Xis the list of circular arc elements in the object. These specify continuous Xcircular curves in three-space. The curves are assumed drawn in the Y-Z XCartesian plane then rotated using nested gimbals such that the X and Y Xaxes of the original frame of reference are aligned with the vectors X.B object->circl->x Xand X.B object->circl->y. X X.B object->circl->res Xis the specification of the drawing resolution to use by interactive Xdisplay programs or when expanding the arcs into connected line segments. X X.B object->spher Xis the list of sphere elements in the object. These specify continuous Xspherical surfaces in three-space. X X.B object->bicub Xis the list of bi-parametric cubic spline surface patch elements used by Xthe object. The supported basis types describe continuous surfaces Xthrough the positioning of a four-by-four grid of control vertices in XCartesian three-space. X X.B object->bicub->type Xspecifies one of the three supported basis matrices used in drawing Xparametric cubic spline surfaces. The supported types are X.B BSPLINE, X.B BEZIER Xand X.B CARDINAL. XSee X.B REFERENCES Xfor further information. X X.B object->bicub->u_res Xand X.B object->bicub->v_res Xspecify the rectangular mesh resolution to use in interactive drawing Xprograms and in expanding the parametric surfaces to finite polygon Xapproximations. X X.B object->metadef Xsupplies the capability for the recursive definition of an object 'meta Xelement', or the description of a morphological type which is to be Xrepeated throughout the object. This feature allows a compact representation Xfor object instances as well as a language for high-level specification Xof object structure. The recursion implies that the morphological Xspecification can be hierarchical. X X.B object->metaref Xis a reference to or instance of an object meta-element. The orientation Xstructure specifies the orientation of the element in three-space, while the X.B object->metaref->meta Xpointer-to-structure allows elements defined in one level of recursion to Xbe references in another. X X.B object->metaop Xis an operation on object meta-elements. This is required in a descriptive Xmodeling system which performs Combinational Solid Geometry or other Xoperations as a means for defining form. X X.B object->metaop->function Xis the pointer to the function called to perform this operation. X X.B object->metaop->objarg Xis the standardized formal parameter interface used by object operator Xfunctions in this object modeling system. X X X.SH AUTHOR XStewart Dickson X.SH FILES X.nf X$SPD_DIR/include/topology.h X$SPD_DIR/src/obj_lib/alloc_obj.c X$SPD_DIR/src/obj_lib/rd_IGES.c X$SPD_DIR/src/obj_lib/rd_byu.c X$SPD_DIR/src/obj_lib/rd_gr.c X$SPD_DIR/src/obj_lib/rd_obj.c X$SPD_DIR/src/obj_lib/wt_IGES.c X$SPD_DIR/src/obj_lib/wt_byu.c X$SPD_DIR/src/obj_lib/wt_obj.c X X.SH SEE ALSO X.nf Xbyu2obj(1 local) Xgr2obj(1 local) Xsg2ds(1 local) Xvg2sg(1 local) Xwf2IGES(1 local) X Xalloc_obj(3 local) Xrd_IGES(3 local) Xrd_byu(3 local) Xrd_gr(3 local) Xrd_mtl(3 local) Xrd_obj(3 local) Xwt_IGES(3 local) Xwt_byu(3 local) Xwt_obj(3 local) X Xmaterials(5 local) X X.SH REFERENCES X XSilicon Graphics IRIS Graphics Library Programming Guide X XFoley and Dan Dam, X.ul XFundamentals of Interactive Computer Graphics, X1982, Addison-Wesley, (Chapter 13.5-6, Parametric Cubic Curves and Surfaces) !EOR! echo extracting man/man5/poly.man echo mkdir ./man mkdir ./man echo mkdir ./man/man5 mkdir ./man/man5 sed 's/^X//' > man/man5/poly.man << '!EOR!' X.TH POLY 5 X.SH NAME Xpoly \- polyhedron database X.SH DESCRIPTION XThe directory X.B /usr/lib/polyhedra Xcontains an index file and many polyhedron description files. XThe index file consists of lines composed of the polyhedron number followed Xby a horizontal tab and the polyhedron's name. XThe polyhedron's number is also the name of its description file. XThe routines of X.IR poly (3) Xread such description files. X.PP XThe description file consists of a number of fields. XA field header is a line with an initial X.B : . XThe remainder of the line is the field name. XFields start with a field header line and are terminated by the next field header line Xor by end of file. XA polyhedron's description is terminated by the field X.B EOF . XThe fields include, Xbut are not limited to, X.TP 12n X.B number Xthe polyhedron's number (written and read with the X.B %d Xprintf/scanf format). X.TP X.B name Xthe polyhedron's name is less than 128 characters long and is not capitalized. X.TP X.B symbol Xthe X.IR eqn (1) Xinput for two symbols separated by a tab; Xthe Johnson symbol, and the Schla\*:fli symbol. X.TP X.B dual Xthe name of the dual polyhedron optionally followed by a horizontal tab Xand the number of the dual. X.TP X.B vertices Xthe first line contains the total number of vertices in the database entry and Xan optional second number indicating the number of vertices in the solid Xseparate from the planar net. The vertices are arranged one per line as an X.RI ( x ,\fIy\fR, z ) Xcoordinate of white-space Xseparated values (described below). XThe vertices are implicitly numbered starting at zero. X.TP X.B svertices Xthe following line contains the total number of vertices, and an itemized list Xof vertices with various valences. X.TP X.B net Xthe first line contains the number of faces and the maximum number of Xvertices in a face. XThe remaining lines are the faces in the planar net. XEach face has a vertex count followed by the vertex numbers. XThe vertices are listed in counter-clockwise order Xas viewed from outside the polyhedron. X.TP X.B sfaces Xthe following line contains the total number of faces followed by an itemized Xlist of the number of faces having various numbers of sides in the form: Xnumber_of_faces{number_of_sides} number_of_faces{number_of_sides}... X.TP X.B hinges Xthe first line contains the number of hinges in the planar net. XThe remaining lines are hinge connections. XThe format is X.IR "face1 side1 face2 side2 value" . XSides are numbered from zero. XIf the dihedral X.RI ( value ) Xis greater than \(*p, it is a reflex or re-entrant hinge. X.TP X.B solid Xthe first line contains the number of faces and the maximum number of Xvertices in a face. XThe remaining lines are the faces in the 3D polyhedron. XEach face has a vertex count followed by the vertex numbers. XThe vertices are listed in counter-clockwise order Xas viewed from outside the polyhedron. X.TP X.B dihedral Xthe first line contains the number of distinct dihedrals. XEach dihedral starts on a new line and has a count and a value. XIf the count is non-zero, Xthen that many X.I "face edge" Xpairs (one per line) follow the dihedral value. X.TP X.B EOF Xthe end of the polyhedron's description. X.PP XA value consists of a floating point number Xoptionally followed by a expression enclosed by X.B [] . XThe expression is the exact value represented in X.IR bc (1) Xcode with the following function meanings: X.EQ Xa(x) ~=~ {tan sup -1 {( x )}}, X.EN X.EQ Xb(x) ~=~ { ( x ) } sup { 1/3 }, X.EN X.EQ Xc(x) ~=~ {cos ( {x} ) }, X.EN X.EQ Xd(x) ~=~ {tan {( x )}}, X.EN X.EQ Xp ~=~ {pi}, X.EN X.EQ Xq(x) ~=~ {{x} sup 2}, X.EN X.EQ Xr(x) ~=~ {cos sup -1 {( x )}}, X.EN X.EQ Xs(x) ~=~ {sin ( {x} )}, X.EN X.EQ Xt ~=~ {phi}. X.EN XThe code may include assignments but does not include white space. X.SH FILES X.ta 31n X.F "/usr/lib/polyhedra/index " Xindex file X.br X.F "/usr/lib/polyhedra/[0-9]* " Xdescription files X.SH "SEE ALSO" Xpoly(3), Xpoly(7) X !EOR! echo extracting man/man5/Make.poly2obj echo mkdir ./man mkdir ./man echo mkdir ./man/man5 mkdir ./man/man5 sed 's/^X//' > man/man5/Make.poly2obj << '!EOR!' X# file: $SPD_DIR/man/man5/Make.poly2obj X X# description: instructions for printing section 5 of the Stewart Dickson X# 3D graphical modeling package X X# author: Stewart Dickson X Xobjects: objects.sl X troff -man -t objects.sl | rsh tpg lpr -t X Xpoly: poly.man X eqn poly.man |troff -man -t |rsh tpg lpr -t !EOR!