Skip to content

Initializing a triangulated mesh #590

@sambaPython24

Description

@sambaPython24

Hey, I have two numpy arrays with the information about vertices and faces. (The mesh is closed).
How do I create a mesh from that in pygmsh in order to e.g. perform boolean operations with it?

import numpy as np
vertices_list = np.array([
    [-0.5, -0.5, -0.5],
    [0.5, -0.5, -0.5],
    [-0.5, 0.5, -0.5],
    [0.5, 0.5, -0.5],
    [-0.5, -0.5, 0.5],
    [0.5, -0.5, 0.5],
    [-0.5, 0.5, 0.5],
    [0.5, 0.5, 0.5]])

faces_list = np.array([
    [2, 1, 0],
    [1, 2, 3],
    [4, 2, 0],
    [2, 4, 6],
    [1, 4, 0],
    [4, 1, 5],
    [6, 5, 7],
    [5, 6, 4],
    [3, 6, 7],
    [6, 3, 2],
    [5, 3, 7],
    [3, 5, 1]])
``

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions