Hi Sevgi,
For creating a solid model shown in the image you attached you can use Matlab 3-D shape and "subtract" function.
Note: It can only be done on MATLAB R2023B release
Here is an example for you:
% Define the start and end points
xStart = -13;
xEnd = 13;
% Number of cylinders to create
numCylinders = 5;
% Calculate the spacing between each cylinder
spacing = (xEnd - xStart) / (numCylinders - 1);
% Initialize an array to hold the Cylinder objects
cylinders = cell(1, numCylinders);
% Loop to create each Cylinder and set its center
for i = 1:numCylinders
xCenter = xStart + (i-1) * spacing;
cylinders{i} = shape.Cylinder("Radius", 1, "Height", 10, ...
"Color", [0.9290, 0.6940, 0.1250], ...
"Center", [xCenter, 0, 0]);
end
box = shape.Box("Height",10 ,"Length",30,"Color","r","Width",10);
show(box)
for i = 1:numCylinders
box = subtract(box, cylinders{i});
end
show(box)
Now you can use this shape and apply other techniques such as triangulation, generate STL file.
Some of the resources that might help you.
- "customAntenna" object lets you create an antenna from a custom shape. https://www.mathworks.com/help/antenna/ref/customantenna.html
- "stlwrite" function writes the points and connectivity list of an antenna or array mesh to a STL file of specified name. https://www.mathworks.com/help/antenna/ref/stlwrite.html
- "subtract" function for Boolean subtraction operation on two shapes https://www.mathworks.com/help/antenna/ref/subtract.html
I hope this helps!