Skip to content

[New feature] SVG Layered Import#15265

Open
pgilfernandez wants to merge 19 commits intoprusa3d:masterfrom
pgilfernandez:import-layered-svg-v1
Open

[New feature] SVG Layered Import#15265
pgilfernandez wants to merge 19 commits intoprusa3d:masterfrom
pgilfernandez:import-layered-svg-v1

Conversation

@pgilfernandez
Copy link

Hi!

Importing SVG files as plain extrusions into PrusaSlicer is a game changer for lot of designers that being expert in graphic design (we could called them 2D artists) they don't know how to design in 3D and so they don't use 3D printers. This feature allows them to join the 3D printing world without the need of learning a 3D software that are commonly complex with a step learning curve. PrusaSlicer now allows them to create lots of objects (single or multi-material) with just the concept of positive, negative or "modifier mode" extrusions. But... at the time being, the workflow to get "complex" shapes is somehow difficult and tedious (something that has been already commented before). This PR tries to solve this problem:

So this PR improves SVG import workflows by adding robust layer-aware import options, aligning behavior across Plater and GLGizmoSVG, and polishing the import dialogs for usability and consistency.

Workflow demostration

Import part

svg_layers_mmu

Import multi-material part

svg_layers_parts

What’s Included

1. Layer-aware SVG import in Plater

  • Added an SVG import options dialog shown during SVG import.
  • Added Import mode options:
    • Merged layers (default)
    • Layers as parts
  • Added per-layer controls:
    • Import checkbox
    • Type (Part, Negative volume, Modifier)
    • From / To extrusion range in mm
  • Added row-level enable/disable logic:
    • Per-layer controls are disabled when layer import is unchecked.
    • Per-layer controls are disabled when Merged layers mode is selected.
  • Added validation:
    • At least one layer must be selected.
    • To > From for each editable row.

2. Layer parsing and selection behavior

  • Implemented explicit SVG layer parsing from Inkscape-style layer groups.
  • Preserved real SVG layer names in UI.
  • Added fallback for SVG files without explicit layers:
    • Treat file as one logical layer.
  • Hidden layers in SVG are now unchecked by default.
  • Fixed import behavior so selected hidden layers are actually imported.
  • Corrected inverse hidden-layer bug where unchecked hidden layers could still be imported.

3. Import modes and part generation logic

  • Merged layers:
    • Imports selected layers as one volume.
  • Layers as parts:
    • Creates initial volume + additional parts per selected layer.
    • Preserves shared XY origin across generated parts for designed alignment.
  • Per-layer volume type is applied correctly (Part / Negative volume / Modifier).

4. Extrusion ranges and Z placement

  • Added per-layer From/To fields in Plater.
  • Default range strategy:
    • From = 0 for all layers
    • To initialized from 10 mm and incremented by 2 mm per consecutive layer
  • Corrected Z placement calculations so each generated volume matches expected depth and center.

5. Naming improvements

  • In layered import mode:
    • Imported object/group name is now the original SVG filename (without extension).
    • Individual generated volumes use SVG layer names.

6. Dialog/UI polish (Plater + GLGizmoSVG)

  • Improved table-like layout, spacing, and readability.
  • Added column tooltips and control tooltips.
  • Added scrolling support for long layer lists.
  • Updated and aligned headers (including Layer name wording).
  • Improved minimum/default dialog sizing and resizing behavior.
  • Added ellipsizing for long layer names where applicable.

7. GLGizmoSVG parity and stability improvements

  • Extended GLGizmoSVG layer selection dialog behavior to match Plater where applicable.
  • Removed unused mode toggles in GLGizmoSVG flow where import is always merged.
  • Added relink flow for volumes loaded from 3MF with missing/empty linked shape data.
  • Prevented repeated/double relink popups.
  • Added robust guards around selection/model validity to prevent crashes.
  • Resolved crash paths triggered when entering Edit SVG after reload scenarios.

8. Size editing behavior in floating SVG panel

  • Fixed regression where changing Size rebuilt to merged unexpectedly.
  • Improved transformation update behavior so XY scale edits do not introduce incorrect Z jumps.
  • Stabilized update path for reloaded/editable SVG volumes.
  • Ability to edit, combine or change selected layers

Notes

  • This PR focuses on import UX + behavior correctness and keeps current 3MF storage model unchanged.
  • Internationalization-compatible labels/tooltips are used via existing localization macros.
  • Behavior between Plater import and GLGizmoSVG editing paths is now significantly closer and more predictable.
  • I used AI to help me with the code as I'm not an experienced programmer so the code must be reviewed and, even after my personal review, may include functions, checks and things that are not fully optimised. This is the cost of designing with AI but I think in this case it worth it.

Finally, I'm sure graphic designers would love this "not new but improved" feature that allows them to really create lots of prints without effort and moreover without the need to use a 3D software as bridge or to "loose" their time learning how to 3D design.

I'm open to suggestions, improvements, cleaning the code, squashing the PR... let's talk and try to merge this cool feature
=D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant