In this topic there is code for drawing a tube from a set of 2d points, but I need to draw from a set of 3d points, where the tube can’t be represented as a line in a 2d plane.
function CapsuleGeom(R, L){
let path = new THREE.Path();
path.absarc(0, 0, R, Math.PI * 1.5, 0);
path.absarc(0, L, R, 0, Math.PI * 0.5);
let pts = path.getPoints(5);
let g = new THREE.LatheBufferGeometry(pts);
return g;
}
@prisoner849 I don’t understand, doesn’t Path can only be 2D? I mean, it can be shifted and rotated, but it will always be a line in a 2D plane. Isn’t it?
An [probably bad] idea I had with your other comment is betwen each two coordinates have a tube geometry, but that would be very slow.
Another idea is use LineGeometry? Can it looks more 3Dish?
What I want to say is that even if it be rotated, translated and scalled it still is a line in a 2d plane.
There is a plane which pass through any 3 points, but this is not true for every 4 points, what leads to even if we rotate and translate a set of 2d points, its plane won’t contain every possibility of a set of 4+ coordinates. But of course this is a start, as I guess the tubes are going to be <4 points a good part of the time.