-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error generating mesh #289
Comments
Looks like a marching cube problem for sure. Let me take a look. |
I'll check this issue. Thanks. :) |
I tested the simulator again and noticed one thing: fluid-engine-dev/src/jet/marching_cubes.cpp Line 395 in 45b4bdb
I hope this information will help you understand the cause of the error. |
Thanks @PavelBlend ! So I guess what’s happening here is that boundary mesher is adding more triangles and the topology of it does not agree with the surface mesher. Maybe it’s direction-dependent; one side of the domain works fine but the opposite side might show this problem. @utilForever: one way to fix this is to make a simple repro case with two volumes close together and see how the lookup table is being referred for the particular case. |
@doyubkim I created a small example: from pyjet import *
import numpy as np
ANIM_NUM_FRAMES = 360
ANIM_FPS = 60
Logging.mute()
# Create APIC solver
resX = 50
solver = ApicSolver3(resolution=(resX, resX, resX), domainSizeX=1.0)
solver.useCompressedLinearSystem = True
# Setup emitter
sphere = Sphere3(center=(0.5, 0.5, 0.5), radius=0.15)
emitter = VolumeParticleEmitter3(implicitSurface=sphere, spacing=1.0 / (2 * resX), isOneShot=True)
solver.particleEmitter = emitter
# Convert to surface
grid_size = 1.0 / resX
grid = VertexCenteredScalarGrid3((resX, resX, resX), (grid_size, grid_size, grid_size))
# Make first frame
frame = Frame(0, 1.0 / ANIM_FPS)
for i in range(ANIM_NUM_FRAMES):
print('Frame {:d}'.format(i))
solver.update(frame)
pos = np.array(solver.particleSystemData.positions, copy=False)
converter = SphPointsToImplicit3(1.5 * grid_size, 0.5)
converter.convert(pos.tolist(), grid)
surface_mesh = marchingCubes(
grid,
(grid_size, grid_size, grid_size),
(0, 0, 0),
0.0,
DIRECTION_ALL,
DIRECTION_NONE
)
surface_mesh.writeObj('frame_{:06d}.obj'.format(i))
frame.advance() Here is the obj file: I think this is due to the fact that two drops are in the same voxel: The mesh generator builds a polygon between the drops. |
@PavelBlend Thanks! |
Yup, I think this is definitely a marching square issue where its lookup table is not consistent with the marching cube. |
It seems to me that the polygon mesh generator does not work correctly at some points.
The mesh is not Manifold.
test_apic_method.zip
The text was updated successfully, but these errors were encountered: