Export radiation pattern to stl

조회 수: 26 (최근 30일)
Anne
Anne 2021년 2월 16일
편집: DGM 2025년 9월 27일 8:29
Hey there,
I try to export a radiation pattern (3D) in the .stl format. That's my code:
fc = 62e9;
pm = design(patchMicrostrip, fc);
pattern(pm, fc);
Now it would be great to export this pattern as .stl or something similar. I'll be greatful for every idea or hint.
Thanks in advance!
  댓글 수: 1
Anne
Anne 2021년 2월 17일
편집: Anne 2021년 2월 17일
I thought about (and tried them):
> stlwrite (part of the antenna package), which needs a triangulation object as input, but i couldn't find a way to convert the 3D-pattern to a triangulation object
> surf2stl (https://uk.mathworks.com/matlabcentral/fileexchange/4512-surf2stl), which needs a Surface as input.
h = gcf;
get(h)
children = h.Children
axChild = children(6).Children
This shows me that "Axes" has a Child of type Surface. I can export this to an stl without problems, but it's just a sphere. So there has to be some information missing.
Thanks in advance for any helpfull idea!

댓글을 달려면 로그인하십시오.

답변 (2개)

Sai Kiran
Sai Kiran 2022년 12월 21일
Hi,
Please follow the steps below to export the 3D radiation pattern to .stl format.
[D,A,E]=pattern(pm,fc)
where D is the Directivity, A is an array of azimuth angle and E is an array of elevation angle.
[A,E]=meshgrid(A,E);
Download the surf2stl function from the below link.
surf2stl('filename.stl',D,A,E);
The resultant stl file contains the 3D radiation pattern.
I hope it resolves your query.

DGM
DGM 2025년 7월 14일
편집: DGM 2025년 9월 27일 8:29
Let's go the rest of the way.
% let's say we have the pattern data
l = linearArray;
[D A E] = pattern(l,70e6);
% yeah, we're gonna need to expand
[A E] = meshgrid(A,E);
% but we also need to change to cartesian
% note the change of units and the shift on D
[X Y Z] = sph2cart(deg2rad(A),deg2rad(E),D - min(D(:)));
% now the data is in a form that can be accepted by surf() or surf2stl()
hs = surf(X,Y,Z); axis equal
% but we really don't need to use surf2stl() if we don't want to
[F,V] = surf2patch(hs,'triangles'); % the 'triangles' option is needed
T = triangulation(F,V); % now we can just write it like any STL
stlwrite(T,'test.stl')
% for show and tell, let's just read it back and show it
T = stlread('test.stl');
figure
trisurf(T,'facecolor',[1 1 1]*0.8,'edgecolor','none')
view(3); view(-40,33); camlight;
axis equal; grid on
As an aside, trying to learn toolboxes I don't even have, while in the confines of the forum editor is really a cumbersome feeling.
See also:

카테고리

Help CenterFile Exchange에서 STL (STereoLithography)에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by