System and method for creating a design tool using a clockwise fill rule
A system and method for creating a design tool using a clockwise fill rule are disclosed. The system creates a design tool for use in an editor, implemented as a feature of application on a server. The design tool provides a user interface allowing a user to create a path of contours using the design tool. For each contour, the design tool provides an interface function to categorize the contour as either a “hole” or a “fill.” For contours designated as “hole,” the design tool automatically orders the points in a counterclockwise fashion, without user interaction. For contours designated as “fill,” the design tool automatically orders the points in a clockwise fashion, without user interaction. In instances where a contour has self-intersections resulting in regions with both clockwise and counterclockwise winding, the design tool orders the points so the majority of an area of the contour winds in a desired direction.
1 . A method for creating a design tool in an interactive graphics system, via executable code stored in a memory coupled to a graphical processing unit, wherein the executable code causes the graphical processing unit to trigger control actions to:
execute an action to present a user interface to a user, to enable the user via the user interface, to create a path of contours, each contour comprising a plurality of points defining the contour, wherein the user interface provides an interface function for the user to categorize each contour as either a hole designation or a fill designation, wherein for contours given the hole designation, the design tool is configured to automatically order the points in a counterclockwise fashion, without user interaction, and for contours given the fill designation, the design tool automatically orders the points in a clockwise fashion without user interaction, wherein in an event that a contour has self-intersections that result in regions with both clockwise and counterclockwise winding, the design tool orders the points so that a majority of an area of each contour winds in a desired direction.
2 . The method according to claim 1 , wherein the design tool transmits an instruction to a rendering engine to draw.
3 . The method according to claim 2 , wherein the design tool in an editor that instructs the rendering engine to fill a region of a resulting path where a winding number is positive.
4 . The method according to claim 3 , wherein the design tool is implemented in an editor application.
5 . The method according to claim 4 , wherein the editor application is a program application coupled to a GPU driver.
6 . The method according to claim 5 , wherein the user interface provides a seamless design experience.
7 . The method according to claim 6 , wherein a clockwise fill rule identifies positive instances.
8 . The method according to claim 1 , wherein a path's fill rule determines if a region should be filled based on a winding number.
9 . A non-transitory computer-readable medium storing instructions that, when executed on a processor, cause the processor to render a graphic, by performing the steps of:
execute an action to present a user interface to a user, to enable the user via the user interface, to create a path of contours, each contour comprising a plurality of points defining the contour, wherein the user interface provides an interface function for the user to categorize each contour as either a hole designation or a fill designation, wherein for contours given the hole designation, a design tool is configured to automatically order the points in a counterclockwise fashion, without user interaction, and for contours given the fill designation, the design tool automatically orders the points in a clockwise fashion without user interaction, wherein in an event that a contour has self-intersections that result in regions with both clockwise and counterclockwise winding, the design tool orders the points so that a majority of an area of each contour winds in a desired direction.
10 . The non-transitory computer-readable medium according to claim 9 , wherein the design tool transmits an instruction to a rendering engine to draw.
11 . The non-transitory computer-readable medium according to claim 10 , wherein the design tool in an editor that instructs the rendering engine to fill a region of a resulting path where a winding number is positive.
12 . The non-transitory computer-readable medium according to claim 11 , the design tool is implemented in an editor application.
13 . The non-transitory computer-readable medium according to claim 12 , the editor application is a program application coupled to a GPU driver.
14 . The non-transitory computer-readable medium according to claim 13 , the user interface provides a seamless design experience.
15 . The non-transitory computer-readable medium according to claim 14 , wherein a clockwise fill rule identifies positive instances.
16 . The non-transitory computer-readable medium according to claim 15 , wherein a path's fill rule determines if a region should be filled based on a winding number.
17 . The non-transitory computer-readable medium according to claim 9 , wherein the design tool assigns an integer winding number to every region of a path, based on a number of loops that cover the area and by determining whether a surrounding loop is clockwise or counterclockwise.
18 . The non-transitory computer-readable medium according to claim 9 , wherein a fill rule associated with the path determines whether the area should be filled, based on a winding number.
19 . The non-transitory computer-readable medium according to claim 18 , wherein any area with a winding number that is nonzero is filled.
20 . The non-transitory computer-readable medium according to claim 18 , wherein any area with a winding number that is at least one of odd and positive is filled.