X Tutup
Skip to content

Reduce number of <use> tags in SVG output #80

@mcous

Description

@mcous

This ticket is taking over for tracespace/gerber-to-svg#36. See that ticket for some background.

I believe overuse of <use> is making our SVG output harder for browsers / image editors to deal with. For some things (e.g. referencing entire layers multiple times in pcb-stackup) <use> is the best solution for the job. For other things (e.g. individual pad flashes in a single layer) a <use> could be easily replaced in most instances with a single <path>.

Problems:

This change should result in simpler SVG output and could even reduce the output file size (each <use> needs a corresponding shape in <defs> with a unique ID.

<use> tags in gerber-to-svg have some nice side-effects with regards to identifying which Gerber "tool" created a given shape by inspecting the id, but that sort of metadata could (and probably should) be attached to a data-attribute rather than inferred from an internal id.

Metadata

Metadata

Assignees

No one assigned

    Labels

    featuregerber-to-svgTickets for the gerber-to-svg packagepcb-stackup-coreTickets for the pcb-stackup-core packagev5-fixedTicket is resolved in the `v5` branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup