Create the Cassini CAD model from DXF data

The dxf file has been preloaded to a mat-file for efficiency, as the process of loading it can be slow. ------------------------------------------------------------------------- See also cassini.dxf and LoadCAD, BuildCADModel, QLVLH, BuildDXF -------------------------------------------------------------------------

Contents

%--------------------------------------------------------------------------
%  Copyright (c) 2002 Princeton Satellite Systems, Inc. All rights reserved.
%--------------------------------------------------------------------------

Orbit parameters

%-------------------
r     = 42167;
v     = sqrt(3.98600436e6/r);
rECI  = [r;0;0];
vECI  = [0;v;0];
qLVLH = QLVLH( rECI, vECI );
q     = [1;0;0;0];
omega = [0;-v/r;0];

Read in the model

%-------------------
% We have already done this step, see BuildDXF:
% d = LoadCAD( 'cassini.dxf', [], '', 0.2 );
% save Cassini d -struct

d = load('Cassini');
for k = 1:length(d.component)
  d.component(k).f = fliplr(d.component(k).f);
end

% Create the CAD model
%---------------------
BuildCADModel( 'initialize' );
BuildCADModel( 'set mass',           struct('mass',2000,'inertia',2000*eye(3),'cM',[0;0;-6]) );
BuildCADModel( 'set name' ,         'Cassini' );
BuildCADModel( 'set units',         'mks'     );
BuildCADModel( 'set rECI' ,          rECI     );
BuildCADModel( 'set vECI' ,          vECI     );
BuildCADModel( 'set qLVLH',          qLVLH    );
BuildCADModel( 'set qECIToBody',     q        );
BuildCADModel( 'set omega',          omega    );
BuildCADModel( 'set external model', d        );

g = BuildCADModel('get model');
BuildCADModel('show spacecraft');


%--------------------------------------