Binding 2 wood logs like scouts

Hi @Pop_John,

As @prisoner849 suggested, you could use this set of utilities for lines to solve this

Example

const line1 = new Line3D(new Vec3(0, 5, 20), new Vec3(10, 5, 20));
const line2 = new Line3D(new Vec3(5, 0, 0), new Vec3(5, 10, 0));
const intersection = line1.intersect(line2);
// The resulting "intersection" is a line with the start at Vec3(5, 5, 20) and the end at Vec3(5, 5, 0)

You can either install the library via npm

npm i @immugio/three-math-extensions

Or just grab the method from the source code

2 Likes