Open florianwechsung opened 6 years ago
Thanks for the report. I've tried to reproduce this, but the script just ran forever, filling the memory until it eventually choked. Somethings not right with Union
. I'll check it out sometime later.
I've improved some things in domain specifications and released a new version, but the above mesh will still fail. I found that all cuboid unions fail where the two cuboids share part of at least one side exactly. For example, this
c1 = pygalmesh.Cuboid([0., 0., 0.], [1.0, 1.0, 1.0])
c2 = pygalmesh.Cuboid([-0.5, -0.5, -0.5], [0.9, 0.9, 1.0])
will hang/segfault as well. I'm not sure why this happens yet, perhaps is has to do with the feature edges. As a work-around, add a miniscule offset; this works:
c1 = pygalmesh.Cuboid([0., 0., 0.], [1.0, 1.0, 1.0])
c2 = pygalmesh.Cuboid([-0.5, -0.5, -0.5], [0.9, 0.9, 1.0 - 1.0e-15])
Thanks, that runs! Unfortunately when adding such a small offset, this seems to confuse the mesh generator, as I see this when I zoom into (0.0, 0.9, 1.0):
If I zoom out further, I see a few more issues:
Yup, feature edges aren't preserved by default. Right now, all primitive domains are implemented in terms of level-sets, even polygonal domains like cuboids. As a consequence, feature edges are not preserved automatically. There are native polyhedral domains in CGAL, perhaps that can help out. Not sure...
I'm trying to join two cuboids to create a backwards facing step. Unfortunately I get a segfault when I run the code below. This is on macOS 10.13.4 with Python 3.6.5, cgal 4.12 from brew and pygalmesh v0.2.4.
I had to apply this patch to get it to install, but that shouldn't be relevant.