{"course":{"slug":"vector-and-print","title":"Vectors, Logos and Things That Get Printed","url":"https://addaly.com/learn/vector-and-print","level":"beginner","track":"create"},"lesson":{"slug":"winding-rules-and-compound-paths","title":"Why the hole will not appear","url":"https://addaly.com/learn/vector-and-print/winding-rules-and-compound-paths","position":5,"of":73,"minutes":9,"answer":"A shape with more than one loop needs a rule for what counts as inside: non-zero winding depends on the direction each subpath is drawn, even-odd only on how many crossings there are.","keyIdea":"A shape with more than one loop needs a rule for what counts as inside: non-zero winding depends on the direction each subpath is drawn, even-odd only on how many crossings there are, and the same geometry prints differently under each."},"body":{"format":"markdown","text":"## One path, several loops\n\nA path can contain more than one subpath: the letter \"O\" is two loops, a die-line with a window is two loops, a five-pointed star drawn in one continuous stroke is one loop that crosses itself. In every case the renderer has to answer a question that is not obvious: **for any point on the page, is it inside the shape or outside it?**\n\nThere are two answers in general use, and they disagree.\n\n## Non-zero winding\n\nFire an imaginary ray from the point out to infinity. Every time the ray crosses a subpath, add 1 if that subpath is running left-to-right across the ray, subtract 1 if it is running right-to-left. If the total is anything other than zero, the point is inside.\n\nThe word doing the work is **direction**. Two circles drawn the same way (both clockwise) give a winding number of 2 in the inner region, which is not zero, so it fills. You get a disc. Reverse the inner circle and the counts cancel to zero: a hole.\n\n## Even-odd\n\nCount crossings and ignore direction. Odd is inside, even is outside. Two nested circles always give 2 crossings in the middle, which is even, which is outside. You always get a hole.\n\n> Figure: Two circles, one inside the other. A two by two grid, rows Same direction and Inner reversed, columns Non-zero and Even-odd: Same direction and Non-zero: Solid disc; Same direction and Even-odd: Hole; Inner reversed and Non-zero: Hole; Inner reversed and Even-odd: Hole. Non-zero winding depends on the direction each subpath is drawn; even-odd only counts crossings. Same geometry, two printed results, neither program broken. Reversing the inner loop is the portable fix, because direction travels with the file and a fill-rule attribute can be dropped on import.\n\n## Why this matters more than it sounds\n\nTake a five-pointed star drawn as one self-intersecting path, the one you draw without lifting the pen. The central pentagon has a winding number of 2.\n\n- Under **non-zero**, 2 ≠ 0, so the pentagon fills. You get a solid star.\n- Under **even-odd**, 2 crossings is even, so the pentagon is outside. You get a star with a pentagonal hole in the middle.\n\nSame geometry, same file, two completely different printed results. Neither program is broken.\n\nBoth SVG and PDF default to non-zero. In PDF the two operators are literally `f` and `f*`; in SVG it is `fill-rule=\"nonzero\"` or `\"evenodd\"`. Illustrator's default is non-zero; Inkscape's default is non-zero; CorelDRAW's is even-odd for some legacy objects, which is one reason CDR imports fill strangely.\n\n## The fixes, in each program\n\n- **Reverse the inner subpath.** Inkscape: select the node-tool, click a node on the inner loop, Path ▸ Reverse (**Shift+R**). Illustrator: Attributes panel ▸ Reverse Path Direction. CorelDRAW: Shape tool, select a node on the subpath, then the reverse button on the property bar.\n- **Switch the object to even-odd.** Inkscape: Fill & Stroke ▸ the two small buttons beside the fill swatch. Illustrator: Attributes panel ▸ Even-Odd Fill Rule.\n\nReversing is the more portable fix, because direction is stored in the geometry and travels with the file. The fill rule is an attribute that some importers drop.\n\n## See the direction\n\nYou cannot fix what you cannot see. Turn on direction markers:\n\n- Inkscape: node tool, then Edit ▸ Preferences ▸ Tools ▸ Node ▸ show path direction on outlines.\n- Illustrator: View ▸ Show Edges plus the Document Info panel, or select the path and look at where the start point sits.\n- Any program: apply a dashed stroke with an arrow marker at the end. Crude and instant.\n\n## Compound path, group, clip: three different things\n\nPeople use these interchangeably and they are not.\n\n- A **compound path** is *one object* made of several subpaths, sharing one fill and one stroke, and subject to a winding rule. This is what a letter \"O\" or a die-line window is. Make one: **Ctrl+8** in Illustrator, Path ▸ Combine (**Ctrl+K**) in Inkscape, Object ▸ Combine (**Ctrl+L**) in CorelDRAW.\n- A **group** is several independent objects moved together. Each keeps its own fill. Grouping two circles never produces a hole.\n- A **clip** hides everything outside a shape. It does not remove it, which is the subject of the next lesson.\n\nThe practical consequence: if you send a die-line to a cutting machine as a *group* of two circles, the machine cuts both outlines and the middle falls out. As a *compound path* with the inner loop reversed, it is one object with a hole, and the operator's software reads it as one closed cut with an interior.\n\n## Where you will meet this again\n\nA logo with counters that fill solid after import. A map where the lakes print as land. An envelope die-line whose window prints as a block. A vinyl cut where the inside of every \"e\" is cut as a separate piece. All the same rule."},"check":{"question":"A five-pointed star is drawn as a single path without lifting the pen, so the path crosses itself and the central pentagon has a winding number of 2. It renders as a solid star in one application and as a star with a pentagonal hole in another. Why?","options":[{"text":"The second application imported the path as a group rather than a compound path, so the inner region became a separate object.","correct":false,"tempting":"A group would show two independent objects with their own fills; the hole appears with no extra object present, because it is a fill-rule decision on one path."},{"text":"The path was left open in the second application, and open paths fill only their outermost loop.","correct":false,"tempting":"Open paths are filled as if closed by a straight line back to the start; openness changes the stroke, not the winding calculation."},{"text":"One uses non-zero winding, where 2 counts as inside, and the other uses even-odd, where 2 crossings count as outside.","correct":true},{"text":"The second application converted the path to even-odd because the subpaths run in opposite directions.","correct":false,"tempting":"There is only one subpath here, so there are no opposing directions to detect. Direction matters for non-zero, but the difference between the two renderings is the rule itself."}]},"prev":{"slug":"a-path-has-no-thickness","title":"A path has no thickness","url":"https://addaly.com/learn/vector-and-print/a-path-has-no-thickness"},"next":{"slug":"clipping-hides-it-does-not-remove-it","title":"Clipping hides; it does not remove","url":"https://addaly.com/learn/vector-and-print/clipping-hides-it-does-not-remove-it"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Why the hole will not appear', in Vectors, Logos and Things That Get Printed. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/vector-and-print/winding-rules-and-compound-paths (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Why the hole will not appear","courseTitle":"Vectors, Logos and Things That Get Printed","module":{"index":1,"slug":"what-a-vector-is","title":"The thing that is actually in the file"},"answer":null,"keyIdea":"A shape with more than one loop needs a rule for what counts as inside: non-zero winding depends on the direction each subpath is drawn, even-odd only on how many crossings there are, and the same geometry prints differently under each.","hero":{"kind":"figure","figure":{"t":"figure","label":"Figure","figure":{"cols":["Non-zero","Even-odd"],"rows":["Same direction","Inner reversed"],"type":"matrix","cells":[["Solid disc","Hole"],["Hole","Hole"]],"title":"Two circles, one inside the other","caption":"Non-zero winding depends on the direction each subpath is drawn; even-odd only counts crossings. Same geometry, two printed results, neither program broken. Reversing the inner loop is the portable fix, because direction travels with the file and a fill-rule attribute can be dropped on import.","cellLabels":[["winding number 2","two crossings"],["winding number 0","two crossings"]]},"alt":"Figure: Two circles, one inside the other. A two by two grid, rows Same direction and Inner reversed, columns Non-zero and Even-odd: Same direction and Non-zero: Solid disc; Same direction and Even-odd: Hole; Inner reversed and Non-zero: Hole; Inner reversed and Even-odd: Hole. Non-zero winding depends on the direction each subpath is drawn; even-odd only counts crossings. Same geometry, two printed results, neither program broken. Reversing the inner loop is the portable fix, because direction travels with the file and a fill-rule attribute can be dropped on import."}},"blocks":[{"t":"h2","id":"one-path-several-loops","runs":[{"text":"One path, several loops"}]},{"t":"p","runs":[{"text":"A path can contain more than one subpath: the letter “O” is two loops, a die-line with a window is two loops, a five-pointed star drawn in one continuous stroke is one loop that crosses itself. In every case the renderer has to answer a question that is not obvious: "},{"text":"for any point on the page, is it inside the shape or outside it?","b":true}]},{"t":"p","runs":[{"text":"There are two answers in general use, and they disagree."}]},{"t":"h2","id":"non-zero-winding","runs":[{"text":"Non-zero winding"}]},{"t":"p","runs":[{"text":"Fire an imaginary ray from the point out to infinity. Every time the ray crosses a subpath, add 1 if that subpath is running left-to-right across the ray, subtract 1 if it is running right-to-left. If the total is anything other than zero, the point is inside."}]},{"t":"p","runs":[{"text":"The word doing the work is "},{"text":"direction","b":true},{"text":". Two circles drawn the same way (both clockwise) give a winding number of 2 in the inner region, which is not zero, so it fills. You get a disc. Reverse the inner circle and the counts cancel to zero: a hole."}]},{"t":"h2","id":"even-odd","runs":[{"text":"Even-odd"}]},{"t":"p","runs":[{"text":"Count crossings and ignore direction. Odd is inside, even is outside. Two nested circles always give 2 crossings in the middle, which is even, which is outside. You always get a hole."}]},{"t":"h2","id":"why-this-matters-more-than-it-sounds","runs":[{"text":"Why this matters more than it sounds"}]},{"t":"p","runs":[{"text":"Take a five-pointed star drawn as one self-intersecting path, the one you draw without lifting the pen. The central pentagon has a winding number of 2."}]},{"t":"ul","items":[[{"text":"Under "},{"text":"non-zero","b":true},{"text":", 2 ≠ 0, so the pentagon fills. You get a solid star."}],[{"text":"Under "},{"text":"even-odd","b":true},{"text":", 2 crossings is even, so the pentagon is outside. You get a star with a pentagonal hole in the middle."}]]},{"t":"p","runs":[{"text":"Same geometry, same file, two completely different printed results. Neither program is broken."}]},{"t":"p","runs":[{"text":"Both SVG and PDF default to non-zero. In PDF the two operators are literally "},{"text":"f","code":true},{"text":" and "},{"text":"f*","code":true},{"text":"; in SVG it is "},{"text":"fill-rule=\"nonzero\"","code":true},{"text":" or "},{"text":"\"evenodd\"","code":true},{"text":". Illustrator’s default is non-zero; Inkscape’s default is non-zero; CorelDRAW’s is even-odd for some legacy objects, which is one reason CDR imports fill strangely."}]},{"t":"h2","id":"the-fixes-in-each-program","runs":[{"text":"The fixes, in each program"}]},{"t":"ul","items":[[{"text":"Reverse the inner subpath.","b":true},{"text":" Inkscape: select the node-tool, click a node on the inner loop, Path ▸ Reverse ("},{"text":"Shift+R","b":true},{"text":"). Illustrator: Attributes panel ▸ Reverse Path Direction. CorelDRAW: Shape tool, select a node on the subpath, then the reverse button on the property bar."}],[{"text":"Switch the object to even-odd.","b":true},{"text":" Inkscape: Fill & Stroke ▸ the two small buttons beside the fill swatch. Illustrator: Attributes panel ▸ Even-Odd Fill Rule."}]]},{"t":"p","runs":[{"text":"Reversing is the more portable fix, because direction is stored in the geometry and travels with the file. The fill rule is an attribute that some importers drop."}]},{"t":"h2","id":"see-the-direction","runs":[{"text":"See the direction"}]},{"t":"p","runs":[{"text":"You cannot fix what you cannot see. Turn on direction markers:"}]},{"t":"ul","items":[[{"text":"Inkscape: node tool, then Edit ▸ Preferences ▸ Tools ▸ Node ▸ show path direction on outlines."}],[{"text":"Illustrator: View ▸ Show Edges plus the Document Info panel, or select the path and look at where the start point sits."}],[{"text":"Any program: apply a dashed stroke with an arrow marker at the end. Crude and instant."}]]},{"t":"h2","id":"compound-path-group-clip-three-different-things","runs":[{"text":"Compound path, group, clip: three different things"}]},{"t":"p","runs":[{"text":"People use these interchangeably and they are not."}]},{"t":"ul","items":[[{"text":"A "},{"text":"compound path","b":true},{"text":" is "},{"text":"one object","i":true},{"text":" made of several subpaths, sharing one fill and one stroke, and subject to a winding rule. This is what a letter “O” or a die-line window is. Make one: "},{"text":"Ctrl+8","b":true},{"text":" in Illustrator, Path ▸ Combine ("},{"text":"Ctrl+K","b":true},{"text":") in Inkscape, Object ▸ Combine ("},{"text":"Ctrl+L","b":true},{"text":") in CorelDRAW."}],[{"text":"A "},{"text":"group","b":true},{"text":" is several independent objects moved together. Each keeps its own fill. Grouping two circles never produces a hole."}],[{"text":"A "},{"text":"clip","b":true},{"text":" hides everything outside a shape. It does not remove it, which is the subject of the next lesson."}]]},{"t":"p","runs":[{"text":"The practical consequence: if you send a die-line to a cutting machine as a "},{"text":"group","i":true},{"text":" of two circles, the machine cuts both outlines and the middle falls out. As a "},{"text":"compound path","i":true},{"text":" with the inner loop reversed, it is one object with a hole, and the operator’s software reads it as one closed cut with an interior."}]},{"t":"h2","id":"where-you-will-meet-this-again","runs":[{"text":"Where you will meet this again"}]},{"t":"p","runs":[{"text":"A logo with counters that fill solid after import. A map where the lakes print as land. An envelope die-line whose window prints as a block. A vinyl cut where the inside of every “e” is cut as a separate piece. All the same rule."}]}],"check":{"question":[{"text":"A five-pointed star is drawn as a single path without lifting the pen, so the path crosses itself and the central pentagon has a winding number of 2. It renders as a solid star in one application and as a star with a pentagonal hole in another. Why?"}],"options":[{"text":[{"text":"The second application imported the path as a group rather than a compound path, so the inner region became a separate object."}],"correct":false,"tempting":[{"text":"A group would show two independent objects with their own fills; the hole appears with no extra object present, because it is a fill-rule decision on one path."}]},{"text":[{"text":"The path was left open in the second application, and open paths fill only their outermost loop."}],"correct":false,"tempting":[{"text":"Open paths are filled as if closed by a straight line back to the start; openness changes the stroke, not the winding calculation."}]},{"text":[{"text":"One uses non-zero winding, where 2 counts as inside, and the other uses even-odd, where 2 crossings count as outside."}],"correct":true,"tempting":null},{"text":[{"text":"The second application converted the path to even-odd because the subpaths run in opposite directions."}],"correct":false,"tempting":[{"text":"There is only one subpath here, so there are no opposing directions to detect. Direction matters for non-zero, but the difference between the two renderings is the rule itself."}]}],"order":[1,3,2,0],"why":null},"prev":{"slug":"a-path-has-no-thickness","title":"A path has no thickness","minutes":9},"next":{"slug":"clipping-hides-it-does-not-remove-it","title":"Clipping hides; it does not remove","minutes":8}}}