Replies: 1 comment 6 replies
-
Hi @ahmad681, thank you for reaching out! The from_image example file converts the image to a 2D numpy array in the beginning, so you should be able to reuse the remainder of the code. In this block, the image is converted to a 2D array of 0s and 1s. https://github.com/kip-hart/MicroStructPy/blob/master/src/microstructpy/examples/from_image.py#L20 Feel free to use the code in this file. If you define bin_nums to be equal to your 2D array, the rest of the code should work. Let me know if I can help further. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
first thanks for this wonderful package, it is fantastic. It seems to be potential to serving my purpose for research.
So I have two-phase micostructure generated. It is basically a 2D numpy array of 1's and 2's. The examples I studied so far using MicroPy seems to be self-generating their own microstructure and then mesh them. I would like to input my randomly generated two-phase microstructure using my numpy 2D array as input, and mesh it using MicrostructurePy. How do you advise in proceeding forward with it? I see an example of importing an image, but again I am trying to import a 2D array.
Thank you a lot in advance. It looks something like the image below, it is nothing more than cartesian array of ones and twos. Many thanks in advance.
Beta Was this translation helpful? Give feedback.
All reactions