Truble codeing a diamond lattice
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Lighting, Transparency, and Shading dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!