###

####

###

###

###

###

###

###

###

###

###

###

##

###

###

###

###

###

###

    gCAD3D

    gCAD3D Codes and Formats

    General code format

    Variable
    Points
    Lines
    Vectors
    Circles
    Curves
    Plane / Reference system
    Surfaces
    Solids
    Notes / Dimensions
    Models
    Transformations
    Interactions
    Joints
    Group

    values             19 RAD_360 V20 X(10) SQRT(L20) ..
    ObjRefs            P(L20 0.5) ..
    properties         # properties filtercodes objName ..

    Program_codes

    Attributes          Linetype, default-color, ..
    Settings            Toolbars, Browser .. ON/OFF

    gcad file format

    General format

    The native (internal) format is .gcad.
      Its objectcodes are stored as asciitext, not binary.
      You can also create / modify modelfiles (.gcad) with any editor.

    Processing is done sequential by a interpreter.

    All objects in memory are kept in analytical form with all definition parameters
      (Ascii text, analytical form)

    Curves and surfaces (ellipses, Ruled and Revolved Surfaces) are
      not converted into Splines/NURBS, they are stored / exported
      in their orignal form.

    The file format .gcad is the same as the internal format.

    There are 3 types of codes:

      Definition-codes: Generates geometric objects.
        Format is: "{DB-obj} = {parameters ..} [# {properties}"

        DB-obj:
          is stored in DB,
          consists of a type-letter and a DB-index (the obj-ID or DB-ID)
          example: "P123" is a point with DB-index 123
          DB-index 0 is reserved for the active object;
          DB-indexes 1 to 19 should be kept free for script-functions.

        parameters:
          functionCodes   (eg INT (intersect) CUT (trim) ..)
          DB-objs         (eg L20 (db-line 20)
          dynamic-objs    (eg P(10 5 0) ..; see dynamic-obj)
          values          (eg 10 (direct) or V20 (DB-variable 20) or VAL(expression) ..)
                          see values
          propertyCodes   (eg REV (revers) ..)

        properties (optional, separated by '#', see properties)

        Definition-codes for points eg:           (see Points)
          P123=P(10 5 0)              # point-123 = point at x=10, y=5, z=0
        - with parameters:
          P124=INT S30 L24            # intersection curve-30 with line-24
          P126=PRJ P37 L21            # projection of P37 onto line-21

        Definition-codes for lines eg:            (see Lines)
          L20=L(P20 P(10 5 0))        # line from point 20 to coords (10 5 0)
        - with parameters:
          L20=TNG P30 C20             # line-20 is a tangent from point-30 to circle-20

        Create definition-codes:
          - with module CAD - see using CAD
          - or with module MAN - see using MAN
          - or produce the codes direct (with editor or scripts or plugins ..)

      Execution-codes:
         - set / change attibutes (Linetype, color, construction-plane ..)
         - consist of a direct statement,
         eg DEFCOL 0 0 220     # set default colour blue
         see Attributes
         and Settings

      Programming-codes:
        - control the programflow (IF JUMP CALL EXIT DEBUG PRI ..)
        eg PRI "P20=" P20"     # print coords. of point P20
        see - Programmingcodes

    All objects stored in DB need one of the following codeletters:

    Codeletters:
    A = Area (surface)
    B = Body (Solid)
    C = Circle (circle),
    D = Direction (vector)
    I = Interaction
    J = Joint
    L = Line
    M = Model, Sub-model, mockup model, standard part of
    N = Note, Tag, bitmap image
    P = Point (points)
    R = Refsys (referencesystem, plane)
    S = Spline (B-spline-curve, polygon, trimmed-curve, ..)
    T = Transformation (Translation, rotation, .. )
    U = Union (Group)
    V = Variable (value number.)

    DB-index:

      0 (zero) can not be used (is the current object)
      Is a positive number for permanent objects,
      Is a negative number for temporary objects that are dynamically generated.

    Variable
    Identification key for a variable is V.

    see also CAD functions variable

    - stores a numeric value in DB;  "V{DB-index}={value}"

      Example:
        V20=25              # set DB-variable[20] = 25
        C20=P20 V20         # use DB-variable[20] for circle - set radius = 25

    Numeric values see values

    Point
    Identification letter code of a point is P.

    see also CAD-point functions,
    see also ObjRefs

    # 3D point absolute
    P21 = P(10 20 0)

    # points from polar coordinates (rotate around the active Z-axis)
    # P = BasePoint, RotationAngle, [Tilt Angle,] Distance
    P5 = P4 ANG(90) 25           #  25 units from P4 along X-axis rotated 90 deg around origin/Z-axis
    P6 = P4 ANG(90) ANG(45) 50   # rotate P4 90 degrees and tilt up 45 degrees, length 50.

    # create point with offset
    # P = BasePoint, [X-offset,] [X-offset,] [Z-offset]
    P21 = P20 X(10) Y(5)         # move point P20 10 units along x-axis, 5 units along y-axis

    # move point;
    # P = BasePoint, Direction, [Distance,] [NormalDistance]
    P21 = P20 D20 10             # move P21 into direction of vector D20 distance 10
    P22 = P21 D(P20 P21) 10      # - vector from P20-P21
    P23 = P20 D(L20) 10          # - vector from line

    # get characteristic points of objs; eg startpoint, endpoint, midpoint ..
    See characteristic-point-functions
    P20=C20             # center of circle: or
    P20=C20 PTS(1)
    P24=L21 PTS(2)      # endpoint of line, or:
    P24=P(L21 PTS(2))
    P7=S20 PTS(2)       # endpoint of curve S20
    P3=P1 P2            # midpoint
    P3=L1 PTS(3)        # midpoint

    # point from joint-import (joint 1 from submoodel M20)
    P20=IMP M20 J1

    # Rotate a Point around the Z-axis of the active construction plane
    # P = BasePoint, RotationAngle, [Tilt Angle,] [Distance]
    #   optional: rotate (tilt) normal to the Z-axis
    #   optional: distance from BasePoint to new point
    P3 = P1 P2 ANG(180)       # rotate P2 180 degrees around P1/Z-axis
    P4 = P1 P2 ANG(90) ANG(45)       # rotate P2 180 degrees around P1/Z-axis
    P5 = P1 P2 ANG(45) DX            # rotate P2 45 degrees around P1/DX
    P6 = P1 L2 ANG(30)               # rotate P1 30 degrees around line L2

    # Rotate a Point around a axis:
    # P = point, rot-axis, angle
    P21=P20 L20 ANG(30)    # rotate P20 30 degrees around line L20

    # project point onto obj (line, circle, spline ..)
    # P = [PRJ] point, curve [solution-nr]
    P2 = P1 L1        # project P1 onto line L1
    # or
    P2 = PRJ P1 L1
    P11=P1 S10 MOD(2)     # 2. solution-point of projetion onto curve S10
    P22=P20 R20           # projection onto plane R20

    # point from intersection obj - obj (line, circle, spline ..)
    # P = INT curve, curve, [solutionNr]
    P4=INT L1 L2          # point from intersection line L1 - Line L2
    P4=INT C1 C2 MOD(2)   # intersection-point nr. 2 from intersection C1 - C2
    P41 = L20 A20         # intersection Line - B-SplineFläche

    # transfer point into other reference-system
    # P = TRA  point, plane
    P20=TRA P20 R20  # transform point P10 into reference-system from plane R20

    Line
    Identification key for Line is L.

    see also CAD-Function Linie
    see also ObjRefs

    P20=10 0 0
    L20= P20 P(100 100 0)        # line between 2 points

    L21=Y(10)                    # horizontal line at Y=10

    L22=DY P20                   # direction y-axis, starting at P20

    # line with given direction:
    #   additional parameter can be length, offset-values, CX, UNL/UNL1/UNL2

    L23=P20 ANG(45)              # starting at P20, with direction (vector)

    L24=D(ANG(0) ANG(30)) P20    # with rot-angle and tilt-angle
    # rotation is around active z-axis, tilt is normal to z-axis.

    L25=D(L24) P(50 -100 0)      # parallel L24, new startpoint

    L26=L23 L24                  # angle bisector, from intersectionpoint

    L27=L23 L24 ANG(90)          # angle bisector, additionally rotated

    # line tangential to 2 objects:
    #   additional parameter can be MOD, REV, UNL/UNL1/UNL2

    # line tangent to 2 circles (Location: in out)
    L31=TNG C20 C21 MOD(2)

    # line tangential to circle, parallel to line.
    L30=TNG C20 D(L1) MOD(1)

    # line tangent to circle with a fixed angle
    L32=TNG C20 D(ANG(45)) MOD(1)

    # tangent line through point P10 to S10 curve.
    L33=TNG P20 S10 MOD(1)

    # line through point, tangential to circle
    L34=TNG P1 C1 MOD(1)

    # cut line; result is a trimmed-curve (S)
    S20=CUT R20 R21

    # projection of a line onto plane.
    L40=PRJ L20 R20

    Vector / direction
    Identification key for a vector is the letter D ( "Direction").

    A vector defines a direction and is not bound to any position.
    representation of vectors:
      - vectors are only temporarily displayed,
      - Always in the center of the screen.
      - Normalized vectors (with length 1) in black, otherwise red.

    The following are standard vectors:
      DX DY DZ           according to standard axis directions;
      DIX DIY DIZ        correspond to the inverse standard axis directions

    Display of Vectors:
    - Vectors are only temporarly represented;
    - standard-vectors are displayed in the lower right corner
    - scan through defined vectors with the PageUp or PageDown button
    - Standardized vectors (with length 1) as dashed line, otherwise as full line.

    See also CAD-Function Vector
    Definition of a vector: see vector
    see also dynamic vectors

    Standard formats

    # defined by vector direction and length.
    # D = D(dx, dy [, dz]) [length] [ "REV"]
    D1=DX 100
    D2=D(10 0)
    D3=D(0.7 0 0.7) 100

    # Define vector by rotation-angle, tilt-angle (optional), vector length (optional).
    D3 = ANG(30) 100
    D4 = ANG(90) ANG(30) 100
    # First rotate around Z-axis, then around the new Y-axis.
    # ANG(0) ANG(0)      - gives Vector 1,0,0
    # ANG(90) ANG(0)     - gives Vector 0,1,0
    # ANG(90) ANG(30)    - gives Vector 0,0.9,0.5
    # ANG(180) ANG(30)   - gives Vector -0.9,0,0.5

    # vector from 2 points, vector length (optional)
    D5=P1 P2
    D5=P1 P2 100

    # vector from line, vector length (optional)
    D6=L10 100

    # vector = tangent to curve
    D25=C20 PTS(1)   # tangent at startpoint of C20
    D24=C20 0.25     # tangent to circle at 25% (eg 90 deg for full circle)

    # standard-vectors of Circ, ellipse, Plane through Modifier:
    #  MOD  plane   ellipse       circle
    #   0   Z-axis  normal-axis   normal-axis
    #   1   X-axis  major-axis    center-startpoint
    #   2   Y-axis  minor-axis    center-endpoint

    D20 = C20 MOD(2) provides the vecto centerpoint - endpoint of C20

    # Normal vectors:
    #   D = Circle
    #   D = Ellipse
    #   D = Plane
    #   D = Point Point Point
    #   D = Line Line
    #   D = Line Point
    #   D = Vector Line
    #   D = Vector Point Point

    D21=C20 100         # vector in the direction of the Z-axis of C20, length 100
    D22=R10 REV         # vector in the opposite direction of the Z-axis of plane R10
    D23=L20 L21         # normal-vector to lines L20 L21

    Circle / Arc
    Identification key for circle/arc is C

    see also CAD functions circle / arc (Circle / Arc)

    Definition of a circle by defining an arc by:

    - C (Start Point Endpoint centre [Z-axis] [Rotation direction])
    - C (endpoint center [Z-axis] [Rotation direction])
      Points here with index "P20" or "xCoord yCoord [Z (zCoord]"
    For example: | C (25 0 0 25 0 0)
    If the starting point, then the endpoint is the last P(), L() or C() - the definition used.
    - Selection of a circle,
      the name, eg "C20"
    - selection of a circle in a Contour (CCV):
      C (S{ccv} MOD({ccvSegNumber}))

    Deviation:
      The deviation for the presentation of the circles can be set directly in Standards/Tolerances with tolerances for the representation – Polygon."
      Furthermore, by changing the Model size (MODSIZ) the deviation is set.

    Parameter direction of rotation:
    CW (clockwise) or
    CCW (counter-clockwise)
    The specification of CCW is not required (default).

    The turning point is valid if the spin axis of the eye of the beholder shows.
    # Circle copy
    C2 = C1

    Standard formats:
    # concentrically. circles. Negative radius difference shrinks the circle.
    C2 = C1 (radius differential)
    # center point, point at the periphery [Z-axis vector]
    C3 = P1 P2
    C3 = P1 P2 D(1 0 1)
    # center, tangential to Line/Circ
    C1 = P1 L1
    C1 = P1 C1
    # Tangential to 2 elements, radius.
    # C1 = P1, L1, Radius, page
    # C2 = P1, C1, Radius, page
    # C5 = L1, L2, Radius, page
    # C5 = L1, C1, radius, Page
    # C5 = C1, C2, Radius, page
    L1 = X (10)
    L2 = Y (10)
    C1 = L1 L2 VAL(5) MOD(1)

    # 2 points on the scale radius. page on which the center is located.
    # C1 = P1 P2 radius side Z-axis vector
    P20 = P(98.6 5.4 0)
    P21 = P(114.5 -15.2 0)
    C22 = P20 P21 VAL(12) MOD(1) DR

    # point at the periphery, tangent, radius .
    #C1 = P1 L1 radius side
    L20 = P(44.6 -32.8 0) P(86.5 -69.3 0)
    P26 = P(56.2 -35.5 0)
    C21 = P26 L20 VAL(8) MOD(2)

    # point at the periphery, tangential to a circle.
    # C2 = P1 C1 radius page
    C20 = P (114.5 -15.2 0) VAL (12) DR
    P27 = P (96.9 -19.7 0)
    C21 = P27 C20 VAL (8) MOD (1)

    # Circle through three edge points
    C20 = P (0 0) P (10 0) P (10 10)

    Arc (limited circles):

      Start center point of rotation angle Z-axis vector
    C21 = ARC P20 P21 ANG(90) DZ

      Circ ARC starting point endpoint center [Z] [Rotation direction]
      Arc from start point endpoint center (center axis of rotation direction)
      Rotation direction: CW (clockwise) or CCW (counter-clockwise, default).
      The turning point is valid if the spin axis of the eye of the beholder shows.
    C20 = ARC P1 P2 P3
    C31 = ARC P(10,0,10) P(0,10,10) P(0,0,10) =
    C32 = ARC P(10,0,0) P(0,0,10) P( 0,0,0) D(0,1,0) CW
      Circ ARC start point, end point, radius, Z-axis
      Arc from start point endpoint radius center axis
      Radius: positive for clockwise, negative for counter-clockwise.
    C21 ARC = P(251 23 0) P(189 75 0) VAL(50) DZ

      Double arc through the starting point, starting direction, and radius. off direction: the tangent to the circle in the Start point. A vector.
      Angle: start angle, optional, default is 360 degrees.
      Axis vector optional.
      [CW / CCW] is the direction of rotation; optional ( "CW").
    Example: End tangents of a Clothoid as the start direction.
    S20 = CLOT P(0 0 0) DX ANG(30) 0 10
    P20 = P(S20 1)
    D20 = TNG P20 S20
    C20 = ARC P20 D20 25 ANG(30)

      Arc through three points on the edge
    C20 = ARC1 P (0 0) P (10 0) P (10 10)

    Implicit Definition of circles/arcs:

    C ((starting point) (end) (center) [Z] [Direction])
    C ((end) (center) [Z] [Direction])
    here only points with index "P20" or "xCoord yCoord [Z (zCoord] "
    Example: C(25 0 0 25 0 0)

    Circle from copyfunction
    These formats are generated when selecting features
    Circle from CCV:
    C(S{ccv} MOD({ccvSegNumber}))

    Splines/Curves
    Identification letter for curves is S (spline).

    see also CAD functions for curves

    Polygon
    ellipse
    Clothoide
    free-form curve (B-Spline)
    contour (compound curve)
    polynomial curve (currently only import programs or MANual)

    Standard sizes ellipse:
      ellipse from center, endpoint main axis, endpoint Besides axis:
    S1 = ELL P (100 0) P (150 0) P (100 20)
    ellipse from center, the main vector, vector addition axis:
    S1 = ELL P(100 0) D(10 0) D(0 5)
     (the vectors defining the direction and length of main and secondary axes)

     Limited ellipse from center, main axis vector, secondary axis vector, starting point and end point:
    S1 ELL = P(0 0) D(10 0) D(0 5) P(10 0) P(-10 0)

     projection of an ellipse from circle on plane:
    S20 = R20 ELL C20

    Standard formats polygon:
     Parallelogram from one point and 2 vectors:
     S = REC pt1 vec1 vec2
     (vectors: the direction and length!)
    S20 = REC P(100 0 0) D(50 0 0) D(0 12 0)

     Polygon of points:
     S# = POL, point1, point2 <POINT3, .. pointn>
    P20=P(10,10)
    P21=P(20,20,15)
    P22=P(25,20)
    S24=POL P20 P21 P22 P(30,12,0) P(30,10,10) P(40,30,10)

     Polygon projected onto plane
     S#=POL Polygon Refsys
    S20=POL P(30,0) P(30,10,10) P(40,30,20)
    S21=POL S20 R0

     3D-Polygon from B-Spline:
     S#=POL,B-Spline,Tolerance

    Standard formats Clothoids:
     Create a clothoid curve (by a planar spiral through Fresnel integrals).
     Start Point       Start Point
     Start Vector      Start direction (or vector angle)
     Angle             Difference Angle off direction-toward the end point is positive, clockwise (CW);
                        negative: counterclockwise (CCW).
     Start radius      Radius at the start point, or 0 for infinite radius
     EndRadius         Radius at the end point or 0 to infinity
     [Z-Axis]          Normal vector; optional.

    S20 = CLOT P(0 0 0) ANG( 0) ANG(30) 0 10

    Example Model: see sample_cloth1.gcad

    To export a clothoid curve:
     DXF: Output as POLYLINE.
     Iges: output entity 106 (CopiousData, form 12 = 3D polygon).

    Standard formats B-spline:

     B-spline from control points/node vector:
     S-bsp=BSP, ptNr, degree, control points, node vector, startup parameters, end parameter
      ptNr = number of control points,
      control points: the control points, number = ptNr, 3 values (X/Y/Z).
      node vector: the distance parameter, number = ptNr + degree + 1
    S20 GNP, 6.3, -178,109,0, -166,128,0, -144,109,0, -109,112,0, -106,134,0, -119.138, 0,0,0 , 0,0,0.333333,0.666667,1,1,1,1,0,1

     B-Spline from points:
     S-bsp = BSP{points} [, degree] [, CTRL]
     CTRL: whether the defined points are transit points or control points.
    P20 = P (78.9)
    P21 = P (66.28)
    P22 = P (44,9,25)
    P23 = P (9.12)
    P24 = P (6.34)
    # B-spline from Points
    S20 + BSP, P20, P21, P22, P23, P24

     B-spline from polygon:
     S-bsp = BSP {polygon} [, degree] [, CTRL]
     CTRL: whether the defined points are transit points or control points.
    P20 = P (78.9)
    P21 = P (66.28)
    P22 = P (44,9,25)
    P23 = P (9.12)
    P24 = P (6.34)
    # B-spline from points
    S20 = GNP, P20 , P21, P22, P23, P24
    # Polygon from Points:
    DRAW OFF
    S21 = POL, P20, P21, P22, P23, P24
    # BSpline from Polygon
    DRAW ON
    S22=BSP, S21

     B-Spline = isoparametric curve from a surface
     Currently from B-Spline surface only, entry point instead of parameter value has not yet been implemented
     S-bsp = ISO {B-Spline surface} {parameter value} [{direction}]
      (Modifier CX = across; Default = along)
    # cross-section curve in the middle of the Surface A20:
    S20 = ISO A20 0.5 CX

    Standard format contour (compound curve):

    Contour ("concatenated Curve"-CCV),
    The contour begins and ends at a point.
    Elements: points, lines, circles, curves.
    Following circles and curves, the direction of rotation (CW or CCW) can be defined.
    It will automatically be formed normal to lines and arcs.

    Format:
    S# = CCV {contour elements}

    Example:
    C20 = P(39.26) VAL( 22)
    S20 = CCV P (7.25) C20 CW P (35.58)

    Standard format polynomial curve:

     Polynomial curve from evaluating a polynomial:
     S# = PSP3, arc1{, arc2, .. arcn}
     Polynomial curve with 1-n arcs.
     An arc comprises 13 numbers, the distance value and the evaluated polynomial
     xa, ya, za, xb, yb, zb, xc, yc, zc and xd, yd, zd.
     xa, ya, za defines a passage point.
    S20=PSP3,0,3.84815,0.967105,0,0.577021,0.207039,0,0,0,0,-0.169071,0.140166,0, 1,4.2561,1.31431,0,0.069808,0.627537,0,-0.507212,0.420498,0,0.341924, -0.327596,0,2,4.16062,2.03475,0,0.081155,0.485747,0,0.518559,-0.562288,0, -0.183075,0.224101,0,3,4.57726,2.18231,0,0.56905,0.033474,0,-0.030664, 0.110016,0,-0.060996,-0.13481,0,4,5.05465,2.19099,0,0.324734,-0.150924,0, -0.213651,-0.294414,0,0.071217,0.098138,0,5,5.23695,1.84379,0,0.111083, -0.445338,0,0,0,0,0.427303,0.588828,0

    Solids (Bodies)
    Identification letter for Solids is B (Body).

    see also CAD-Functions for Solids (Bodies)

    Cone
    Torus
    Sphere
    Prism

    Sphere:

    # Sphere from the radius center:
    B1 = SPH P(0 0 0) 12

    # Sphere from circle:
    C1 = P(0 0 0) 12
    B2 = SPH C1

    Cone-shaped body:

       B2 = CON Midpoint_1 Midpoint_2 Radius_1 Radius_2
    B20 = CON P(0 0 0) P(100 0 0) VAL(60) VAL(40)

       B3 = CON circle_1 circle_2
    C20 = P(0 0 0) VAL(100) DX
    C21 = P(100 0 0) VAL(40) DX
    B20 = CON C20 C21

       B1 = CON base_circle point_cone_top

    Torus / circular ring:

      B# = TOR centrPt axis Radius_major Radius_minor

      B# = TOR L C    // axis outer_circle
      B# = TOR C C    // main_circle, outer_circle
      B# = TOR R C    // mani_radius,  outer_circle

      The axis of the circle of skin is the main axis.
      The minor circle axis is always normal to the main axis.
      Radius_major circle is entirely on the outside, and is always positive.
      Modifier_outer_Inner: required for selection of a variant
       where the Radius_major circle is smaller than the Radius_minor circle.

    B20=TOR P(0 0 0) DZ VAL(100) VAL(25)
    C20=P(100 0 0) VAL(25) DY
    B20=TOR P(0 0 0) DZ C20

    Prism:

      B = PRISM plane_Base_surface Vector/Point/thickness

      plane_Base surface: Closed Polygon/Circle/Ellipse
      The opposite surface may be a point or defined by a vector
      or by the thickness (for example wall thickness).

    # Prism from Parallelogram and vector
    S20=REC P(100 0 0) D(50 0 0) D(0 12 0)
    B20=PRISM S20 D(0 0 10)

    # Prism from circle with thickness (cylinder height)
    C20=P(289 -20.8 0) VAL(125) DZ
    B20=PRISM C20 25

    # Conic prism from polygon
    20=P(768 -457 0)
    S20=POL P20 P(930 -474 0) P(1029 -251 0) P(971 -246 0) P(891 -412 0) P(801 -407 0) P20
    B21=PRISM S20  P(900 -500 200)

    Notes / Dimensions
    Identification letter for Notes/Dimensions is N.

    see also CAD-Functions for Notes / Dimensions

       The font size for text and dimensioning is defined by
    DEFTX {Textsize} {DimTextSiz} {text general scale} {number decimal places}
       or interactively in Standards/Text.
       Default values in the file {base}/xa/gCAD3D.rc.

    TODO:
    TEXTS AND DIMENSIONS ARE NOT EXPORTED TO IGS or DXF.
    For interactive modification of the parameters Marrow, Mline
      and additional text a user interface is to be created.

    Model
    Identification letter for Models is M.

    see also CAD-Functions for Models

    A model (a Assembly) can consist of several Models (Sub-models)

    Transformations
    Identification letter for Transformations is T.

    see also CAD-Functions for Definition of Transformations
    see also CAD-functions for modifying geometry

    Rotation
     CW      (clockwise) or
     CCW     (counter-clockwise)
     The specification of CCW is not required (default).
     The rotation results in plan view of the axis of rotation
     as seen by the eye of the beholder.

    Rotation angle (Rotate)
     The rotation is around the Z-axis of the active construction plane.
     Input directly: Angle
     Enter indirectly: ANG(angle)
     Output format: ANG(angle ()), for example:
     ANG(30) - rotation by 30 degrees
     # Angle value
     ANG (angle value [REV])
     # Direction vector
     ANG (D [ANG () / REV])
     # Line (direction)
     ANG (L [ANG () / REV])
     # 2 Points (direction)
     ANG (P P [ANG () / REV])
    In CAD mode, the PgUp / PgDown button can add together one additional (relative)
     angle value of about +90 degrees. (There must have been a prior
     selection to indicate direction (eg select a line)).

    Tilt angle
    The rotation (tilting) is done to the new Y-axis created by a rotation of the Z-axis.
     A tilt angle of 90 degrees provides the Z-axis (independent from the angle of rotation).

    Output format: ANG({angle}), for example:
     ANG(30) - rotation by 30 degrees
    Example of rotate and tilt:
     ANG(90) ANG(30)
     There the object is rotated 90 degrees around the Z axis;
     The horizontal axis now corresponds to the old X-axis, tilt axis at this
     tilt is now around 30 degrees.
     A negative tilt angle rotates in the opposite direction.

    Page 1 / 2
     Page: with PageUp / Down button;
     1, 2 lateral right / left;
     Output Format: MOD (1) or MOD (2)

    Color
     0 = black
     1 = DefCol
     2 = red
     3 = green
     4 = blue
     5 = yellow
     6 = magenta
     7 = cyan
     8 = white
     9 = hilite
     10 = dimmed

       SymbolType
         0 = star small,
         1 = small triangle
         2 = small circle
         3 = large rectangle
         4 = normalized vector (always same length, arrowhead points to EndpointVector)
         5 = vector (with correct length, arrowhead is at EndpointVector)
         6 = Arrowhead 2D (SymbolPosition is the arrowhead)

    Symbolic modelfilenames
    A symbolic file name consists of
    "{path}/{filename}"
    All symbolic pathe are defined in file {base}xa/dir.lst.
    The icon can be freely chosen.
    Interactively define the path using the "Standards/Directories".
    Default directory is {base}/dat; the identifier for this
     directory is "Data".

    Example of symbolic file name:
    "Data/Niet1.dat"

    Establish symbolic directory: see Standards / Directories.

    Group
    Identification key for group is U.

    Select the objects in the group - the objects will be highlighted.
    Remove from the group by selecting again.
    Go to the next field with the Tab key.
    Example:
    # Group 2 surfaces
    U (A20 A21)

    In the CAD input fields numerical values can be used (eg, for radius only) as well as variables,
    PI, the basic arithmetic and mathematics. Functions are also used (but not the functions X, Y, Z and L, C).

    Format Attributes:

    Set Hide / View
    # Hide object B20
    SHOW B20 OFF
    # redisplay
    SHOW B20

    Create new linetype
    ATTL <indexNr> <colour> <lineTyp> <lineThick>
    Example:
    ATTL 20 9 2 4

    # create lineAttribute 20 with color 009 = blue, 2=dashed, 4=linewidth

     Format: indexNr colour lineTyp lineThick // comment

       colour     3 digits; red, green, blue.
                  900 = red,   090 = green, 009 = blue;
                  000 = black; 999 = white, 990 = yellow ..
       lineTyp:   0 = full-line (VollLinie);    1 = dash-dot (Strich-Punkt),
                  2 = dashed (kurz strichliert) 3 = dashed-long (lang strichliert),
       lineThick: 1-6, thickness in pixels

    Max. nr of attribute-records is 44 (indexes 0 - 44)
    Defaults are in file <cadbase>/gCAD3D/<config>/ltyp.rc
      config is eg cfg_Linux.

    Set Linetypes

    # apply linentype 8 to objects L21 und L22
    ATTL 8 L21 L22
    # Siehe Defaultsettings

    Set surface attributes (color, shading, transparency ..)

    # set surface A21 symbolic (not shaded)
    ATTS "S" A21

    # set transparent  (T0=reset, T1=half transparent, T2=full transparent)
    ATTS "T2" A21

    # set color green (red-share-0, green-share-255, blue-share-0)
    ATTS "C00ff00" A21

    # reset previous color (default-colour)
    ATTS "C" A21

    See also: Set Attributes

    Settings:

    # menu off
    MODE MEN OFF

    # browser off
    MODE BRW OFF

    # upper toolbar off
    MODE BAR1 OFF

    # messagewindow off
    MODE BAR2 OFF

    # restore messagewindow
    MODE BAR2 ON

    # Display planes off
    MODE DISP_PL OFF

    # Display points on (in mode VWR display points is OFF per default)
    MODE DISP_PT ON

    # Display points off
    MODE DISP_PT OFF

    # Display all object-names
    MODE DISP_OID ON

    Values:

    - Direct: enter number with keybord;

    - from DB-variable (eg V20 (DB-variable 20))

      Example:
        V20=25
        C20=P20 V20         # circle with radius 25

    - from geometric obj -
        X(P20)                   x-coordinate of point 20
        Y(P20)                   y-coordinate of point 20
        Z(P20)                   z-coordinate of point 20
        VAL(L20)                 length of line 20
        VAL(C20)                 radius of circle 20
        VAL(P1 P2)               length between 2 points
        VAL(P1 L1)               normal distance from point to line

      Example:
        C21=P21 VAL(C20)     # circle with same radius as C20

    - from numeric constant:
        RAD_360    PI * 2     6.2831853071795862319
        RAD_180    PI         3.1415926535897932384
        RAD_90     PI / 2     1.5707963267948965579
        RAD_1      PI / 180   0.0174532925199432954
        SR_3       SQRT(3)    1.732050808
        SR_2       SQRT(2)    1.414213562

      Example:
        V21 = V20 * TAN(RAD_90)

    - from mathematic functions:
       SIN () COS () TAN () ASIN () ACOS () ATAN ())
       SQRT()      square-root
       ABS()       Absolute value (the sign is always positive)
       FIX()       remove the numbers after the decimal point
       RND()       Rounding. 1.3 to 1.0, 1.8 to 2.0, -1.3 to -1.0, -1.8 to -2.0

      Example:
        V26=RND(V20) * 2    # V20=1.8 resuts in 4

    - from mathematic operations:
      supported operators: + - / * ^   (plus minus multiply subtract power)

      Example:
        V20=10
        V21=10+20*2     # result is 60
        V22=10+(20*2)   # result is 50
        V23=V22*2       # result is 100
        V27=4^0.5       # result is 2 (4 to the power 0.5)

    Properties:

      - Properties follow the definitioncode separated by '#'
      - Properties can be used for filtering objects  (see Search / Name)

      Example:
        P20=0,0,0            # Origin BaseLayer
        V30=V20+(V21*1.2)    # sum

    Dynamic-objs:

       -  obj is stored in the dynamic-area,
       -  is not yet stored in DB or is a sub-object of an DB-obj;
       -  consists of a type-letter and parameters

      Example new defined dynamic-obj:
        P(10 5 0)              # point at x=10, y=5, z=0;
        L(P20 P(10 5 0))       # line from point 20 to coords (10 5 0)
        D(V20 0 0)             # vector - cartesian; x-coord from variable
        C(P(0 0 0) P(10 0 0))  # circle from centerpoint, point on circle

      Example sub-object:      eg P(L20 PTS(1)) # startpoint of line L20
        - is a reference to a component of an existing obj
        - this formats can come from object-selections
        see ObjRefs

    Sub-objects:

      - are parts of objects already stored in dB.
      - can come from object-selections
      - use this functionCodes:
        SEG(segment-nr)        # SEG(1) is first segment of polygon or composite-curve (CCV)
        PTS(point-code)        # PTS(1) gives startpoint, endpoint is PTS(2)
        PTI(point-index)       # PTI(2) is the second point of a polygon

    Examples:
    P(C21 0.25)            # parametric point on circle (parameter 0.25 = at 25 % of curve)
    P(S21 0.5)             # parametric point on curve (parameter 0.5 = midpoint)
    P(L20 PTS(1))          # startpoint of line 21 (endpoint is PTS(2))
    P(S21 PTI(7))          # point 7 of curve-21 (a polygon)
    P(S21 SEG(2) PTS(2))   # endpoint of segment 2 of compound-curve-S21
    P(A20 {uPar} {vPar})   # Parametric point on a surface (not all surface-types yet supported)

    L(C20 0.25)            # tangential line to circle (parameter 0.25 = at 25 % of curve)
    L(C21 PTS(2))          # tangential line to circle at endpoint
    L(C20 MOD(1))          # line from centerpoint of C20 to its startpoint
    L(S21 0.25)            # tangential line to curve S21 at parametric pos. 0.25
    L(S21 SEG(3))          # linesegment-3 of curve-21 (a polygon)
    L(S22 SEG(3) SEG(1))   # linesegment-1 of curve nr 3 (a polygon) of composite-curve S22

    D(C21 0.25)            # tangential vector to circle (parameter 0.25 = at 25 % of curve)
    D(S21 PTS(1))          # tangential vector to startpoint of curve S21
    D(S22 SEG(3))          # tangential vector to segment 3 of curve S22
    D(C20 MOD(2))          # vector from centerpoint of C20 to its endpoint

    C(S21 SEG(2))          # second object of composite-curve S21 (must be circle)