Coordinates of koch snowflake

4 次查看(过去 30 天)

I am trying to the coordinates of a Koch snowflake fractal antenna designed using the Antenna Toolbox.

All I get is a picture, and the antenna performance. I would like to have the coordinates so i can modify the design and/or send to fabrication

  2 个评论
Mathieu NOE
Mathieu NOE 2025-5-7
maybe from the picture you can extract the coordinates (maybe not ideal but probably doable)
can you share that picture ?
Walter Roberson
Walter Roberson 2025-5-7
ant = fractalSnowflake;
pattern(ant, 1e7);
The lower left corner shows the drawing of the snowflake.
I looked into this, but it looked to me as if the important portion of it was a .p file.

请先登录,再进行评论。

采纳的回答

Charu
Charu 2025-5-9
Hi Arnold,
As I understand, you want to know the coordinates of the antenna of the Koch snowflake fractal antenna. You can use the “mesh” function to obtain the coordinates.
Kindly refer to the steps mentioned below to do so:
1.Extract the mesh data of the antenna using the “mesh” function.
meshData = mesh(antenna);
2.Get the vertices (coordinates) from the mesh data
vertices = meshData.Points;
3.Export the vertices to a CSV file for fabrication or further modification
csvwrite('antenna_vertices.csv', vertices);
4.Display the coordinates of the vertices and visualize the extracted vertices.
disp('Coordinates of the antenna vertices:');
disp(vertices);
figure;
scatter3(vertices(:,1), vertices(:,2), vertices(:,3), 'filled');
xlabel('X-axis');
ylabel('Y-axis');
zlabel('Z-axis');
title('Vertices of Koch Snowflake Fractal Antenna');
axis equal;
I tried to extract the coordinates of antenna using the code mentioned above and got the attached figure.
You may refer to the following documentation for more information on “mesh” function:
Hope this helps!

更多回答(1 个)

Divyajyoti Nayak
Divyajyoti Nayak 2025-5-9
Like @Mathieu NOE suggested, the coordinates of the snowflake can be extracted from the figure. Here's some sample code using @Walter Roberson's example:
ant = fractalSnowflake;
pattern(ant, 1e7);
fig = gcf; %Get figure object
fig.Children
ans =
8x1 graphics array: UIControl (patternpopUp) ContextMenu UIControl (ThirdColumn) UIControl (SecondColumn) UIControl (FirstColumn) Axes (geometryInPattern) ColorBar (dBi) Axes (patternAxis)
%The pattern is in the 'geometryInPattern' axes
Axes = fig.Children(6);
Axes.Children
ans =
5x1 graphics array: Surface (feed) Patch (MetalEdge) Patch (MetalEdge) Patch (MetalEdge) Group
%By looking into the children objects, I found that the pattern was in the second Patch
xData = Axes.Children(3).XData
xData = 2×48
-0.0450 -0.0350 -0.0300 -0.0250 -0.0150 -0.0100 -0.0150 -0.0050 0 0.0050 0.0150 0.0100 0.0150 0.0250 0.0300 0.0350 0.0450 0.0400 0.0450 0.0350 0.0300 0.0350 0.0450 0.0400 0.0450 0.0350 0.0300 0.0250 0.0150 0.0100 -0.0350 -0.0300 -0.0250 -0.0150 -0.0100 -0.0150 -0.0050 0 0.0050 0.0150 0.0100 0.0150 0.0250 0.0300 0.0350 0.0450 0.0400 0.0450 0.0350 0.0300 0.0350 0.0450 0.0400 0.0450 0.0350 0.0300 0.0250 0.0150 0.0100 0.0150
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
%Similarly
yData = Axes.Children(3).YData;
%Both rows of the data contain the coordinates
plot(xData(1,:),yData(1,:),'k');
%The second row in the data is just an offset of the first row so that the whole snowflake can be plotted
hold on;
plot(xData(2,:),yData(2,:),'k');
hold off

类别

Help CenterFile Exchange 中查找有关 Polygons 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by