hexagon logo

STL creation in python api

Hello ,

 Can we create a .stl file in Simufact python API using .stl creation code just like we do in MATLAB? 

I have tried but the system was showing this errors: 

ModuleNotFoundError: No module named 'stl'

Thanks,

VIgnesh

Parents
  • Hello Vignesh,

    Yes, you can use Simufact python API to create .stl files, for that you have to install the required package before with "pip" Python package installer. 

    Please find instruction of the "pip" usage in the documentation linked in the python terminal by searching for "pip":

    Best regards,

    Qi

  • I was able to create the 3rd party package using PIP one problem is solved!! It would be helpful if I could get the answers for my other questions. 

  • Hi Vignesh,

    I'm happy to hear that you were able to install the package using pip. In this case you should be able to generate random .stl files as you did in MATLAB, and you can then directly import the generated .stl file into Simufact project via python. I assumed your first question is answered or solved.

    To your second question: Yes, it is possible to extract results by accessing object Project -> Process -> Results -> ResultIncrement -> Mesh -> IntegrationPointResults or NodeResults. Please search for the class name in the same documentation for instruction. The results can e.g. be exported into a file for further data processing.

    To the third question: Yes, you can setup the model, export the results, run your own algorithm to generate new .stl and assign them again in a loop so that e.g. 10 simulations can be started one after another and run at a time. But please note how many simulations can be performed at a time is limited by your available licenses and hardware (processors).

Reply
  • Hi Vignesh,

    I'm happy to hear that you were able to install the package using pip. In this case you should be able to generate random .stl files as you did in MATLAB, and you can then directly import the generated .stl file into Simufact project via python. I assumed your first question is answered or solved.

    To your second question: Yes, it is possible to extract results by accessing object Project -> Process -> Results -> ResultIncrement -> Mesh -> IntegrationPointResults or NodeResults. Please search for the class name in the same documentation for instruction. The results can e.g. be exported into a file for further data processing.

    To the third question: Yes, you can setup the model, export the results, run your own algorithm to generate new .stl and assign them again in a loop so that e.g. 10 simulations can be started one after another and run at a time. But please note how many simulations can be performed at a time is limited by your available licenses and hardware (processors).

Children
No Data