Ejemplo n.º 1
0
def grid():
    mesh = Mesh.from_meshgrid(dx=10, nx=10)
    return mesh
Ejemplo n.º 2
0
from random import choice
from compas.geometry import Point, Vector
from compas.datastructures import Mesh, mesh_thicken
from compas.utilities import geometric_key_xy
from compas_gmsh.models import MeshModel
from compas_view2.app import App
from compas_view2.shapes import Arrow

# ==============================================================================
# Make a plate mesh
# ==============================================================================

mesh = Mesh.from_meshgrid(dx=10, nx=5)
plate = mesh_thicken(mesh, 0.3)

# ==============================================================================
# Select random internal vertex for load application
# ==============================================================================

poa = choice(list(set(mesh.vertices()) - set(mesh.vertices_on_boundary())))

# ==============================================================================
# GMSH model
# ==============================================================================

model = MeshModel.from_mesh(plate, targetlength=2.0)

model.mesh_targetlength_at_vertex(poa, 0.01)

for vertex in mesh.vertices_on_boundary():
    a = geometric_key_xy(mesh.vertex_coordinates(vertex))