I am interested in creating a twisting effect during extrusion on a shape, rotating it about the Z-axis like seen in the examples below
https://i.sstatic.net/wLF2s.png
and here
https://i.sstatic.net/Aq7Db.png
My attempt at achieving a twisted cube is outlined below:
var squareShape = new THREE.Shape();
squareShape.moveTo(10,0);
squareShape.lineTo(0,10);
squareShape.lineTo(-10,0);
squareShape.lineTo(0,-10);
squareShape.lineTo(10,0);
var extrudeSettings={amount:10, bevelEnabled:false};
var geometry = new THREE.ExtrudeGeometry( gearShape, extrudeSettings );
Unfortunately, this code only extrudes the shape in a straight line along the z-axis. It seems challenging to shear the cube into a twist about the z-axis using geometry.applyMatrix( );
It is possible that manually adjusting the normals, bi-normals, and tangents of the 2D shape while extruding could achieve the desired twist. I suspect that the solution may involve extrudePath — THREE.CurvePath and frames-THREE.TubeGeometry.FrenetFrames, but I am uncertain if there is a simpler approach.
Any assistance on this issue would be highly appreciated!