THREE.ShapeUtils.area( contour )
How to get a contour, how define a contour, in what format?
I made a contour like this, and get a NaN.
var contour = [
[0,0],
[0,2],
[2,2],
[2,0],
]
THREE.ShapeUtils.area( contour )
How to get a contour, how define a contour, in what format?
I made a contour like this, and get a NaN.
var contour = [
[0,0],
[0,2],
[2,2],
[2,0],
]
Hi!
Looking at the source code of that function
and seeing x
and y
for contour
items, means contour
must be an array of THREE.Vector2()
.
That’s definitely something that should be stated in the docs. Perhaps a note at the top saying that a 2D polygon is an array of Vector2s and a 3D polygon is an array of Vector3s?
Thanks.
The Docs is too simple for beginners.
The docs are written by the community. Some parts are well written, and some parts need more work. If you come across things like this you can help by improving them. Every docs page has an ‘Edit’ button.
Pull request created, wait to be verified.