I need to draw a 2d shape from lots of points, my current approach (r124) is the following:
const normalVector = new Vector3(
isXCoplanar,
isYCoplanar,
isZCoplanar
);
const normalZVector = new Vector3(0, 0, 1);
const points = Coords.map((coordinate) =>
new Vector3(...coordinate).applyQuaternion(
new Quaternion().setFromUnitVectors(
normalVector,
normalZVector
)
)
);
geometry = new ShapeGeometry(new Shape(points));
geometry.vertices = geometry.vertices.map(
(vertex) => vertex.applyQuaternion(
new Quaternion().setFromUnitVectors(
normalZVector,
normalVector
)
)
);
geometry.computeFaceNormals();
Applying the quaternion once zero the z values, and applying it again move the shape to the correct position.
But it is very slow, and I need to use Geometry
(which was removed in r125) is there a manner to use a BufferGeometry
here?