Check if a set of objects intersect another set of objects

I have an object(LineA) that is composed of 4 children and sub-children. They are Meshes(MeshLineMaterial) and ArrowHelpers. Then I have another set of objects(Other Lines) of the same kind. Sample object:

castShadow: false

children: Array(2)
0: ja {uuid: "B883597B-392D-41EB-A306-33A2F065A5B1", name: "PathA", type: "Mesh", parent: Hc, children: Array(0), …}
1: tb {uuid: "8B507A56-437C-47C5-9A0A-43DE9D8DE0D4", name: "", type: "Object3D", parent: Hc, children: Array(2), …}

length: 2

__proto__: Array(0)


frustumCulled: true

layers: Pf {mask: 1}

matrix: U {elements: Array(16)}

matrixAutoUpdate: true

matrixWorld: U {elements: Array(16)}

matrixWorldNeedsUpdate: false

nObjType: "Path"

name: "Path"

parent: wd {uuid: "20293B1F-868F-4A06-9A24-AF14738955A8", name: "", type: "Scene", parent: null, children: Array(121), …}

position: n {x: 0, y: 0, z: 0}
quaternion: ua {_x: 0, _y: 0, _z: 0, _w: 1, 
_onChangeCallback: ƒ}

receiveShadow: false

renderOrder: 0
rotation: Qb {_x: 0, _y: 0, _z: 0, 
_order: "XYZ", 
_onChangeCallback: ƒ}

scale: n {x: 1, y: 1, z: 1}

selectable: true

type: "Group"

up: n {x: 0, y: 1, z: 0}

userData: {}

uuid: "CC27818D-5EEE-4A89-A39C-7F56C8C8F9BB"

visible: true

eulerOrder: (...)

id: 561

modelViewMatrix: U {elements: Array(16)}
normalMatrix: Y {elements: Array(9)}

useQuaternion: (...)

__proto__: B



I am trying to create a system where when I create LineA, it shouldn't collide/cross with Other Lines.

I have tried the bounding box and raycaster:

function collision()
{
  var originPoint = LineA.position.clone();
var bb=new THREE.BoxHelper(LineA, 0x00ff00);
bb.geometry.computeBoundingBox(); 
var collidableMeshList = OtherLines;
    
    for (var vertexIndex = 0; vertexIndex < bb.geometry.attributes.position.array.length; vertexIndex++)
    {   
            
        var ray = new THREE.Raycaster( bb.position, bb.geometry.attributes.position.array[vertexIndex] );
        var collisionResults = ray.intersectObjects( collidableMeshList );
        if ( collisionResults.length > 0)  
        {
      console.log("true");
      hit = true;
     }
  } 
} 

I tried referring to this example

function detectCollisionCubes(bb, Line2bb){
  bb.geometry.computeBoundingBox(); //not needed if its already calculated
  Line2bb.geometry.computeBoundingBox();
  bb.updateMatrixWorld();
  Line2bb.updateMatrixWorld();
  
  var box1 = bb.geometry.boundingBox.clone();
  box1.applyMatrix4(bb.matrixWorld);

  var box2 = Line2bb.geometry.boundingBox.clone();
  box2.applyMatrix4(Line2bb.matrixWorld);

  return box1.intersectsBox(box2);
}

None of them seems to be working in my case. They show no error. Any help would be greatly appreciated.