I ended up doing
if (i && i % 3 === 0) {
// push only every nth vertice
tempGeometry.push(pos);
} else if (tempBuf.vertices.length - 1 === i) {
// if its the last one, push it anyway
tempGeometry.push(pos);
}
and for the shape
const profileGeometry = new ShapeBufferGeometry(profileShape, 3); //12 is standard