Generate Gyroid structures using Matlab (Meshlab +FreeCAD conversion)

Поділитися
Вставка
  • Опубліковано 2 січ 2025

КОМЕНТАРІ • 116

  • @Aamor321
    @Aamor321 Рік тому +1

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

    • @RamiRouhana
      @RamiRouhana  Рік тому +1

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

  • @maxgoris7568
    @maxgoris7568 2 роки тому

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

    • @RamiRouhana
      @RamiRouhana  2 роки тому +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.

  • @신상오원자력공학과한
    @신상오원자력공학과한 10 місяців тому

    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  10 місяців тому

      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.

    • @신상오원자력공학과한
      @신상오원자력공학과한 10 місяців тому

      @@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  10 місяців тому

      @@신상오원자력공학과한 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.

  • @leonardomontanosimonato8003
    @leonardomontanosimonato8003 2 місяці тому +1

    Obrigado do Brasil, this is amazing!

  • @joerees9060
    @joerees9060 3 місяці тому +1

    I’m trying to create a lattice structure of gyroids. Each unit cell 3x3x3 mm then using Formlabs 3 to print it. I guess I confused on how to understand what dimensions this code makes the gyroid. Is this something that can be altered in FreeCAD? Also, how would I repeat the gyroids to make the lattice structure?

    • @RamiRouhana
      @RamiRouhana  3 місяці тому

      Hello. In the OBJ equation multiply or divide "X" , "Y" ,"Z" by 2 and try.
      That is ine way to have 8 gyroids...
      The best way is still to generate one and in an STL manipulation software xombine them. Like meshlab.

    • @joerees9060
      @joerees9060 3 місяці тому

      And parameterize in STL software too?

    • @RamiRouhana
      @RamiRouhana  3 місяці тому

      @@joerees9060 parametrize in Matlab and then use STL pattern option either in meshlab or better in CAD form in FreeCAD

    • @joerees9060
      @joerees9060 3 місяці тому

      Been working on this for a little while. Followed your process but have been trying to upload the file into NX Siemens to work on it more. When I upload into NX, each element appears to be its own body.. any suggestion on how to make it one solid body? Is this something I’m messing up in freeCAD

    • @RamiRouhana
      @RamiRouhana  3 місяці тому

      @@joerees9060 Replace the section where the main equation is written with this:
      % Gyroid equation
      OBJ = cos(X/2*SFact).* sin(Y/2*SFact) + cos(Y/2*SFact).* sin(Z/2*SFact)...
      + cos(Z/2*SFact).* sin(X/2*SFact)+(0);
      Change Def = 80; (Improves mesh quality)
      Try it. You will get multiple gyroids.

  • @신상오원자력공학과한
    @신상오원자력공학과한 11 місяців тому

    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?

  • @pawanharsha3826
    @pawanharsha3826 9 місяців тому

    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  9 місяців тому

      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.

  • @OfufualuaguAugustus
    @OfufualuaguAugustus Рік тому

    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  Рік тому

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

  • @OfufualuaguAugustus
    @OfufualuaguAugustus Рік тому

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

    • @RamiRouhana
      @RamiRouhana  Рік тому

      I am sorry, I cannot help you with that.

    • @OfufualuaguAugustus
      @OfufualuaguAugustus Рік тому

      @@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  Рік тому

      @@OfufualuaguAugustus Try commenting out the isosurface section.

    • @OfufualuaguAugustus
      @OfufualuaguAugustus Рік тому

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

  • @SubhaNath-m5u
    @SubhaNath-m5u 8 місяців тому

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

    • @RamiRouhana
      @RamiRouhana  8 місяців тому

      Hello, I currently have v2020.07

  • @OfufualuaguAugustus
    @OfufualuaguAugustus Рік тому

    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  Рік тому

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

    • @OfufualuaguAugustus
      @OfufualuaguAugustus Рік тому

      @@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?

  • @SubhaNath-m5u
    @SubhaNath-m5u 5 місяців тому

    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  5 місяців тому

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

  • @ZacLCroft
    @ZacLCroft Рік тому +1

    Very helpful. Thanks so much!

  • @alejandroalonso2216
    @alejandroalonso2216 Місяць тому

    Hello, thank you very much for the tutorial, it is very helpful!
    One question: when trying to convert to a solid in the last step, I get this error from FreeCAD: Cannot convert gyroid_T05_601_clean001 because Shape is not a shell. Do you know why?

    • @RamiRouhana
      @RamiRouhana  Місяць тому

      @@alejandroalonso2216 hello. I am glad you found the tutorial usefull. Probably you reduced the mesh size too much in meshlab or the mesh was not cleaned.

  • @OfufualuaguAugustus
    @OfufualuaguAugustus Рік тому

    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  Рік тому

      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.

    • @OfufualuaguAugustus
      @OfufualuaguAugustus Рік тому

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

    • @RamiRouhana
      @RamiRouhana  Рік тому

      @@OfufualuaguAugustus you need to instal the stl generation plugin in the right folder.

  • @fereshteh-tn4kk
    @fereshteh-tn4kk Рік тому

    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  Рік тому

      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 Рік тому

      👍🏻🙏

  • @SubhaNath-m5u
    @SubhaNath-m5u Рік тому +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  Рік тому +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  Рік тому +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 Рік тому

      @@RamiRouhana thank you sir for this information

  • @박세민-k7g
    @박세민-k7g 2 роки тому

    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  2 роки тому

      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.

    • @박세민-k7g
      @박세민-k7g 2 роки тому +1

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

  • @jonathanvillada9330
    @jonathanvillada9330 Рік тому

    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  Рік тому

      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 Рік тому +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  Рік тому

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

  • @LorenzoPiccinini-um6hd
    @LorenzoPiccinini-um6hd 10 місяців тому

    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  10 місяців тому

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

  • @relab5346
    @relab5346 10 місяців тому

    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  10 місяців тому

      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 10 місяців тому

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

    • @RamiRouhana
      @RamiRouhana  10 місяців тому

      @@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

  • @chaiyasitpoompurk
    @chaiyasitpoompurk Рік тому

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

    • @RamiRouhana
      @RamiRouhana  Рік тому

      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.

  • @alessandraadrover6403
    @alessandraadrover6403 Рік тому +1

    thank you so much. Very useful tutorial

  • @kanav1998
    @kanav1998 5 місяців тому

    Hi, I had two questions and was wondering if you could help me out.
    1. How do I generate the gyroids but instead of the walls in the sheet type, I want the paths inside the double gyroids.
    2. I want to control the thickness of the paths as well.
    Thanks in advance!

    • @RamiRouhana
      @RamiRouhana  5 місяців тому

      Hello,
      1- you should switch the boundary limits and the volumes you combine at the end of the code. It is doable, if you break down the code and the functions in it.
      2-The thickness can always be controlled by the T parameters.

    • @kanav1998
      @kanav1998 5 місяців тому

      @@RamiRouhana hey really appreciate the quick reply! Just that I am not very good at MATLAB. I fear if I break down the code I’ll end up actually breaking it.

    • @RamiRouhana
      @RamiRouhana  5 місяців тому

      @@kanav1998 just experiment woth the code at the end that combines the surfaces. Keep an oroginal backup of the script. Understanding better the code will allow you to manipulate it easier.

  • @いーま-v5j
    @いーま-v5j Рік тому

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

    • @RamiRouhana
      @RamiRouhana  Рік тому +1

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

    • @いーま-v5j
      @いーま-v5j Рік тому

      ​@@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  Рік тому

      @@いーま-v5j 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.

  • @jiyoungjung5461
    @jiyoungjung5461 10 місяців тому

    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  10 місяців тому +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

  • @SubhaNath-m5u
    @SubhaNath-m5u 8 місяців тому

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

  • @SubhaNath-m5u
    @SubhaNath-m5u 8 місяців тому

    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  8 місяців тому

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

    • @SubhaNath-m5u
      @SubhaNath-m5u 8 місяців тому

      @@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

    • @SubhaNath-m5u
      @SubhaNath-m5u 8 місяців тому

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

    • @RamiRouhana
      @RamiRouhana  8 місяців тому

      @@SubhaNath-m5u try IGS and STP

    • @SubhaNath-m5u
      @SubhaNath-m5u 8 місяців тому

      @@RamiRouhana thank you sir.

  • @신상오원자력공학과한
    @신상오원자력공학과한 11 місяців тому

    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  11 місяців тому

      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 .

    • @신상오원자력공학과한
      @신상오원자력공학과한 11 місяців тому

      @@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  11 місяців тому

      @@신상오원자력공학과한 you have to click on the part name on the left sidebar before you do the conversion.

  • @user-MehrdadLotfi
    @user-MehrdadLotfi 2 роки тому +1

    Very useful! Thank you!

  • @fereshteh-tn4kk
    @fereshteh-tn4kk Рік тому

    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  Рік тому

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

  • @SyedArafunNabi
    @SyedArafunNabi Рік тому

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

    • @RamiRouhana
      @RamiRouhana  Рік тому +1

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

    • @SyedArafunNabi
      @SyedArafunNabi Рік тому

      ​@@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?

    • @SyedArafunNabi
      @SyedArafunNabi Рік тому

      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  Рік тому

      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.@@SyedArafunNabi

    • @RamiRouhana
      @RamiRouhana  Рік тому

      F is the faces , and V are the vertices. @@SyedArafunNabi

  • @SubhaNath-m5u
    @SubhaNath-m5u Рік тому

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

    • @SubhaNath-m5u
      @SubhaNath-m5u Рік тому

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

    • @RamiRouhana
      @RamiRouhana  Рік тому

      @@SubhaNath-m5u I explain mesh conversion on FreeCAD at the end of the video.

    • @SubhaNath-m5u
      @SubhaNath-m5u Рік тому

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

  • @maxonokram2275
    @maxonokram2275 9 місяців тому

    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  9 місяців тому

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

  • @camilomaturana9011
    @camilomaturana9011 Рік тому

    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 Рік тому

      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  Рік тому

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

    • @camilomaturana9011
      @camilomaturana9011 Рік тому

      @@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');

  • @haithamshawwa8573
    @haithamshawwa8573 2 місяці тому

    ممكن اتواصل مع حضرتك طلبا للمساعدة في مشروعي ؟

    • @RamiRouhana
      @RamiRouhana  2 місяці тому

      @@haithamshawwa8573 what type of project?

  • @SubhaNath-m5u
    @SubhaNath-m5u Рік тому

    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  Рік тому

      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).

  • @SubhaNath-m5u
    @SubhaNath-m5u Рік тому

    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  Рік тому

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

    • @subhanath6405
      @subhanath6405 Рік тому

      Sir unit means I need 20 cm length gyroid

    • @RamiRouhana
      @RamiRouhana  Рік тому

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

  • @GuHong98
    @GuHong98 2 роки тому

    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  2 роки тому +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.