Skip to content

importing 2D geometry from binary image

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics importing 2D geometry from binary image

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5501
    lollipopcorn
    Participant

    Dear developer,

    I am wondering what is the appropriate way of importing a geometry from a binary png image (e.g. 0 for bulk liquid and 1 for wall) ?
    Two potential options maybe (1) firstly convert image into STL, then import geometry from STLreader. (2) write a loop, individually assign each pixel of the image to a material number during each iteration. But I think there is probably better way of doing this?

    Regards,
    John

    #5502
    mathias
    Keymaster

    Dear John,

    yes, that is right. I third way is to put the binary in a vtk vti file format and you the vtiReader of OpenLB. Then, transform it intro an analytical functor and use it to set the materials.

    Best
    Mathias

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.