You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/contactDetection/ContactDetectionMPR/mpr.jl
+17-28Lines changed: 17 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -15,7 +15,7 @@ struct SupportPoint{T}
15
15
end
16
16
17
17
18
-
functiongetSupportPoint(shapeA::Modia3D.Composition.Object3D, shapeB::Composition.Object3D, n::SVector{3,T}; scale::T=T(1.0)) where {T}
18
+
functiongetSupportPoint(shapeA::Modia3D.Composition.Object3D{F}, shapeB::Composition.Object3D{F}, n::SVector{3,T}; scale::T=T(1.0)) where {T,F}
19
19
a = Modia3D.supportPoint(shapeA, n)
20
20
b = Modia3D.supportPoint(shapeB, -n)
21
21
returnSupportPoint{T}((a-b).*scale,n,a,b)
@@ -66,22 +66,21 @@ end
66
66
67
67
# checks if centers of shapeA and shapeB are overlapping
68
68
# belongs to construction of r0
69
-
functioncheckCentersOfShapesOverlapp(r0::SupportPoint{T}, shapeA::Composition.Object3D, shapeB::Composition.Object3D) where {T}
69
+
functioncheckCentersOfShapesOverlapp(r0::SupportPoint{T}, shapeA::Composition.Object3D{F}, shapeB::Composition.Object3D{F}) where {T,F}
70
70
ifnorm(r0.p) <= Modia3D.nepsType(T)
71
71
error("MPR: Too large penetration (prerequisite of MPR violated). Centers are overlapping. Look at $(Modia3D.fullName(shapeA)) and $(Modia3D.fullName(shapeB)).")
# Phase 3.3: construct baby tetrahedrons with r1,r2,r3,r4 and create a new portal
358
-
functionmprGeneral(ch::Composition.ContactDetectionMPR_handler{T,F}, shapeA::Composition.Object3D, shapeB::Modia3D.Composition.Object3D) where {T,F}
351
+
functionmprGeneral(ch::Composition.ContactDetectionMPR_handler{T,F}, shapeA::Composition.Object3D{F}, shapeB::Modia3D.Composition.Object3D{F}) where {T,F}
359
352
tol_rel = ch.tol_rel
360
353
niter_max = ch.niter_max
361
354
neps = Modia3D.nepsType(T)
@@ -371,12 +364,10 @@ function mprGeneral(ch::Composition.ContactDetectionMPR_handler{T,F}, shapeA::Co
error("MPR: One of the absolute position or translation is NaN.")
367
+
ifisnan(centroidA[1]) ||isnan(centroidB[1]) ||
368
+
isnan(centroidA[2]) ||isnan(centroidB[2]) ||
369
+
isnan(centroidA[3]) ||isnan(centroidB[3])
370
+
error("MPR: One of the absolute position or translation is NaN. Look at $(Modia3D.fullName(shapeA)): r_abs = $(shapeA.r_abs), R_abs = $(shapeA.R_abs) and $(Modia3D.fullName(shapeB)): r_abs = $(shapeB.r_abs), R_abs = $(shapeB.R_abs).")
0 commit comments