I am experimenting with ways to increase the detail of three.js geometries by subdividing their faces into smaller faces. This process would essentially enhance the "resolution" of the geometry. While there is a helpful subdivision modifier available in the examples of three.js, it tends to distort the original shape of the geometry. My goal is to maintain the integrity of the original shape.
Check out the Subdivision Modifier Example
Comparison of current subdivision modifier behavior:
https://i.sstatic.net/YACT9.png
Desired behavior visualization:
https://i.sstatic.net/fTdo7.png
This is how the subdivision modifier is currently applied:
let originalGeometry = new THREE.BoxGeometry(1, 1, 1);
let subdivisionModifier = new THREE.SubdivisionModifier(3);
let subdividedGeometry = originalGeometry.clone();
subdivisionModifier.modify(subdividedGeometry);
I tried exploring the source code of the subdivision modifier, but I struggled to figure out how to adjust it for the desired outcome.
Note: The subdivision should be applicable to any type of geometry. Although my example suggests that modifying a three.js PlaneGeometry with increased segments could work, I need this technique to be compatible with various geometries.