Hi,

i have read all discussion going on, and i am also facing such kind of problem.

below is my current code:

var minDist = 0.6;

var raycaster = new THREE.Raycaster();

var intersects = [];

var pos = threejsobject.position; //positions of geometry

var ori = new THREE.Vector3();

var dir = new THREE.Vector3();

var trc = new THREE.Vector3();

var a = new THREE.Vector3(),

b = new THREE.Vector3(),

c = new THREE.Vector3(),

midPoint = new THREE.Vector3(),

tri = new THREE.Triangle();

var closest = new THREE.Vector3();

var faces = threejsobject.positioncount; // faces of geometry

console.log(“Faces:”+faces);

for (let i = 0; i < faces; i++) {

a.fromBufferAttribute(pos, i * 3 + 0);

b.fromBufferAttribute(pos, i * 3 + 1);

c.fromBufferAttribute(pos, i * 3 + 2);

tri.set(a, b, c);

console.log(tri);

// tri.getMidpoint(ori);

// get some random point on face

let r0 = 0.33 * Math.random();

let r1 = 0.33 * Math.random();

let r2 = 1.0 - r0 - r1;

```
let ori = new THREE.Vector3(
r0*a.x + r1*b.x + r2*c.x,
r0*a.y + r1*b.y + r2*c.y,
r0*a.z + r1*b.z + r2*c.z
);
tri.getNormal(dir);
raycaster.set(ori, dir.negate());
intersects = raycaster.intersectObject(mesh);
//minDist = Math.min(minDist, intersects[intersects.length > 1 ? 1 : 0].distance);
minDist = intersects[intersects.length > 1 ? 1 : 0].distance;
}
console.log("printable:", minDist >= 0.6);
```

i got correct number of faces of geometry, but sometimes in For Loop “tri.set(a, b, c);” function set/show only one triangle(and not give any result) how ever in some cases it set/show all triangle which finally gives expected result.

Also i gone through the link

https://stackoverflow.com/questions/55126766/improving-raycasting-precision-in-three-js/55159041#55159041

Can anyone suggest where i am going wrong?

Thanks