Gyroid Surface Area & Volume Calculation from existing code
Show older comments
The following code is to generate the shape of gyroid. From the code I want to calculate the surface area and volume. Instead of exporting the file and imprt in 3D design software could a potential solution, I want to get the surface area and volume from the code below:
clc
clear
close all
SizeL = 20;
Def = 40;
SFact = (SizeL/2)/pi;
A = SFact*pi;
D = A/Def;
[X,Y,Z] = meshgrid(-A:D:A);
OBJ = cos(X/SFact).*sin(Y/SFact) + cos(Y/SFact).*sin(Z/SFact) + cos(Z/SFact).*sin(X/SFact);
T = 0.5;
OBJ = (OBJ - T) .* (OBJ + T);
[F1,V1] = isosurface(X,Y,Z,OBJ,0);
[F2,V2] = isocaps(X,Y,Z,OBJ,0,'below');
F3 = [F1; F2+length(V1(:,1))];
V3 = [V1;V2];
p = patch('Vertices',V3,'Faces', F3, 'FaceColor', 'red', 'EdgeColor', 'none');
view(3);
camlight
Code Source: https://www.youtube.com/watch?v=uvCfVsFAcSw
Accepted Answer
More Answers (0)
Categories
Find more on Surface and Mesh Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!