BulliM
December 22, 2019, 11:43am
1
I created a shape from HeartCurve by using TubeGeometry. The result isn’t exactly what I want to create. At the conjunctions in sharp corners, geometry is badly folded, as you can see on my example image.
Now, how to resolve this to a clean unfolded mesh? Furthermore at the top I need a sharp edge, too.
Mugen87
December 22, 2019, 12:12pm
2
I’m afraid TubeGeometry
is not intended for this kind of 3D object. Consider to define a heart shape like in the following example:
https://threejs.org/examples/webgl_geometry_shapes
You only need to define a hole and can then use ExtrudeGeometry
in order to create a 3D mesh.
BulliM
December 22, 2019, 12:26pm
3
Is there an example? Threejs has one for ExtrudeGeometry but not for holes, I guess.
Mugen87
December 22, 2019, 12:34pm
4
The example also demonstrates how to define shapes with holes e.g.:
// Smiley
var smileyShape = new THREE.Shape()
.moveTo( 80, 40 )
.absarc( 40, 40, 40, 0, Math.PI * 2, false );
var smileyEye1Path = new THREE.Path()
.moveTo( 35, 20 )
.absellipse( 25, 20, 10, 10, 0, Math.PI * 2, true );
var smileyEye2Path = new THREE.Path()
.moveTo( 65, 20 )
.absarc( 55, 20, 10, 0, Math.PI * 2, true );
var smileyMouthPath = new THREE.Path()
.moveTo( 20, 40 )
.quadraticCurveTo( 40, 60, 60, 40 )
.bezierCurveTo( 70, 45, 70, 50, 60, 60 )
.quadraticCurveTo( 40, 80, 20, 60 )
.quadraticCurveTo( 5, 50, 20, 40 );
This file has been truncated. show original
1 Like