gCAD3D
Codes
File-formate
Binary-formate
File-formate gcad
File structure
Format mainmodel / submodels
Format Attributes
Examples
All objects in memory are kept in analytical form with all definition parameters
(Ascii text, analytical form)
The file format .gcad is the same as the internal format.
The objects can also be exported as mock-up elements,
tesselated for faster loading in assemblies, but without parametrics.
Other analytical export formats: .gcad, .iges
Mock-up export formats: Vrml-1, Vrml-2, obj, tess
If you save a model file as {base}/tmp/Model,
it will be loaded wenn the program starts.
{base} normally is ~/gCAD3D/.
File structure gcad
Structure of Model files:
The model files contain all subModels, NC-processes and applicationData
(data of plugins).
The format of the model files is ascii - text.
SubModels, Processes and applicationData are embedded into sections,
followed by the mainModel.
All sections before the mainModel start with:
SECTION {sectionTyp} {parameter}
and end with:
SECTIONEND
- subModels SECTION MODEL {modelname}
- point Tables SECTION PTAB {modelname} {ObjID}
- Meshes SECTION MESH {modelname} {ObjID}
- Processes (eg NC) SECTION PROCESS {processName}
- applicationData SECTION APPDAT {pluginName}
- mainModel ..
SECTION MODEL {modelname}
- Dynamic-Dataspace (settings, standards, End: ":DYNAMIC_DATA")
- Objectdata
SECTIONEND
SECTION PTAB {modelname}_{ObjID}
ptnr={nr of points}
{pointCoords, one point per line}
SECTIONEND
SECTION MESH {modelname}_{ObjID}
faces={nr of faces} edgelines={nr of edgelines}
{faces (3 indices for one face per line)}
edgeline={nr of edgeline} points={nr of points} edgetyp={edgetyp}
{edgeline (indices for points)}
SECTIONEND
SECTION PROCESS {processName}
- Objectdata
- process-specific-commands
SECTIONEND
SECTION APPDAT {pluginName}
- beliebige Daten;
werden nur von der Applikation {pluginName} geschrieben, gelesen.
SECTIONEND
Das mainModel contains the objectcodes, see Examples.
Format mainmodel / submodels:
- Section DYNAMIC_DATA (optional)
- Objectdata
Section DYNAMIC_DATA:
can have these records:
- MODSIZ Modelsize
- DEFTX Textsize
- VIEW active view
- CONST_PL active construction plane
- GATAB table graf. attributes
- :DYNAMIC_DATA end of section DYNAMIC_DATA
Objectdata:
see Codes,
see Beispiele.
Format Attributes:
The grafic attributes define linientypes, colours, transparency, textures.
GATAB starts the grafic-attributes-table, .
ENDGATAB end of table.
Grafic-Attributes-Records for Lines, Curves:
[T#]
H hide
T index Linetyp; 2=dash, 3=dashDot; see file cfg/ltyp.rc
Grafic-Attributes-Records for surfaces:
[C [H] [T#] [S#] [X"filename"<,parameters>]
H hidden
C R-G-B-Colors as 3 x 2 hex-chars; eg. green is C00ff00
T transparent; 0=not, 1=50% transparent, 2=full transparent
S symbolic; 0=not, 1=symbolic display
X textured surface; Format:
X"",X-scale,Y-Scale,X-Offset,Y-Offset,RotAng[,X-vec,Z-Vec]
consists of "/"
Offsets are Values from 0-1
RotAng in degree
Example line with linetype 2 (dashed):
GATAB
L20 T2
ENDGATAB
:DYNAMIC_DATA
L20=P(0 0 0) P(100 10 0)
#eof
Example area with colour:
# example GATAB: surface A20 has color e2dc27; surf. A21 is symbolic (not shaded)
GATAB
A20 Ce2dc27
A21 S1
ENDGATAB
:DYNAMIC_DATA
C20=P(50 100) 25
C21=P(100 100) 25
A20=C20
A21=C21
#eof
Examples:
Example mainmodel only:
# 2010/11/29-18:37:05
P1=P(0 0)
P2=P(200 20)
# Line from 2 points
L1=P1 P2
# circle from Center, Radius
C1=P(50 100) 25
# area from circle
A1=C1
# Ende
Example model file with subModel:
# 2010/11/29-18:37:05
SECTION MODEL SM1
# Cone from 1 Points 2 radius
B1=CON P(0 0) P(0 0 12) VAL(16) VAL(12)
SECTIONEND
# 2 references of submodel
M1="SM1" P(0 0)
M1="SM1" P(50 0)
# End
Example model with mesh:
SECTION PTAB _A1
ptnr=4
78.206807 -215.069439 0
75.797808 -206.220382 0
82.125568 -204.36855 0
83.557688 -210.647853 0
SECTIONEND
SECTION MESH _A2
faces=2 edgelines=1
3 2 1
3 1 0
edgeline=0 points=4 edgetyp=5
3 2 1 0
SECTIONEND
A1=PTAB
A2=MSH A1
Send bug-reports, suggestions for improvement to
franz.reiter@cadcam.co.at