Skip to content
Snippets Groups Projects
Commit c292da38 authored by giuliaghirardini's avatar giuliaghirardini
Browse files

[rocket-plot][classes] Modified implementation and aspect

parent cfaf29f1
Branches
Tags
1 merge request!12[rocket-plot] Added ability to plot rocket
......@@ -84,7 +84,8 @@ classdef Rocket < Component
if ~isempty(obj.lengthCenterNoMot)
obj.length = obj.lengthCenterNoMot + obj.motor.length + obj.parafoil.noseLength;
else
obj.length = (obj.absolutePositions("rear") + obj.bays("rear").length) + obj.bays("parafoil").noseLength;
obj.length = (obj.absolutePositions("rear") + obj.bays("rear").length ...
+ obj.bays("rear").finsDeltaXFreeChord) + obj.bays("parafoil").noseLength;
obj.lengthCenterNoMot = obj.absolutePositions("motor");
end
if isempty(obj.crossSection)
......@@ -348,7 +349,10 @@ classdef Rocket < Component
end
end
function img = rocketPlot(obj, mission)
function img = plot(obj)
arguments
obj Rocket
end
deltaXLE = obj.rear.finsDeltaXFreeChord;
r = obj.diameter/2;
height = obj.rear.finsHeight;
......@@ -434,13 +438,20 @@ classdef Rocket < Component
%%% BAYS
lengths = obj.absolutePositions.values + 2*Lnos;
baysBody = obj.absolutePositions.keys;
iMotor = find(strcmp(obj.absolutePositions.keys,"motor"));
xline(0,'r-.', 'Label', 'NOSE', ...
'LabelOrientation', 'aligned', 'LabelVerticalAlignment', 'bottom', ...
'LabelHorizontalAlignment', 'right');
for i = 1:length(lengths)
xline(lengths(i), '--', 'Label', baysBody(i), ...
'LabelOrientation', 'aligned', 'LabelVerticalAlignment', 'bottom', ...
'LabelHorizontalAlignment', 'right');
if i == iMotor
line([lengths(i) lengths(i)], [-1 1], 'LineStyle', '--', 'Color', 'b'); % Draw the line
text(lengths(i), -1 + 0.3, baysBody(i), 'VerticalAlignment', 'top', ...
'HorizontalAlignment', 'right', 'Rotation', 90, 'Color', 'b');
else
line([lengths(i) lengths(i)], [-1 1], 'LineStyle', '--', 'Color', 'k'); % Draw the line
text(lengths(i), 1 + 0.1, baysBody(i), 'VerticalAlignment', 'top', ...
'HorizontalAlignment', 'right', 'Rotation', 90);
end
end
boatPlotLength = obj.length - obj.rear.boatLength;
xline(boatPlotLength,'r-.', 'Label', 'BOAT-TAIL', ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment