Skip to content

Commit cd92162

Browse files
committed
collisionSmoothingRadius for FileMesh --> 0.5*shortestEdge
1 parent c2e2d7f commit cd92162

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/Shapes/setCollisionSmoothingRadius.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ setContactSphereRadius(shape::Beam{F}, contactSphereRadius::Nothing, ::Type{F})
6262
setContactSphereRadius(shape::Beam{F}, contactSphereRadius::F, ::Type{F}) where F <: Modia3D.VarFloatType = (true, contactSphereRadius )
6363

6464

65-
setContactSphereRadius(shape::FileMesh, contactSphereRadius::Nothing, ::Type{F}) where F <: Modia3D.VarFloatType = (false, shape.shortestEdge )
65+
setContactSphereRadius(shape::FileMesh, contactSphereRadius::Nothing, ::Type{F}) where F <: Modia3D.VarFloatType = (false, shape.shortestEdge * 0.5 )
6666
setContactSphereRadius(shape::FileMesh, contactSphereRadius::F, ::Type{F}) where F <: Modia3D.VarFloatType = (false, contactSphereRadius )

src/Shapes/solid.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Generate a [Solid](@ref) with physical behavior of a rigid body with mass, visua
4848
| [Cone](@ref) | `(diameter + topDiameter)/4` |
4949
| [Capsule](@ref) | `diameter/2` |
5050
| [Beam](@ref) | `min(length, width, thickness)/2` |
51-
| [FileMesh](@ref) | `shortestEdge` |
51+
| [FileMesh](@ref) | `shortestEdge/2` |
5252
5353
For flat shapes, [Box](@ref) and [Beam](@ref), no `contactSphereRadius` is taken. For Herz' pressure it is needed only if two flat shapes are colliding.
5454

test/Collision/CollidingSphereWithBunnies.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ convexPartitions = @instantiateModel(buildModia3D(ConvexPartitions), unitless=tr
3030

3131
stopTime = 1.3
3232
if Sys.iswindows()
33-
requiredFinalStates = [1.6872544817380444, -1.9587432095329889, 1.553289445400032, 4.5870758721172, -3.6273026821182888, -1.8308615472313539, 16.048916787369645, 0.11940970690989604, 8.103360754506756, 28.819004920911127, 8.50096951972608, 37.13678202093278]
33+
requiredFinalStates = [1.6880905717835102, -1.9581866518182218, 1.5540070046622505, 4.591196433435899, -3.623997139784296, -1.8270065864639107, 16.049310296830665, 0.12415840409300469, 8.104493059905009, 28.87433208939259, 8.576413172605596, 37.0912510073438]
3434
elseif Sys.isapple()
3535
requiredFinalStates = [1.687587439697609, -1.958402549228965, 1.5536690340762165, 4.588930235927663, -3.6255044015487035, -1.8288741879694177, 16.049606070613557, 0.12014325285843275, 8.103183190218997, 28.842653455779967, 8.498278222288814, 37.12003462990435]
3636
else

test/Robot/YouBotPingPong.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,8 @@ modelParameters = Map(
476476
stopTime = 5.0
477477
testTime = 2.6
478478
tolerance = 1e-6
479-
requiredFinalStates = [-0.03158747043096268, -0.10649074184772618, 0.029895517033172142, 0.0015801764831357115, -0.016103870180510103, 3.0647332775854547e-6, 5.931626393118782, -0.12111882537425132, -3.1998834006615127, -0.6434579376126508, -0.09754820912048147, -0.056751608359316544, -0.018177570782297342, -0.04024642751149416, 0.029895831658455524, 7.725182548591907e-14, 7.009575071513706e-14, -1.5832876599015842e-6, 2.660614917159462, 0.9432946129122108, 5.493556660598091, 1.059276838819331e-12, -1.5024971829819885e-12, -2.0515616279450872e-12, 0.030984374457220996, 0.08325328402030487, 0.029894964905552535, -1.0155184391451235e-15, 3.0723209984482187e-16, -9.459296674070217e-7, 3.069567335180294, -0.5911836947757584, 1.3138620051588528, 2.3812055360652834e-14, 1.1960425669561842e-14, 5.9686650805787834e-15, -1.1074562488447844e-6, -1.570828718718346e-6, 0.004318767690961195, -0.054981259608387505, 0.01834152242400252, -0.23292171802704026, -2.5341492401393595e-5, 9.563867635374948e-6, 9.861985469938779e-8, -3.7574791174841696e-8, -0.008203276554541334, 0.08427818457130207, -0.19863801640195203, -0.0858138644731111, 0.0003301870168371117, -1.1073726615546118e-6, -1.5709123053952306e-6, 0.004318767670170559, -0.054981259587595546, 0.01834152240597686, -0.23292171800901154, -2.534150403358706e-5, 9.563879270118567e-6, 9.862060174961774e-8, -3.757553823626217e-8, -0.00820263760817991, 0.08427802565969766, -0.1986381047108251, -0.08581390493294977, 0.0003301896157919179, -1.1076292439524772e-6, -1.5706557245991997e-6, 0.004318767741888795, -0.054981259659317175, 0.018341522413747244, -0.23292171801678854, -2.5341477333742316e-5, 9.563852565159495e-6, 9.862602231487768e-8, -3.7580958770311354e-8, -0.008204598936583091, 0.0842785738482444, -0.19863806667104147, -0.08581381206211312, 0.00033020847402692944]
479+
requiredFinalStates = [-0.031058480611579637, -0.11131601419357129, 0.029896056231649582, 0.0018108544954039748, -0.018398717067104806, 3.18458481411634e-6, 6.1276285038678635, -0.10283199185702306, -3.19638839886394, -0.735149888693328, -0.11267543845082122, -0.0649990597001986, -0.0213425010849096, -0.04301927935698638, 0.02989440328270474, -3.4070640727872146e-10,
480+
-3.068900414962272e-10, -2.0223211796932104e-6, 2.6871824069631205, 1.053554620854836, 5.600838036728896, -5.113258042895109e-9, 7.294739213679486e-9, 9.889049486470221e-9, 0.03278388550757873, 0.08625297583076974, 0.029894101450869983, 7.082224110863361e-19, 2.4454446892041373e-19, -1.1462637989445882e-6, 2.9401488473966704, -0.6689700579914613, 1.2913367628067651, -2.0787563245913748e-17, 2.190253696750652e-18, 1.1532671847956196e-18, -1.1074362611898026e-6, -1.5707198549590212e-6, 0.0043187678851806756, -0.05498125972716101, 0.01834152280425301, -0.23292171811817347, -2.5341260474901556e-5, 9.56381649601528e-6, 9.861894783625605e-8, -3.757452664153385e-8, -0.008203103943920882, 0.08427968033785894, -0.19863612511095569, -0.08581304513679631, 0.000330183816938746, -1.1073561236455634e-6, -1.5707999918658427e-6, 0.004318767865452493, -0.05498125970743127, 0.018341522786344114, -0.23292171810026155, -2.5341271877166888e-5, 9.563827900569396e-6, 9.861970889354406e-8, -3.757528770950012e-8, -0.008202491367579737, 0.08427952954729884, -0.19863621284818073, -0.0858130847969572, 0.00033018646462512353, -1.10761216034589e-6, -1.5705439568070628e-6, 0.004318767937143109, -0.05498125977912553, 0.018341522794175506, -0.23292171810809956, -2.53412450552167e-5, 9.563801073632897e-6, 9.862522682182094e-8, -3.758080560633876e-8, -0.008204448524670616, 0.08428007752471801, -0.19863617450949345, -0.08581299150133814, 0.00033020566158642516]
480481
simulate!(youbot, stopTime=testTime, tolerance=tolerance, requiredFinalStates_atol=0.001, log=true, logStates=false, requiredFinalStates=requiredFinalStates)
481482

482483
end

0 commit comments

Comments
 (0)