3MAH / microgen

Microstructure generation
https://3mah.github.io
GNU General Public License v3.0
65 stars 8 forks source link

Low density skeletal TPMS fails to generate with cadquery #56

Closed ylgrst closed 4 months ago

ylgrst commented 4 months ago

Describe the bug, what's wrong, and what you expected.

When generating low density skeletal TPMS using cadquery, an error occurs leading to no shape being generated at all. However the error does not occur at higher densities.

Steps to reproduce the bug.

from microgen import Tpms
from microgen.shape.surface_functions import gyroid

density = 0.15
cell_size = 4.0
center = (0.0, 0.0, 0.0)

shape = Tpms(surface_function=gyroid, density=density, cell_size=cell_size, resolution=20).generate(type_part="upper skeletal")

System Information

--------------------------------------------------------------------------------
  Date: Tue Apr 30 15:40:45 2024 CEST

                OS : Linux
            CPU(s) : 20
           Machine : x86_64
      Architecture : 64bit
               RAM : 7.6 GiB
       Environment : IPython
       File system : ext4

  Python 3.10.13 | packaged by conda-forge | (main, Dec 23 2023, 15:36:39)
  [GCC 12.3.0]

           pyvista : 0.41.1
               vtk : 9.3.0
             numpy : 1.26.4
            scooby : 0.9.2
              gmsh : 4.12.2
          cadquery : 2.4.0
        matplotlib : 3.8.3
        pytest-cov : 4.1.0
            meshio : 5.3.5
--------------------------------------------------------------------------------

Screenshots

image image