"""SVG output generator — clean SVG serialization from PostProcessResult.""" from __future__ import annotations from pipeline.postprocess import PostProcessResult def generate_svg(result: PostProcessResult) -> str: """Generate a clean SVG string from post-processed path data. Re-serializes paths from the PostProcessResult into a minimal SVG document with a single compound path using fill-rule="evenodd" for proper island rendering. Args: result: PostProcessResult from the post-processing pipeline. Returns: SVG string with simplified paths. """ # The postprocess pipeline already rebuilds SVG; return it directly # if caller just wants the default output. return result.svg