-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDisplayPoints.m
58 lines (44 loc) · 1.57 KB
/
DisplayPoints.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
%% Excel Plot Script
% Riley "Actual badass" Waite
% May 2017
% Rose-Hulman Institute of Technology
%
%
% This script will dynamically plot 3d meshes generated by the Riley's
% equally badass Sketch3D_To_Excel VB macro in Solidworks.
%
% This will ideally be used, eventually, as a GUI for coupled
% moment chassis torsional stiffness FEA
%% Clean Up
clear variables
close all
%% Parameters
DataFile = 'Chassis Nodes.xlsx';
%% Importing data from xlsx
% Points
[temp,~] = xlsread(DataFile, 'B:B'); % Columns in points list
l = length(temp); % Number of points
pts = xlsread(DataFile,['B4:D',num2str(l+3)]);
% Lines
[temp,~] = xlsread(DataFile, 'F:F'); % Columns in lines list
l = length(temp); % Number of lines
lineStart = [xlsread(DataFile,['F4:H',num2str(l+3)])];
lineEnd = [xlsread(DataFile,['I4:K',num2str(l+3)])];
clear l temp
%% Error checking data grab
if length(lineStart) ~= length(lineEnd)
error('Uneven number of line beginning and eng coordinates. This shouldn''t even happen. Something''s gone horribly wrong; check Excel file');
end
if (size(pts(:,1),1) ~= size(pts(:,2),1)) || (size(pts(:,2),1) ~= size(pts(:,3),1))
error('Uneven coordinate count in point cartesians. This shouldn''t even happen. Something''s gone horribly wrong; check Excel file');
end
%% Plotting in 3D
f = figure;
hold on
rotate3d on
daspect([1 1 1])
scatter3(pts(:,1),pts(:,2),pts(:,3))
for i = 1:length(lineStart)
plot3([lineStart(i,1),lineEnd(i,1)],[lineStart(i,2),lineEnd(i,2)],[lineStart(i,3),lineEnd(i,3)])
end
axis vis3d