'Drawing an outline with THREE.EdgesGeometry (Error: THREE.EdgesGeometry is not a constructor)
I am trying to draw an outline to a 2D polyline mesh with three js. Doing some research I've seen that THREE.EdgesGeometry paints the edges of a given geometry. When I tried to use it with my polylineMesh the next error occured:
Uncaught TypeError: THREE.EdgesGeometry is not a constructor.
The next code is the one I'm using:
var zShape = new THREE.Shape(finalShape);
var polylineGeometry = new THREE.ShapeGeometry(zShape);
var polylineMesh = new THREE.Mesh(polylineGeometry, new THREE.MeshPhongMaterial({
color: 0x00ff00,
side: THREE.DoubleSide,
transparent: true,
opacity: 0.25
}));
var geo = new THREE.EdgesGeometry( polylineGeometry ); // or WireframeGeometry
var mat = new THREE.LineBasicMaterial( { color: 0xffffff } );
var wireframe = new THREE.LineSegments( geo, mat );
polylineMesh.add( wireframe );
Here is an image of the polylineMesh that I'm trying to create an outline.
I updated the three.js release to 138 but the error keeps showing. Is there something wrong with my code or can someone help me figuring out how to solve this error?
Thank you so much!!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
