A flat, square, nonideal sail in the Y/Z plane, using CP1 properties

The sail front is along +X in the body frame. Nominal size is 50000 m2.
The vertices and faces for a simple square are defined by hand.
There are no other components.
Since version 9.
------------------------------------------------------------------------
See also BuildCADModel, CreateBody, CreateComponent, DrawSCPlanPlugIn,
Inertias, FindDirectory, SaveStructure, AddAxes, CP1Props
------------------------------------------------------------------------

Contents

%-------------------------------------------------------------------------------
%  Copyright (c) 2005,2006 Princeton Satellite Systems, Inc.
%  All rights reserved.
%   This file is referenced for listings in the User's Guide.
%-------------------------------------------------------------------------------

Script control

%---------------
createFiles = 1;

Properties

%-----------
sailWidth     = sqrt(50000); % m
sailMass      = 100.0;       % kg
[optical, infrared, thermal] = CP1Props;

Create the sail mass structure

%-------------------------------
inertiaSail = Inertias( sailMass, [sailWidth sailWidth], 'plate', 1 );
bXToZ       = [0 0 -1;0 1 0;1 0 0];
massSail    = struct('inertia', bXToZ*inertiaSail*bXToZ', 'mass', sailMass, 'cM', [0;0;0] );

Initialize

%-----------
BuildCADModel( 'initialize' );

Add general properties

%-----------------------
BuildCADModel( 'set name' ,  'Flat Nonideal Sail' );
BuildCADModel( 'set units',  'mks'  );

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

Create CAD bodies first

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

Core

%-----
m = CreateBody( 'make', 'name', 'Core' );
BuildCADModel('add body', m );

This creates the connections between the bodies

%------------------------------------------------
BuildCADModel( 'compute paths' );

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

Create CAD Components second

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

Sail

%-----
v = [0 0 0 0;0.5 -0.5 -0.5 0.5;0.5 0.5 -0.5 -0.5]'*sailWidth;
m = CreateComponent( 'make', 'sail','name','Sail','body',1,...
                 'mass', massSail, 'faceColor', 'mirror','rA',[0;0;0],...
                 'emissivity', thermal.emissivity,...
                 'vertex',v ,'face', [1 2 3; 1 3 4], 'inside', 0 );
m.optical = optical;
m.infrared = infrared;
BuildCADModel( 'add component', m );

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

Export

%------------------------------------------------------------------
if( createFiles )
  g = BuildCADModel( 'get cad model' );
  cd(FindDirectory('SailData'));
  SaveStructure( g, 'FlatCP1Sail' );
end

3D View

%--------
DrawSCPlanPlugIn('initialize',g);
AddAxes(0.6*sailWidth,[],[],gcf)

%--------------------------------------
% PSS internal file version information
%--------------------------------------
ans = 
  Figure (2: 3D Vehicle Plan) with properties:

      Number: 2
        Name: '3D Vehicle Plan'
       Color: [1 1 1]
    Position: [500 470 460 460]
       Units: 'pixels'

  Use GET to show all properties