Programmaticaly creating recognizable SVG files

I’m generating SVGs programmatically for laser cutting and want my files to import with:

  • Cut geometry on Layer 00 (black) as Line (not Fill)

  • Guide/annotation geometry on T1 (tool layer) using the official T1 orange

  • Instruction text on a blue engraving layer (Layer 01) as Fill

I’ve read that LightBurn maps imported SVG objects to layers based on stroke color proximity to the built-in palette, and determines Line vs Fill based on SVG fill/stroke attributes. I’m seeing inconsistent results:

  • Paths with style=“fill:none;stroke:rgb(0,0,0);stroke-width:0.10mm” sometimes import as Fill instead of Line on Layer 00.

  • Objects colored with T1 orange (rgb(243,105,38) / #F36926) often map to Layer 05 (orange) instead of T1.

  • Blue text intended for engraving (Layer 01) sometimes imports as Line rather than Fill.

Could you clarify the exact rules so I can output SVGs that import deterministically?

  1. Layer Mapping by Color

    • Does LightBurn map by stroke color (not fill) for path geometry?

    • Are T1/T2 recognized by exact RGB triplets? If so, what are the exact RGB values used internally for T1 and T2?

    • Is there any tolerance or rounding that would make rgb(243,105,38) map to Layer 05 instead of T1?

  2. Line vs Fill Mode on Import

    • For a to import as Line, is fill:none sufficient, or must fill=“none” be inside the style attribute?

    • Does specifying stroke-width in mm (e.g., 0.10mm) vs px affect the imported mode?

    • For text intended as engrave (Fill), is it enough to set fill:rgb(0,0,255) and stroke:none?

  3. Best-practice SVG recipe

    • Could you provide the recommended attribute pattern (style/units) for:

      • Cut lines on Layer 00 (Line)

      • Tool/guide lines on T1

      • Engrave text on Layer 01 (Fill)

I’ve attached a small SVG with three test objects (cut square, T1 guide line, blue text). If you can tell me how LightBurn expects these to be authored so they land on 00/Line, T1, and 01/Fill respectively on import, I’ll match that in my generator.

To help you see what might influence import behavior, I’ve attached a second variant of the same test file.

The only differences between Variant 1 and Variant 2 are how the attributes are expressed.

  • In Variant 2 the SVG uses separate attributes instead of a single style string (e.g., stroke=“#000000” instead of style=“stroke:rgb(0,0,0)”).

  • Stroke widths are expressed in px instead of mm.

  • The fill=“none” attribute is separated explicitly from the stroke.

If your parser treats these differently, it’ll help me know which authoring pattern is most compatible with LightBurn’s import logic.

Thank you again for clarifying — these details will help ensure consistent layer and mode mapping for all LightBurn users generating SVGs programmatically.

Thanks for the help.

lb_import_test_variant2

lb_import_test_varient1

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.