Generate Gyroid structures using Matlab (Meshlab +FreeCAD conversion)

Sdílet
Vložit
  • čas přidán 23. 07. 2024
  • Gyroid generation based on Matlab script. The advantage is the capability to manipulate the thickness, position and mesh density. At the end I show how the mesh is exported, and improved in Meshlab and also converted to Solid in FreeCAD.
    To calculate approximate volume fraction use:
    Solid Netwrok Vf=0.5-0.333*t
    Sheet network Vf=0.65*t
    Source DOI :10.1177/0278364920907697
    The Matlab script is below:
    % 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);
    %Visualization
    axis equal
  • Věda a technologie

Komentáře • 101

  • @maxgoris7568
    @maxgoris7568 Před rokem

    Thank you very much! I'm researching different lattice structures for orthopaedic applications. You have saved me a lot of time!

    • @RamiRouhana
      @RamiRouhana  Před rokem +1

      You are welcome Max! Share this video with those who might be interested and let me know If I can further help or what additional video could be useful.

  • @Aamor321
    @Aamor321 Před rokem +1

    Big Thanks for the wonderful Tutorial! Greetings from a german engineering student😊

    • @RamiRouhana
      @RamiRouhana  Před rokem +1

      Thank you! Ich wünsche Ihnen viel Erfolg bei Ihrem Studium!

  • @ZacLCroft
    @ZacLCroft Před rokem +1

    Very helpful. Thanks so much!

  • @user-MehrdadLotfi
    @user-MehrdadLotfi Před rokem +1

    Very useful! Thank you!

  • @alessandraadrover6403
    @alessandraadrover6403 Před 8 měsíci +1

    thank you so much. Very useful tutorial

  • @user-if2fk2sw8n
    @user-if2fk2sw8n Před rokem

    Hello! Is it possible for me to alter the triangualtion (deciding if it should be very triangulated or just a little) options for the .stl file?
    Thanks.

    • @RamiRouhana
      @RamiRouhana  Před rokem

      Hello , that is possible. Try to run the script with "Def = 40" changed to "Def = 80" . That defines the mesh density.

  • @pawanharsha3826
    @pawanharsha3826 Před 4 měsíci

    Hey,
    What we created the Gyroid TPMS structure using MS Lattice and have the STL file, any suggestions on how to convert the file to Step or IGES for performing FEA analysis. Im having a hard time cause there are no surfaces in the STL file.

    • @RamiRouhana
      @RamiRouhana  Před 4 měsíci

      I show these steps in this video. Using FreeCAD , or you could use Fusion 360 or there is an abaqus plugin "STL to solid". Watch until the end.

  • @user-qp5dw7zt8k
    @user-qp5dw7zt8k Před 6 měsíci

    Thank you so much. I have a question.
    % Gyroid equation
    OBJ = cos(X/SFact).* sin(Y/SFact) + cos(Y/SFact).* sin(Z/SFact)...
    + cos(Z/SFact).* sin(X/SFact)+(-0.3);
    T = 0.5;
    OBJ = (OBJ-T).*(OBJ+T);
    In this part, how 'OBJ = (OBJ-T).*(OBJ+T);' this part creates 2 surfaces? It there any reference that you used?

  • @user-te6bl9og5v
    @user-te6bl9og5v Před 3 měsíci

    Sir could you please tell me the version of this meshlab. In the latest meshlab the convert vertices and compact face is not available.

  • @fereshteh-tn4kk
    @fereshteh-tn4kk Před 9 měsíci

    Thanks for your great work
    I have a question, if it is possible to have a row of them, for example, 10 gyroid next to each other in a line

    • @RamiRouhana
      @RamiRouhana  Před 9 měsíci

      With this script it would be easier to make on cell and make the repition using the generated STL on another software like meshlab.
      You could do it by adjusting the paremeters in direction x to compress 10 cells in and then later stretch it but the mesh will not be very homogenous. You could also try to define a larger volume for X direction, but I have not myself tried that.

    • @fereshteh-tn4kk
      @fereshteh-tn4kk Před 9 měsíci

      👍🏻🙏

  • @fereshteh-tn4kk
    @fereshteh-tn4kk Před rokem

    Thanks for your great and helpful video. One question, can you let me know how can I make a foam with certain amount of porosity, for example 90%, please?

    • @RamiRouhana
      @RamiRouhana  Před rokem

      That same question was asked below. I added the equation and the reference paper.

  • @user-if2fk2sw8n
    @user-if2fk2sw8n Před rokem

    Thank you so much for your help. In this same code can I generate the gyroid's complementary volume so that it all sms up to a cube?
    How do I proceed

    • @RamiRouhana
      @RamiRouhana  Před rokem

      I have done it yes. You can export the other geometry by tweaking the combine code at the end.

    • @user-if2fk2sw8n
      @user-if2fk2sw8n Před rokem

      @@RamiRouhana % Clear all previous commands
      clear all
      close all
      clc
      % Variables you can change
      Sizex = 1; %average length of RVE
      Sizey = 1;
      Sizez = 1;
      Def = 60; %definition
      % Variables you shouldn´t change
      SFactx = (Sizex/2)/pi; %size factor of RVE
      SFacty = (Sizey/2)/pi;
      SFactz = (Sizez/2)/pi;
      A = SFactx*pi; %lowest and max coordinates of meshgrid
      B = SFacty*pi;
      C = SFactz*pi;
      Dx = A/Def;%definition factor
      Dy = B/Def;
      Dz = C/Def;
      % Generation of gyroids
      [X,Y,Z] = meshgrid(-A:Dx:A, -B:Dy:B, -C:Dz:C); %creates mesh grid
      % Gyroid equation
      OBJ =(A*B*C)-(cos(X/SFactx).* sin(Y/SFacty) + cos(Y/SFacty).* sin(Z/SFactz)...
      + cos(Z/SFactz).* sin(X/SFactx)+(0));
      OBJ1=(cos(X/SFactx).* sin(Y/SFacty) + cos(Y/SFacty).* sin(Z/SFactz)...
      + cos(Z/SFactz).* sin(X/SFactx)+(0));
      T = 0.5;
      OBJ =(OBJ-T);
      OBJ1=(OBJ1-T);
      % Isosurface and isocap
      [F1,V1] = isosurface(X,Y,Z,OBJ,0);
      [F2,V2] = isocaps(X,Y,Z,OBJ,0,'below');
      [F4,V4] = isosurface(X,Y,Z,OBJ1,0);
      [F5,V5] = isocaps(X,Y,Z,OBJ1,0,'below');
      %Combines isosurface and isocaps into one
      F3 = [F1;F2+length(V1(:,1))];
      V3 = [V1;V2];
      F6 = [F4;F5+length(V4(:,1))];
      V6 = [V1;V4];
      % Visualization
      P = patch('Vertices',V3,'Faces',F3,'FaceColor', ...
      'magenta','EdgeColor','none');
      view(3)
      camlight
      P = patch('Vertices',V6,'Faces',F6,'FaceColor', ...
      'green','EdgeColor','none');
      view(3)
      camlight
      %Visualization
      axis equal
      here is the code...i want to represent both the gyroid's and its complement inside the cube but with different colors...The graph is a little strange. Do you have any idea why?

  • @jiyoungjung5461
    @jiyoungjung5461 Před 4 měsíci

    Hello, This video is awesome and very informative. I saw you posted approximated vf for the sheet as Vf=0.65*t. How did you obtain the equation? Is there a range of t that satisfies the approximation? Could you share the reference for the equation please?

    • @RamiRouhana
      @RamiRouhana  Před 4 měsíci +1

      Hello. I am glad you found the vid useful. The paper reference DOI is also in another comment. I can only assume that the equation holds until t=1.38

  • @chaiyasitpoompurk
    @chaiyasitpoompurk Před rokem

    If it's other TPMS (example Diamond), how can I find Vf equation ?

    • @RamiRouhana
      @RamiRouhana  Před rokem

      In the code, this is the Gyroid equation.
      % Gyroid equation
      OBJ = cos(X/SFact).* sin(Y/SFact) + cos(Y/SFact).* sin(Z/SFact)...
      + cos(Z/SFact).* sin(X/SFact)+(0);
      The Diamond Equation is :
      sin(X/SFact).* sin(Y/SFact).* sin(Z/SFact) +
      sin(X/SFact).* cos(Y/SFact).* cos(Z/SFact)+
      cos(X/SFact).* sin(Y/SFact).* cos(Z/SFact)+
      cos(X/SFact).* cos(Y/SFact) .* sin(Z/SFact) - (0);
      replace it in the code.

  • @user-if2fk2sw8n
    @user-if2fk2sw8n Před rokem

    Thank you. I would like to visualise the uncombined nodes cut at the edges. How do I do that?

    • @RamiRouhana
      @RamiRouhana  Před rokem

      I am sorry, I cannot help you with that.

    • @user-if2fk2sw8n
      @user-if2fk2sw8n Před rokem

      @@RamiRouhana I just want to know which part of the code to delete so the gyroïd does not become a smooth uniform surface

    • @RamiRouhana
      @RamiRouhana  Před rokem

      @@user-if2fk2sw8n Try commenting out the isosurface section.

    • @user-if2fk2sw8n
      @user-if2fk2sw8n Před rokem

      @@RamiRouhana But if i delete that isosurface line it will impact the "combine" and "visualisation" parts.

  • @user-ed9pj4eu6g
    @user-ed9pj4eu6g Před rokem

    hello, Can I ask you a question?
    The following error occurs when executing your code.
    " Input argument must be a triangulation object "
    Maybe the cause of the problem is 'stlwrite'.
    How can I solve this problem?

    • @RamiRouhana
      @RamiRouhana  Před rokem

      Hello. When the error occurs it indicates usually the line of code where the error is. The forums suggest it is an error related to stlwrite yes. Make sure you install the plugin using Matlab add-ons.
      It could be dependent on the matlab version you are using also.

    • @user-ed9pj4eu6g
      @user-ed9pj4eu6g Před rokem +1

      @@RamiRouhana oh, I looked at the video carefully again, You've already explained it
      thank you so much. I solved the problem :)

  • @user-te6bl9og5v
    @user-te6bl9og5v Před 3 měsíci

    Sir could you please tell me which version of FreeCAD software you r using?

  • @jonathanvillada9330
    @jonathanvillada9330 Před rokem

    Hi Rami,
    When I get to the last step of converting the surfaces to a solid I run into an error on FreeCAD. I select G1_T05_50K001 > Part > Convert to solid and then the error reads "Cannot convert model because Shape is not a shell. Any recommendations on what to do? I tried exporting it after the fact and my program just frozen indefinitely.

    • @RamiRouhana
      @RamiRouhana  Před rokem

      Hello , try checking mesh quality on meshlab and check if there are holes or bad mesh. Often there are duplicate surfaces or independent nodes.

    • @jonathanvillada9330
      @jonathanvillada9330 Před rokem +1

      @@RamiRouhana Do you know if meshlab changed some of their settings? I could not find compact faces and vertices in their submenus so I went straight for removing and merging.

    • @RamiRouhana
      @RamiRouhana  Před rokem

      @@jonathanvillada9330 there should be other software for mesh correction. Meshmixer maybe.

  • @user-te6bl9og5v
    @user-te6bl9og5v Před 9 dny

    Sir could you please tell me which version or matlab you have used. Actually the stlwrite is not working in my matlab 2024b.I have already addon stl write

    • @RamiRouhana
      @RamiRouhana  Před dnem

      I tested on 2024b , it appears to work. Place the STL write code in the same folder where the script is.

  • @user-if2fk2sw8n
    @user-if2fk2sw8n Před rokem

    One more question ...whenever I try to save as .stl file the program tells me "Error using stlwrite
    Input argument must be a triangulation object." how do I solve this?"

    • @RamiRouhana
      @RamiRouhana  Před rokem

      it could be that you are using a mesh sensity that is low.
      Try first to run the code as it is and see if the STL is generated.
      If it works and then give errors due to the changes you made, then the changes you have made are causing the error.

    • @user-if2fk2sw8n
      @user-if2fk2sw8n Před rokem

      @@RamiRouhana The STL is not generated even with your original file. How do I increast the mesh sinsity?

    • @RamiRouhana
      @RamiRouhana  Před rokem

      @@user-if2fk2sw8n you need to instal the stl generation plugin in the right folder.

  • @LorenzoPiccinini-um6hd
    @LorenzoPiccinini-um6hd Před 4 měsíci

    I tried to save the file using stl but it requested the triangulation I don't know how to fix it could you please help me?

    • @RamiRouhana
      @RamiRouhana  Před 4 měsíci

      Hello. Adjust the mesh density, but also check the other comments. I provided some solutions.

  • @user-lg4ho1mz8d
    @user-lg4ho1mz8d Před rokem

    Thank you for useful content! I have a question. How can I make the structure has more finer unit cell??

    • @RamiRouhana
      @RamiRouhana  Před rokem +1

      Hello , that is possible. Try to run the script with "Def = 40" changed to "Def = 80" . That defines the mesh density.

    • @user-lg4ho1mz8d
      @user-lg4ho1mz8d Před 11 měsíci

      ​@@RamiRouhana Thank you for your answer! I mean unit cell is a repeated structure of the gyroid structure. So, I want to know if I can make a structure that has many smaller repeated structures. Sorry for confusing you.

    • @RamiRouhana
      @RamiRouhana  Před 11 měsíci

      @@user-lg4ho1mz8d That would be possible in the script but very tricky, you will need to adjust the the values in the cos(x) to cos (x/3) and then increase resolution. You will get 3 cells in the x direction.

  • @relab5346
    @relab5346 Před 4 měsíci

    Can I save the file as Tiff rather than STL, also can I change the solid of the gyrode to be made of small particles of spheres

    • @RamiRouhana
      @RamiRouhana  Před 4 měsíci

      Yes there are methods if you export node coordiates you can make what is called SPH in Abaqus. Or you can adjust the script in matlab to generate a sphere at the location of nodes, there are tutorials of that.

    • @relab5346
      @relab5346 Před 4 měsíci

      Thanks for your reply please can you explain more, I'm a beginner in Matlab.

    • @RamiRouhana
      @RamiRouhana  Před 4 měsíci

      @@relab5346 It is not an easy task in matlab. It is better if you import the CAD to abaqus. Look for tutorials to convert the CAD to particles SPH in abaqus.
      For matlab , this might help arxiv.org/abs/2209.05189

  • @maxonokram2275
    @maxonokram2275 Před 4 měsíci

    Hello! Rami Rouhana, I think this video is very informative. I want to know more about the volume calculation of gyroid. How I can edit the MATLAB code that you provided in the description to get the volume of the gyroid?
    I hope this comment finds you well.
    Thanks.

    • @RamiRouhana
      @RamiRouhana  Před 4 měsíci

      Hello. In the comments i posted the equation to calculate volume and the reference paper.
      I will add that to the video description.

  • @user-te6bl9og5v
    @user-te6bl9og5v Před 3 měsíci

    Thank you for your support.
    I have some doubt in my mind and I will feel grateful if you please resolve these issues.
    1. After creation of a part when I am not to select any face, which is required for assembly.
    2. I want to simulate the structure in abaqus. Which file format I should save after freeCAD

    • @RamiRouhana
      @RamiRouhana  Před 3 měsíci

      1-What aeesmbly do you mean ??
      2- save as 'SAT" file type

    • @user-te6bl9og5v
      @user-te6bl9og5v Před 3 měsíci

      @@RamiRouhana I want to assembly two different TPMS structures but when I insert this in FreeCAD software I am not able to select any face of the structures to mate 2 faces

    • @user-te6bl9og5v
      @user-te6bl9og5v Před 3 měsíci

      @@RamiRouhana .sat file option is not available in freecad save types

    • @RamiRouhana
      @RamiRouhana  Před 3 měsíci

      @@user-te6bl9og5v try IGS and STP

    • @user-te6bl9og5v
      @user-te6bl9og5v Před 3 měsíci

      @@RamiRouhana thank you sir.

  • @user-qp5dw7zt8k
    @user-qp5dw7zt8k Před 5 měsíci

    Hi sir
    I followed your order correctly but there is error in FreeCAD conversion
    When I click "convert to solid", I got this error message.
    File "", line 2, in
    : Shape is not a shell
    20:11:50 Cannot convert GyroidD_40_t_0_T_0_5_____50K001 because Shape is not a shell.
    Did you really succeed to do this order?
    Thank you so much

    • @RamiRouhana
      @RamiRouhana  Před 5 měsíci

      Try to adjust the mesh density you generate in matlab , your mesh might have defects in it. As mentioned in the video, the step in Meshlab for mesh optimization is very helpful, and in some cases necessary.

    • @user-qp5dw7zt8k
      @user-qp5dw7zt8k Před 5 měsíci

      @@RamiRouhana
      I input "40" mesh density in matlab.
      And I optimized faces into 50000 faces in Meshlab.
      However I got this error....TT

    • @RamiRouhana
      @RamiRouhana  Před 5 měsíci

      @@user-qp5dw7zt8k have you adjusted the t value or are u following the exact same steps in the vid. I would say try Fusion360 to convert mesh to CAD . Maybe the new FreeCAD has a code problem.

  • @user-te6bl9og5v
    @user-te6bl9og5v Před 11 měsíci

    sir could you please tell me how can I can convert it into 3d solid meshed?

    • @user-te6bl9og5v
      @user-te6bl9og5v Před 11 měsíci

      Actually I want to apply load on one face and fixed in other end in matlab.

    • @RamiRouhana
      @RamiRouhana  Před 11 měsíci

      @@user-te6bl9og5v I explain mesh conversion on FreeCAD at the end of the video.

    • @user-te6bl9og5v
      @user-te6bl9og5v Před 11 měsíci

      Thank you sir for your guidance. I am looking that is their any way we can convert this to solid in matlab itself? @@RamiRouhana

  • @user-kp1ko9dg3s
    @user-kp1ko9dg3s Před 8 měsíci

    Thanks a lot for the video. Is it possible to calculate the surface area and volume of the sheet gyroid in matlab?

    • @RamiRouhana
      @RamiRouhana  Před 8 měsíci +1

      The volume it is possible by the equation in the video description. Surface area should be possible but I do it on meshlab.

    • @user-kp1ko9dg3s
      @user-kp1ko9dg3s Před 8 měsíci

      ​@@RamiRouhana
      Thanks for your reply.
      Is F3 representative of the surface area of the gyroid, and is V3 the corresponding volume?
      Is there a direct relationship between the T value and the thickness of the sheet gyroid?

    • @user-kp1ko9dg3s
      @user-kp1ko9dg3s Před 8 měsíci

      From your previous comment -
      These two equations give you a sheet gyroid. To find approximate thickness :
      sin 0 cos 0 + sin 0 cos z + sin z cos0 =+0.1
      sin 0 cos 0 + sin 0 cos z + sin z cos0 =-0.1
      Solving these 2 equations we get z= arcsin(t) & z= arcsin(-t). so arcsin(t) should be the thickness of the sheet gyroid, right?

    • @RamiRouhana
      @RamiRouhana  Před 8 měsíci

      The thickness is not a constant, this is the value you get near the center of the cube face. The deviation becomes larger with larger T values.@@user-kp1ko9dg3s

    • @RamiRouhana
      @RamiRouhana  Před 8 měsíci

      F is the faces , and V are the vertices. @@user-kp1ko9dg3s

  • @user-qp5dw7zt8k
    @user-qp5dw7zt8k Před 6 měsíci

    Thank you so much! I have a question.
    % Gyroid equation
    OBJ = cos(X/SFact).* sin(Y/SFact) + cos(Y/SFact).* sin(Z/SFact)...
    + cos(Z/SFact).* sin(X/SFact)+(-0.3);
    T = 0.5;
    OBJ = (OBJ-T).*(OBJ+T);
    In this part, I can't understand how "OBJ = (OBJ-T).*(OBJ+T);" works to create 2 isosurfaces. Is there any reference which you used?
    Thank you ^^

    • @RamiRouhana
      @RamiRouhana  Před 6 měsíci

      Hello. The equation of a gyroid is equal to a constant. By reducing or increasong the constant, the gyroid surface shifts like an offset but in 3D. So offsetting equally give a symmetric thick shell .

    • @user-qp5dw7zt8k
      @user-qp5dw7zt8k Před 5 měsíci

      @@RamiRouhana Thank you. Sir
      And I have one more problem in FreeCAD
      I followed your order well but when I do this function
      Part - Convert to Solid
      There is a error msg : because Shape is not a shell
      I don't know why.... I really created shape from mesh first but I can't make a solid from shape

    • @RamiRouhana
      @RamiRouhana  Před 5 měsíci

      @@user-qp5dw7zt8k you have to click on the part name on the left sidebar before you do the conversion.

  • @camilomaturana9011
    @camilomaturana9011 Před 7 měsíci

    Thank you so much. Your code was very useful for me 🙏. It is possible modify the code and make a cylinder fill with gyroid tpms unit cells? And if it is possible, how can i do that?

    • @camilomaturana9011
      @camilomaturana9011 Před 7 měsíci

      In your code i made some modifications for get that cylinder, with booleans operations, but the result is a little bit bad, because the surface of the units cells are stranges, so i dont know how i can solve that.
      % Clear all previous commands
      clear all
      close all
      clc
      % Variables you can change
      SizeL = 1; %average length of RVE
      Def = 60; %definition
      % Variables you shouldn´t change
      SFact = (SizeL/2)/pi; %size factor of RVE
      A = 10*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);
      T = (-0.05*(X.*X + Y.*Y) + 1.25);
      OBJ = OBJ >= 0 ;
      % Extrusion
      ExtrusionHeight = 10
      CylinderRadius = 5
      extrusionMask = Z CylinderRadius^2;
      cylindricalShape = cylinderMask & extrusionMask;
      % Combine gyroid structure with extrusion and cylindrical shape
      ResultSurface = OBJ | cylinderMask;
      % Isosurface and isocap
      [F1, V1] = isosurface(X, Y, Z, ResultSurface, 0);
      [F2, V2] = isocaps(X, Y, Z, ResultSurface, 0, 'below');
      % Combine isosurface and isocaps into one
      F3 = [F1; F2 + length(V1(:, 1))];
      V3 = [V1; V2];
      % Visualization
      figure;
      P = patch('Vertices', V3, 'Faces', F3, 'FaceColor', 'blue', 'EdgeColor', 'none');
      view(3);
      camlight;
      % STL export of the entire structure
      % Change current file path with desired file path.
      % Visualization
      axis equal;

    • @RamiRouhana
      @RamiRouhana  Před 7 měsíci

      @@camilomaturana9011 You are welcome. What is the code you added ?

    • @camilomaturana9011
      @camilomaturana9011 Před 7 měsíci

      @@RamiRouhana This parts (The code is up):
      A = 10*SFact*pi; %lowest and max coordinates of meshgrid (This for make an a repetition of the unit cells in the space)
      OBJ = OBJ >= 0 ;
      % Extrusion
      ExtrusionHeight = 10
      CylinderRadius = 5
      extrusionMask = Z CylinderRadius^2;
      cylindricalShape = cylinderMask & extrusionMask;
      % Combine gyroid structure with extrusion and cylindrical shape
      ResultSurface = OBJ | cylinderMask;
      % Isosurface and isocap
      [F1, V1] = isosurface(X, Y, Z, ResultSurface, 0);
      [F2, V2] = isocaps(X, Y, Z, ResultSurface, 0, 'below');

  • @user-te6bl9og5v
    @user-te6bl9og5v Před rokem +1

    Respected sir,
    Thank you for this outstanding video. It helps me lot for my research. I have some doubts regarding this video and it will be grateful if you help me on that.
    1. What is the thickness of this sheet type gyroid?
    2. How can I create network type gyroid with specific volume fraction?

    • @RamiRouhana
      @RamiRouhana  Před rokem +1

      I am glad this video is helpful.
      1-The wall tickness if the sheet gyroid is not constant. You can estimate it by setting X and Y to 0 in the equation and calculate for Z value for the constant set to +t and -t.
      Example :
      sinx cosy + sin y cos z + sin z cos x = +0.1
      sinx cosy + sin y cos z + sin z cos x = -0.1
      These two equations give you a sheet gyroid.
      To find approximate thickness :
      sin 0 cos 0 + sin 0 cos z + sin z cos0 =+0.1
      sin 0 cos 0 + sin 0 cos z + sin z cos0 =-0.1
      Solve for Z and calculate the difference, you will have the sheet thickness in Z. It would be better to do the same for X and then also for Y. The smallest value it the closest to to average.
      2-This paper will help you with your questions.
      journals.sagepub.com/doi/10.1177/0278364920907697

    • @RamiRouhana
      @RamiRouhana  Před rokem +1

      The volume fraction of the sheet-like structure can be controlled by its thickness that is constant throughout the structure and depends on the values chosen for the constant . The relationship between the level set constant and the volume fraction
      of the solid-network Gyroid reinforcement phase is as follows:
      Vf = 0.65c

    • @subhanath2914
      @subhanath2914 Před rokem

      @@RamiRouhana thank you sir for this information

  • @user-te6bl9og5v
    @user-te6bl9og5v Před 11 měsíci

    Respected sir,
    In my research I need to check any point within that TPMS or not? But in that code I am not able to do that. I will be appreciated if you kindly help me to correct that.
    %clear all previous commands
    clear all
    close all
    clc
    %variable you can change
    SizeL = 5;
    Def = 160;
    SFact = (SizeL/2)/pi;
    A = SFact*pi;
    D = A/Def;
    [X,Y,Z] = meshgrid(-A:D:A);
    OBJ = cos (X/SFact)+cos (Y/SFact)+cos (Z/SFact) + (0);
    T = 0;
    OBJ = (OBJ);
    [F1,V1] = isosurface (X,Y,Z,OBJ,0);
    [F2,V2] = isocaps(X,Y,Z,OBJ,0,'above');
    F3 = [F1;F2+length(V1(:,1))];
    V3 = [V1;V2];
    P = patch ('Vertices',V3, 'Faces',F3,'FaceColor','blue','EdgeColor','none');
    K = [0 0 0];
    in = intriangulation(V3,F3,K)
    if in==0
    fprintf("outside");
    else
    fprintf("inside");
    end
    view(3)
    camlight
    axis equal
    THANK YOU

    • @RamiRouhana
      @RamiRouhana  Před 11 měsíci

      I am sorry. I cannot help you at the momet with a specific coding task. You will need to export surface node coordinates and write a script to compare positions (In/Out).

  • @user-te6bl9og5v
    @user-te6bl9og5v Před rokem

    Respected sir,
    Thank you for such a helpful tutorial. It helps me lot in my research. I am facing two issues regarding gyroid coding:
    1. How can I insert the unit of gyroid in this code?
    2. I want to create a row of gyroids then what are the changes I need to do?
    It will be helpful for me if you help me regarding that.

    • @RamiRouhana
      @RamiRouhana  Před rokem

      1-What do you mean by unit?
      2- create the stl and copy in a row using fusion software.

    • @subhanath6405
      @subhanath6405 Před rokem

      Sir unit means I need 20 cm length gyroid

    • @RamiRouhana
      @RamiRouhana  Před rokem

      @@subhanath6405 you can scae up the stl to any size you need after genrating it.
      Use fusion software or Meshlab.

  • @GuHong98
    @GuHong98 Před rokem

    Hello Rami, great video. If I were to 3D print structures like this do you know how to fill the Gyroid walls? The model right now is hollow.
    Thank you very much :)

    • @RamiRouhana
      @RamiRouhana  Před rokem +1

      Hello Alexandre. For printing you do not need to do any changes to the exported STL file. The slicer for printing fills the volume based on you print settings, number of walls and infil precentage if you are using FDM. If you are using SLM or SLA or SLS additive technology the STL model is assumed a solid in the slicer.