Cylinder with gyroid infill
Hello,
I have following matlab code
% Clear all previous commands
clear all
close all
clc
% Variables you can change
SizeL = 20; %average length of RVE
Def = 40; %definition
% Variables you shouldn´t change
SFact = (SizeL/2)/pi; %size factor of RVE
A = SFact*pi; %lowest and max coordinates of meshgrid
D = A/Def; %definition factor
% Generation of gyroids
[X,Y,Z] = meshgrid(-A:D:A); %creates mesh grid
% Gyroid equation
OBJ = cos(X/SFact).* sin(Y/SFact) + cos(Y/SFact).* sin(Z/SFact)…
+ cos(Z/SFact).* sin(X/SFact)+(0);
T = 0.5;
OBJ = (OBJ-T).*(OBJ+T);
% Isosurface and isocap
[F1,V1] = isosurface(X,Y,Z,OBJ,0);
[F2,V2] = isocaps(X,Y,Z,OBJ,0,’below’);
%Combines isosurface and isocaps into one
F3 = [F1;F2+length(V1(:,1))];
V3 = [V1;V2];
% Visualization
P = patch(‘Vertices’,V3,’Faces’,F3,’FaceColor’, …
‘red’,’EdgeColor’,’none’);
view(3)
camlight
% STL export of independet files per gyroid.
% Change current file path with desired file path.
stlwrite([‘C:…filepath…G1-T05’ num2str(1) ‘.stl’],F3,V3);
It generates cubical unit cell with gyroid infill. I would need to change it to produce the cylindrical unit cell with height H and radius R with the same infill. I am failing to change the code. Can you help me?
Thank youHello,
I have following matlab code
% Clear all previous commands
clear all
close all
clc
% Variables you can change
SizeL = 20; %average length of RVE
Def = 40; %definition
% Variables you shouldn´t change
SFact = (SizeL/2)/pi; %size factor of RVE
A = SFact*pi; %lowest and max coordinates of meshgrid
D = A/Def; %definition factor
% Generation of gyroids
[X,Y,Z] = meshgrid(-A:D:A); %creates mesh grid
% Gyroid equation
OBJ = cos(X/SFact).* sin(Y/SFact) + cos(Y/SFact).* sin(Z/SFact)…
+ cos(Z/SFact).* sin(X/SFact)+(0);
T = 0.5;
OBJ = (OBJ-T).*(OBJ+T);
% Isosurface and isocap
[F1,V1] = isosurface(X,Y,Z,OBJ,0);
[F2,V2] = isocaps(X,Y,Z,OBJ,0,’below’);
%Combines isosurface and isocaps into one
F3 = [F1;F2+length(V1(:,1))];
V3 = [V1;V2];
% Visualization
P = patch(‘Vertices’,V3,’Faces’,F3,’FaceColor’, …
‘red’,’EdgeColor’,’none’);
view(3)
camlight
% STL export of independet files per gyroid.
% Change current file path with desired file path.
stlwrite([‘C:…filepath…G1-T05’ num2str(1) ‘.stl’],F3,V3);
It generates cubical unit cell with gyroid infill. I would need to change it to produce the cylindrical unit cell with height H and radius R with the same infill. I am failing to change the code. Can you help me?
Thank you Hello,
I have following matlab code
% Clear all previous commands
clear all
close all
clc
% Variables you can change
SizeL = 20; %average length of RVE
Def = 40; %definition
% Variables you shouldn´t change
SFact = (SizeL/2)/pi; %size factor of RVE
A = SFact*pi; %lowest and max coordinates of meshgrid
D = A/Def; %definition factor
% Generation of gyroids
[X,Y,Z] = meshgrid(-A:D:A); %creates mesh grid
% Gyroid equation
OBJ = cos(X/SFact).* sin(Y/SFact) + cos(Y/SFact).* sin(Z/SFact)…
+ cos(Z/SFact).* sin(X/SFact)+(0);
T = 0.5;
OBJ = (OBJ-T).*(OBJ+T);
% Isosurface and isocap
[F1,V1] = isosurface(X,Y,Z,OBJ,0);
[F2,V2] = isocaps(X,Y,Z,OBJ,0,’below’);
%Combines isosurface and isocaps into one
F3 = [F1;F2+length(V1(:,1))];
V3 = [V1;V2];
% Visualization
P = patch(‘Vertices’,V3,’Faces’,F3,’FaceColor’, …
‘red’,’EdgeColor’,’none’);
view(3)
camlight
% STL export of independet files per gyroid.
% Change current file path with desired file path.
stlwrite([‘C:…filepath…G1-T05’ num2str(1) ‘.stl’],F3,V3);
It generates cubical unit cell with gyroid infill. I would need to change it to produce the cylindrical unit cell with height H and radius R with the same infill. I am failing to change the code. Can you help me?
Thank you gyroid, .stl MATLAB Answers — New Questions