Yes, the own calculation of the BufferGeometry has advantages.
I did the same for frames. See Construction of frames with contour/profile
But if you change the orientation and the basic settings for scaling there, you can easily create walls. So it is a bit problematic, but it works.
Here I use indexed BufferGeometry.
The main calculation is from line 523 to 638.
The core is mathematically not that complicated.
phi = Math.acos( e2x * e0x + e2y * e0y ) / 2;
bend = Math.sign( dx0 * dy2 - dy0 * dx2 ); // z cross -> curve bending
xRdiv = Math.sin( phi );
}
for ( let j = 0; j < rs1; j ++ ) {
j3 = 3 * j;
//.....................[ ] - 1 x is 1 right in R ...
xR = ( gLineR.positions[ j3 ] - 1 ) * sizeFactorR;
x = xc1 + xR / xRdiv * bend * ex ;
y = yc1 + xR / xRdiv * bend * ey;
z = gLineR.positions[ j3 + 1 ] * sizeFactorR * ( -1 ); // -y LineR -> +z FrameA
vIdx = rs1 * i + j;
posIdx = vIdx * 3;
gFrameA.positions[ posIdx ] = x;
gFrameA.positions[ posIdx + 1 ] = y;
gFrameA.positions[ posIdx + 2 ] = z;
}
Currently I’m working on a variant with non indexed BufferGeometry and uv’s to provide textures.