This disclosure relates to techniques for computer graphics and digital drawing and painting. In particular, this disclosure relates to techniques providing reflection symmetry around a curvilinear path in a drawing context.
In digital drawing and painting (and even using traditional methods), it is often desirable for an artist to use symmetry to create a design. For example, drawing a human or animal face or the front of a car as well as all kinds of abstract geometric objects involve symmetry. The most common type of symmetry in this kind of artistic creation is “vertical symmetry” where the left and right halves of an image are mirrored copies of one another. In traditional painting and drawing, symmetry may be accomplished by using tools like a mirror or tracing or carbon paper. Digital painting tools can make this process much easier and quicker for the artist. Although some painting/drawing digital tools provide for generating mirror symmetric drawings in a linear context, there are other more creative applications of mirror symmetry that would be valuable in digital drawing/painting tools. For example, there are several reasons why performing mirror symmetry using a non-linear axis of symmetry is desirable. First, perfect symmetry across a linear axis does not exist in most of the macroscopic natural world. That is, perfect symmetry is for the most part not lifelike and typically there exists some degree of asymmetry in natural objects, although the asymmetry may be subtle. Thus, in order to render an asymmetric representation, typically a symmetric representation may first be generated and then the symmetric representation may be modified to introduce some asymmetry. For example, minor inflections may be introduced along a path so they appear asymmetrical. Second, in general, it is desirable to allow for a symmetry definition around paths that are not straight lines. Although known techniques exist for performing mirror symmetry around a linear axis, a need exists for performing a symmetry operation on a non-linear (i.e., curvilinear) axis of symmetry.
The present disclosure describes techniques for creating a mirror symmetric image using a curvilinear path or non-linear axis of symmetry in 2-D or 3-D space. For each of a set of sample points comprising an image, a respective tangent line associated with the sample point is computed with respect to the curvilinear axis of symmetry. A linear reflection operation is then performed with respect to the current sample point and the respective tangent line to generate a reflected symmetry point. The operation is performed for each sample point, such that a corresponding tangent line is determined with respect to the curvilinear symmetry axis for each point and a linear reflection is then performed with respect to the sample point and the computed tangent line. As will be appreciated in light of this disclosure, numerous artistic and design applications can benefit from the various techniques disclosed herein for performing a symmetry operation across a non-linear axis of symmetry.
Referring to
If so (‘Yes’ branch of 106), flow continues with 108 and the next sample point is received. In 110, the closest point to the current sample point on the curvilinear path is computed. According to one embodiment of the present disclosure, a distance metric such as the Euclidean distance may be used to calculate the closest point on the curvilinear path. For example, a distance may be computed between each point on the curvilinear path and the current sample point and the point having the minimum distance metric may then be selected. In 112, a tangent line is computed at the previously determined closest point on the curvilinear path. According to one embodiment of the present disclosure, the tangent line may be computed by calculating the discrete derivative at the closest point on the curvilinear path. An analytic method for computing the tangent line at a point is described below.
Once the associated tangent line is determined, a paint reflection operation around a linear axis of symmetry may be performed. Thus, as shown in
Referring to
If not (‘No’ branch of 124), flow continues with 128 and the current sample point is set to the next sample point. In 128, the closest point to the current sample point on the curvilinear path is computed. According to one embodiment of the present disclosure, a distance metric such as the Euclidean distance may be used to calculate the closest point on the curvilinear path. For example, a distance may be computed between each point on the curvilinear path and the current sample point and the point having the minimum distance metric may then be selected. In 130, the closest point on the curved path to the current sample point is determined. In 132, a tangent line is computed at the closest point on the curvilinear path determined in 130. According to one embodiment of the present disclosure, the tangent line may be computed by calculating the discrete derivative at the closest point on the curvilinear path. An analytic method for computing the tangent line at a point is described below.
The steps shown in 118 comprise a method for performing paint reflection around a linear path. In particular, in 134, a representation of a perpendicular line is determined from the current sample point to the closest point on the tangent line determined in 132. In, 136 a reflected symmetry point associated with the current sample point is determined by reflecting the perpendicular line computed in 134 about the tangent line. Flow then continues with 124 such that it is determined whether all sample points have been reflected.
Similarly point P′ 206(b) on curvilinear symmetry path 202 is calculated as the closest point to sample point A′ 208(b) lying on curvilinear symmetry path 202. Tangent line 204(b) may be computed through point P′ 206(b). Perpendicular A′P′ 212(c) may then be computed with respect to sample point A′ 208(b) and tangent line 204(b). Perpendicular A′P′ 212(c) may then be reflected around point P′ 206(b) and tangent line 204(b) to generate reflected perpendicular 212(d) and reflected symmetry point 210(b).
As shown in
An example method for computing a reflected point with respect to a sample point will now be described. For purposes of the present discussion, the vector to the sample point (e.g., 208(a), 208(b)) is referred to as {right arrow over (s)}. According to one embodiment of the present disclosure, for a sample point the closest point on curvilinear symmetry path 202 and its associated vector (herein referred to as p and {right arrow over (p)} respectively) may be computed by scanning through all points on curvilinear symmetry path 202 and computing the Euclidean distance to the sample point and then selecting the point on curvilinear symmetry path 202 having the smallest Euclidean distance.
The slope at the determined closest point on curvilinear symmetry path 202 may then be calculated by computing the discrete derivative as follows:
where n2 and n1 are neighboring points to the computed closest point and nx and ny respectively are the x and y coordinates of neighboring points. The tangent vector may be expressed as.
where {circumflex over (t)} is the unit vector in the tangential direction.
The symmetry point may now be computed by first computing the vector {right arrow over (v)}, which comprises the vector from the sample point to the closest point p such that:
{right arrow over (v)}
p
={right arrow over (v)}−{right arrow over (v)}({right arrow over (v)}·{right arrow over (t)})
Then, the reflected symmetry point is:
{right arrow over (s′)}={right arrow over (s)}−2{right arrow over (v)}p
Batch sample data 306 may comprise samples that have been previously stored, for example in database 318. That is, batch sample data 306 may have been generated and stored in database 318 by a user interacting with a digital painting program/process, for example using painting device 318.
Curvilinear paint reflection module 302 may utilize either streaming sample data 308 or batch sample data 306 to generate reflected sample coordinates 310. A method for computing reflected sample coordinates has been described above. As shown in
It will be understood that network 610 may comprise any type of public or private network including the Internet or LAN. It will be further readily understood that network 610 may comprise any type of public and/or private network including the Internet, LANs, WAN, or some combination of such networks. In this example case, computing device 600 is a server computer, and client application 612 may be any typical personal computing platform
As will be further appreciated, computing device 600, whether the one shown in
In some example embodiments of the present disclosure, the various functional modules described herein and specifically training and/or testing of network 340, may be implemented in software, such as a set of instructions (e.g., HTML, XML, C, C++, object-oriented C, JavaScript, Java, BASIC, etc.) encoded on any non-transitory computer readable medium or computer program product (e.g., hard drive, server, disc, or other suitable non-transitory memory or set of memories), that when executed by one or more processors, cause the various creator recommendation methodologies provided herein to be carried out.
In still other embodiments, the techniques provided herein are implemented using software-based engines. In such embodiments, an engine is a functional unit including one or more processors programmed or otherwise configured with instructions encoding a creator recommendation process as variously provided herein. In this way, a software-based engine is a functional circuit.
In still other embodiments, the techniques provided herein are implemented with hardware circuits, such as gate level logic (FPGA) or a purpose-built semiconductor (e.g., application specific integrated circuit, or ASIC). Still other embodiments are implemented with a microcontroller having a processor, a number of input/output ports for receiving and outputting data, and a number of embedded routines by the processor for carrying out the functionality provided herein. In a more general sense, any suitable combination of hardware, software, and firmware can be used, as will be apparent. As used herein, a circuit is one or more physical components and is functional to carry out a task. For instance, a circuit may be one or more processors programmed or otherwise configured with a software module, or a logic-based hardware circuit that provides a set of outputs in response to a certain set of input stimuli. Numerous configurations will be apparent.
The foregoing description of example embodiments of the disclosure has been presented for the purposes of illustration and description. It is not intended to be exhaustive or to limit the disclosure to the precise forms disclosed. Many modifications and variations are possible in light of this disclosure. It is intended that the scope of the disclosure be limited not by this detailed description, but rather by the claims appended hereto.
The following examples pertain to further embodiments, from which numerous permutations and configurations will be apparent.
Example 1 is a method for performing paint reflection of a plurality of sample points around a curvilinear path, the method comprising receiving a curvilinear path, wherein said curvilinear path comprises a plurality of points and separates a first region from a second region, for a sample point within said first region, determining an associated reflected point in said second region by determining a closest point on said curvilinear path contour, and, performing a linear paint reflection operation with respect to said sample point and said closest point to generate said associated reflected point.
Example 2 is the method of Example 1 wherein performing a linear paint reflection comprises computing a perpendicular from said sample point to said closest point, and, generating a reflected perpendicular from said perpendicular to generate said reflected point, wherein said reflected point comprises an endpoint of said reflected perpendicular.
Example 3 is the method of Example 2, wherein computing a perpendicular further comprises determining a tangent line at said closest point, and, determining said a perpendicular line to said tangent line.
Example 4 is the method according to Example 1, wherein said plurality of sample points and said curvilinear path are generated based on input received from a digital input device.
Example 5 is the method according to Example 1, wherein said curvilinear path is extended beyond an endpoint associated with such curvilinear path by concatenating a straight line at said endpoint, said straight line having a slope associated with a point near said endpoint.
Example 6 is the method according to Example 1, wherein said sample points lie in a 2D space.
Example 7 is the method according to Example 1, wherein said sample points lie in a 3D space.
Example 8 is a system for performing paint reflection of a plurality of sample points around a curvilinear path comprising a processor, wherein said processor is adapted to execute a curvilinear paint reflection process, said process further comprising receiving a curvilinear path, wherein said curvilinear path comprises a plurality of points and separates a first region from a second region for a sample point within said first region, determining an associated reflected point in said second region by determining a closest point on said curvilinear path contour, and, performing a linear paint reflection operation with respect to said sample point and said closest point to generate said associated reflected point.
Example 9 is the system of Example 8, wherein performing a linear paint reflection further comprises computing a perpendicular from said sample point to said closest point, and, generating a reflected perpendicular from said perpendicular to generate said reflected point, wherein said reflected point comprises an endpoint of said reflected perpendicular.
Example 10 is the system of Example 8, wherein said plurality of sample points and said curvilinear path are generated from a digital input device.
Example 11 is the system of Example 8, wherein said curvilinear path is extended beyond an endpoint associated with such curvilinear path by concatenating a straight line at said endpoint, said straight line having a slope associated with a point near said endpoint.
Example 12 is the system of Example 9, wherein computing a perpendicular further comprise determining a tangent line at said closest point, and, determining said a perpendicular line to said tangent line.
Example 13 is the system of Example 8, wherein said sample points lie in a 2D plane.
Example 14 is the system of Example 8, wherein said sample points lie in a 3D space.
Example 15 is a computer program product including one or more non-transitory machine-readable mediums encoded with instructions that when executed by one or more processors cause a process to be carried out for performing paint reflection of a plurality of sample points around a curvilinear path, the method comprising receiving a curvilinear path, wherein said curvilinear path comprises a plurality of points, and separates a first region from a second region, for a sample point within said first region, determining an associated reflected point in said second region by determining a closest point on said curvilinear path contour, and, performing a linear paint reflection operation with respect to said sample point and said closest point to generate said associated reflected point.
Example 16 is the computer program product of Example 15, wherein performing a linear paint reflection further comprises computing a perpendicular from said sample point to said closest point, and, generating a reflected perpendicular from said perpendicular to generate said reflected point, wherein said reflected point comprises an endpoint of said reflected perpendicular.
Example 17 is the computer program product according to Example 15, wherein said plurality of sample points and said curvilinear path are generated from a digital input device.
Example 18 is the computer program product of Example 15, wherein said curvilinear path is extended beyond an endpoint associated with such curvilinear path by concatenating a straight line at said endpoint, said straight line having a slope associated with a point near said endpoint.
Example 19 is the computer program product of Example 16, wherein generating a perpendicular further comprises determining a tangent line at said closest point, and, determining said a perpendicular line to said tangent line.
Example 20 is the computer program product of Example 15, wherein said sample points lie in a 2D plane.