Tissue Forge C++ 0.2.1
Interactive, particle-based physics, chemistry and biology modeling and simulation environment
Loading...
Searching...
No Matches
tfConvexPolygonConstraint.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of Tissue Forge.
3 * Copyright (c) 2022-2024 T.J. Sego and Tien Comlekoglu
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as published
7 * by the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 *
18 ******************************************************************************/
19
24
25#ifndef _MODELS_VERTEX_SOLVER_ACTORS_TFCONVEXPOLYGONCONSTRAINT_H_
26#define _MODELS_VERTEX_SOLVER_ACTORS_TFCONVEXPOLYGONCONSTRAINT_H_
27
29
30
31namespace TissueForge::models::vertex {
32
33
42 struct ConvexPolygonConstraint : MeshObjActor {
43
45 FloatP_t lam;
46
47 ConvexPolygonConstraint(const FloatP_t &_lam=0.1) {
48 lam = _lam;
49 }
50
52 virtual std::string name() const override { return "ConvexPolygonConstraint"; }
53
55 static std::string actorName() { return "ConvexPolygonConstraint"; }
56
64 FloatP_t energy(const Surface *source, const Vertex *target) override;
65
73 FVector3 force(const Surface *source, const Vertex *target) override;
74
80 static ConvexPolygonConstraint *fromString(const std::string &str);
81 };
82
83}
84
85#endif // _MODELS_VERTEX_SOLVER_ACTORS_TFCONVEXPOLYGONCONSTRAINT_H_
The mesh surface is an area-enclosed object of implicit mesh edges defined by mesh vertices.
Definition tfSurface.h:65
The mesh vertex is a volume of a mesh centered at a point in a space.
Definition tfVertex.h:71
FloatP_t lam
Definition tfConvexPolygonConstraint.h:45
static ConvexPolygonConstraint * fromString(const std::string &str)
Create from a JSON string representation.
static std::string actorName()
Definition tfConvexPolygonConstraint.h:55
FVector3 force(const Surface *source, const Vertex *target) override
Calculate the force that a source object exerts on a target object.
virtual std::string name() const override
Definition tfConvexPolygonConstraint.h:52
FloatP_t energy(const Surface *source, const Vertex *target) override
Calculate the energy of a source object acting on a target object.
Base definition of how a mesh object acts on another mesh object.
Definition tfMeshObj.h:97