Hello Jagandeep,
Basic Concept
Two parts A, B are in collision if they have a common volume ie C = A∩B ≠ 0
You may follow the following conceptual pseudo code:
0. Define an angle increment ∆φ=0.5 deg , accuracy level Cmin=1E-9 and φ=0 deg
1. Rotate part A by φ = φ + ∆φ
2. Calculate C=A∩B (with the aid of CATIA)
3. If (C = 0 And φ < 360deg) Then φ = φ + ∆φ, Goto 1
Else
If C > Cmin Then ∆φ = ∆φ/2, φ = φ - ∆φ ,Goto 1
Else Return
In my humble opinion, this is also how CATIA faces the collision problem. Due to this, in some singular cases the parts instead of colliding are jumping one over the other.
I hope it helps.
-GEL
Imposible is nothing.