{
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "$id": "pcb_svg_config.a0.schema.json",
    "type": "object",
    "properties": {
        "schema": {
            "type": "string",
            "const": "kicad_cruncher.pcb_svg.config.a0"
        },
        "global": {
            "$ref": "#/$defs/PcbSvgConfigGlobal"
        },
        "assembly": {
            "$ref": "#/$defs/PcbSvgConfigAssembly"
        },
        "dnp": {
            "$ref": "#/$defs/PcbSvgConfigDnp"
        },
        "diodes": {
            "$ref": "#/$defs/PcbSvgConfigDiodes"
        },
        "pin1": {
            "$ref": "#/$defs/PcbSvgConfigPin1"
        },
        "components": {
            "$ref": "#/$defs/PcbSvgConfigComponents",
            "description": "Per-component overrides. A key that is a designator on the board is an exact, case-sensitive key for that part. Any other key is a selector, matched case-insensitively, as in assembly_designators.selector_overrides: a prefix (a key ending in *, or one of letters only, as \"TP\" or \"TP*\") or a range <P><n>-<P2><m> (P any run of non-digits, P2 empty or P, either order, as \"U5-U15\" or \"U$1-U$9\"); a key that is neither matches nothing. Every matching entry applies field by field, selector keys in file order with a later key over an earlier one, then the exact key; style mappings merge key by key. A newly written config holds the generated entries of kcr's assembly part rules."
        },
        "layer_outputs": {
            "$ref": "#/$defs/PcbSvgConfigLayerOutputs"
        },
        "views": {
            "type": "array",
            "items": {
                "$ref": "#/$defs/PcbSvgConfigViewsItem"
            }
        }
    },
    "required": [
        "schema",
        "global",
        "layer_outputs",
        "views"
    ],
    "unevaluatedProperties": {
        "not": {}
    },
    "title": "PcbSvgConfig",
    "$defs": {
        "PcbSvgConfigGlobal": {
            "type": "object",
            "properties": {
                "pcbdoc": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "null"
                        }
                    ]
                },
                "canvas": {
                    "$ref": "#/$defs/PcbSvgConfigGlobalCanvas",
                    "description": "The one canvas of every view and layer output of a board: bounds \"board_outline\" fits the Edge.Cuts outline at the global board_outline.line_width_mm, drawn or not (all geometry when the board has no outline); \"all_geometry\" fits all source geometry. Either grows by margin_mm. Toon keeps its own side frame."
                },
                "include_metadata": {
                    "type": "boolean"
                },
                "show_empty_layers": {
                    "type": "boolean"
                },
                "clip_to_outline": {
                    "type": "boolean"
                },
                "clip_holes_from_copper": {
                    "type": "boolean"
                },
                "mirror_bottom_view": {
                    "type": "boolean"
                },
                "svg_scale": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "svg_size_unit": {
                    "type": "string"
                },
                "clean_output": {
                    "type": "boolean"
                },
                "styles": {
                    "$ref": "#/$defs/StyleTable"
                }
            },
            "unevaluatedProperties": {}
        },
        "PcbSvgConfigAssembly": {
            "type": "object",
            "properties": {
                "default_projection": {
                    "anyOf": [
                        {
                            "type": "string",
                            "const": "detail"
                        },
                        {
                            "type": "string",
                            "const": "outline"
                        },
                        {
                            "type": "string",
                            "const": "bounding_box"
                        },
                        {
                            "type": "string",
                            "const": "model_bounds"
                        },
                        {
                            "type": "string",
                            "const": "pad_bounds"
                        },
                        {
                            "type": "string",
                            "const": "pad_shape"
                        },
                        {
                            "type": "string",
                            "const": "none"
                        }
                    ],
                    "description": "The projection of standalone ASSEMBLY_HLR_TOP/BOTTOM and ASSEMBLY_DESIGNATORS_* layer outputs only, for a component that sets none; configured views use their assembly_hlr_mode."
                },
                "dnp_projection": {
                    "anyOf": [
                        {
                            "type": "string",
                            "const": "detail"
                        },
                        {
                            "type": "string",
                            "const": "outline"
                        },
                        {
                            "type": "string",
                            "const": "bounding_box"
                        },
                        {
                            "type": "string",
                            "const": "model_bounds"
                        },
                        {
                            "type": "string",
                            "const": "pad_bounds"
                        },
                        {
                            "type": "string",
                            "const": "pad_shape"
                        },
                        {
                            "type": "string",
                            "const": "none"
                        }
                    ]
                },
                "designator_color": {
                    "type": "string"
                },
                "dnp_designator_color": {
                    "type": "string"
                }
            },
            "unevaluatedProperties": {
                "not": {}
            }
        },
        "PcbSvgConfigDnp": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string"
                },
                "hatch": {
                    "type": "boolean"
                },
                "hatch_spacing_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "hatch_angle_deg": {
                    "type": "number"
                },
                "hatch_line_width_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                }
            },
            "unevaluatedProperties": {
                "not": {}
            }
        },
        "PcbSvgConfigDiodes": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "line_art": {
                    "type": "boolean"
                },
                "marker_color": {
                    "type": "string"
                },
                "numeric_cathode_pad": {
                    "type": "string"
                },
                "cathode_pad_names": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "designator_prefixes": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "parameter_terms": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                }
            },
            "unevaluatedProperties": {
                "not": {}
            }
        },
        "PcbSvgConfigPin1": {
            "type": "object",
            "properties": {
                "exclude_designators": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                },
                "exclude_designator_prefixes": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "exclude_single_pin": {
                    "type": "boolean"
                }
            },
            "unevaluatedProperties": {
                "not": {}
            }
        },
        "PcbSvgConfigComponents": {
            "type": "object",
            "properties": {},
            "unevaluatedProperties": {
                "$ref": "#/$defs/ComponentOverride"
            }
        },
        "PcbSvgConfigLayerOutputs": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "layers": {
                    "anyOf": [
                        {
                            "type": "string",
                            "const": "auto"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                },
                "include_special_layers": {
                    "type": "array",
                    "items": {
                        "anyOf": [
                            {
                                "type": "string",
                                "const": "BOARD_SUBSTRATE"
                            },
                            {
                                "type": "string",
                                "const": "BOARD_OUTLINE"
                            },
                            {
                                "type": "string",
                                "const": "BOARD_CUTOUTS"
                            },
                            {
                                "type": "string",
                                "const": "DRILLS"
                            },
                            {
                                "type": "string",
                                "const": "SLOTS"
                            },
                            {
                                "type": "string",
                                "const": "SOLDERMASK_FILM_TOP"
                            },
                            {
                                "type": "string",
                                "const": "SOLDERMASK_FILM_BOTTOM"
                            },
                            {
                                "type": "string",
                                "const": "ILLUSTRATION_TOP"
                            },
                            {
                                "type": "string",
                                "const": "ILLUSTRATION_BOTTOM"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_HLR_TOP"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_HLR_BOTTOM"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_DESIGNATORS_TOP"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_DESIGNATORS_BOTTOM"
                            },
                            {
                                "type": "string",
                                "const": "PIN1_TOP"
                            },
                            {
                                "type": "string",
                                "const": "PIN1_BOTTOM"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_HLR_TOP_OUTLINE"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_HLR_BOTTOM_OUTLINE"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_HLR_TOP_DETAIL"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_HLR_BOTTOM_DETAIL"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_BOUNDS_TOP_MODEL"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_BOUNDS_BOTTOM_MODEL"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_BOUNDS_TOP_PADS"
                            },
                            {
                                "type": "string",
                                "const": "ASSEMBLY_BOUNDS_BOTTOM_PADS"
                            }
                        ]
                    }
                },
                "add_edge_cuts_to_physical_layers": {
                    "type": "boolean",
                    "description": "Include raw Edge.Cuts geometry as context in each non-Edge.Cuts physical layer output."
                },
                "add_drills_to_physical_layers": {
                    "type": "boolean",
                    "description": "Include computed round drill overlays as context in each non-Edge.Cuts physical layer output."
                },
                "add_slots_to_physical_layers": {
                    "type": "boolean",
                    "description": "Include computed slot overlays as context in each non-Edge.Cuts physical layer output."
                },
                "write_virtual_layers": {
                    "type": "boolean",
                    "description": "Write standalone __virtual__ layer SVG files selected by include_special_layers and synthetic layer tokens."
                },
                "output_dir": {
                    "type": "string"
                }
            },
            "unevaluatedProperties": {
                "not": {}
            }
        },
        "PcbSvgConfigViewsItem": {
            "type": "object",
            "properties": {
                "name": {
                    "type": "string",
                    "minLength": 1
                },
                "enabled": {
                    "type": "boolean"
                },
                "group_id": {
                    "type": "string"
                },
                "output_svg": {
                    "type": "string"
                },
                "layers": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "mirror": {
                    "type": "boolean"
                },
                "assembly_hlr_mode": {
                    "anyOf": [
                        {
                            "type": "string",
                            "const": "outline"
                        },
                        {
                            "type": "string",
                            "const": "detail"
                        },
                        {
                            "type": "string",
                            "const": "bounding_box"
                        },
                        {
                            "type": "string",
                            "const": "model_bounds"
                        },
                        {
                            "type": "string",
                            "const": "pad_bounds"
                        },
                        {
                            "type": "string",
                            "const": "pad_shape"
                        },
                        {
                            "type": "string",
                            "const": "none"
                        }
                    ],
                    "description": "How the view's ASSEMBLY_HLR_* layers draw a component that sets no projection, \"detail\" when unset; its designators fit the same geometry."
                },
                "styles": {
                    "$ref": "#/$defs/StyleTable"
                },
                "pin1": {
                    "$ref": "#/$defs/Pin1"
                },
                "description": {
                    "type": "string"
                }
            },
            "required": [
                "name",
                "layers"
            ],
            "unevaluatedProperties": {
                "not": {}
            }
        },
        "PcbSvgConfigGlobalCanvas": {
            "type": "object",
            "properties": {
                "bounds": {
                    "anyOf": [
                        {
                            "type": "string",
                            "const": "board_outline"
                        },
                        {
                            "type": "string",
                            "const": "all_geometry"
                        }
                    ]
                },
                "margin_mm": {
                    "type": "number",
                    "minimum": 0
                }
            },
            "unevaluatedProperties": {
                "not": {}
            }
        },
        "StyleTable": {
            "type": "object",
            "properties": {
                "illustration": {
                    "$ref": "#/$defs/StyleTableIllustration"
                },
                "board_substrate": {
                    "$ref": "#/$defs/StyleTableBoardSubstrate"
                },
                "soldermask_film": {
                    "$ref": "#/$defs/StyleTableSoldermaskFilm"
                },
                "board_outline": {
                    "$ref": "#/$defs/StyleTableBoardOutline"
                },
                "board_cutouts": {
                    "$ref": "#/$defs/StyleTableBoardCutouts"
                },
                "drills": {
                    "$ref": "#/$defs/HoleStyle"
                },
                "slots": {
                    "$ref": "#/$defs/HoleStyle"
                },
                "pin1_marker": {
                    "$ref": "#/$defs/StyleTablePin1Marker"
                },
                "assembly_designators": {
                    "$ref": "#/$defs/StyleTableAssemblyDesignators"
                },
                "assembly_hlr": {
                    "$ref": "#/$defs/StyleTableAssemblyHlr"
                },
                "silkscreen_component_graphics": {
                    "$ref": "#/$defs/StyleTableSilkscreen"
                },
                "silkscreen_designators": {
                    "$ref": "#/$defs/StyleTableSilkscreen"
                },
                "silkscreen_board_graphics": {
                    "$ref": "#/$defs/StyleTableSilkscreen"
                }
            },
            "unevaluatedProperties": {
                "$ref": "#/$defs/StyleTableExtension"
            }
        },
        "ComponentOverride": {
            "type": "object",
            "properties": {
                "side": {
                    "anyOf": [
                        {
                            "type": "string",
                            "const": "top"
                        },
                        {
                            "type": "string",
                            "const": "bottom"
                        }
                    ]
                },
                "projection": {
                    "anyOf": [
                        {
                            "type": "string",
                            "const": "detail"
                        },
                        {
                            "type": "string",
                            "const": "outline"
                        },
                        {
                            "type": "string",
                            "const": "bounding_box"
                        },
                        {
                            "type": "string",
                            "const": "model_bounds"
                        },
                        {
                            "type": "string",
                            "const": "pad_bounds"
                        },
                        {
                            "type": "string",
                            "const": "pad_shape"
                        },
                        {
                            "type": "string",
                            "const": "none"
                        }
                    ],
                    "description": "How the assembly HLR draws the component, over the view's assembly_hlr_mode. \"pad_bounds\" is the box around every pad land on the side, non-plated holes included; \"pad_shape\" outlines each copper pad on the side in its own shape and each non-plated hole; \"none\" draws nothing. The fixed-mode tokens (ASSEMBLY_HLR_*_OUTLINE and _DETAIL, ASSEMBLY_BOUNDS_*) keep their own mode over it."
                },
                "assembly_hlr": {
                    "$ref": "#/$defs/ComponentOverrideAssemblyHlr"
                },
                "assembly_designators": {
                    "$ref": "#/$defs/ComponentOverrideAssemblyDesignators"
                },
                "illustration": {
                    "$ref": "#/$defs/ComponentIllustration"
                },
                "pin1_enabled": {
                    "type": "boolean"
                },
                "pin1_pad": {
                    "type": "string"
                },
                "cathode_pad": {
                    "type": "string"
                },
                "diode": {
                    "type": "boolean"
                },
                "diode_line_art": {
                    "type": "boolean"
                },
                "show_designator": {
                    "type": "boolean"
                }
            },
            "unevaluatedProperties": {
                "not": {}
            }
        },
        "Pin1": {
            "type": "object",
            "properties": {
                "exclude_designators": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    ]
                },
                "exclude_designator_prefixes": {
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "exclude_single_pin": {
                    "type": "boolean"
                }
            },
            "unevaluatedProperties": {
                "not": {}
            }
        },
        "StyleTableIllustration": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "outline_width_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "detail_width_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                }
            },
            "unevaluatedProperties": {}
        },
        "StyleTableBoardSubstrate": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "color": {
                    "type": "string"
                },
                "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                }
            },
            "unevaluatedProperties": {}
        },
        "StyleTableSoldermaskFilm": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "color": {
                    "type": "string",
                    "description": "The film colour, or \"auto\": the board's saved solder-mask colour for the view's side."
                },
                "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                }
            },
            "unevaluatedProperties": {}
        },
        "StyleTableBoardOutline": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "color": {
                    "type": "string"
                },
                "line_width_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "max_arc_segment_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "max_curve_segment_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "max_circle_segment_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "min_arc_segments": {
                    "type": "integer",
                    "minimum": 1
                },
                "min_curve_segments": {
                    "type": "integer",
                    "minimum": 1
                },
                "min_circle_segments": {
                    "type": "integer",
                    "minimum": 8
                },
                "max_arc_segments": {
                    "type": "integer",
                    "minimum": 8
                },
                "max_curve_segments": {
                    "type": "integer",
                    "minimum": 8
                },
                "max_circle_segments": {
                    "type": "integer",
                    "minimum": 8
                }
            },
            "unevaluatedProperties": {}
        },
        "StyleTableBoardCutouts": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "color": {
                    "type": "string"
                },
                "hatch": {
                    "type": "boolean"
                },
                "hatch_spacing_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "hatch_angle_deg": {
                    "type": "number"
                },
                "hatch_line_width_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "hatch_color": {
                    "type": "string"
                },
                "hatch_opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "outline_style": {
                    "anyOf": [
                        {
                            "type": "string",
                            "const": "solid"
                        },
                        {
                            "type": "string",
                            "const": "dashed"
                        }
                    ]
                },
                "outline_dash_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "outline_width_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "outline_opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                }
            },
            "unevaluatedProperties": {}
        },
        "HoleStyle": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "plated_color": {
                    "type": "string"
                },
                "non_plated_color": {
                    "type": "string"
                },
                "outline": {
                    "type": "boolean"
                },
                "outline_width_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "respect_tenting": {
                    "type": "boolean"
                },
                "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                }
            },
            "unevaluatedProperties": {}
        },
        "StyleTablePin1Marker": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "color": {
                    "type": "string"
                },
                "dot_diameter_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "pad_diameter_ratio": {
                    "type": "number",
                    "minimum": 0
                },
                "min_dot_diameter_mm": {
                    "type": "number",
                    "minimum": 0
                },
                "max_dot_diameter_mm": {
                    "type": "number",
                    "minimum": 0
                }
            },
            "unevaluatedProperties": {}
        },
        "StyleTableAssemblyDesignators": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string"
                },
                "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "stroke_color": {
                    "type": "string"
                },
                "stroke_width_mm": {
                    "type": "number",
                    "minimum": 0
                },
                "stroke_width_pct": {
                    "type": "number",
                    "minimum": 0
                },
                "enabled": {
                    "type": "boolean"
                },
                "font_family": {
                    "type": "string"
                },
                "font_weight": {
                    "anyOf": [
                        {
                            "type": "string"
                        },
                        {
                            "type": "number"
                        }
                    ]
                },
                "box_fill_ratio": {
                    "type": "number",
                    "description": "The share of the part's label area the designator may fill, clamped to 0.05..1 (a value outside warns), as Altium Cruncher."
                },
                "max_font_size_mm": {
                    "type": "number",
                    "minimum": 0
                },
                "selector_overrides": {
                    "$ref": "#/$defs/StyleTableAssemblyDesignatorsSelectorOverrides"
                }
            },
            "unevaluatedProperties": {}
        },
        "StyleTableAssemblyHlr": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "color": {
                    "type": "string"
                },
                "line_width_mm": {
                    "type": "number",
                    "exclusiveMinimum": 0
                },
                "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                }
            },
            "unevaluatedProperties": {}
        },
        "StyleTableSilkscreen": {
            "type": "object",
            "properties": {
                "enabled": {
                    "type": "boolean"
                },
                "color": {
                    "type": "string",
                    "description": "The silkscreen colour, or \"contrast\": black on a white mask, else near-white, against the view's resolved film colour."
                }
            },
            "unevaluatedProperties": {}
        },
        "StyleTableExtension": {
            "type": "object",
            "properties": {},
            "unevaluatedProperties": {}
        },
        "ComponentOverrideAssemblyHlr": {
            "type": "object",
            "properties": {},
            "unevaluatedProperties": {}
        },
        "ComponentOverrideAssemblyDesignators": {
            "type": "object",
            "properties": {
                "color": {
                    "type": "string"
                },
                "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                },
                "stroke_color": {
                    "type": "string"
                },
                "stroke_width_mm": {
                    "type": "number",
                    "minimum": 0
                },
                "stroke_width_pct": {
                    "type": "number",
                    "minimum": 0
                }
            },
            "unevaluatedProperties": {}
        },
        "ComponentIllustration": {
            "type": "object",
            "properties": {
                "opacity": {
                    "type": "number",
                    "minimum": 0,
                    "maximum": 1
                }
            },
            "unevaluatedProperties": {
                "not": {}
            }
        },
        "StyleTableAssemblyDesignatorsSelectorOverrides": {
            "type": "object",
            "properties": {},
            "unevaluatedProperties": {
                "$ref": "#/$defs/StyleTableAssemblyDesignatorsSelectorOverridesExtension"
            }
        },
        "StyleTableAssemblyDesignatorsSelectorOverridesExtension": {
            "type": "object",
            "properties": {},
            "unevaluatedProperties": {}
        }
    }
}