AGX Dynamics 2.42.2.1
Loading...
Searching...
No Matches
SoilPenetrationResistance.h
Go to the documentation of this file.
1/*
2Copyright 2007-2025. Algoryx Simulation AB.
3
4All AGX source code, intellectual property, documentation, sample code,
5tutorials, scene files and technical white papers, are copyrighted, proprietary
6and confidential material of Algoryx Simulation AB. You may not download, read,
7store, distribute, publish, copy or otherwise disseminate, use or expose this
8material unless having a written signed agreement with Algoryx Simulation AB, or having been
9advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10valid commercial license from Algoryx Simulation AB.
11
12Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13from using this software, unless otherwise stated in written agreements with
14Algoryx Simulation AB.
15*/
16
17#pragma once
18
19#include <agxTerrain/export.h>
21#include <agx/Prismatic.h>
22#include <agxCollide/Box.h>
23#include <agx/Line.h>
24
25namespace agxTerrain
26{
27 class Shovel;
28 class Terrain;
29 class TerrainMaterial;
30
33 {
34 public:
35
37 {
38 NO_MODEL,
39 ELASTIC_PLASTIC_LIMIT,
40 PLASTIC
41 };
42
44
46
53
60
66 void onPre(Terrain* terrain, Shovel* shovel);
67
73 void onPreCollide( Shovel* shovel );
74
75 /*
76 \return last computed shovel separation plate area created from
77 the convex 2D hull of the particle <-> shovel contacts.
78 */
80
81 /*
82 \return last computed tooth force that is used together with the
83 plate force as the upper limit of the penetration resistance.
84 */
86
87 /*
88 \return last computed separation plate force that is used together
89 with the tooth force as the upper limit of the penetration resistance.
90 */
92
94
96
98
99 void setupPenetrationResistance(Terrain* terrain, Shovel* shovel);
100
102
104
105 bool isActive();
106
107 void onEnableChange( bool enable );
108
110
112
114
122 void setActive(bool enable);
123
124 protected:
126
127 private:
128
129 void _updateTeethGeometry( agx::Real toothLength,
130 agx::Real toothWidth,
131 agx::Real toothDiameter );
132
133 void updateTeethGeometryTransform( const agx::Vec3& position,
134 const agx::Quat& rot );
135
136 agx::Real calculateToothPressureElasticPlasticLimit(agx::Real cohesion,
137 agx::Real poissionRatio,
138 agx::Real frictionAngle,
139 agx::Real E,
140 agx::Real p0,
141 agx::Real a,
142 agx::Real a0);
143
144 agx::Real calculateToothPressurePlastic(agx::Real cohesion,
145 agx::Real poissionRatio,
146 agx::Real frictionAngle,
147 agx::Real E,
148 agx::Real p0,
149 agx::Real dilatancyAngle,
150 agx::Real a,
151 agx::Real a0);
152
153 void calculateToothRadiusAndDepth(Terrain* terrain, Shovel* shovel, agx::Real& a, agx::Real& h);
154
155 agx::Real calculateSeparatingPlateArea(Terrain* terrain, Shovel* shovel, agx::Vec3Vector& contactPositions);
156
157 agx::Real calculateSeparatingPlateMassParticles(Terrain* terrain, Shovel* shovel);
158
159 void getPressureAndYoungsModulusAtTeeth( Terrain* terrain,
160 Shovel* shovel,
161 agx::UInt nTeeth,
162 agx::Real& p0,
163 agx::Real& E,
164 agx::Real& compaction,
165 agx::Real& meanDilatancyAngle,
166 agx::Real& meanDepth,
167 agx::Real swell );
168
169 agx::Vec3iVector voxelIndicesAlongEdge(Terrain* terrain, agx::Line edge);
170
171 agx::Real calculateSeparatingPlateForce(Terrain* terrain, Shovel* shovel);
172
173 agx::Real calculateToothForce(Terrain* terrain, Shovel* shovel);
174
175 void calculatePowerSeriesCoefficients(const agx::Real gamma,
176 const agx::Real xi,
177 const agx::UInt n,
178 agx::RealVector& coefficients);
179
180 agx::Real calculatePowerSeries(const agx::Real x,
181 const agx::Real gamma,
182 const agx::UInt n,
183 const agx::RealVector& coefficients);
184
185 agx::Real calculatePressureLimit(const agx::Real m,
186 const agx::Real beta,
187 const agx::Real gamma,
188 const agx::Real delta,
189 const agx::Real eta,
190 const agx::UInt n,
191 const agx::RealVector& coefficients);
192
193 agx::Real calculatePressureRatio(const agx::Real R_limit,
194 const agx::Real a,
195 const agx::Real a0,
196 const agx::Real m,
197 const agx::Real beta,
198 const agx::Real gamma,
199 const agx::Real delta,
200 const agx::Real eta,
201 const agx::UInt n,
202 const agx::RealVector& coefficients);
203
204 private:
205 agx::PrismaticRef m_penetrationPrismatic;
206 PenetrationModel m_model;
207 agxCollide::GeometryRef m_teethGeometry;
208 agxCollide::BoxRef m_teethBox;
209 bool m_enable;
210
211 // Last computed separating plate area
212 agx::Real m_lastPlateArea;
213 // Last computed tooth force
214 agx::Real m_lastToothForce;
215 // Last computed separating plate force
216 agx::Real m_lastPlateForce;
217 };
218}
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:254
#define AGXTERRAIN_EXPORT
The geometry representation used by the collision detection engine.
Definition: Geometry.h:92
Simulation is a class that bridges the collision space agxCollide::Space and the dynamic simulation s...
Definition: Simulation.h:131
Shovel object used to interact with a terrain via an active zone that converts solid terrain to dynam...
Definition: Shovel.h:63
void setPenetrationModel(PenetrationModel model)
void updateTeethGeometry(Shovel *shovel)
void updateTeethPlacement(agxTerrain::Shovel *shovel)
agx::Vec3 getPrismaticDirectionWorld() const
agx::Prismatic * getPenetrationPrismatic()
void addNotification(agxSDK::Simulation *simulation)
agxCollide::Geometry * getTeethGeometry() const
agx::Real getLastSeparatingPlateArea() const
void onPre(Terrain *terrain, Shovel *shovel)
void updatePrismaticFrames(Shovel *shovel)
agx::Real getLastSeparatingPlateForce() const
void removeNotification(agxSDK::Simulation *simulation)
void setupPenetrationResistance(Terrain *terrain, Shovel *shovel)
A terrain model based a 3D grid model with overlapping height field that can be deformed by interacti...
Definition: Terrain.h:92
A prismatic joint keeps a fixed relative orientation between the attached bodies but allows them to s...
Definition: Prismatic.h:67
Base class providing referencing counted objects.
Definition: Referenced.h:120
The agxTerrain namespace contains a 3D model for a dynamic deformable Terrain and related classes.
Definition: Geometry.h:59
uint64_t UInt
Definition: Integer.h:27
double Real
Definition: Real.h:41