STL creation for customAntennaStl?

I'm trying to do some antenna analysis requiring models outside the geometries included in the antenna toolbox. I've tried uploading several STL models, placing feeds, and attempting some analysis (specifically 'pattern'). When trying to create a directivity diagram via pattern, matlab hangs as busy until forcefully closed.
I suspect that MATLAB is hanging because the geometries I'm using are closed (3D watertight meshes), while most of the MATLAB provided antennas are a thin mesh with no interior. See code below. I can't attach STLs, so I've provided a link to the STLs I tried analyzing here: https://www.thingiverse.com/thing:4699096
I'm using models of v-dipoles as they should be simple geometries with verifyable results. They have not worked.
What are good external tools for creating thin meshes that are usable for antenna analysis? Or is there something else going on?
clear
close all
f = 137.4*10^6; % frequency
c = customAntennaStl('FileName', 'Vdipole_simple.STL');
c.Tilt = 90;
figure
%c.createFeed(); % I've tried using this as well as create feed below
c.createFeed('FeedLocation', [546.6, -0.3475, 10], 'NumEdges', 1)
show(c)
figure(1)
p = PatternPlotOptions;
p.SizeRatio = 1.2;
p.Transparency = 0.7;
pattern(c, f, 'patternOptions',p); % it hangs here

Answers (1)

Hi James,
In this particular case, the workflow initially appeared to hang because the STL coordinates were interpreted as 'meters' and the geometry dimensions became unrealistically large when treated as meters. Since STL files do not store unit information, it is important to scale the coordinates to the correct units (millimeters in this case) before creating the antenna model.
something like this c = customAntennaStl( 'FileName','...', 'Units','mm'); stlFieChecker can be used to see if there are any bad features in the mesh.
Below is an alternate approach that can be used to create thin-sheet geometries by importing the STL as a Custom3D shape and removing unwanted faces.
clear
close all
f = 137.4e6; % Frequency
tr = stlread('Vdipole_simple.STL');
convert imported STL coordinates to mm and create shape.
newTr = triangulation( ...
tr.ConnectivityList, ...
1e-3*tr.Points);
s = shape.Custom3D(newTr);
Interactively remove unwanted faces.
For this model, all faces except 4 and 11 were removed (faces selected for removal: 1:3,5:10,12:13).
s.removeFaces
c = customAntenna("Shape",s);
Create feed at the desired location. can be picked interactively using c.createFeed
c.createFeed([0.5464 0.0050 0.0015],1);
c.Tilt = 90;
figure
show(c)
figure
mesh(c,"MaxEdgeLength",0.004)
figure
pattern(c,f)
sp = sparameters(c,(0.8:0.01:1)*f);
figure
rfplot(sp)

Asked:

on 27 Dec 2020

Answered:

on 17 Jul 2026

Community Treasure Hunt

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

Start Hunting!