# Draw 2d shape faster

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?

Not sure if this is what you’re looking for but positioning the geometry itself is usually done via

geometry.translate( x, y, z )

@georgewaraw this won’t solve the problem as I still would need to apply the quaternion once. Anyway thanks!

What I made is create 2 Float32Array, one 3d and one 2d. Then I set the geometry position to the 3d one, and set its index with earcut (operating over the 2d one). This way I only need to apply the quaternion once.