Inkscape.org
Creating New Extensions How to combine and unite paths within an inkscape extension?
  1. #1
    max1josef max1josef @max1josef

    I'm new to writing Inkscape extensions and writing Python code in general.

    My first project is an extension to reformat SVGs exported from FreeCAD.

    I already managed ungrouping all objects (with modified code from "deep ungroup" extension) and assigning a desired stroke-with to stroked pathes and a desired color to filled paths.

    Now I want to combine (Ctrl K) all stroked paths and unite (Ctrl +) all filled paths.

    How can I do that?

    Here is the last part of my code:

                for node in self.ungroupedNodes:
                    if('stroke' in node.style and node.style['stroke'] != 'none'):
                        node.style['stroke-width'] = 1.2
                        # code for combine here?
    
                    if('fill' in node.style and node.style['fill'] != 'none'):
                        node.style['fill'] = 'red'
                        # code for union here?
    

     

Inkscape Inkscape.org Inkscape Forum Creating New Extensions How to combine and unite paths within an inkscape extension?