Why do I observe a gap between layers when visualizing my "customAntenna" geometry in Antenna Toolbox R2025a?
1 view (last 30 days)
Show older comments
MathWorks Support Team
on 15 Oct 2025
Answered: MathWorks Support Team
on 14 Nov 2025 at 19:19
I am building an antenna using code inspired by examples from the MathWorks "customAntenna" documentation. However, upon visualizing my antenna geometry via the "show" function, I find that my substrate appears to be "floating" above my ground plane, i.e., there appears to be a significant gap between the layers.
The code snippet below and the attached image "floatingSubstrate.png" demonstrate the issue.
% Ground plane
gndLength = 0.014;
gndWidth = 0.016;
% Substrates
lengthFR4 = 0.024;
widthFR4 = 0.016;
substrateHeight = 0.1;
% Middle layer patches and strips
horzStripLength = 0.014;
stripWidth = 0.002;
sub1 = shape.Box(Name="FR4 Substrate", Length=lengthFR4, Width=widthFR4,...
Height=substrateHeight, Dielectric="FR4");
[~] = translate(sub1,[0 0 substrateHeight/2]);
horzStrip = shape.Rectangle(Name="Horizontal Strip", Length=horzStripLength, Width=stripWidth,...
Metal="Copper");
[~] = translate(horzStrip,[horzStripLength/2-lengthFR4/2 0 0]);
gndLayer = shape.Rectangle(Name="Ground Plane", Length=gndLength, Width=gndWidth,...
Metal="Copper");
[~] = translate(gndLayer,[gndLength/2-lengthFR4/2 0 0]);
midLayer = horzStrip;
[~] = translate(midLayer,[0 0 substrateHeight]);
metalShape = midLayer + gndLayer;
substrate = sub1;
antShape = addSubstrate(metalShape,substrate);
ant = customAntenna(Shape=antShape);
createFeed(ant,[-0.012 0 substrateHeight],1);
figure; show(ant)
I am confident that I have defined the substrate to lie flush against my ground plane. Why do I observe a gap between layers in the visualization?
Accepted Answer
MathWorks Support Team
on 15 Oct 2025
The gap between the ground plane and substrate that you observe is present in MathWorks “customAntenna” examples as well. This gap is merely a visual artifact: when two layers of antenna geometry lie in the exact same plane, the slight translation of one layer above the other ensures that the geometry meshing can be resolved.
The large gap you observe in your custom antenna visualization likely only appears so substantial due to axis scaling. The “createFeed” function adjusts the figure aspect ratio when visualizing the antenna geometry, so by commenting out the line where “createFeed” is called out, the geometry should appear as shown in the attached image, "adjustedAspectRatio.png". With the new aspect ratio, the gap between the ground plane and the substrate should appear more on par with those in MathWorks examples such as “Create Custom Antenna with Multiple Dielectric Substrates”.
Note that exporting the antenna geometry to a Gerber file may be useful for visualizing the physical geometry with greater accuracy.
0 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!