I’m trying to create a room with this kind of cross section:

Initially I wanted to do it with LatheGeometry, but I don’t like the topology it produces.
My current naive approach is to create an IcosahedronGeometry, translate its vertices up a bit, squish every y<0 vertex to y=0 to create a floor, and try to round the edges:
const roomRadius = 200;
let roomGeo = new THREE.IcosahedronGeometry(roomRadius, 6);
roomGeo.translate(0, 40, 0);
{
const attr = roomGeo.attributes.position;
for (let i = 0; i < attr.count; i++) {
const initY = attr.getY(i);
let y = initY;
// Create floor
y = Math.max(0, y);
// Lift up vertices around the edge
const liftedHeight = roomRadius * 0.3;
if (initY > -liftedHeight && initY < liftedHeight) {
y = liftedHeight * (Math.min(1, (initY + liftedHeight) / (liftedHeight * 2)));
}
attr.setY(i, y);
}
roomGeo.computeVertexNormals();
}
But rather than a spherical room as illustrated above, it is producing more of a mushroom head shape:

Which would be good enough, but there is also an issue with normals when I do computeVertexNormals() on the resulting geometry. I can either have a good floor, or good smooth edges, but not both:
Should I just stop being pedantic and go with the Lathe?




