Save 3d surface plot as u3d or .ply file

11 views (last 30 days)
Anand Ra
Anand Ra on 20 Oct 2022
Hello, I am having trouble in saving my matlab interactive 3d plot as u3d or .ply file.
Any help wor alternative would be greatly appreciated.
Below is my sample code.
%% Plotting the curve to be reflected
clear all
close all
clc
% Constants
I0 = 1; % Initial X-ray beam intensity
rCu = 405; % radius of copper wire, um
rPMMA = 25; % radius of the PMMA, um
lamda = 7.1255e-5; % x-ray wavelength, um, (17400 eV)
k = 2*pi/lamda; % wavenumber, um^-1
beta_Cu = 2.5914E-07; % https://henke.lbl.gov/optical_constants/
beta_PMMA = 5.0314E-10; % https://henke.lbl.gov/optical_constants/
%Xray
mu_Cu = 0.076E-4;
mu_PMMA = 4.165E-4
%% Computing intensity versus x-position
%I(x)= I0*exp(−(µCu*LCu(x)+µPMMA*LPMMA(x))]
%Assume wire long axis is along z-axis, with center at x=0.
%Assume x-rays travel in y direction.
rT=rCu+rPMMA; % Total radius of the copper wire ,um
x=(-2:.04:1.98)*rT; %x values (um) (range = +-2*rT)
t_Cu=2*sqrt(max(rCu^2-x.^2,0));
t_total=2*sqrt(max(rT^2-x.^2,0));
t_PMMA=t_total-t_Cu;
It=exp(-mu_Cu*t_Cu-mu_PMMA*t_PMMA);
Iab = 1-It;
%% Guass
xstart=-2;
xstop=2;
xpoints=100;
xinc=(xstop-xstart)/(xpoints-1);
ystart=-2;
ystop=2;
ypoints=100;
yinc=(xstop-xstart)/(xpoints-1);
for ii=1:xpoints
x(ii)=xstart+xinc*(ii-1);
for jj=1:ypoints
y(jj)=ystart+yinc*(jj-1);
z=x(ii)*x(ii)+y(jj)*y(jj);
Is(ii,jj)=exp(-z);
end
end
% figure(2)
% plot(Is)
%% Detector intensity
M=It.*Is;
figure(3)
% subplot(211)
Z=log(M);
M=mesh(M)
title('Transmission plot','FontSize',13)
% xlabel('$x (\mumm)$','interpreter','latex')
ylabel('$length (\mu m)$','interpreter','latex')
zlabel('$Detector Intensity$ (arb.)','interpreter','latex')
view([-4 12])
% Create textbox
% Create textbox
annotation('textbox',...
[0.733097718253965 0.811081794195249 0.0877356150793676 0.0360912174896386],...
'String','Wire radius = 430 \mum',...
'FontWeight','bold',...
'FitBoxToText','off',...
'BackgroundColor',[1 0 0]);
% Create textbox
annotation('textbox',...
[0.730363343253966 0.767810026385223 0.108699156746034 0.0300226159065249],...
'String','Coating thickness = 80 \mum',...
'FontWeight','bold',...
'FitBoxToText','off',...
'BackgroundColor',[1 0 0]);
% VMRL export
%%
%% Absorption
Iabs=Iab.*Is;

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!