diff --git a/classes/Rocket.m b/classes/Rocket.m index 8ae797c8f793ec214628af750403558f68b54e2d..5cb47ec18224f5503545361a85dabacb95613c1b 100644 --- a/classes/Rocket.m +++ b/classes/Rocket.m @@ -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', ...