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
+22-20Lines changed: 22 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -65,17 +65,18 @@ end
65
65
66
66
# checks if centers of shapeA and shapeB are overlapping
67
67
# belongs to construction of r0
68
-
functioncheckCentersOfShapesOverlapp(r0::SupportPoint, neps::T, shapeA::Composition.Object3D, shapeB::Composition.Object3D) where {T}
69
-
ifnorm(r0.p) <=neps
68
+
functioncheckCentersOfShapesOverlapp(r0::SupportPoint{T}, shapeA::Composition.Object3D, shapeB::Composition.Object3D) where {T}
69
+
ifnorm(r0.p) <=Modia3D.nepsMPR(T)
70
70
error("MPR: Too large penetration (prerequisite of MPR violated). Centers are overlapping. Look at $(Modia3D.fullName(shapeA)) and $(Modia3D.fullName(shapeB)).")
shapeA::Composition.Object3D, shapeB::Composition.Object3D, scale::T) where {T}
125
126
r1org = r1
126
127
r2org = r2
127
128
r3org = r3
128
129
aux =SVector{3, T}(Modia3D.ZeroVector3D)
130
+
neps = Modia3D.nepsMPR(T)
129
131
success =false
130
132
for i in1:niter_max
131
133
aux =cross(r1.p-r0.p,r3.p-r0.p)
@@ -146,7 +148,7 @@ function tetrahedronEncloseOrigin(r0::SupportPoint, r1::SupportPoint,
146
148
if success !=true
147
149
if niter_max <=100
148
150
@warn("MPR (phase 2): Max. number of iterations (= $niter_max) is reached. niter_max increased locally by 10 and phase 2 is rerun. Look at $(Modia3D.fullName(shapeA)) and $(Modia3D.fullName(shapeB)).")
error("MPR (phase 2): Max. number of iterations (= $niter_max) is reached and $niter_max > 100, look at $(Modia3D.fullName(shapeA)) and $(Modia3D.fullName(shapeB)).")
### Phase 3.2: check if r4 is close to the origin ###
@@ -314,7 +317,7 @@ function phase3(r0::SupportPoint, r1::SupportPoint, r2::SupportPoint, r3::Suppor
314
317
end
315
318
if niter_max <=100
316
319
@warn("MPR (phase 3): Numerical issues with distance computation between $(Modia3D.fullName(shapeA)) and $(Modia3D.fullName(shapeB)). Max. number of iterations (= $niter_max) is reached. niter_max increased locally by 10 and phase 3 is rerun.")
@warn("MPR (phase 3): Max. number of iterations (= $niter_max) is reached and $niter_max > 100, look at $(Modia3D.fullName(shapeA)) and $(Modia3D.fullName(shapeB)). tol_rel increased locally for this computation to $new_tol.")
320
323
if isTC2
@@ -357,7 +360,7 @@ end
357
360
functionmprGeneral(ch::Composition.ContactDetectionMPR_handler{T}, shapeA::Composition.Object3D, shapeB::Modia3D.Composition.Object3D) where {T}
0 commit comments