experience and innovation

---------------------------------------------------------------------------
   Build up a 3D spacecraft model. You can enter vertices and faces 
   directly or geometric primitives:

   'antenna'
   'box'
   'cylinder'
   'ellipsoid'
   'rwa'
   'surface of revolution'
   'triangle'
   'truss'       
  
   When entering mass properties the various vectors for each component
   are defined as follows

              |
   --- rA --- b --- rB ---   
              |
 
   rB      is the position of the component origin wrt the point of rotation
   b       is the rotation matrix
   rA      is the position of the rotation point wrt the origin of the body
   rOffset is a vector used to temporarily move the component (after all
           of the above) to the right position in the picture
   bOffset is a transformation matrix to temporarily rotate the component

   The last two are not used outside of Build3DSC.

   When you create a body, bHinge is the rotation structure at the hinge
   It may be of the form

   bHinge.b     (3,3) Transformation matrix
         .q     (4,1) Quaternion
         .a     (3,1) Unit Vector
         .angle (1,1) Angle about the unit vector

   You must include the last two to use a rotation angle.

   Build3DSC will compute the total body mass properties and attach the
   data structure .mass which is

   mass.mass    (1,1) mass
   mass.cM      (3,1) center-of-mass
   mass.inertia (3,3) inertia matrix

   If you do not wish to use the computed body mass properties, you can manually
   alter the output structure.

   The commands you use from the script are:

   'init'            The first command
   'add'             Once for each component
   'add body'        After all components are entered
   'add units'       Any time but always prior to 'compute paths'
   'add name'        Any time     
   'add qecitobody'  Any time
   'add reci'        Any time
   'add veci'        Any time
   'add omega'       Any time
   'add qlvlh'       Any time
   'compute paths'   Always last. You  need to 'add units' prior to using this
   'component list'  Any time
   
---------------------------------------------------------------------------
   Form:
   g = Build3DSC( mode, gNew, gX )
---------------------------------------------------------------------------

   ------
   Inputs
   ------
   mode        (1,:) See above
   gNew               If 'add' Spacecraft image data structure
                     .name
                     .rOffset                    (3,1) Offset from reference
                     .bOffset                    (3,1) Rotation wrt reference axes
                     .faceColor                  (1,3) Color of faces.  available colors are:
																												'solar cell', 'mirror', 'gold foil', 'aluminum', 'steel', 
																												'aluminum truss', 'radiator', 'white', 'black', 'magenta'
																												more colors can be added in the SetColor subfunction
                     .specularExponent           (1,1) SpecularExponent
                     .specularColorReflectance   (1,3) specularColorReflectance,...
                     .rB                         (3,1) Location of reference pt wrt rotation point
                     .rA                         (3,1) Location wrt origin after rotation
                     .b                          (3,3) Transformation matrix

                      and
                     .v                          (:,3) Vertex list
                     .f                          (:,:) Face list

                      or

                     .type                       (1,:) 'antenna', 'box', 'cylinder', 'ellipsoid',
                                                       'rwa', 'surface of revolution', 'truss'
                     .info                       (:)   Parameters defining the geometric solid

                     .optical                          .sigmaT      (1,1) Transmission coefficient
                                                       .sigmaA      (1,1) Absorption coefficient
                                                       .sigmaD      (1,1) Diffuse reflection coefficient
                                                       .sigmaS      (1,1) Specular reflection coefficient

                     .thermal                          .alpha       (1,1) Absorptivity
                                                       .epsilon     (1,1) Emissivity
                                                       .cP          (1,1) Specific heat
                                                       .temperature (1,1) Temperature (deg-K)

                     .magnetic                         .dipole      (3,1) Dipole

                     .aero
                                                       .cD          (1,1) Drag coefficient
                                                       .sigmaN      (1,1) Normal surface accommodation coefficient
                                                       .sigmaT      (1,1) Tangential surface accommodation coefficient

                     .mass                             .mass        (1,1) Mass
                                                       .inertia     (3,3) Inertia matrix
                                                       .cM          (3,1) Center of mass wrt origin

                     .rF                               .flux        (1,1) flux
                                                       .u           (3,1) Unit vector
                                                       .r           (3,1) Vector from reference to rF centroid

                     .inside                           If included the component is considered
                                                       to be inside the spacecraft and will
                                                       not be used in aero or optical disturbance
                                                       calculations.
   'add units'       (1,:) ''m' 'in' 'ft'
   'add name'        (1,:) any name     
   'add qecitobody'  (4,1) Quaternion from ECI to Body
   'add reci'        (3,1) Vector origin to spacecraft in ECI coordinates
   'add veci'        (3,1) Velocity in the ECI frame
   'add omega'       (3,1) Angular velocity in the body frame
   'add qlvlh'       (4,1) Quaternion from ECI to LVLH (local vertical local horizontal coordinates)

   -------
   Outputs
   -------
   g                 Output

---------------------------------------------------------------------------