AU2003200347C1  A Method for Stroking Flattened Paths  Google Patents
A Method for Stroking Flattened Paths Download PDFInfo
 Publication number
 AU2003200347C1 AU2003200347C1 AU2003200347A AU2003200347A AU2003200347C1 AU 2003200347 C1 AU2003200347 C1 AU 2003200347C1 AU 2003200347 A AU2003200347 A AU 2003200347A AU 2003200347 A AU2003200347 A AU 2003200347A AU 2003200347 C1 AU2003200347 C1 AU 2003200347C1
 Authority
 AU
 Australia
 Prior art keywords
 point
 points
 sequence
 boundary
 path
 Prior art date
 Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
 Ceased
Links
Description
S&F Ref: 621202
AUSTRALIA
PATENTS ACT 1990 COMPLETE SPECIFICATION FOR A STANDARD PATENT
ORIGINAL
Name and Address of Applicant: Actual Inventor(s): Address for Service: Invention Title: Canon Kabushiki Kaisha 302, Shimomaruko 3chome, Ohtaku Tokyo 146 Japan Keith Harwood Spruson Ferguson St Martins Tower,Level 31 Market Street Sydney NSW 2000 (CCN 3710000177) A Method for Stroking Flattened Paths ASSOCIATED PROVISIONAL APPLICATION DETAILS [33] Country [31] Applic. No(s) AU PS0384 [32] Application Date 07 Feb 2002 The following statement is a full description of this invention, including the best method of performing it known to me/us: 5815c 1 A METHOD FOR STROKING FLATTENED PATHS Technical Field of the Invention The present invention relates generally to computer graphics and, in particular, to a method and apparatus for stroking flattened paths.
Background Art The introduction of personal computers popularised the use of computer graphic systems allowing usercomputer interaction. Typical computer graphic systems may display and print text, images, polygons, lines, curves and many other objects. These lines and curves may in some instances be stroked, giving the lines and curves an appearance of width when displayed or printed by the computer graphic render system.
Line and curve stroking is particularly useful in drawing and printing applications or display device software such as video drivers, printer drivers and interactive Computer Aided Design (CAD) systems.
Figs. 14 illustrate a conventional process for stroking a path for display on an output device.
Graphics languages describe geometric figures in terms of paths. As an example, Fig. 1 shows a path 50 made up of a straightline segment 55 between points 51 and 52, a curved segment 56 between points 52 and 53 and a curved segment 57 joining points 53 and 54. Points 51 and 54 are end points of the path 50 and points 52 and 53 are join points of the path Fig. 2 shows a path 59 that is a stroked version of path 50, having an appearance of greater width. In Fig. 2, the stroked path 59 is superimposed on path 50 to illustrate the relation between the paths 50, 59.
Most graphics display devices cannot display continuous smooth curves.
Instead, smooth curves are approximated by a sequence of short straight lines. Fig. 3 shows a path 65 that is a flattened version of path 50. There is no change to the straight 621202.doc 2line segment 55 joining points 51 and 52, but the two curved segments 56, 57 are each approximated by three straightline segments. Segment 56 is replaced by a straight line joining point 52 to point 61, a straight line joining point 61 to point 62 and a straight line joining point 62 to point 53. Similarly, the flattening method replaces segment 57 with a straight line joining point 53 to point 63, a straight line joining point 63 to point 64 and a straight line joining point 64 to point 54.
The points 6164 introduced by the flattening procedure are termed 'bends'. In practice a greater number of bends would be introduced to give a better approximation of path 50. The flattened path 65 only has four bends 6164 so that the effects of the flattening procedure are clearly visible.
Fig. 4 shows a stroked path 66 obtained by stroking the flattened path 65. Path 66 is thus a flattened version of path 59. However, the flattened stroked path 66 has some undesirable visual features. Apart from the lack of smoothness, the mitred join 80b at point 52 is lopsided, unlike the original corresponding join 80a. The join 60b at point 53 is short compared with the original join 60a and the orientation of the squaredoff end at end point 54 differs from the orientation of the original squaredoff end 70a. In addition, line 66 has the correct thickness on the straight sections between points, but has the wrong thickness at points such as 52, 53 that are on the original curve.
Flattening a curve and then stroking the flattened curve does not provide the desired appearance. A conventional alternative is to construct a curved path corresponding to the boundary of the stroked path and then to flatten the curved boundary path. However, flattening curved paths is a computationally expensive operation, and if the flattened path is required for other purposes, repeating the flattening in order to stroke the path is inefficient.
621202.doc 3 There is thus a need for an efficient method of stroking a flattened path such that the thickness of the stroked line is correct and all end points and joins have the correct size and orientation.
Summary of the Invention It is an object of the present invention to substantially overcome, or at least ameliorate, one or more disadvantages of existing arrangements.
According to a first aspect of the invention, there is provided a method of stroking a flattened path comprising a series of straight lines joining a sequence of points, at least one point in said sequence being introduced into said sequence when flattening an original path to generate said flattened path, said method comprising the steps of: calculating, for said at least one point, a first quadratic spline passing through said at least one point and two other points in said sequence; constructing a tangent for each of said sequence of points, wherein the tangents corresponding to said at least one point and said two other points are construction lines of said first quadratic spline; locating, for a current point in said sequence, a first boundary point on a first side of said flattened line and a second boundary point on a second side of said flattened line, wherein said boundary points are distanced from said current point by half a predetermined stroke width and wherein said boundary points lie on a vector orthogonal to the tangent at said current point; repeating step for all points in said sequence; and joining said boundary points to form a boundary of a stroked path.
According to a second aspect of the invention, there is provided a method of stroking a flattened path comprising a series of straight lines joining a sequence of points, at least one point in said sequence being introduced into said sequence when flattening an original path to generate said flattened path, said method comprising the steps of: 621202.doc 4calculating, for said at least one point, a first quadratic spline passing through said at least one point and two other points in said sequence; constructing a tangent for each of said sequence of points, wherein the tangents corresponding to said at least one point and said two other points are construction lines of said first quadratic spline; locating, for a current point in said sequence, a first boundary point on a first side of said flattened line and a second boundary point on a second side of said flattened line, wherein said boundary points are distanced from said current point by half a predetermined stroke width and wherein said boundary points lie on a vector orthogonal to the tangent at said current point; repeating step for all points in said sequence; and joining said boundary points to form a boundary of a stroked path.
According to a second aspect of the invention, there is provided a method of stroking a flattened path wherein said flattened path is derived from an original path comprising a first series of lines joining a first sequence of points wherein at least one of said first series of lines is a curve and wherein said at least one curve is replaced in said flattened path by a second series of straight lines between bend points such that said flattened path comprises straight lines between a second sequence of points that is a union of said first sequence of points and said bend points, said method comprising the steps of: defining a direction of travel along said second sequence of points; constructing, if a current point in said second sequence of points is one of said bend points, a first control point of a first quadratic spline passing through said current bend point, a preceding point in said direction of travel and a following point in said direction of travel; defining a tangent through the current point in said second sequence wherein 621202.doc if said current point is a member of said first sequence of points and said current point is a neighbour of one of said bend points, said tangent is a line joining said current point to said first control point, and wherein (ii) if said current point is one of said bend points, said tangent is a construction line of said first quadratic spline joining a first line between said preceding point and said first control point and a second line joining said following point and said first control point; calculating, for said current point in said second sequence of points, a boundary point on a stroked path distanced from said current point by half a predefined stroke width and positioned on a vector orthogonal to said tangent; joining said boundary point to a boundary point corresponding to a preceding point in said second sequence of points to form a boundary segment of a stroked path; repeating steps to for all points in said second sequence of points; reversing said direction of travel; and repeating steps to According to a further aspect of the invention, there is provided a method of stroking a flattened path wherein said flattened path is derived from an original path comprising a first series of lines joining a first sequence of points wherein at least one of said first series of lines is a curve and wherein said at least one curve is replaced in said flattened path by a second series of straight lines between bend points such that said flattened path comprises straight lines between a second sequence of points that is a union of said first sequence of points and said bend points, said method comprising the steps of: defining a direction of travel along said second sequence of points; constructing, if a current point in said second sequence of points is one of said bend points, a first control point of a first quadratic spline passing through said 621202.doc 6current bend point, a preceding point in said direction of travel and a following point in said direction of travel; defining a tangent through the current point in said second sequence wherein if said current point is a member of said first sequence of points and said current point is a neighbour of one of said bend points, said tangent is a line joining said current point to said first control point, and wherein (ii) if said current point is one of said bend points, said tangent is a construction line of said first quadratic spline joining a first line between said preceding point and said first control point and a second line joining said following point and said first control point; calculating, for said current point in said second sequence of points, a left boundary point and a right boundary point on a stroked path, each said boundary point distanced from said current point by half a predefined stroke width and positioned on a vector orthogonal to said tangent; joining said left boundary point to a left boundary point corresponding to a preceding point in said second sequence of points to form a left boundary segment of a stroked path; joining said right boundary point to a right boundary point corresponding to said preceding point in said second sequence of points to form a right boundary segment of said stroked path; repeating steps to for all points in said second sequence of points.
According to another aspect of the invention, there is provided apparatus for stroking a flattened path comprising a series of straight lines joining a sequence of points, at least one point in said sequence being introduced into said sequence when flattening an original path to generate said flattened path, said apparatus comprising: 621202.doc 7means for calculating, for said at least one point, a first quadratic spline passing through said at least one point and two other points in said sequence; means for constructing a tangent for each of said sequence of points, wherein the tangents corresponding to said at least one point and said two other points are construction lines of said first quadratic spline; means for locating, for each point in said sequence of points, a first boundary point on a first side of said flattened line and a second boundary point on a second side of said flattened line, wherein said boundary points are distanced from a current one of said points by halfa predetermined stroke width and wherein said boundary points lie on a vector orthogonal to the tangent at said current one of said points; and means for joining said boundary points to form a boundary of a stroked path.
According to another aspect of the invention, there is provided apparatus for stroking a flattened path wherein said flattened path is derived from an original path comprising a first series of lines joining a first sequence of points wherein at least one of said first series of lines is a curve and wherein said at least one curve is replaced in said flattened path by a second series of straight lines between bend points such that said flattened path comprises straight lines between a second sequence of points that is a union of said first sequence of points and said bend points, said apparatus comprising: means for defining a direction of travel along said second sequence of points; means for constructing, if a current point in said second sequence of points is one of said bend points, a first control point of a first quadratic spline passing through said current bend point, a preceding point in said direction of travel and a following point in said direction of travel; 621202.doc 8means for defining a tangent through the current point in said second sequence wherein if said current point is a member of said first sequence of points and said current point is a neighbour of one of said bend points, said tangent is a line joining said current point to said first control point, and wherein (ii) if said current point is one of said bend points, said tangent is a construction line of said first quadratic spline joining a first line between said preceding point and said first control point and a second line joining said following point and said first control point; means for calculating, for said current point in said second sequence of points, a boundary point on a stroked path distanced from said current point by half a predefined stroke width and positioned on a vector orthogonal to said tangent; means for joining said boundary point to a boundary point corresponding to a preceding point in said second sequence of points to form a boundary segment of a stroked path; means for processing all points in said second sequence of points in said direction of travel; means for reversing said direction of travel; and means for processing all points in said second sequence of points in said reversed direction of travel.
Other aspects of the invention are also disclosed.
Brief Description of the Drawings A number of embodiments of the present invention will now be described with reference to the drawings, in which: Fig. I shows an example of a path to be displayed on a graphics display; Fig. 2 shows a stroked version of the path of Fig. 1; 621202.doc 9 Fig. 3 shows a flattened version of the path of Fig. 1; Fig. 4 shows a stroked version of the path of Fig. 3; Fig. 5 is a flow chart of a method for stroking a flattened path; Fig. 6A is a flow chart of a step of the method of Fig. 5 in the case that a current point on the path is an end or join followed by a bend; Fig. 6B is a flow chart of a step of the method of Fig. 5 in the case that a current point on the path is a bend; Fig. 6C is a flow chart of a step of the method of Fig. 5 in the case that a current point on the path is an end or join preceded by a bend; Fig. 7 is an example of a path used to illustrate the method of Figs 56C; Fig. 8 illustrates the method of Fig. 6A applied to the path of Fig.7; Fig. 9 illustrates a further step of the method of Fig. 6A applied to the path of Fig. 7; Fig. 10 illustrates the method of Fig. 6B applied to the path of Fig. 7; Fig. 11 illustrates the method of Fig. 6C applied to the path of Fig. 7; Fig. 12 shows the final result of applying the method of Figs. 56C to the path of Fig. 7; and Fig. 13 is a schematic block diagram of a generalpurpose computer upon which arrangements described can be practiced.
Detailed Description including Best Mode Where reference is made in any one or more of the accompanying drawings to steps and/or features, which have the same reference numerals, those steps and/or features have for the purposes of this description the same function(s) or operation(s), unless the contrary intention appears.
Some portions of the description which follows are explicitly or implicitly presented in terms of algorithms and symbolic representations of operations on data 621202.doc within a computer memory. These algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here, and generally, conceived to be a selfconsistent sequence of steps leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated. It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like.
It should be borne in mind, however, that the above and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise, and as apparent from the following, it will be appreciated that throughout the present specification, discussions utilising terms such as "scanning", "calculating", "determining", "replacing", "generating" "initialising", "outputting", or the like, refer to the action and processes of a computer system, or similar electronic device, that manipulates and transforms data represented as physical (electronic) quantities within the registers and memories of the computer system into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
The present specification also discloses apparatus for performing the operations of the methods. Such apparatus may be specially constructed for the required purposes, or may comprise a generalpurpose computer or other device selectively activated or reconfigured by a computer program stored in the computer. The algorithms and displays presented herein are not inherently related to any particular computer or other apparatus.
Various generalpurpose machines may be used with programs in accordance with the 621202.doc llteachings herein. Alternatively, the construction of more specialised apparatus to perform the required method steps may be appropriate. The structure of a conventional generalpurpose computer will appear from the description below.
In addition, the present specification also discloses a computerreadable medium comprising a computer program for performing the operations of the methods. The computerreadable medium is taken herein to include any transmission medium for communicating the computer program between a source and a destination. The transmission medium may include storage devices such as magnetic or optical disks, memory chips, or other storage devices suitable for interfacing with a generalpurpose computer. The transmission medium may also include a hardwired medium such as exemplified in the Internet system, or wireless medium such as exemplified in the GSM mobile telephone system. The computer program is not intended to be limited to any particular programming language and implementation thereof. It will be appreciated that a variety of programming languages and coding thereof may be used to implement the teachings of the disclosure contained herein.
Before proceeding with a description of the embodiments, a brief review of terminology is discussed herein. 'End points' and 'joins' are points on a path that are inputs to the methods described herein. 'Bends' are points on a flattened path that are introduced by the flattening procedure.
In the following description, a point i is described by the coordinate pair zi=(xiyj. Thus, the zi are vectors and operations on the zi are vector operations.
The method of stroking a flattened path described herein is preferably practiced using a generalpurpose computer system 900, such as that shown in Fig. 13 wherein the processes described with reference to Figs. 56C may be implemented as software, such as an application program executing within the computer system 900. In particular, the steps of the described methods are effected by instructions in the software that are carried 621202.doc 12out by the computer. The software may be stored in a computer readable medium, including the storage devices described below, for example. The software is loaded into the computer from the computer readable medium, and then executed by the computer. A computer readable medium having such software or computer program recorded on it is a computer program product. The use of the computer program product in the computer preferably effects an advantageous apparatus for stroking flattened paths.
The computer system 900 comprises a computer module 901, input devices such as a keyboard 902 and mouse 903, output devices including a printer 915 and a display device 914. A ModulatorDemodulator (Modem) transceiver device 916 is used by the computer module 901 for communicating to and from a communications network 920, for example connectable via a telephone line 921 or other functional medium. The modem 916 can be used to obtain access to the Internet, and other network systems, such as a Local Area Network (LAN) or a Wide Area Network (WAN).
The computer module 901 typically includes at least one processor unit 905, a memory unit 906, for example formed from semiconductor random access memory (RAM) and read only memory (ROM), input/output interfaces including a video interface 907, and an I/O interface 913 for the keyboard 902 and mouse 903 and optionally a joystick (not illustrated), and an interface 908 for the modem 916. A storage device 909 is provided and typically includes a hard disk drive 910 and a floppy disk drive 911. A magnetic tape drive (not illustrated) may also be used. A CDROM drive 912 is typically provided as a nonvolatile source of data. The components 905 to 913 of the computer module 901, typically communicate via an interconnected bus 904 and in a manner which results in a conventional mode of operation of the computer system 900 known to those in the relevant art. Examples of computers on which the described arrangements can be practised include IBMPC's and compatibles, Sun Sparcstations or alike computer systems evolved therefrom.
621202.doc 13 Typically, the application program is resident on the hard disk drive 910 and read and controlled in its execution by the processor 905. Intermediate storage of the program and any data fetched from the network 920 may be accomplished using the semiconductor memory 906, possibly in concert with the hard disk drive 910. In some instances, the application program may be supplied to the user encoded on a CDROM or floppy disk and read via the corresponding drive 912 or 911, or alternatively may be read by the user from the network 920 via the modem device 916. Still further, the software can also be loaded into the computer system 900 from other computer readable medium including magnetic tape, a ROM or integrated circuit, a magnetooptical disk, a radio or infrared transmission channel between the computer module 901 and another device, a computer readable card such as a PCMCIA card, and the Internet and Intranets including email transmissions and information recorded on websites and the like. The foregoing is merely exemplary of relevant computer readable mediums. Other computer readable media may alternately be used.
Fig. 5 is a flow chart of a method of stroking a flattened path. The input to the method is a path 500 that has been flattened from an original curve using known methods.
An illustrative example of a flattened path 500 is shown in Fig. 7. Path 100 is the original curve. Points 1 and 3, at the start and end of path 100 respectively, may be either end points orjoins. Points 1, 3 are joins if path 100 is connected to contiguous paths. If there are no contiguous paths, points 1, 3 are end points. The flattened path 500 is made up of straight line 101 joining points 12 and straight line 102 joining points 23.
The flattening method used to generate flattened path 500 ensures that all points 13 on the flattened curve 500 also lie on the original curve 100. The flattening method also ensures that the straight lines 101, 102 joining the points 13 deviate from the original curve 100 by an amount too small to be visible at the resolution of the display device 914, 915. The example of Fig.7 shows an exaggerated deviation between lines 621202.doc 14 101, 102 and curve 100 so that all steps of the construction are visible in Figs. 812. In general the length of line sections making up the flattened path is much shorter than the width of the stroked path.
Path 103, superimposed on path 100, is a desired stroked version of path 100.
Point 11 is a point on the boundary of path 103 corresponding to end point 1. Point a is a general point on the boundary of path 103.
The flattening method approximates path 100 by two straight lines 101, 102.
Line 101 joins point I and point 2, and line 102 joins point 2 and point 3. Point 2 is a bend introduced by the flattening method. Point 12 is a point on the boundary of the desired stroked path 103 corresponding to point 2.
In step 502, software running on computer module 901 marks each point on the flattened line 500 as an end point, a join or a bend. In the example of Fig. 7, points 1, 3 are end points or joins, and point 2 is a bend.
In step 504, the method defines a direction of travel along the flattened path 500.
The direction may be chosen arbitrarily. In the illustrative example, the initial direction of travel is from point 1 to point 3.
In step 506, the method identifies the type of the current point and the type of points adjacent to the current point, where the type may be an end point, a join or a bend.
In step 508 the method processes the current point according to the type identified in step 506 to calculate the boundary of the stroked line to the left of the path 500. Step 508 is described in more detail with reference to Figs. 6A6C.
Next, in step 510, the method checks that all points on the flattened path 500 have been processed. If there are still points to process (the NO option of step 510), the method proceeds to the next point along the direction of travel, and flow control returns to step 506. If all points in the initial direction of travel have been processed (the YES option of step 510), control flow proceeds to step 512.
621202.doc 15 Step 512 checks whether both the forward and reverse directions have been traversed. If the answer is "YES", flow control proceeds to step 516. If the answer is flow control proceeds to step 514, in which the current direction of travel is reversed. In the illustrative example, the reverse direction is from point 3 to point 1.
Once the direction has been reversed, flow control returns to step 506, and step 508 is repeated until the stroke boundary to the left of the new direction of travel has been determined.
When the method reaches step 516, a stroke boundary has been determined on both sides of the flattened path 500. In step 516 the method fills the stroke boundary using a known fill method.
The output of method steps 502516 is a stroked flattened path 518. Fig. 12 is an example of a stroked flattened path 518 derived from the illustrative example of Fig. 7.
In an alternative arrangement, the method of Fig. 5 calculates the stroke boundary to the right of the current direction of travel. In a third arrangement, the method calculates the stroke boundary to both the left and the right of the current point on the flattened path 500. In the third arrangement it is not necessary to traverse the path 500 twice.
Figs. 6A6C are flow diagrams showing step 508 in more detail. Fig. 6A shows the method applied when the current point on the flattened curve 500 is an end or a join followed by a bend. Fig. 6B shows the method of step 508 when the current point is a bend and Fig. 6C shows the method of step 508 when the current point is an end or a join preceded by a bend. In each of the cases shown in Figs. 6A6C there is a bend, and the method acts to approximate the original curve with a quadratic spline passing through the bend. Geometric constructions associated with the quadratic spline are used to determine the boundary of the stroked path.
621202.doc 16 In step 600, software running on the computer module 901 checks whether the current point is an end or join followed by a bend. If this is the case, for example point 1 of line 101, control flow proceeds to step 602. Since bends are constructed when a path between two points is flattened, it follows that end points cannot be bends and consequently every bend has a neighbour on either side.
In step 602, the method uses the current point 1, the following bend 2 and the following point 3 in the direction of travel in order to calculate a control point 6 of a quadratic spline passing through the current point 1 and the two following points 2, 3.
Step 602 is illustrated in Fig. 8, in which point 4 lies halfway along the line 104 joining points 1 and 6. Point 5 lies halfway along the line 105 joining points 3 and 6.
Point 2 lies halfway along the line 106 joining points 4 and If the coordinates of the given points 13 are z, z 2, and z3 the coordinates of the control point 6 are given by: z =2z In step 604, the method calculates the tangent at the current point. From the known properties of quadratic splines, line 104 is a tangent to the curve 100 at point 1.
Because the flattened path 500 is a close approximation to the original path 100, path 104 is a close approximation to the tangent of the original path 100.
In step 608 the method calculates the unit vector u in the direction of the tangent.
The direction of the tangent is the same as the direction of travel along the flattened path 500. The unit vector u is calculated from: Z6 Zt (x 6 X 1 2 +(y 6 y) 2 The unit vector is stored in memory, as it will be used again when the flattened path 500 is traversed in the opposite direction.
621202.doc 17 Next, in step 610, the method rotates the unit vector 900 anticlockwise from the direction of travel. The rotated unit vector is In step 612 the method finds a point 11 on the stroke boundary corresponding to the current point 1. The desired boundary point 11 is a distance d from the current point 1 in the direction of the rotated unit vector ui' where d is half the width of thedesired stroke.
This is illustrated in Fig. 9, in which point 11 is the calculated point on the stroke boundary and line 107 is the rotated unit vector u' Next, in step 614, the method calculates the coefficients of a line 108 that passes through the boundary point 11 calculated in step 612 and that is parallel to the tangent 104 calculated in step 604. The coefficients of line 108 are stored for use in later steps of the method. If the equation of the line 108 has the form Aix+Bzy+C 1 =0 the coefficients are A, u B, x C, x1 yuXyt In step 616 the method checks whether the current point is an end point. If it is an end point (the "YES" option of step 616), flow control proceeds to step 618. If it is a join (the "NO" option of step 616), flow control proceeds to step 620.
In step 618 the method adds an end cap as if the end cap were connected to the straight line 104 connecting the current point I and the control point 6. In this way the end cap is oriented in the correct direction.
In step 620 the method constructs a join to a segment of the boundary of the stroked path calculated in previous steps. If the point on the flattened path 500 prior to the current point 1 is a bend, the boundary of the stroked path is calculated using the method of Fig. 6C. If the point on the flattened path prior to the current point 1 is an end point or a join, previous processing has established a boundary point corresponding to the 621202.doc 18 prior point and a tangent direction at the prior point (not illustrated). In this case, point 11 is connected to the prior boundary point using a method selected from known prior art techniques. For example, if a bevel join is selected, the prior boundary point is joined to point 11 by a straight line. If a round join is selected, the prior boundary point is joined to point 11 using a circular arc of radius d and centred at point 1. If a mitre join is selected, the intersection of a line through the prior boundary point in the direction of the tangent at the prior boundary point with the line 108 of Fig. 9 is calculated. The intersection is joined to both point 11 and the prior boundary point by straight lines.
When either step 620 or step 618 is completed, control flow proceeds to step 622, which simply moves to the next point along the flattened curve 500. The method then proceeds to step 510, as shown in Fig. Fig. 6B is a flow diagram of step 508 in the case when the current point is a bend, for example point 2 in Figs.712. Step 700 checks whether the current point 2 is a bend and, if so, continues to step 702. Because of the way the original curve 100 was flattened, a bend 2 always has a neighbouring point 1, 3 on either side. In addition, the prior point 1 already has an associated boundary point 11. The coefficients of line 108 tangent to the stroke boundary at point 11 have already been calculated (see step 614). In addition, the control point 6 defining a quadratic spline through points 1,2 and 3 has already been calculated.
In step 702 the method calculates the tangent at the current point 2. Because of the way that quadratic splines are calculated, the line 106 that passes through points 4, 2 and 5 is the tangent at point 2. The coordinates of point 5 are: z 5
=(Z
6 In step 704 the method alculates the unit vector v for the tangent 106 as: (XwYv Z 5
Z
2 (x x 2 2 5
Y
2 2 621202.doc 19 Next, in step 706, the unit vector v is rotated 90° anticlockwise from the direction of travel. The rotated unit vector is v in step 708 the method marks a point 12 a distance d from point 2 in the direction ofv', where d is half the width of the desired stroke. Point 12 is a point on the stroke boundary corresponding to point 2. The coordinates of point 12 are:_ z 2 xv) +z2.
At the end of step 708 points 11 and 12 are available. Points 11 and 12 are adjacent points on the stroke boundary and it would be tempting to simply join them with a straight line. However, bearing in mind that the length of a flattened segment 101, 102 is generally much shorter than d, the halfwidth of the stroked line, the length between points 11 and 12 may be too great to be approximated by a straight line. Simply joining point I 1 to point 12 may introduce unsightly comers into what is supposed to be a smooth outline. For this reason, steps 710714 of Fig. 6B construct the boundary of the stroked line as a quadratic spline between points 11 and 12.
The construction of the quadratic spline requires two end points and a control point. Points 11 and 12 are the end points and it is known from the properties of quadratic splines that the control point 16 lies at the intersection of the tangents to the curve at the end points 11, 12. The tangent 108 at point 11 is already known, and the tangent at point 12 is constructed in step 710.
If the equation of the tangent 110 has the form A 2 x+Bv+C=O the coefficients calculated in step 710 are: A Yv B, xv
C
2
X
1 ivXvY 2 621202.doc 20 Next, in step 712, the method calculates the coordinates of the control point 16, which is located at the intersection of the tangents 108 and 110: (XIY~d (BI C 2 B 2C I ICIA2 C2A, B 2 2 I 1 2 2 I 1 B 'A R AR A problem arises if the denominator is zero, implying that points 13 are colinear. However, in this case the bend 2 would not required. It is assumed the flattening algorithm tests for and removes colinear points.
Fig. 10 shows the boundary of the stroked line between points 11 and 12 as straightline segments 111 and 112, constructed as a single step of a quadratic spline. If necessary, further steps of the quadratic spline are constructed, thereby representing the stroke boundary between points 11 and 12 as a greater number of straightline segments.
A predefined flattening criterion is used to determine how many construction steps are required. The criterion is preferably the same as that used in the flattening algorithm, and relates to the resolution of the display device 914. A suitable measure is to calculate the distance from control point 16 to a straight line joining points 11 and 12. If the calculated distance is less than a predefined threshold, the straight line joining points 11 and 12 is used as the stroke boundary. If the calculated distance is greater than the threshold, lines 111 and 112 are constructed and further control points are calculated corresponding to lines Ill and 112 respectively. Depending on the distance of these further control points from their respective lines, lines 111 and 112 may be further subdivided.
Next, in step 716, the method checks whether the next point 3 in the current direction of travel is a bend. If point 3 is not a bend, no further processing is required and flow control proceeds to step 720. If the next point 3 is a bend, then in step 718 the method calculates a new control point analogous to control point 6. The new control point is that associated with a quadratic spline passing through point 2, point 3 and the next point (not shown) along the flattened path 500.
621202.doc 21 In step 720 the method proceeds to the next point along the flattened curve 500 and control flow returns to step 510 of Fig. Fig. 6C is a flow diagram of step 508 in the case that the current point is an end point or join preceded by a bend, for example point 3 in Figs. 712. In this case the control point 6 is already known, as is the tangent 110 at the preceding bend 2.
In step 800 software running on the computer module 901 checks whether the current point 3 is an end point or join preceded by a bend. If this is true, flow control proceeds to step 802, in which the method calculates a tangent at point 3. From the properties of quadratic splines it is known that the line 105 joining point 3 to the control point 6 is a tangent at point 3.
The unit vector w in the direction of tangent 105 is calculated in step 804 from:
*Z
3
Z
6 (x 3
X
6 2 +(y 3 y 6 2 Next, in step 806, the method rotates w clockwise away from the direction of travel by 90°. Point 13 is a point on the boundary of the stroked line a distance d from point 3 in the direction of the rotated unit vector w. In step 808, point 13 is calculated from: z 13d(ywXw) +X3.
In step 810 the method calculates the coefficients of the line 113 parallel to tangent 105 and passing through point 13. If the equation of the line 113 has the form
A
3 x+B3y+C 3 =0 the coefficients calculated in step 810 are:
A
3 Yw
B
3 Xw
C
3 X ywxWY13.
621202.doc 22 Next, in step 812, the method calculates the control point 26 of a quadratic spline that has points 12 and 13 as end points. From the properties of quadratic splines it is known that control point 26 is located at the intersection of tangents 114 and 113, as seen in Fig. 11.
In step 814 the stroke boundary between points 12 and 13 is approximated as a quadratic spline using control point 26 and points 12, 13. Fig. 11 shows one step of the construction of the spline, in which straightline segments 115 and 116 are generated. If line segments 115, 116 do not meet the predefined flatness criterion discussed with reference to step 714, the method performs one or more further steps of the construction of the quadratic spline.
In step 816 the method checks whether the current point 3 is an end point. If point 3 is an end point, flow control passes to step 818, in which an end cap is added to the stroked line 518. If point 3 is not an end point, flow control passes to step 820, in which the method steps forward to the next point on the flattened line 500 in the current direction of travel.
Fig. 12 shows a stroked line 518 after the method of Figs. 56C has been applied in both the forward direction (from points 1 to 3) and the reverse direction (from points 3 to On the return traversal, boundary point 43 is found to the left of point 3, boundary point 42 is found to the left of point 2 and boundary point 41 is found to the left of point 1. A quadratic spline is used as the boundary of the stroked path 518 between points 41 and 42, and another quadratic spine is used to approximate the boundary of the stroked path 518 between points 42 and 43.
The method steps described above all relate to cases which involve a bend on the flattened path 500. Other cases may arise. The current point may be an end or a join preceded by either an end or a join. In all of these cases the curve 100 between the current point and the preceding point is a straight line. The corresponding boundaries of 621202.doc 23 the stroked path are straight lines parallel to the line between the current point and the preceding point.
The method of stroking a flattened path described above allows loops to form on inside bends of the stroked path 518. Loops will arise if the radius of the curve 100 is less than the halfwidth d of the stroked path 518. and only occur between_ userspecified points on the flattened path 500. Loops are acceptable if the path is filled with a nonzerofill rule. It is not acceptable for an evenodd or counting fill rule. In an alternative arrangement, the boundary of the stroked line 518 is edited to remove such loops. The existence of loops can be detected and edited at the method step that produces them. An advantage of the method described herein is that loops do not occur at the bends introduced by the flattening process.
The aforementioned preferred method(s) comprise a particular control flow.
There are many other variants of the preferred method(s) which use different control flows without departing the spirit or scope of the invention. Furthermore one or more of the steps of the preferred method(s) may be performed in parallel rather then sequentially.
Industrial Applicability It is apparent from the above that the arrangements described are applicable to the computer graphics and data processing industries.
The foregoing describes only some embodiments of the present invention, and modifications and/or changes can be made thereto without departing from the scope and spirit of the invention, the embodiment(s) being illustrative and not restrictive.
AUSTRALIA ONLY In the context of this specification, the word "comprising" means "including principally but not necessarily solely" or "having" or "including" and not "consisting only of". Variations of the word comprising, such as "comprise" and "comprises" have corresponding meanings.
621202.doc
Claims (3)
Priority Applications (3)
Application Number  Priority Date  Filing Date  Title 

AUPS0384  20020207  
AUPS0384A AUPS038402A0 (en)  20020207  20020207  A method for stroking flattened paths 
AU2003200347A AU2003200347C1 (en)  20020207  20030204  A Method for Stroking Flattened Paths 
Applications Claiming Priority (1)
Application Number  Priority Date  Filing Date  Title 

AU2003200347A AU2003200347C1 (en)  20020207  20030204  A Method for Stroking Flattened Paths 
Publications (3)
Publication Number  Publication Date 

AU2003200347A1 AU2003200347A1 (en)  20030828 
AU2003200347B2 AU2003200347B2 (en)  20041028 
AU2003200347C1 true AU2003200347C1 (en)  20050421 
Family
ID=33491204
Family Applications (1)
Application Number  Title  Priority Date  Filing Date 

AU2003200347A Ceased AU2003200347C1 (en)  20020207  20030204  A Method for Stroking Flattened Paths 
Country Status (1)
Country  Link 

AU (1)  AU2003200347C1 (en) 
Citations (3)
Publication number  Priority date  Publication date  Assignee  Title 

US5611036A (en) *  19901130  19970311  Cambridge Animation Systems Limited  Apparatus and method for defining the form and attributes of an object in an image 
WO2000063843A1 (en) *  19990416  20001026  Avid Technology, Inc.  A method and apparatus for hierarchically combining regions 
US6271864B1 (en) *  19970630  20010807  Sun Microsystems, Inc.  Representing a path as an object with transformation capability 

2003
 20030204 AU AU2003200347A patent/AU2003200347C1/en not_active Ceased
Patent Citations (3)
Publication number  Priority date  Publication date  Assignee  Title 

US5611036A (en) *  19901130  19970311  Cambridge Animation Systems Limited  Apparatus and method for defining the form and attributes of an object in an image 
US6271864B1 (en) *  19970630  20010807  Sun Microsystems, Inc.  Representing a path as an object with transformation capability 
WO2000063843A1 (en) *  19990416  20001026  Avid Technology, Inc.  A method and apparatus for hierarchically combining regions 
Also Published As
Publication number  Publication date 

AU2003200347B2 (en)  20041028 
AU2003200347A1 (en)  20030828 
Similar Documents
Publication  Publication Date  Title 

Sen et al.  Shadow silhouette maps  
US5325472A (en)  Image displaying system for interactively changing the positions of a view vector and a viewpoint in a 3dimensional space  
US6215496B1 (en)  Sprites with depth  
Hsu et al.  Drawing and animation using skeletal strokes  
US6285779B1 (en)  Floatingpoint complementary depth buffer  
US6982724B2 (en)  Method for antialiasing an object represented as a twodimensional distance field in objectorder  
US20030117425A1 (en)  Electronic simulation of interaction with printed matter  
EP0950988A2 (en)  ThreeDimensional image generating apparatus  
US6434277B1 (en)  Image processing apparatus and method, and medium therefor  
US20040155904A1 (en)  Dynamic rendering of ink storkes with transparency  
US6268865B1 (en)  Method and apparatus for threedimensional painting  
Chaurasia et al.  Depth synthesis and local warps for plausible imagebased navigation  
US5745666A (en)  Resolutionindependent method for displaying a threedimensional model in twodimensional display space  
US7577902B2 (en)  Systems and methods for annotating pages of a 3D electronic document  
US7791617B2 (en)  Method and system for rendering polygons having abutting edges  
US5307451A (en)  Method and apparatus for generating and manipulating graphical data for display on a computer output device  
US6483519B1 (en)  Processing graphic objects for fast rasterised rendering  
EP0134809B1 (en)  Method and apparatus for representation of a curve of uniform width  
US20050151740A1 (en)  Methods and systems for hinting fonts  
EP1453007B1 (en)  Color gradient paths  
US7385612B1 (en)  Distortion of raster and vector artwork  
KR100834596B1 (en)  Image processing apparatus, image processing method, and computer readable recording medium having image processing program  
EP0703550B1 (en)  Utilisation of scanned images in an image compositing system  
KR0125776B1 (en)  Apparatus and method for convertng line segment data to threedimensional data  
US6879717B2 (en)  Automatic coloring of pixels exposed during manipulation of image regions 
Legal Events
Date  Code  Title  Description 

DA2  Applications for amendment section 104 
Free format text: THE NATURE OF THE AMENDMENT IS AS SHOWN IN THE STATEMENT(S) FILED 08 OCT 2004. 

MK14  Patent ceased section 143(a) (annual fees not paid) or expired 