Truble codeing a diamond lattice

3 ビュー (過去 30 日間)
William
William 2022 年 6 月 23 日
コメント済み: William 2022 年 6 月 24 日
Hello, I have a problem with codeing a diamond lattice. I found a script for this porpouse that I would like to try but when I run it it says "error: 'diamondLattice' undefined near line 30, column 15". Is there somthing I need to change or add? Not really sure how to define the "diamondLattice". All help is vary much appreciated. I will share the skript and the link to it below. Thank you.
fontSize=15;
faceAlpha1=0.8;
faceAlpha2=1;
edgeColor=0.25*ones(1,3);
edgeWidth=1.5;
markerSize=25;
markerSize2=10;
cMap=gjet(4);
%Latticeparameters
nRepeat=3; %Number of repetitions of the lattice pattern
sampleSize=30;
nSubPenta=1;
strutThickness=2; %Set the strut thickness
[Ep,Et,VT,Ct]=diamondLattice(sampleSize,nRepeat,strutThickness,0);
[Ep,VT]=subPenta(Ep,VT,nSubPenta,3); %Sub-divide pentahedra
% strutThicknessCheck=mean(patchEdgeLengths(Fp{1},VT));
%Get element faces for visualization
Fp=element2patch(Ep,[],'penta6');
Ft=element2patch(Et,[],'tet4');
cFigure;
subplot(1,2,1); hold on;
gpatch(Fp,VT,'bw','none',1);
gpatch(Ft,VT,'bw','none',1);
axisGeom; camlight headlight;
subplot(1,2,2); hold on;
hpl=gpatch(Fp,VT,'rw','r',0.5);
hpl(end+1)=gpatch(Ft,VT,'gw','g',0.5);
legend(hpl,{'Pentahedral triangles','Pentahedra quads','Tetrahedral triangles'});
axisGeom; camlight headlight;
drawnow;
https://www.gibboncode.org/html/HELP_diamondLattice.html

採用された回答

Karim
Karim 2022 年 6 月 23 日
You need the additional subroutines. In this case "diamondLattice.m" and all other routines accompined by it...
After a quick bit of googling it would seem that you need to download the following toolset: gibbonCode/GIBBON: The Geometry and Image-Based Bioengineering add-On for MATLAB (github.com) and add it to the matlab path.
Afterwards, the example runs fine.
  1 件のコメント
William
William 2022 年 6 月 24 日
Thank you vary much, I will try that!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSTL (STereoLithography) についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by