MeshSolver

class compas_shapeop.meshsolver.MeshSolver(mesh)

Bases: Solver

Create a solver from a COMPAS mesh.

This is a convenience method that allows you to initialize a solver directly from a COMPAS mesh.

Attributes:
meshcompas.datastructures.Mesh

A COMPAS mesh.

pointsnumpy.ndarray

Direct reference to the solver’s points matrix in shape (n, 3).

Methods

add_gravity

Add gravity to the mesh.

constrain_edge_lengths

Add edge length constraints to all edges of a COMPAS mesh.

constrain_face_diagonals

Add diagonal constraints to quads to prevent shearing.

constrain_face_planarity

Add plane constraints to all faces of a COMPAS mesh.

constrain_face_regularization

Add equalize face constraints to all faces of a COMPAS mesh.

constrain_triface_bending

Add bending constraints to all pairs of adjacent triangular faces in a COMPAS mesh.

fix_vertex

Add closeness constraints to all vertices of a COMPAS mesh to the boundary edges.

fix_vertices

Add closeness constraints to vertices of a COMPAS mesh.

from_grid

Create a MeshSolver from a rectangular grid mesh.

from_obj

Create a MeshSolver from an OBJ file.

inflate

Add inflation force to the mesh.

solve

Solve the constraint problem.

Inherited Methods

add_bending_constraint

Add a bending constraint between two neighboring triangles.

add_circle_constraint

Add circle constraint to make vertices lie on a circle.

add_closeness_constraint

Add a closeness constraint to the solver.

add_closeness_constraint_with_position

Add a closeness constraint at a specific xyz coordinate.

add_closeness_constraints

Add closeness constraints to multiple vertices.

add_edge_strain_constraint

Add an edge strain constraint between two specific vertices.

add_gravity_force

Add a gravity force to all vertices in the system.

add_mesh_vertex_force

Add vertex forces to all vertices of a COMPAS mesh.

add_normal_force_with_faces

Add a normal force (inflation) using custom face topology.

add_plane_constraint

Add a plane constraint to the solver.

add_regular_polygon_constraint

Add constraint to make vertices form a regular polygon.

add_shape_constraint

Add a unified shape constraint with different shape types.

add_shrinking_edge_constraint

Add a shrinking edge constraint to the solver.

add_similarity_constraint

Add similarity constraint to transform vertices to match a target shape.

add_vertex_force

Add a vertex force to a specific point.

init

Initialize the solver with simulation parameters.