Creating solid geometry with PDE

7 次查看(过去 30 天)
sevgi
sevgi 2024-3-9
回答: Yatharth 2024-3-18
Hello there;
For thermal analysis, I need to create the solid model shown in the attached image with PDE. Coul you help me create the geometry with PDE?
Note: the circles are empty

回答(1 个)

Yatharth
Yatharth 2024-3-18
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.
  1. "customAntenna" object lets you create an antenna from a custom shape. https://www.mathworks.com/help/antenna/ref/customantenna.html
  2. "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
  3. "subtract" function for Boolean subtraction operation on two shapes https://www.mathworks.com/help/antenna/ref/subtract.html
I hope this helps!

类别

Help CenterFile Exchange 中查找有关 Geometry and Mesh 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by