Make an offset on a stl file like with the multicuboid function
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello eveyrone,
I have this stl file below and I would like to do a layer of a different material as with the offset of the multicuboid function.
I don't know if it is possible to do it with an stl file.
I also made a canteliver with the multicuboid function with a layer on top of a different material but I don't succeed to make "holes" to reproduce this structure. I tried with the addVoid function but it doesn't work.
Here is the beginning of the code with the multicuboid function :
clc
clear vars
close all
% Create a PDE model for a modal analysis
modelModal_TP2 = createpde("structural","modal-solid");
% Dimensions of the canteliver
L = 75e-6;
l = 9e-6;
h = 1.2e-6;
% Geometry of the canteliver
gm1 = multicuboid(L,l,h);
% Geometry to do the hole in the first geometry
gm2 = multicuboid(45e-6,3e-6,h);
translate(gm2,[-15e-6 0 0]);
% g3 = addVoid(gm,gm1);
figure;
pdegplot(gm1)
hold on
pdegplot(gm2)
% figure;
% pdegplot(g3,"FaceLabels","on")
Thank you in advance
댓글 수: 0
답변 (1개)
Drishti
2024년 10월 3일
Hi Alex,
I understand that you are trying to create 'holes' in the 3d geometry. On reproducing the provided code on my end, I faced a similar issue.
One possible work around to rectify the problem of ‘holes’ is by utilizing the Antenna Toolbox, which offers the ‘subtract’ function for 3D geometries.
You can refer to the provided implementation for better understanding:
% Geometry of the cantilever
gm1 = multicuboid(L, l, h);
% Geometry for the hole in the first geometry
gm2 = multicuboid(45e-6, 3e-6, h);
translate(gm2, [-15e-6, 0, 0]);
% Subtract gm2 from gm1 to create a void using Antenna Toolbox
% Convert to Antenna Toolbox format
cantilever = antenna.Rectangle('Length', L, 'Width', l, 'Center', [L/2, l/2]);
void = antenna.Rectangle('Length', 45e-6, 'Width', 3e-6, 'Center', [15e-6, 1.5e-6]);
% Perform subtraction
resultingGeometry = subtract(cantilever, void);
You can also refer to the MATLAB Documentation of ‘subtract’ function available in Antenna Toolbox.
I hope this resolves the query.
댓글 수: 3
Drishti
2024년 10월 4일
Hi Alex,
If you could provide the use case of your code and what exactly the code is for, we might be able to help.
참고 항목
카테고리
Help Center 및 File Exchange에서 Geometry and Mesh에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!