Skip to content
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

Negative offset in thickenMesh results in incorrect filling of mesh #2162

Open
JeffreyWardman opened this issue Feb 5, 2024 · 3 comments
Open

Comments

@JeffreyWardman
Copy link

image

    params = mrmeshpy.GeneralOffsetParameters()
    params.signDetectionMode = mrmeshpy.SignDetectionMode.WindingRule
    params.mode = mrmeshpy.GeneralOffsetParametersMode.Smooth

    faces = np.array(mesh.cells.copy(), np.int32)
    faces = np.ndarray(shape=faces.shape, dtype=np.int32, buffer=faces)

    verts = mesh.vertices.copy()
    verts = np.ndarray(shape=verts.shape, dtype=np.float32, buffer=verts)

    mesh = mrmeshnumpy.meshFromFacesVerts(faces, verts)
    mesh = mrmeshpy.thickenMesh(mesh, offset=-3, params=params)

    vertices = mrmeshnumpy.getNumpyVerts(mesh)
    cells = mrmeshnumpy.getNumpyFaces(mesh.topology)
@Grantim
Copy link
Contributor

Grantim commented Feb 5, 2024

Hello!
Looks like you have open input mesh, thats why params.signDetectionMode = mrmeshpy.SignDetectionMode.WindingRule does not work good. We recomment to use 'params.signDetectionMode = mrmeshpy.SignDetectionMode.Unsigned' for open meshes thickening, please try this

    params = mrmeshpy.GeneralOffsetParameters()
    params.signDetectionMode = mrmeshpy.SignDetectionMode.Unsigned
    params.mode = mrmeshpy.GeneralOffsetParametersMode.Smooth

    faces = np.array(mesh.cells.copy(), np.int32)
    faces = np.ndarray(shape=faces.shape, dtype=np.int32, buffer=faces)

    verts = mesh.vertices.copy()
    verts = np.ndarray(shape=verts.shape, dtype=np.float32, buffer=verts)

    mesh = mrmeshnumpy.meshFromFacesVerts(faces, verts)
    mesh = mrmeshpy.thickenMesh(mesh, offset=-3, params=params)

    vertices = mrmeshnumpy.getNumpyVerts(mesh)
    cells = mrmeshnumpy.getNumpyFaces(mesh.topology)

@JeffreyWardman
Copy link
Author

Unfortunately that does not enclose between the original mesh and the internal component.

Screenshot 2024-02-05 at 10 41 36 pm

@Grantim
Copy link
Contributor

Grantim commented Feb 5, 2024

Currently our thicken algorithm only creates inner/outer component but does not connect components. This discussion may be useful for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants