How to create an object from coordinates and save it as SVG?

Hi, as in the title, I need to export the object created from the coordinates to the SVG or base64 (it will be a thumbnail of each object in the scene). Do you have any experience or implementation examples?

// how I create an object 2D

     const geometry = new BufferGeometry().setFromPoints(
      coordinates.map(([x, y]) => new Vector2(x, y))
    );
    const line: Line = new Line(geometry, new LineBasicMaterial({ color }));

You mean converting 3D object to a 2D SVG?

definitely 2D to 2D :slight_smile:

Do these 3D objects have details / textures or just flat colours ? If not, you can try to use SVGRenderer. It allows you to load 3D models and converts them to paths, but afaik only with flat colors - so if models are complex you can add detail by shading each submesh a bit differently. If models are just single 3D meshes it will end up something like this though:

Screenshot 2020-10-08 at 13.28.45

2 Likes