Skip to content

[BUG] gen.remove_sphere crashes #40

Description

@sambaPython24

Description

Hey, thank you for the effort that you put into this library.

I am trying to generalize some of your example, but the
gen.remove_sphere functions crashes/takes infinite time
while gen.remove_cube works.

Minimal reproducing example

from tensormesh.visualization import setup_headless
from tensormesh import MeshGen

n_grid   : int = 10
max_iter : int = 20

gen = MeshGen(dimension = 3,chara_length=1.0/n_grid)
gen.add_cube(0.0,0.0,0.0,1.0,2.0,1.0)


gen.remove_sphere(0.1, 0.2, 0.3, 0.05)
#gen.remove_cube(0.1, 0.2, 0.3, 0.05, 0.05, 0.05) # This works

mesh     = gen.gen().double()

points   = mesh.points

Full traceback / error output

I had to stop it after 4 minutes.

Expected behavior

The corresponding function remove.cube works within fractions of a seconds.

Environment

torch:       2.5.1+cu118
torch_sla:   0.2.1
tensormesh:  0.1.1
python:      3.11.11
cuda:        11.8

Pre-flight checks

  • I searched existing issues and did not find a duplicate.
  • I confirmed this is a bug, not a usage question.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions