AU2003202435A1 - Generating an Outline of a Stroked Path - Google Patents
Generating an Outline of a Stroked Path Download PDFInfo
- Publication number
- AU2003202435A1 AU2003202435A1 AU2003202435A AU2003202435A AU2003202435A1 AU 2003202435 A1 AU2003202435 A1 AU 2003202435A1 AU 2003202435 A AU2003202435 A AU 2003202435A AU 2003202435 A AU2003202435 A AU 2003202435A AU 2003202435 A1 AU2003202435 A1 AU 2003202435A1
- Authority
- AU
- Australia
- Prior art keywords
- path
- segment
- points
- sub
- generating
- 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.)
- Abandoned
Links
Landscapes
- Image Generation (AREA)
Description
I
S&F Ref: 630407
AUSTRALIA
PATENTS ACT 1990 COMPLETE SPECIFICATION FOR A STANDARD PATENT
ORIGINAL
Name and Address of Applicant: Canon Kabushiki Kaisha 30-2, Shimomaruko 3-chome, Ohta-ku Tokyo 146 Japan Actual Inventor(s): Address for Service: Invention Title: Cuong Hung Robert Cao Spruson Ferguson St Martins Tower,Level 31 Market Street Sydney NSW 2000 (CCN 3710000177) Generating an Outline of a Stroked Path ASSOCIATED PROVISIONAL APPLICATION DETAILS [33] Country [31] Applic. No(s), AU PS1401 [32] Application Date 27 Mar 2002 The following statement is a full description of this invention, including the best method of performing it known to me/us:- 5815c GENERATING AN OUTLINE OF A STROKED PATH Copyright Notice This patent specification contains material that is subject to copyright protection.
The copyright owner has no objection to the reproduction of this patent specification or related materials from associated patent office files for the purposes of review, but otherwise reserves all copyright whatsoever.
Technical Field The present invention relates generally to stroked paths and, in particular, to generating an outline of a stroked path.
Background The introduction of personal computers popularized the use of computer graphic systems for user-computer interaction. Typical computer graphic systems may display and print text, images, polygons, paths and many other objects. These paths may comprise line and/or curve segments, which in some instances may be stroked giving the path an appearance of width when displayed or printed by the computer graphic render system. Path stroking is particular useful in drawing and printing applications, or display device software: such as video drivers, printer driver, and mouse interactive CAD systems.
Typically, computer graphic systems stroke paths in one domain before being transformed to another domain. Most of the existing known computer graphic systems implement stroking methods that approximate paths as line segments and then stroke them in the required domain. These line segments are then transformed to the desired domain prior to rendering. This approach has the disadvantage that the stroking method may, in some instances, breakdown the path into too many line segments, and thus extensive transformation calculations are needed for transforming all the points of the line segments. This approach has the further disadvantage that the transformed line segments in the desired domain may in some instances differ significantly from the shape of the actual stroked path. Thus, in the former case, the outline of the stroked path may contain many unnecessary points to be processed, whereas in the latter case the stroked path does not contain enough points to adequately define the outline of the path, resulting in visual 574871:PWM -M -2distortion or fragmentation of a smooth stroked path. When the scale factors are high, such line fragmentation becomes visible to a user.
The following are examples to highlight the problems of the aforementioned existing stroking method. For example, the existing method may stroke a Bezier curve segment describing a 90-degree arc of radius 5 units, and then scale it by a factor of 10 in both x y direction. The existing stroking method may approximate the Bezier curve segment as 5 line segments, and stroke these line segments. The existing method will then scale these 5 stroked line segments 10 times. This results in 5 segments describing a arc of 50 units radius and clearly results in visual distortion and fragmentation.
In another example, the existing method may stroke a Bezier curve segment describing a arc of radius 50 units and then scale it down by a factor of 1 10 th in both x y direction. The existing method may approximate the Bezier curve segment as 50 line segments, and stroke these line segments. The existing method will then scale these stroked line segments 1 1 1 0 th times. This results in 50 connected line segments describing a 90-degree arc of 5 units radius. However the arc need only require a small number (eg.
of line segments to sufficiently define it. In this case, there are numerous unnecessary transformation calculations (eg. 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 one aspect of the invention, there is provided a method of generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the method comprising the steps of: inputting a path, wherein the path comprises one or more curve segments; and generating, for each curve segment of the path, a plurality of quadratic or higher order Bezier curves, which form that part of the outline of the stroked path corresponding to the curve segment of the path.
According to another aspect of the invention, there is provided a method of generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the method comprising the steps of: determining, for each curve segment, one or more first sets of points and one or more second sets of points, 574871:PWM wherein each point in said one or more first sets is located on one side of the curve segment, and each point in said one or more second sets is located on an other side of the curve segment, and each point of the one or more first and second sets is spaced a distance W/2 from a corresponding point on the curve segment, where W is constant; and generating, for each one of the first and second sets, a quadratic or higher order Bezier curve fitting the set of points, wherein the generated Bezier curves form part of the outline of the stroked path.
According to still another aspect of the invention, there is provided a method of generating an outline of a stroked path, wherein the path to be stroked comprises one or more adjoined cubic Bezier segments, and the method comprising the steps of: segmenting each said cubic Bezier segment into one or more adjoining sub-segments, wherein the cubic Bezier segment is segmented at those points of the segment where the first and second derivatives of the parametric equation of the cubic Bezier segment are zero; determining, for each said sub-segment, a set of points on the sub-segment comprising a starting point of the sub-segment, a first predetermined point intermediate the starting and terminating points, a second predetermined point intermediate the starting and terminating points, and the terminating point of the sub-segment; determining, for each said sub-segment, a first set of points and a second set of points corresponding to the determined set of points on the sub-segment, wherein the first set of points and the second set of points are located on opposing sides of the sub-segment, and each point of the first and second set is spaced a distance W/2 from a corresponding point of the determined set of points on the sub-segment, where W is constant; and generating, for each said subsegment, two cubic Bezier curves respectively fitting the first and second set of points, wherein the generated cubic Bezier curves form part of the outline of the stroked path.
According to still another aspect of the invention, there is provided apparatus for generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the apparatus comprises: means for inputting a path, wherein the path comprises one or more curve segments; and means for generating, for each curve segment of the path, a plurality of quadratic or higher order Bezier curves, which form that part of the outline of the stroked path corresponding to the curve segment of the path.
574871:PWM According to still another aspect of the invention, there is provided apparatus for generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the apparatus comprises: means for determining, for each curve segment, one or more first sets of points and one or more second sets of points, wherein each point in said one or more first sets is located on one side of the curve segment, and each point in said one or more second sets is located on an other side of the curve segment, and each point of the one or more first and second sets is spaced a distance W/2 from a corresponding point on the curve segment, where W is constant; and means for generating, for each one of the first and second sets, a quadratic or higher order Bezier curve fitting the set of points, wherein the generated Bezier curves form part of the outline of the stroked path.
According to still another aspect of the invention, there is provided apparatus for generating an outline of a stroked path, wherein the path to be stroked comprises one or more adjoined cubic Bezier segments, and the apparatus comprises: means for segmenting each said cubic Bezier segment into one or more adjoining sub-segments, wherein the cubic Bezier segment is segmented at those points of the segment where the first and second derivatives of the parametric equation of the cubic Bezier segment are zero; means for determining, for each said sub-segment, a set of points on the subsegment comprising a starting point of the sub-segment, a first predetermined point intermediate the starting and terminating points, a second predetermined point intermediate the starting and terminating points, and the terminating point of the subsegment; means for determining, for each said sub-segment, a first set of points and a second set of points corresponding to the determined set of points on the sub-segment, wherein the first set of points and the second set of points are located on opposing sides of the sub-segment, and each point of the first and second set is spaced a distance W/2 from a corresponding point of the determined set of points on the sub-segment, where W is constant; and means for generating, for each said sub-segment, two cubic Bezier curves respectively fitting the first and second set of points, wherein the generated cubic Bezier curves form part of the outline of the stroked path.
57487 I:PWM According to still another aspect of the invention, there is provided a computer program for generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the computer program comprises: code for inputting a path, wherein the path comprises one or more curve segments; and code for generating, for each curve segment of the path, a plurality of quadratic or higher order Bezier curves, which form that part of the outline of the stroked path corresponding to the curve segment of the path.
According to still another aspect of the invention, there is provided a computer program for generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the computer program comprises: code for determining, for each curve segment, one or more first sets of points and one or more second sets of points, wherein each point in said one or more first sets is located on one side of the curve segment, and each point in said one or more second sets is located on an other side of the curve segment, and each point of the one or more first and second sets is spaced a distance W/2 from a corresponding point on the curve segment, where W is constant; and code for generating, for each one of the first and second sets, a quadratic or higher order Bezier curve fitting the set of points, wherein the generated Bezier curves form part of the outline of the stroked path.
According to still another aspect of the invention, there is provided a computer program for generating an outline of a stroked path, wherein the path to be stroked comprises one or more adjoined cubic Bezier segments, and the computer program comprises: code for segmenting each said cubic Bezier segment into one or more adjoining sub-segments, wherein the cubic Bezier segment is segmented at those points of the segment where the first and second derivatives of the parametric equation of the cubic Bezier segment are zero; code for determining, for each said sub-segment, a set of points on the sub-segment comprising a starting point of the sub-segment, a first predetermined point intermediate the starting and terminating points, a second predetermined point intermediate the starting and terminating points, and the terminating point of the subsegment; code for determining, for each said sub-segment, a first set of points and a second set of points corresponding to the determined set of points on the sub-segment, 574871:PWM wherein the first set of points and the second set of points are located on opposing sides of the sub-segment, and each point of the first and second set is spaced a distance W/2 from a corresponding point of the determined set of points on the sub-segment, where W is constant; and code for generating, for each said sub-segment, two cubic Bezier curves respectively fitting the first and second set of points, wherein the generated cubic Bezier curves form part of the outline of the stroked path.
Brief Description of the Drawings A number of embodiment(s) of the present invention will now be defined with reference to the drawings, in which: Fig. 1 shows a flow chart of a preferred method of generating one or more outlines of one or more stroked paths; Fig. 2 shows a flow chart of the sub-steps of step 21 of Fig. 1 of generating the outline of the currently stroked path; Fig. 3 shows a flow chart of a sub-process 300 for generating an outline of the current Bezier segment of the path; Fig. 4A shows a flow chart of a sub-process 400 for generating end caps for the outline of the stroked path; Fig. 4B shows a flow chart of a sub-process 490 for generating a round end cap; Fig. 5 shows a flow chart of a sub-process 500 for generating joins for the outline of the stroked path; Fig. 6 shows a flow chart of a sub-process 600 for converting an arc segment to Bezier curve(s); Fig. 7 illustrates the conversion of an exemplary arc segment to a Bezier curve by sub-process 500; Fig. 8 shows the desired left and right curves of a cubic Bezier path; Figs. 9A to 9F illustrate 3 typical types of end caps; Fig. 10 shows a left and right outline points of the left and right curves of a path at a point P having a direction vector the stroked path having a stroking width W; Figs. 1 1A and I 1B show two examples of different types of paths; Figs. 12A to 12C illustrates 3 typical types of end caps; 574871 :PWM Fig. 13A to 13C illustrates 3 typical types of joins; Fig. 14 illustrates an exemplary outline of a simple stroked path with a round join and round end caps; Fig. 15A shows an example of an outline of a stroked open path; Fig. 15B shows an example of an outline of a stroked closed path; and Fig. 16 is a schematic block diagram of a general-purpose computer upon which the preferred method 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 of the preferred method that follow are explicitly or implicitly presented in terms of algorithms and symbolic representations of operations on data 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 self-consistent 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 utilizing terms such as "generating", "determining", "computing", "calculating", or the like, refer to the action and processes of a computer system, or similar electronic device, 574871:PWM 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. Similarly, it will be appreciated that throughout the present specification, discussions utilising terms such as "stroked path", "end caps", "joins", etc refer to data stored within the registers and memories or other storage devices, and are representative of drawn lines, particularly for use in computer graphics, such as display and printing software.
The present specification also discloses a general-purpose computer for performing the operations of the method. Alternatively, a dedicated apparatus may be specially constructed for the required purposes, 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 general-purpose machines may be used with programs in accordance with the teachings herein. Alternatively, the construction of more specialized 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 invention also implicitly discloses a computer program, in that it would be apparent to the person skilled in the art that the individual steps of the preferred method described herein are to be put into effect by computer code. 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. Moreover, the computer program is not intended to be limited to any particular control flow. There are many other variants of the computer program which can use different control flows without departing the spirit or scope of the invention.
Furthermore one or more of the steps of the computer program may be performed in parallel rather than sequentially.
Such a computer program may be stored on any computer readable medium.
The computer readable medium may include storage devices such as magnetic or optical 574871:PWM -9disks, memory chips, or other storage devices suitable for interfacing with a general purpose computer. The computer readable medium may also include a hard-wired medium such as exemplified in the Internet system, or wireless medium such as exemplified in the GSM mobile telephone system. The computer program when loaded and executed on such a general-purpose computer effectively results in an apparatus implementing the steps of the preferred method.
The principles of the preferred method defined herein have general applicability to generating an outline of a stroked path, wherein the outline of the stroked path comprises cubic Bezier curves and/or line segments. The preferred method has the advantage that the outline of the stroked path is transformation invariant, because the segments of the outline are either cubic Bezier curves and/or line segments, which are in themselves transformation invariant. Preferably, the preferred method, defines round join, and round end-caps also in term of cubic Bezier curves. Hence the generated outline need only be generated once for the path, and can be saved for subsequent processing.
Before proceeding with a description of the embodiments, a brief review of the terminology as used herein is now discussed.
Stroked path: A stroked path is a drawn line using a pen with specific pen width, end cap, and join styles. Turning now to Fig. 14, there is shown an example of a stroked path 1400. The stroked path 1400 is formed by stroking the path 1410, which in this example comprises two straight-line segments 1412 and 1414. The stroked path 1400 is bounded by an outline 1402, and has a width w, round end caps 1404, and a round join 1406.
Bezier: Any Bezier curve or Bezier segment referred to in the description of the preferred embodiment(s) refers to a cubic Bezier curve or segment, unless otherwise expressed. However, the present invention is not limited to cubic Bezier curves or segments and may include quadratic or other higher order Bezier curves or segments.
Segment: A segment is a portion of a path or sub-path, or a portion of an outline of the stroked path, and is preferably either a Bezier curve segment or a line segment.
574871:PWM Adjoined segments: Adjoined segments are two segments of the path, or an outline of the stroked path, where the end point of the previous segment is the starting point of the next segment.
Sub-path: A sub-path is a list of points, which are used to define a number of adjoined Bezier curve segments or a number of adjoined line segments. Adjoined segments are adjacent segments, where the end point of the previous segment is the starting point of the next segment.
Adioined sub-paths: Adjoined sub-paths are those two sub-paths where the end point of the previous sub-path is the starting point of the next sub-path.
Path: A path is a group of one or more adjoined sub-paths where the end point of the previous sub-path is the starting point of the next sub-path. Turning now to Figs.
1 A and 1 IB, there is shown two exemplary paths to be stroked for the purposes of illustrating the aforementioned terminology. Typically, each path in general comprises one or more adjoined sub-paths of adjoined line segments and/or adjoined Bezier curves.
For example, path 1105 is an open path and comprises two adjoined sub-paths 1110 and 1112, where sub-path 1110 comprises four line segments 1120, 1122, 1124, and 1126, whereas sub-path 1112 comprises only one Bezier curve 1128. Also, adjoined line segments comprise two line segments where the end point of the previous line segment is the starting point of the next line segment (eg. 1120,1122). On the other hand, path 1106 is a closed path and comprises only one sub-path comprising four Bezier curves 1130, 1132, 1134, and 1136. Similarly, adjoined Bezier segments comprise two Bezier segments where the end point of the previous Bezier segment is the starting point of the next Bezier segment (eg. 1130 and 1132).
End cap: An end cap is a segment of the outline at the start and end of an open path. An end cap can be one of the following types but is not limited thereto: butt, round, and square. Turning now to Figs. 12A, 12B, and 12C there are shown three examples of end caps, a butt end cap 1202, a square end cap 1204, and a round end cap 1206. The butt end cap 1202 is placed abutting the end of the open path 1200 at right angles thereto so as to close the outline 1205 of the stroked path. The square end cap 1204 is in the form of a square that is placed abutting the end of the open path 1200 so as to close the outline 1205 574871:PWM -11of the stroked path. The round end cap 1206 is in the form of a half circular disk that is placed abutting the end of the open path 1200 so as to close the outline 1205 of the stroked path.
Join type: A join is required in the outline of the stroked path, where the tangent at the end of the previous segment of the path is not equal to the tangent at the beginning of the next segment of the path. Turning now to Figs. 13A, 13B, and 13C there are shown three examples of joins, a miter join, a bevel join, and a round join. As can be seen in these examples, the stroking of the path 1300 leaves a gap in the outline 1305 thus requiring ajoin. The bevel and mitre joins are defined by one line segment 1304, and two line segments 1302 respectively and form part of the outline 1305 of the stroked path. A round join 1306 is defined by an arc segment, which can be approximated to one or more Bezier curves, which makes it invariant to linear transformations. The outline 1305 does not require a join at the other side of joins 1302, 1304, and 1306.
Transformation invariant: A curve is said to be transformation invariant if the equation of the curve has the same form as before the transformation. For example, let the linear geometric transformation of cubic bezier control points defining a curve C(t) be P0' TRAN(PO), P1' TRAN(P1), P2' TRAN(P2), P3' TRAN(P3), P4' TRAN(P4), where TRAN( is a linear geometric transformation operator such as: rotation, shearing, scaling, or shifting. It can then be shown that the geometric transformation of a point on curve C(ti) is TRAN(C(ti)) where curve has control points P0', PI', P3', and P4'. Thus the cubic bezier curve C(t) is said to be transformation invariant under such linear geometric transformation. This is a property of bezier curves in general including linear bezier curves i.e. straight lines), quadratic bezier curves, and other higher order bezier curves.
A brief review of the convention as used herein to define the outline of a stroked path is now discussed with reference to the exemplary stroked open and closed paths shown in Figs. 15A and 15B respectively. The preferred method takes as input the path to be stroked and outputs the outline of the stroked path as two curves. The present convention that is used to define these curves will now be described. It would be apparent to those skilled in the art that other conventions are possible.
574871:PWM -12- In the present convention, the outline of any stroked path (eg. 1500, 1550), is defined by 2 curves, namely a left curve (eg. 1505, 1555) and right curve (eg. 1510, 1560). The left and right curves are themselves defined with reference to a starting point (eg. 1511, 1561) of the path and the drawing direction of the path (eg. 1501, 1551). For ease of explanation, the drawing direction is shown in Figs. 15A and 15B by way of arrows on the paths 1501 and 1551. The left and right curves proceed in the same direction as the drawing direction, and are to the left and right of the path (eg. 1501, 1551) respectively. In addition, the outline of a stroked open path (eg. Fig. 15A) is defined by the left (eg. 1505) and right curve (eg. 1510) together forming a closed curve.
On the other hand, the outline of a stroked closed path (eg. Fig. 15B) is defined by the left and right curves (eg. 1555, and 1560 respectively) forming two 2 independent closed curves. The outline of a stroked path is also preferably defined by the same specified join type for joining together adjoined segments of the outline (eg. a round join 1507, and 1557). Preferably, the outline of the adjoined segments at the other side of the join is defined by two points (eg. 1512, 1514). The first point (eg. 1514) defines the end of the outline of the first segment, whereas the second point (eg. 1512) defines the start of the outline of the second segment. In a variation of the preferred method, the variant method calculates the intersection point of the outlines of the first and second segments of the adjoined segments. The outline is instead defined by this intersection point.
Where the outline is of a stroked open path (eg. Fig. 15A), both the right and left curves start at the same point on the outline adjacent the starting point 1511. Specifically, the left and right curves start at a point (eg. 1503) on the outline of the path to the left of the drawing direction. This starting point (eg. 1503) of the outline is spaced from the starting point (eg. 1511) of the path (eg. 1501) by a distance equal to half the pen width.
Also, the direction of the line connecting the starting point (eg. 1511) of the path and the starting point of the outline (eg. 1503) is perpendicular to the tangent of the first segment of the path (eg. 1501) at the starting point (eg. 1511) of the path. This starting point (eg.
1503) of the outline also coincides with starting point of the adjoining end cap. The right curve (eg. 1501) starts at the starting point (eg. 1503) of the outline and proceeds along the outline of the end cap and hence along the outline of the path in an anti-clockwise 574871:PWM 13direction. The right curve terminates at the end (eg. 1509) of the outline at the other end cap. The left curve starts at the starting point (eg. 1503) and proceeds along the outline of the path and around the outline of the other end cap in a clockwise direction. The left curve terminates at the same point as the right curve (eg. 1509).
Where the outline is of a stroked closed path (eg. Fig. 15B), both the left and right curves (eg. 1550, and 1555) form two 2 independent closed curves. Thus no end caps are required for a stroked closed path. However, there will be required joins to join adjoining line segments. Again, the left (eg. 1555) and right (eg. 1550) curves proceed in the same direction as the drawing direction, and are to the left and right of the drawing direction respectively. The starting points (eg. 1563, 1564) of the left and right curves of a stroked closed path are defined in similar fashion as the starting point (eg. 1503) of the left and right curves of a stroked open path, but are spaced both to the left and right of the path respectively. The left and right curves of a stroked closed path also terminate at the left and right starting points (eg. 1563, 1564).
In some instances, a closed path to be stroked is defined by one or more segments, where the last point of the path is not the same as the first point of the path.
Typically, in these cases, a flag identifies that this path is closed. In these cases, the preferred method adds an extra line segment to the path from the last point of the path to the first point of the path, so that the method can generate an outline of the closed the path.
From the above convention rules, it can be shown that, for any open stroked path, the first point of the left and right curve will be the same. Similarly the last point of the left and right curves will be the same. Thus by reversing the direction of one of the curves of the outline and appending to the end of the other curve of the outline will form a single closed curve. Furthermore, for any closed stroked path, the left curve is a closed curve, ie. the first and last points of the curve are the same. Similarly, the right curve is a closed curve.
Turning now to Fig. 1, there is shown a flow chart of the preferred method 10 of generating one or more outlines of one or more stroked paths. The preferred method processes in sequence one or more paths of a group. The method 10 starts at step 11 574871:PWM 14where any necessary parameters are initialized. For example, during this step 11, the method loads and initializes the pen characteristics for this group, sets the pen width, the type of end cap, and type of join etc. After step 11, the method 10 proceeds to a comparison step 17 where a check is made whether there are any more paths of the said group to be stroked. If the comparison step 17 returns true (yes), the method 10 proceeds to step 19 where the method 10 increments to the next path to be stroked of the said group. After step 19, the method 10 proceeds to step 21, where the method generates the outline of the current stroked path. The method 10 then proceeds to step 23, where the outline of the currently stroked path is subsequently processed. For example, the outline of the currently stroked path can be stored for future usage, transformed and flattened for rendering, or used for hit detection. In this particular case, the paths are stroked having the same pen characteristics. In the case, where paths are to be stroked with different pen characteristics, then preferably the paths are grouped together such that each group contains paths that are to be stroked with a pen having the same pen characteristics, eg.
width, end cap type, join type etc. The method 10 then increments through each group, then each path.
A brief overview of the step 21 of generating an outline of the path now follows.
Step 21 takes as input a path in the form of one or more Bezier curves and/or one or more line segments. The step 21 then generates an outline of the path comprising a left and right curve, each left and right curve comprising one or more Bezier segments and/or one or more line segments. As the Bezier segments and line segments of the outline are each transformation invariant, it follows that the outline of the stroked path overall is also transformation invariant. In this fashion, the preferred method 10 overcomes the problems associated with transformations to another domain. As will be described in more detail below, the preferred method 10 in step 21 computes the outline of a sub-path comprising one or more line segments in a different manner from the outline of a sub-path comprising one or more Bezier segments.
Before discussing these different modes of generating line and Bezier segment outlines, reference is first made to Fig. 10. Fig. 10 shows the desired left and right points of an outline of any path at any point P having a direction vector where the stroked 574871:PWM path has a stroking width W. As will be become apparent to a person skilled in the art, the following equations are applicable to any path comprising, at any point P, any type of segment such as a line segment or a Bezier segment. The path (not shown) has a direction vector P' at a point P on the path, and the left outline point L and right outline point R are spaced at a distance W/2 from the point P at right angles to the direction vector Point C is also spaced at a distance W/2 from P in the direction of the direction vector Thus the vectors PC, PL, and PR can be shown to be: PC Eqn(1) PL PC Rotate(90' anticlockwise) Eqn(2) PR PC Rotate(90' clockwise) Eqn(3) Thus in the generalized case the L, R outline points of any point P of any path can be computed in theory from the following equations, where I L RI W is invariant.
L P PL Eqn(4) R =P PR As would be appreciated by the person skilled in the art, it is desirable the value I L RI W is invariant for any point P on the path. Namely, the width of the stroked path has a constant value W.
Returning now to the overview of step 21. In the case where a sub-path comprises adjoined line segments, step 21 generates, for each line segment of the subpath, a left line segment outline and a right line segment outline each parallel to and spaced W/2 from the sub-path line segment. Preferably, the step 21, in the case of line segment sub-paths, generates and stores only the starting points and end points of the left and right line segment outlines. The preferred method generates the starting and end points of the left and right segment outlines based on the foregoing equations and For example, the starting point of the left segment outline L is calculated such that it is spaced W/2 from the starting point P of the line segment path, where the line LP is perpendicular to the line segment path. Thus, the step 21 generates line segments outlines in which the value I L RI W is substantially invariant.
However, in the case where the sub-path comprises one or more Bezier segments, it is generally not possible to approximate a single left Bezier outline and a 574871:PWM -16single right Bezier outline to fit the set of points L and R of the path P (see Fig. without introducing significant errors. Namely, in this case the difference II L RI WI for the approximated Bezier outlines is not zero and in fact can be significantly greater than zero for a number of points on the path. To overcome this problem, the step 21 divides the Bezier segment of the path into one or more sub-segments. Preferably, the method 10 divides the Bezier segment of the path at the critical points, ie. at the maximum, minimum, and inflection points of the parametric equation defining the Bezier segment of the path. The preferred method 10 then calculates, for each Bezier subsegment, preferably four outline points on each left and right outline corresponding to four points on the Bezier sub-segment based on the foregoing equations and Preferably, these four points on the Bezier sub-segment are: the starting point of the Bezier sub-segment, a second predefined point between the start and end points, a third predefined point between the start and end points, and the end point of the Bezier subsegment. Once this is done, the preferred method 10 then approximates a Bezier segment to fit the four left outline points and similarly for the four right outline points corresponding to these four points on the Bezier sub-segment. The preferred method finally stores the control points of these approximated Bezier segments as part of the left and right curve outlines. In this fashion, the step 21 minimizes the error II L RI WI.
In the case where the path also comprises round joins or round end caps, the step 21 approximates these joins and end caps with Bezier curves. Otherwise, if the joins or end caps comprise line segments, the step 21 adds the starting and end points of these line segments to the outline.
The step 21 of generating the outline of a stroked path can be implemented based on the following pseudo code: OUTLINE GENERATION PSEUDO CODE: SET first-segment TRUE FOR each sub-path belong to the current path FOR each segment belonging to the current sub-path 574871:PWM -17- IF first-segment TRUE Initalised left right curve.
Generate beginning end cap if required.
Set firstsegment FALSE
ELSE
Make join between the previous segment and the current segment.
END IF Generate the outline for the segment.
Make the previous segment current segment.
END FOR END FOR IF first_segment FALSE IF the path is a open path.
Generate the end end cap
ELSE
IF the first point and the last point of the stroked path are not the same Add additional segment from the last point to the first points END IF Generate the join from the last segment to the first segment of the stroked path.
END IF END IF Turning now to Fig. 2, there is shown in more detail a flow chart of the sub-steps of step 21 of Fig. 1 of generating the outline of the currently stroked path. The step 21 of generating the outline of the currently stroked path commences at step 250, where the current path is loaded. The path is preferably a list of one or more sub-paths, where each sub-path is defined by adjoined line segments or defined by adjoined cubic Bezier 574871:PWM -18segments. The sub-paths in the list are arranged in order of the drawing direction.
Preferably, each sub-path Sp is described by the following variables: Variables Description Sp.pts A list of points of the sub-path. Each of these points are in x,y coordinates form which are stored in Sp.pts[i].x and Sp.pts[i].y respectively.
Where the sub-path consists of one or more adjoined line segments, these points represent the start point of the initial line segment, and the end points of subsequent line segments. There is no duplication of points and the points are arranged in order according to the desired drawing direction.
Where the sub-path consists of one or more adjoined cubic Bezier segments, the points represent the control points Po PI P 2
P
3 of the cubic Bezier segments. There is no duplication of the start and end control points and the sets of control points are arranged in order according to the desired drawing direction. For example, [Po P 1
P
2
P
3 P'I P' 2
P'
3 where P'o P3.
Sp.count The number of points stored in the list Sp.pts.
Sp.isend Sp.is_end is set TRUE to indicate that the last point in Sp.pts is the end of the current path.
Sp.is_begin Sp.is_begin is set TRUE to indicate that the first point in Sp.pts is the start of the current path. Otherwise if it is set FALSE, Sp continues from the previous sub-path. The first sub-path of a path has Sp.is_begin set to TRUE. Moreover the last sub-path of a path has Sp.is_end set to TRUE.
The intermediate sub-paths have both Sp.is_end, and Sp.isbegin set to
FALSE.
Sp.is_closed Sp.is_closed is set TRUE to indicate that the path the sub-path is describing is a closed path. Otherwise if it is set FALSE, the path is an open path.
If a path is a closed path, the first point of the path must start and finish at the same point. If the end points are not the same, then the preferred 574871:PWM 19method adds a line segment to the endpoints to form a closed path. This avoids duplication of the start and endpoints.
Sp.isBezier Sp.isBezier is set to TRUE to indicate the points in Sp.pts are controlled points of one or more Bezier segments. Otherwise, if it set FALSE the points are endpoints of one or more line segments.
If Sp.isbegin is FALSE, the first point of the sub-path is the last point of the previous sub-path.
If there are N Bezier segments in a path, and Sp.isbegin TRUE then Sp.count 1 3*N, otherwise Sp.count 3*N.
The method 10 generates during step 21 the outline of the stroked path as two curves, the aforementioned left and right curves. The generated left and right curves of the outline are preferably each described by a list of one or more adjoined sub-paths.
Each of these sub-paths is preferably defined in turn by a list of points defining either one or more adjoined line segments, or one or more adjoined bezier curve segments but not a mixture of both. Preferably, the sub-paths of the left and right curves are also defined by the aforementioned variables in a similar fashion, to that of the sub-paths of the path.
The method 10, as will be described, generates these left and right curves by determining points defining segments of the left and right curves and in general appending these points to the lists of points associated with the current sub-paths of the respective left and right curves. However, where the current segments defined by the currently determined points are of one type a line segment), and the lists of points associated with the current sub-paths of the left and right curves contain points defining segments of a different type bezier curve segments), then the method initialises a new lists of points for the new sub-paths for the left and right curves and appends the points defining the current segments of the one type line segment) to these lists instead. In this fashion, the method 10 generates a list of points for each sub-path 574871:PWM defining either one or more adjoined line segments, or one or more adjoined bezier curve segments. Thus, for ease of explanation, where reference is made in the description to appending points to a list of points, it is intended to mean appending points to the current or new list of points as the case requires, unless the contrary intention appears The method 10, during the step 21 of generating the outline of the stroked path, also uses the following intermediate state variables.
Name Description F The first point of the stroked path.
FL The left outline point of the path at F where the line FL-F is perpendicular to F dir.
FR The right outline point of the path at F where the line FR-F is perpendicular to F dir.
F_dir The directional vector of the first line segment of the stroked path at F.
S The starting point of the current processing segment.
SL The left outline point of the path at S where the line SL-S is perpendicular to S dir.
SR The right outline point of the path at S where the line SR-S is perpendicular to S dir.
S dir The directional vector of the current segment of the stroked path at S.
E The end point of the current processing segment.
EL The left outline point of the path at E where the line EL-E is perpendicular to E dir.
ER The right outline point of the path at E where the line ER-E is perpendicular to E dir.
Edir The directional vector of the current segment of the stroked path at E.
PE The previous segment end point (same as S the current segment start point) 574871:PWM -21 PEL The left outline point of the path at PE of the previous adjoined segment, where the line PEL-PE is perpendicular to PEdir.
PER The right outline point of the path at PE of the previous adjoined segment, where the line PEL-PE is perpendicular to PE dir PE dir The directional vector of the previous segment of the stroked path at PE.
P0 The starting point of the current segment P1 The second control point of the current Bezier segment, or the end point of the current line segment. The current segment can only be a line segment or a Bezier segment at any one instant.
P2 The 3 rd control point of the current Bezier segment.
P3 The 4 th control point of the current Bezier segment.
After the completion of step 200, the method proceeds to step 201, where a flag first_segment is set to TRUE to indicate the first segment of the first sub-path has not yet been processed. This flag is also used to generate proper first segment conditions for the left and right curves (step 211). In addition, the flag is used to indicate that the path is empty, ie. contains no sub-paths (step 222).
The method 10 after setting 201 the firstsegment flag, proceeds to a comparison step 202 to check whether there are any more sub-paths. This comparison step 202, which is the starting point of an outer loop, determines whether there are any more subpaths for processing. If the comparison step 202 determines there are more sub-paths to be processed the method 10 proceeds to step 203 of the outer loop, otherwise if there are no more sub-paths, the method 10 exits the outer loop and proceeds to step 222.
The method 10 during step 203 gets the next sub-path from the path for processing. As mentioned previously, the path is a list of one or more sub-paths, with the sub-paths arranged in order of the drawing direction. The method during step 203 gets the next sub-path in that order which has not been previously processed. After step 203, the method 10 then proceeds to a comparison step 204 for determining whether first_segment flag is set to TRUE or FALSE. If the comparison step 204 determines the first_segment flag is set to TRUE, the method 10 proceeds to step 205, otherwise if the 574871:PWM -22comparison step 204 determines the firstsegment flag is set to FALSE, the method proceeds to step 206.
The method 10 during step 205 sets the intermediate variable P0 to the coordinates contained in the variable sp.pts[0] and sets the variable next pointindex to 1.
In this way, the intermediate variable P0, which indicates the starting point of the current segment, is set to the first point of the current sub-path. Also the nextpoint_index variable is set to 1 so as to indicate that the next point to be processed is the second point of the current sub-path. After completion of step 205, the method proceeds to comparison step 207.
The method during step 206 sets the intermediate variable P0 to the co-ordinates currently contained in the intermediate variable PE and sets the variable nextpoint_index to 0. In this way, the intermediate variable P0, which indicates the starting point of the current segment, is set to the last point of the previous sub-path. Also the nextpoint_index variable is set to 0 so as to indicate that the next point to be processed is the first point of the current sub-path. After completion of step 206, the method proceeds to comparison step 207.
The method 10 after the completion of steps 205 or 206 proceeds to the comparison step 207 which is the starting point of an inner loop whereby the method iterates through each remaining segment (viz each remaining point) of the current subpath. The comparison step 207 determines if the current value of the variable nextpoint_index is less than the value contained in the variable sp.count. If the comparison step 207 determines that the current value of nextpoint index is less than the value of sp.count, the method 10 proceeds to step 208. Otherwise if the comparison step 207 determines that the current value of nextpointindex is greater than or equal to the value of sp.count, the method 10 proceeds to step 221. In this way the comparison step 207 determines if there are no more remaining segments (viz points) in the sub-path to be processed then the method 10 exits the inner loop and proceeds to step 221, otherwise its proceeds to comparison step 208 of the inner loop.
The method 10 during the comparison step 208 determines whether the variable sp.isBezier of the current sub-path of the path is currently set to TRUE. In this fashion, 574871:PWM -23the method 10 determines whether the current sub-path comprises Bezier (sp.isBezier TRUE) or line segments (sp.is_Bezier FALSE). If the comparison step 208 determines that the current sub-path comprises Bezier segments (sp.is_Bezier TRUE), the method proceeds to step 209. On the other hand, if the comparison step 208 determines that the current sub-path comprises line segments (sp.is_Bezier FALSE), the method proceeds to step 210.
The method 10 during step 209 gets Bezier information describing the current Bezier segment. Specifically, the method 10 sets the intermediate state variables P1, P2, P3 to the control point values of the current Bezier segment: P1 sp.pts[next_point_index], Eqn(6) P2 sp.pts[next_point_index Eqn(7) P3 sp.pts[next_point_index Eqn(8) The current values of the intermediate state variables PO, P1, P2, P3 describe the current Bezier segment. It should be noted that, the intermediate state variable PO is previously set during the initial steps 205, 206 for the current sub-path, or set during a previous iteration of step 220 for the current sub-path.
The method 10 during step 209, in addition, sets the following intermediate state variables for the current Bezier segment: S_dir 3(P1 PO), where S_dir is the direction vector of the current segment at its starting point PO; Eqn(9) E_dir 3(P3 P2), where E_dir is the direction of the current segment at its end point P3; E P3, where E and P3 are the end point of the current segment; Eqn(l 1) SL.x PO.x W/2( S_dir.y/ I Sdir|) Eqn(12A) SL.y PO.y W/2(S_dir.x/IS_dirl) Eqn(12B) SR.x PO.x W/2( S_dir.y/ I S_dirl) Eqn(13A) SR.y PO.y W/2(S_dir.x/IS_dirl) Eqn(13B) where SL is the starting left outline point, SR is the starting right outline point, PO is the starting point of the current segment, 574871:PWM -24- S_dir is the direction vector at the starting point PO of the current segment, and W is the pen width; EL.x P3.x W/2( E_dir.y/ I E_dirl) Eqn(14A) EL.y E.y W/2(E_dir.x/IE_dirl) Eqn(14B) ER.x E.x W/2( E_dir.y/ I E_dirl) ER.y E.y W/2(E_dir.x/IE_dirl) Eqn( where EL is the end left outline point, ER the end right outline point, E is the end point of the current segment, E_dir is the direction vector at the end point E of the current segment, and W is the pen width.
The equations (12) to (15) for computing the values for the intermediate variables SL, SR, EL, and ER are special instances of the generalized equations and shown and described above with reference to Fig. Returning now to Fig. 2, the method 10 during step 209 also increments the variable next_point_index to next_point_index 3, thus incrementing to the next control point P1 to be processed during the next iteration. However, at the end of the current iteration, if the incremented variable next_pointindex is greater than or equal to sp.count (see step 207), then there is no next control point P1, and the method 10 exits the inner loop and proceeds to step 221.
On the other hand, if the comparison step 208 determines that the subpath comprises line segments, then the method proceeds to step 210. The method during step 210 gets line information describing the current line segment. Specifically, the method 10 sets the intermediate state variable P1 to the end point of the current line segment: P1 sp.pts[next_point_index] Eqn(16) The current values of the intermediate state variables PO, PI describe the current line segment. It should be noted that, the intermediate state variable PO is previously set during the initial steps 205, 206 for the current sub-path, or set during a previous iteration of step 220 for the current sub-path.
574871:PWM The method 10 during step 210, in addition, sets the following intermediate state variables for the current line segment: S_dir P1 PO, where S_dir is the direction vector at the starting point PO of the current segment; Eqn(17) E_dir S_dir, where E_dir is the direction vector at the end point P1 of the current segment; Eqn(18) E P1, where E is the end point of the current line segment; Eqn(19) The method 10 during step 210 then computes the intermediate state variables SL and SR in accordance with aforesaid equations (12A) to (13B) for the current line segment. The method during step 210 then computes the following intermediate variables: EL SL S_dir ER SR+ S_dir Eqn(21) The method 10 during step 210 lastly increments the variable next_point_index to next_pointindex 1, thus incrementing to the next end point P1 to be processed during the next iteration. However, at the end of the current iteration, if the incremented variable next_point_index is greater than or equal to sp.count (see step 207), then there is no next end point P1, and the method 10 exits the inner loop and proceeds to step 221.
The method 10 after completion of steps 209, or 210 proceeds to comparison step 211, where the comparison step 211 determines whether the first_segment flag is set to TRUE, namely determines whether the current segment is the first segment in the path.
If the comparison step 211 determines that the current segment is the first segment in the path ie first_segment flag=TRUE), the method 10 then proceeds to step 212.
On the other hand, if the comparison step 211 determines the current segment is the not the first segment in the path ie first_segment= FALSE), the method 10 then proceeds to step 213 where a join is generated between the previous segment and the current segment. This step 213 calls a sub-process 500 (Fig. 5) for generating the join, and passes to that sub-process 500 the following intermediate variables: PO the center point of the join; PE_dir the previous segment direction at the center point; PEL-the previous segment left outline point; PER the previous segment right outline point; S_dir 574871:PWM -26the next segment direction at the center point; SL the next segment left outline point; and SR the next segment right outline point. The sub-process 500 also takes as input the pen width W and join type. The sub-process 500 for generating a join is described below in more detail. It should be noted that this aforementioned sub-process 500 is used for generating all joins required for the outline. After completion of step 213, the method proceeds to comparison step 217.
As mentioned previously, if the comparison step 211 determines that the current segment is the first segment in the path ie firstsegment flag=TRUE), the method then proceeds to step 212. The comparison step 212 determines whether sp.is_closed TRUE for the current sub-path of the path, namely it checks whether the current path is an open or a closed path in order to set appropriate initial condition for the left and right curves. If the comparison step 212 determines that the current path is a closed path ie.
sp.isclosed=TRUE), the method 10 proceeds to step 214, where the method 10 sets up variables for the start of the outline of the current closed path, or otherwise the method proceeds to step 215 where the method 10 sets up variables for the start of the outline of the current open path.
As mentioned previously, the left and right curves are also both defined by a list of one or more adjoined sub-paths, where each sub-path is defined in turn by a list of points describing adjoined line segments or adjoined cubic Bezier segments. The subpaths in the list are arranged in order of the drawing direction. Preferably, the sub-paths of the right or left curves have the same data structure as the sub-paths of the path Sp.
For example: Sp.pts, Sp.counts, Sp.is_end, Sp.isclosed, Sp.isBezier.
The method during step 214, sets up the following variables for the start of the outline of the current closed path (ie. Sp.is.closed TRUE). The left and right curves of the outline of a closed path are two individual curves, each of which are closed. Thus end caps are not required for these curves. The method 10 during step 214 resets the points of the first sub-path (ie. Sp.pts) of the right curve so that is contains only the starting point SR of the right curve and also sets the Sp.count of the right curve to one. Similarly, the method 10 resets the points of the first sub-path (ie. Sp.pts) of the left curve so that is contains only the starting point SL of the left curve and also sets the Sp.count of the left 574871:PWM -27curve to one. In addition, the method during step 214 stores the values of the intermediate variables SL, SR, P0, S_dir, in the intermediate variables FL, FR, F, F_dir respectively. These latter intermediate variables describe the location of the outline points SL, SR at the start of the path P0, and the direction Sdir of the path at the start PO.
These values are utilised latter in the method 10 to generate joins at the end of the left and right curves to form properly the closed left and right curves.
The method during step 215, sets up the following variables for the start of the outline of the current open path. The left and right curves of the outline of an open path are themselves open and together form a closed curve (ie. Sp.is.closed FALSE). Thus end caps are required for these curves. The method 10 during step 215 resets the points of the first sub-path (ie. Sp.pts) of the left curve so that is contains only the starting point SL of the left curve and also sets the Sp.count of the left curve to one. Similarly, the method 10 resets the points of the first sub-path (ie. Sp.pts) of the right curve so that is contains only the starting point SL of the left curve and also sets the Sp.count of the right curve to one. It should be noted that in this case, both the left and right curves start at the same point SL on the outline, namely the left outline point at the start of the path P0. In addition, the method 10 during step 215 stores the values of the intermediate variables SL, SR, P0, Sdir, in the intermediate variables FL, FR, F, F_dir respectively. These latter intermediate variables describe the location of the outline points SL, SR at the start of the path P0, and the direction Sdir of the path at the start P0. These values are required during the next step 216 for generating the initial end cap at the start of the right curve.
After completion of step 215, the method proceeds to step 216 where an initial end cap is appended to the right curve in an anti-clockwise direction with respect to the outline. Namely, the one or more points defining the initial end cap are added to the list of points (ie. Sp.pts) of the right curve in order. It should be noted that prior to addition of the one or more points of the end cap, the list of points (ie. Sp.pts) of the right curve contains one entry, the starting outline point SL. This step 216 calls a sub-process 400 for generating the end cap, which is described in more detail below with reference to Fig. 4.
574871:PWM -28- After completion of steps 213, 214, or 216 the method 10 proceeds to comparison step 217. The comparison step 217 determines whether the variable sp.isBezier TRUE for the current sub-path of the path. Namely, the comparison step 217 determines whether the current sub-path of the path is comprised of Bezier segments or line segments. If the comparison step 217 determines that the current sub-path of the path is comprised of Bezier segments (ie. sp.isBezier TRUE), then the method proceeds to step 218, otherwise the method proceeds to step 219.
The method 10 during step 218 generates the outlines of the current Bezier segment of the current sub-path of the path from the given control points stored in the intermediate variables P0, P1, P2, P3, and stroking width W. This step 218 calls a subprocess 300 for generating the outlines of the current Bezier segment, which is described in more detail below with reference to Fig. 3.
The method 10 during step 219 generates the outlines of the current line segment of the current sub-path of the path from the outline points stored in the intermediate variables SL, SR, EL, and ER. That is, step 219 appends the points SL and EL, to the list of points Sp.pts of the left curve in that order. Similarly, step 219 appends the points SR and ER to the list of points Sp.pts of the right curve in that order.
After completion of steps 218, or step 219, the method proceeds to step 220.
The method during step 220 sets the flag firstsegment to FALSE and updates the intermediate variables of the previous segment information, so that the method 10 can generate a join to the next adjoined segment. Specifically, the step 220 sets the values of the intermediate variables PEL, PER, PE, PEdir to EL, ER, E, Edir respectively.
Moreover step 220, sets P0 to E.
After completion of step 220, the method 10 returns to the comparison step 207 to process the next segment in the current sub-path of the path, if any. The method continues in this fashion until all the segments in the current sub-path have been processed. When the method has completed processing all the segments of the current sub-path, the method exits the inner loop at comparison step 207 and proceeds to comparison step 221.
574871:PWM -29- The comparison step 221 checks whether the variable sp.is_end of the current sub-path of the path is set to TRUE. If the variable sp.isend TRUE, this indicates that there are no more sub-paths in the current path and the method 10 proceeds to step 222, otherwise the method 10 returns to comparison step 202 to process the next sub-path in the path (if any). The method 10 checks twice whether there are any more sub-paths to be processed both in steps 221 and 202 for the purposes of integrity.
The comparison step 222 checks whether the flag firstsegment=TRUE. If the comparison step 222 determines the firstsegment flag is TRUE, this indicates that there no sub-paths in the path, hence there are no valid outlines and the step 21 for generating an outline of a stroked path terminates 230, and the method 10 proceeds to step 23 (Fig.
Otherwise, if the comparison step 222 determines the first_segment flag is FALSE, this indicates that the left and right outlines contain a valid outline, and the method proceeds to steps 223, 224, 225 to finalize the outline points for the end of the left and right curves. In this regard, it should be noted the method 10 sets at step 201 the flag first_segment to TRUE and the method 10 sets at step 220 the flag firstsegment to FALSE after the first segment of first sub-path has been processed.
The comparison step 223 determines whether the variable sp.isclosed of the current sub-path of the current path is set to TRUE. Namely, the comparison step 223 determines whether the current path is an open or closed path. If the comparison step 223 determines that the current path is an open path, the method 10 proceeds to step 225 to generate the end cap at the end of the left curve. On the other hand if the comparison step 223 determines that the current path is a closed path, the method proceeds to step 224 to generate a final join.
The method 10 during step 225 generates and appends the final end cap at the end of the left curve in a clockwise direction with respect to the outline. Namely, the one or more points defining the final end cap are added to the list of points (ie. Sp.pts) of the left curve in order after the previous points. This step 225 calls a sub-process 400 for generating the final end cap, which is described in more detail below with reference to Fig. 4. After completion of step 225, the description of the outline of the stroked open 574871:PWM path is now finished, and the step 21 for generating an outline of the currently stroked path terminates 230, and the method 10 then proceeds to step 23 (Fig. 1).
The method 10 during step 224 generates the final join. The step 224 initially determines whether current value of point E is the same as SP. If the points are the same, ie. the sub-path is a closed path, then step 224 calls the previously mentioned sub-process 500 (Fig. 5) to generate the final join. In this particular instance the sub-process 500 takes as its input the following intermediate state variables: F- the center point of the join; E_dir the previous segment direction at the center point; EL- the previous segment left outline point; ER- the previous segment right outline point; F_dir the next segment direction at the center point; FL the next segment left outline point; and FR the next segment right outline point. The sub-process 500 also takes as input the pen width W, and join type.
On the other hand, if step 224 initially determines that the current value of point E is not the same as SP, then as the current path is closed, an extra line segment needs to be added to the path from E to F so as to close the path. If this is the case, step 224 then calculates the following intermediate state variables as follows: PO E; Eqn(22) P1 F; Eqn(23) S_dir (P1 P0); Eqn(24) E_dir S_dir E P1 Eqn(26) The method 10 during step 224 then computes the intermediate state variables SL and SR in accordance with aforesaid equations (12A) to (13B) for the current line segment. The method during step 210 then computes the following intermediate variables: EL SL S_dir Eqn(27) ER SR+ Sdir Eqn(28) The step 224 then calls the sub-process 500(Fig. 5) for generating a join between the last segment of the current sub-path and this extra line segment. The sub-process 500 in this particular instance takes as input the following intermediate state variables: P0 574871:PWM -31 the center point of the join; P_dir the previous segment direction at the center point; PLthe previous segment left outline point; PR the previous segment right outline point; S_dir the next segment direction at the center point; SL the next segment left outline point; SR the next segment right outline point. The sub-process 500 also takes as input the pen width W, and join type.
The step 224 after completion of generating a join between the last segment and the extra line segment then generates the outline of the extra line segment E to F. That is, step 224 appends the points SL and EL, to the list of points Sp.pts of the left curve in that order. Similarly, step 224 appends the points SR and ER to the list of points Sp.pts of the right curve in that order. It should be noted that the points SL and SR are generated and appended to the list of points during the generation of the join.
The step 224 then again calls the sub-process 500 (Fig. 5) for generating the final join between the extra line segment and first segment of the path. The sub-process 500 in this particular instance takes as input the following intermediate state variables: E the center point of the join; Edir the previous segment direction at the center point; EL the previous segment left outline point; center point; FL the next segment left outline point; and FR the next segment right outline point. The sub-process 500 also takes as input the pen width W, and join type.
After the step 224 completes the final join of the current stroked path, the description of the outline of the stroked closed path is now finished, and the step 21 for generating an outline of the currently stroked path terminates 230, and the method 10 then proceeds to step 23 (Fig. 1).
For the purposes of explaining the generation of the outlines of a Bezier segment, reference is made to Fig. 8. Fig. 8 shows the desired left and right curves of a cubic Bezier segment of a path, where I L(t) R(t) I W is invariant. The cubic Bezier segment P(t) of the path commences at P(0) and terminates at The outlines of the cubic Bezier segment P(t) are two curves L(t) and R(t) commencing at L(0) and R(0) and terminating at L(1) and R(1) respectively, which define 2 sets of points which are W/2 distance apart from a point on the Bezier segment and perpendicular to the tangent of the segment at the point That is: 574871 :PWM 32 L(t) Ly(t)] defines the left outline curve of the Bezier segment, and R(t) Ry(t)] defines the right outline curve of the Bezier segment; where P(t) Py(t)] is the Bezier segment of the path, w =the outline width, ie. stroking width.
t 1 and IL(t) R(t) I=W is invariant. Eqn(29) Generally for any differentiable path the function exists. For any points on a path P(t) the left and right curve outlines L(t) and R(t) can be derived in similar fashion as described with reference to Fig. 10 and are as follows are: WxP(t 2 x P' 2 p 2 WxPW =PW(t)Y Eqn(3 1) X yY LY =Py t) -WXP(t)Eqn(32) x y 7 W x P'(t) RY(tW Py Eqn(33) xy Tn the case where the path is a Bezier segment, P(t) and are as follows: A, t' 2 Cx t Pox Eqn(34) Py(t) Ayt? +Byt Cy t±+Poy P 3A t 2B t C Eqn(36) Py'(t) 3Ay t +2By t Eqn(37) 574871:PWM -33 Thus by calculating the values for P(t) and for a value of t from Eqns (34) to (37) and substituting these values into the Eqns (30) to it is possible in theory to obtain the set of values of the desired left curve Ly(t)] and right curve Ry(t)].
However, the inventor has found that it is not possible to approximate the aforementioned desired left and right outlines L(t) and R(t) (viz Eqns 30 to 33), each by a single Bezier curve without introducing significant errors. Namely, the difference 11 L(t) R(t) I I is not zero for all values oft, and in fact can be significantly greater than zero for some values of t. The preferred method 10 solves this problem by breaking the Bezier segment P(t) of the path into sub-segments, whereby the outlines L(t) and R(t) of each sub-segment can themselves be approximated by Bezier curves with minimal error. In this fashion the left and right outline curves of a Bezier segment of a path are each approximated by one or more Bezier segments, which are transformation invariant and approximate the desired left and right outline curves with minimal error.
Preferably each Bezier segment P(t) of the path is segmented into sub-segments commencing and terminating at the critical points: ie. minimum, maximum, and inflection points of the Bezier segment so that Bezier outline curves of such sub-segments can be approximated to the desired outline curves with minimal error. That is, the Bezier segment of the path is preferably segmented at those points t where the first and second derivatives of Py P are zeros, that is where: Py'(t) 3At2 +2Bt +Cy 0 Eqn(38) 3At 2 2Bt C, 0 Eqn(39) Py"(t) =6At 2B 0 6At 2B x 0 Eqn(41) The preferred method computes in the following fashion a Bezier approximation of each left and right outline curve of such a sub-segment from tl to t2 (t12) of the Bezier segment of the path, where (0 tl t2 1).
The preferred method initially determines the set of points L(tl), L(tl tmi(t2- L(tl tm2(t2-tl)), and L(t2) lying on the left curve outline, of the Bezier sub-segment t 1 t 2 where tmi 0.333333, and tm2 0.666667. The set of points L(tl tmi(t2-tl)), L(tl 574871:PWM -34tm2(t2-tl)), and L(t2) are computed using the equations (30) and (37) described above.
Similarly, the preferred method determines the set of points R(tl), R(tl tmi(t2-tl)), R(tl tm2(t2-tl)), and R(t2) lying on the right curve outline, of the Bezier sub-segment tit 2 where tmi and tm2 are preset values and are preferably tmi 0.333333, and tm2 0.666667.
However, other values of tmi and tm2 are possible. These set of points R(tl tmi(t2-tl)), R(tl tm2(t2-tl)), and R(t2) are computed using the equations (30) and (37) described above. It should be noted, that both L(tl) and R(tl) are computed during a previous step.
From these set of points, the control points POleft, Plleft, P 2 1eft, P 3 1eft and POight, Piright,
P
2 right, P 3 right of the left and right curve outlines of the Bezier sub-segment t i t 2 are computed by the preferred method as follows: P3et L(t2)
P
2 1 eft L(tl t, (t2 tl) Plieft L(tl tm 2 (t2 tl) PO L(tl) Eqn(42)
P
3 righ R(t2) P2right R(tl ti, (t2 -tl) N*M- Plright R(tl t, 2 (t2 tl) P0right R(tl) Eqn(43) 1 1 1 1 1 1 1 1 0 1 t3 t2 where N 3 /3 nd M= "m mi l 0 0 1 t 2 tm2 m2 0 0 0 1 0 0 0 1 Preferably, the values of the matrix N*M' are precomputed for efficiencies purposes.
Turning now to Fig. 3, there is shown a flow chart of the sub-process 300 called by step 218 of Fig. 2 for generating a left and right outline curve of the current Bezier segment of the path. The sub-process 300 for generating the left and right curves of the current Bezier segment commences at step 350, where the following data is passed by step 218: W (the stroking width), and PO, P1, P2, P3 the 4 control points defining the 574871:PWM Bezier segment). After step 350, the sub-process 300 proceeds to step 301, where the sub-process 300 computes the corresponding parametric coefficients Ax,y, Bx,y, Cx,y, Dx,y from the Bezier controlled points PO, P1, P2, P3 as follows: Dx,y POx,y; Cx,y 3(Plx,y POx,y) Bxy 3(P2x,y P1x,y) x,y Ax,y P3xy POx,y Bx,y Cx,y where Px,y(t) Ax,y *t 3 Bx,y *t 2 Cx,y *t Dx,y Eqn(44) After completion of step of step 301, the method 10 proceeds to step 302, where the method 10 computes the zero crossings t of the first and second derivative parametric equations (38) to (41) and adds those values to an array T. Specifically, the preferred method 10 during this step 302 calculates the zero crossing values t in accordance with Eqns(45)-(50) from the parametric coefficients derived during step 301 and adds the zero crossings to the array T.
-B
x B x 2 -3AxC x t= B-3A 3A, Bx 2 3 Ax C t 3A Eqn(46) 3Ax By +B 2 -3A,C, t= 3A Eqn(47) By B 3AyC t= Eqn(48) 3A, t= -By /3Ay Eqn(49) t B /3A x After completion of step 302, the method 10 adds at step 303 the values t= 0 and t 1 to the array T. The method 10 then sorts the array T and deletes any value of t which is less than zero or which is greater than one and remove repeated t values.
574871:PWM -36- The array T now contains the parametric values of t defining the sub-segments of the current Bezier segment. After completion of step 304, the method proceeds to step 305, where a variable counter called index is set to zero The method 10 then enters a loop, for processing each sub-segment of the current Bezier segment. The first step of the loop comprises a comparison step 306, which checks whether the current value of the variable index is less than the number of entries in the array T. This comparison step 306 determines whether there are any more remaining sub-segments in the array that are to be processed. That is, if the comparison step 306 determines that the index is less the number of entries in the array T, the method proceeds to step 307, otherwise it exits the loop and terminates 355.
The method 10 during step 307 generates the left and right Bezier segment outlines corresponding to the interval tl T[index] and t2 T[index 1] of the current Bezier segment of the path. Specifically, this step 307 first calculates the values L(tl tmi(t2-tl)), L(tl tm2(t2-tl)), and L(t2), and R(tl tmi(t2-tl)), R(tl tm2(t2-tl)), and R(t2) in accordance with the aforementioned equations (30) to (37) where tin 0.333333, and tm2 0.666667 are predefined values. The values L(tl) and R(tl) were calculated during a previous step and are retrieved for this step. The method then calculates the control points Plleft, P 2 1eft, P 3 1eft and Plright, P 2 right, P 3 right of the left and right Bezier curve outlines of the Bezier sub-segment tit 2 in accordance the aforementioned equations (42) and (43).
After completion of step 307, the method proceeds to step 308, where these computed control points Plleft, P 2 1eft, P 3 1eft and Plright, P 2 right, P 3 right are appended to the lists of points Sp.pts of the left and right curves respectively. It should be noted that it is not necessary to calculate and add the control points POleft, POight to lists of points Sp.pts of the left and right curves as these have already been added during a previous iteration of the method 10. After the control points have been added to the right and left curves the method proceeds to step 309, where the counter is incremented by one After step 309, the method returns to the comparison step 306 for processing of the next subsegment of the current Bezier segment of the path, if any. If there are no more subsegments to process, the comparison step 306 determines that the counter index the 574871:PWM -37number of entries in the array T and thus returns false and the method 10 proceeds to step 310. The step 218 terminates at step 310 and thence the method 10 proceeds to step 220.
Turning now to Fig. 4A, there is shown a flow chart of the sub-process 400 for generating end caps for the outline of the stroked path. The sub-process 400 is called by the method 10 during steps 216 and 225. The sub-process 400 commences at step 450 where a variable designating the type of end cap to be drawn and its associated parameters are input. After step 450, the sub-process 400 proceeds to a comparison step 462, where a check is made whether the end cap variable is a round end cap. If the comparison 462 step 462 reveals that end cap is a round end cap, the sub-process 400 proceeds to step 466, where a round end cap is generated. On the other hand, if the comparison step 462 reveals that the end cap is not a round end cap, the sub-process 400 proceeds to a comparison step 464, where it checks 464 whether the end cap variable is a square end cap variable. If the comparison step 464 reveals that the end cap is a square end cap, the sub-process 400 proceeds to step 468, where a square end cap is generated.
On the other hand, if the comparison step 464 reveals that the end cap is not a square end cap, the sub-process 400 then proceeds to a default step 470 where a butt end cap is generated. After completion of steps 466, 468, or 470, the sub-process finishes 455 and returns to the calling step ie. 216 or 225). The preferred method 10 as described utilises only 3 common types of end caps: BUTT, ROUND, and SQUARE, which are shown in Fig. 9. However, the preferred method 10 is not limited to these types of end caps, and many other types of end caps may be implemented.
The aforementioned step 470 of generating a butt end cap is now described in general with reference to Figs. 9A and 9B. The step of generating a butt end cap first determines whether the end cap to be generated is an anticlockwise butt end cap, that is an end cap at the start of the path (cf. step 216), or an clockwise butt end cap, that is an end cap at the end of the path (cf. step 225). In the case of the anti-clockwise butt end cap (Fig. 9B), the step 470 appends the point SR to the list of points sp.pts of the right curve.
The first two points of the list of points sp.pts of the right curve will as a result be SL, and SR in that order. The point SL having being added to sp.pts during the previous step 215.
In the case of the clockwise butt end cap (Fig. 9A), the step 470 appends the point ER to 574871:PWM -38the list of points sp.pts of the left curve. The last two points of the list of points sp.pts of the left curve will as a result be EL, and ER in that order. The point EL having being added to sp.pts of the left curve during either step 218 or step 219. In this way, the butt end caps are defined by the points in the list of points sp.pts of the left and right curve.
The aforementioned step 468 of generating a square end cap is now described in general with reference to Figs. 9E and 9F. The step of generating a square end cap first determines whether the end cap to be generated is an anticlockwise square end cap, that is the end cap at the start of the path (cf. step 216), or an clockwise square end cap, that is the end cap at the end of the path (cf. step 225). In the case of the anticlockwise square end cap (Fig. 9F), the step 468 first computes the location of the points S 1 and S2 from the current values of the variables SL, SR, S_dir and W. The step 470 then appends the points S1, S2, and SR in that order to the list of points sp.pts of the right curve. The first four points of the list of points sp.pts of the right curve will as a result be SL, S1, S2 and SR in that order. The point SL having being added to the right curve list of points sp.pts during the previous step 215. In the case of the clockwise square end cap (Fig. 9E), the step 468 first computes the location of the points S 1 and S2 from the current values of the variables SL, SR, S_dir, and W. The step 470 then appends the points S 1, S2, and ER in that order to the list of points sp.pts of the left curve. The last four points of the list of points sp.pts of the left curve will as a result be EL, S 1, S2 and ER in that order. The point EL having being previously added to the left curve list of points sp.pts during either step 218 or step 219. In this way, the square end caps are defined by the points in the list of points sp.pts of the left and right curves.
The aforementioned step 466 of generating a round end cap is now described in general with reference to Figs. 9C and 9D. The round end caps shown in Figs. 9C and 9D are defined by a 180 degrees circular arc of radius equal half the stroking width, centered at point P, where the line from the starting point of the arc to the end point of arc is perpendicular to the direction of the stroked segment at P. In accordance with above defined stroking convention, the end cap at the start of the path is generated in an anticlockwise direction and constitutes the beginning of the left curve. That is, the left curve starts at point SL and proceeds along the arc to point SR in the anticlockwise direction 574871 :PWM -39- (Fig. 9D). Similarly, the end cap at the end of the path is generated in clockwise direction and constitutes the end of the right curve. That is, the right curve proceeds along the arc from point EL to point ER in the clockwise direction, where the right curve terminates (Fig. 9C). The step 466 generates the control points of the two adjoined Bezier segments 920, 925 each subtending a 90 degree arc at P.
As can be seen, the steps 468 and 480 for generating are straight forward and will not be discussed any further.
Now turning to Fig. 4B, there is shown a flow chart of the sub-steps of step 466 of the sub-process 400 (Fig. 4A) for generating a round end cap in more detail. The step of generating a round end cap is in the form of a sub-process 490 called by step 466. The sub-process 490 commences at step 480 and takes as input the following parameters: a pointer to the left path, a pointer to the right path, P the center point of the end cap (ie start or end point of the path as the case may be); dir the direction of the path at the center point P. L the left outline point at the center point; R the right outline point at the center point; width the width of the stroking pen; a boolean variable "begin" where TRUE indicates the end cap to be generated is at the start of the right curve, and FALSE indicates that the end cap to be generated is at the end of the left curve.
After step 480, the sub-process 490 proceeds to step 401, where the sub-process 490 generates 7 control points for two adjoined Beziers to define the 2nd and 3rd quadrants of a circle of radius width/2 centered at the origin having a the clockwise direction. The step 401, firstly converts the second quadrant 90 degrees arc, starting at point ending at point and centered at point to a Bezier segment using the sub-process 600 described below with reference to Fig. 6. This subprocess 600 (Fig. 6) generates in this instance the control points P1, P2, P3] defining the Bezier segment representative of the second quadrant. Secondly, the step 401 converts the third quadrant 90 degrees arc, starting at point ending at point C(0, and centered at point to a Bezier segment using the sub-process 600 (Fig. This sub-process 600 generates in this instance the control points [P3, P4, P5, C] defining the Bezier segment representative of the third quadrant. It should be noted that the y-axis is going downward, so the 2 nd and 3 rd quadrants are in an anti-clockwise 574871:PWM direction, and the seven control points are thus arranged in a list in anti-clockwise order P1, P2, P3, P4, P5, After completion of step 401, the sub-process 490 proceeds to comparison step 402.
The comparison step 402 determines whether the current end cap to be generated is an end cap at the beginning of the path. The comparison step 402 determines this with reference to the variable begin. In the event the variable begin is TRUE, the preferred method 10 proceeds to step 403, otherwise it proceeds to step 404.
The steps 403 and 404 both calculate a value for an angle alpha. This angle alpha is required for rotating the aforementioned Bezier segments generated in step 401, so that these segments for this end cap are arranged in the proper direction. Step 403 calculates the value of the angle alpha with respect to the direction of the path at the beginning of the path, whereas step 404 calculates the value of the angle alpha with respect to the direction of the path at the end of the path.
Specifically step 403 computes the value of the angle alpha as follows: alpha Cos'(dir.X/dir)I Eqn (51) Alternatively, the step 403 may calculate alpha in accordance with the following formulae: alpha Sin-'(dir.Y/dirj) Eqn(52) Specifically, step 404 computes the value of the angle alpha as follows: alpha Cos-'(-dir.X/dir) Eqn(53) Alternatively, the step 404 may calculate alpha in accordance with the following formulae: alpha Sin'(-dir.Y/Idirl) Eqn(54) After step 403, or step 404 are completed, the sub-process 490 proceeds to step 405. The sub-process 490 during step 405 rotates the seven control points P1, P2, P3, P4, P5, C] of the list by the angle alpha and stores the results in place in the list. The subprocess 490 then shifts at step 406 the resultant seven control points of the list generated during step 405 to the center point P of the end cap.
After completion of step 406, the list of seven control points P1, P2, P3, P4, P5, C] comprises the following: 574871:PWM -41- A P A Rotate(alpha). Pl= P P1 Rotate(alpha).
P P2 Rotate(alpha).
P3 P P3 Rotate(alpha).
P4 P P4 Rotate(alpha).
P5 P P5 Rotate(alpha).
C P C Rotate(alpha). At this point of the sub-process 490, the control points of the two Bezier segments are aligned with the appropriate end cap, however they are in the clockwise direction.
Thus, after completion of step 406, the sub-process 490 proceeds to a comparison step 407. The comparison step 407 determines whether the current end cap to be generated is an end cap at the beginning of the path. The comparison determines this with reference to the variable begin. In the event the variable begin is TRUE, that is the end cap to be generated is at the beginning of the path, the sub-process 490 proceeds to step 408, otherwise it proceeds to step 409.
In the event the sub-process 490 proceeds to step 409, step 409 reverses the 7 control points of the list, so that the Bezier segments will be drawn in a clockwise direction. Specifically, step 409 swaps A and C in the list, swaps P1 and P5 in the list, and swaps P2 and P4 in the list. After step 409, the sub-process 490 at step 410 appends the seven control points P5, P4, P3, P2, P1, A] to the list of points Sp.pts of the left curve in that order commencing with C. In this fashion, these control points of the Bezier segments define the 180 degree clockwise arc of the round end cap at the end of the path.
In the event the sub-process 490 proceeds to step 408, step 408 appends the seven control points P1, P2, P3, P4, P5, C] to the list of points Sp.pts of the right curve in that order commencing with A. In this fashion, these control points of the Bezier segments define the 180 degree anti-clockwise arc of the round end cap at the beginning of the path.
It should be noted that the first and last point in the list of seven control points should correspond to the L and R point at the center point and may be checked against these values for integrity purposes.
574871:PWM -42- After completion of steps 408 and 410,the sub-process 490 terminates 485 and returns to the calling sub-process 400. As will be apparent to a person skilled in the art, similar sub-processes may be implemented for other non-linear end caps.
Turning now to Fig. 5 there is shown a flow chart of a sub-process 500 for generating joins for the outline of the stroked path. The sub-process 500 is called by steps 213 or 214 (Fig. 2) when required. The sub-process 500 commences at step 550 and takes the following parameters as input: J join style; C the center point of the join (viz end point of the previous segment of the path); PDIR The direction of the previous segment at point C; PL the left outline point spaced W/2 distance from C and perpendicular to PDIR; PR- the right outline point spaced W/2 distance from C and perpendicular to PDIR; CDIR direction of the next segment at C; CL the left outline point spaced W/2 distance from C and perpendicular to CDIR; CR the right outline point spaced W/2 distance from C and perpendicular to CDIR; W the width of the stroking pen; Left a pointer to he left curve to store the join; and Right a pointer to the right curve to store the join.
As will become apparent no join is generated if the arc angle between the PDIR and CDIR center at C is zero or 180°. Moreover the arc angle of any join is always between 0° and 180°.
After completion of the commencement step 550, the sub-process 500 proceeds to step 501. The step 501 initially determines the join style. In the event the join style is bevel, the step 501 appends the points CL and CR to the list of points sp.pts for the left curve and right curve respectively and terminates 555 (not shown). Otherwise, the step 501 performs the following operations. Firstly, the step 501 determines which side, ie.
the right or left curve, the join is to be appended. It should be noted that a join is only required on one side (see Figs. 13A to 13C). The step 501 undertakes this by, setting the variables A and D to A C PDIR, and D C CDIR, then computing the angle ACDanticlockwise, and the setting a variable Join_side in accordance with the following: IF angle ACDanticlockwise is [00, 180°] Joinside NONE IF angle ACDanticlockwise 180° 574871:PWM -43- Join side RIGHT Other wise Join side LEFT.
After completion of step 501, the sub-process 500 proceeds to a comparison step 502. The comparison step 502 checks the value of the variable Join side. In the event the comparison step 502 determines that the Join_side is NONE, the sub-process 500 proceeds to step 555 where the sub-process 500 is terminated. Namely, the comparison step 502 has determined that the previous and next segments are parallel and no join is required. In the event the comparison step 502 determines the Joinside is RIGHT, the sub-process continues to step 504. Namely, the comparison step 502 has determined that a join should be added to the right curve. On the other hand, if the comparison step 502 determines the Joinside is LEFT, the sub-process continues to step 503. In the latter case, the comparison step 502 has determined that a join should be added to the left curve.
Step 503 of the sub-process 500 undertakes essentially two operations. The step 503, firstly makes the right curve continuous from PR to CR, by appending the point CR to sp.pts of the right curve. It should be noted that in this case, the join is to be appended to the left curve, and the right curve opposite the join should made continuous. Secondly, it sets the following parameters for generating an arc outline describing the left join: START PL, which is the start point of the arc defining the left join, and END CL, which is the end point of the arc defining the left join. After completion of step 503, the sub-process 500 proceeds to step 505.
Similarly, the step 504 of the sub-process 500 undertakes essentially two operations. Firstly, the step 504 in order to make the left curve continuous from PL to CL, it appends the point CL to sp.pts of the left curve. It should be noted that in this instance, there is no need for a join on the left curve. Secondly, it sets the following parameters for generating an arc outline describing the right join: set START PR, which is the start point of the arc to define the right join, and END CR, which is the end point of the arc to define the right join. After completion of step 504, the sub-process 500 proceeds to step 505.
574871:PWM -44- Step 505 of the sub-process 500 converts the arc segment from START to END centered on C to one or more Bezier segments. This is undertaken by step 505 by calling and passing the parameters (START, END, C) to a sub-process 600 as will be described below in more detail with reference to Fig. 6. This sub-process 600 in turn returns the control points of the Bezier segment(s) approximating the arc segment.
Following completion of step 505, the sub-process 500 proceeds to a comparison step 506, which checks whether the join side is on the left, viz whether Joinside LEFT.
If this comparison reveals that Joinside LEFT, the sub-process proceeds to step 507, otherwise it proceeds to step 508.
The step 507 of the sub-process 500 appends the control points of the Bezier segment(s) generated during step 505 to sp.pts of the left curve in clockwise order.
Otherwise, the step 508 of the sub-process 500 appends the control points of the Bezier segment(s) generated during step 505 to sp.pts of the right curve in clockwise order. It should be noted that START point is not added as it has been previously added during a previous step.
After completion of steps 507 or step 508, the sub-process 500 terminates at step 555 and returns to the step from which it was called.
For the sake of simplicity, the foregoing sub-process 500 does not show the manner of generating a miter join. Such a sub-process 500 for generating either a bevel, miter and round join is essentially the same as shown in Fig. 5, except a further comparison step is disposed between steps 503, 504 and 505. This comparison step checks whether the join type is a round join or a miter join. In the event, the join is a round join the sub-process 500 proceeds to steps 505, 507, 508 in the normal manner. If however, the join is a miter join, the sub-process 500 proceeds to a step (not shown), where the intersection point of the extended outlines (see Fig. 13A- 1302) is calculated.
The intersection point, and start point of the next segment are then added to the right or left curves in similar fashion as described with reference to steps 506, 507, and 508.
Turning now to Fig. 6, there is shown a flow chart of a sub-process 600 for converting a circular arc segment to one or two Bezier curve(s). This sub-process 600 is called by the steps 505 or 401, when required. For the sake of explanation the steps of 574871:PWM this sub-process 600 are also described with reference to Fig. 7, which shows an exemplary circular arc to be converted to a Bezier curve(s). The sub-process 600 is based on the recognition that a circular arc segment, which is less than or equal to 900 can be approximated by one Bezier curve. For example, a circle can be approximated by four Beziers curves, each of which define 4 quadrants of the circle. On the other hand, if the arc angle is greater than 900, but less than or equal to 1800, the sub-process 600 uses two Beziers segments to approximate the arc. The conversion is correct regardless of the arc direction. Thus sub-process 600 is able to approximate any circular arc segment less than or equal to a half circle with a Bezier curve.
The sub-process 600 commences at step 650 and takes the following parameters as input: START the starting point of the arc, END the end point of the arc, C the center point of the circular arc. It should be noted that for sub-process 600 to generate correct results the following invariance must be true ISTART C1 R, JEND CI R, where R is the radius of the arc. The sub-process 600 after step 650 proceeds to step 601, where the sub-process 600 in effect shifts the center C to origin and correspondingly shifts the start and end points. Specifically, the sub-process sets variables A, B, and M as follows: A START C; B END C; and 3. M (A B)/2 where M represents the midpoint of AB. After completion of step 601, the sub-process 600 proceeds to step 602.
The sub-process 600 during step 602 rotates the arc AB so that it is symmetrical about the positive x-axis. Thus referring to Fig. 7, point A, B, and P in effect become points AA, BB, and PP respectively. As can be seen in Fig. 7, point BB is the reflection of point AA about the x-axis. The step 602 computes the angle of rotation beta of the arc and the position of the point AA in the following manner beta cos 1 (P.x/IPI) or alternatively beta sin' (P.y/IPI), and AA A Rotate(-beta). After completion of step 602, the sub-process 600 proceeds to comparison step 603.
The sub-process 600 during comparison step 603 checks if the angle of the line from the origin to AA is less than 45' If the comparison reveals the angle is less than 45', the sub-process 600 proceeds to the branch 604, 605 where a single Bezier curve is generated approximating the arc. On the other hand, if the comparison reveals the 574871 :PWM -46angle is greater than or equal to 450, the sub-process 600 proceeds to the branch 607-612 where two Bezier curves are generated approximating the arc.
The sub-process 600 during step 604 calculates the 2 middle Bezier control points of the arc AA-BB. As can be seen from Fig. 7, since the arc AA BB is symmetrical about the x-axis, the control points AA, PP1, PP2, BB are also symmetrical about the x-axis.
The step 604 calculates the middle control points as follows: PP[1].x AA.x)/3 P[1].y AA.x*PP[1].x)/AA.y P[2].x PP[1].x P[2].y -PP[1].y Eqn (56) The aforementioned equations Eqn (56) are based on the recognition that: P( t is the midpoint of the arc; P( t AA; P(t=l) BB; and Rcos a, Rsina), where is the arc direction at AA, and where a is the angle the line from the origin to AA makes with the x-axis, with a unknown. After completion of step 604, the sub-process proceeds to step 605.
The sub-process 600 during step 605 reverse rotates by the angle beta the two middle control points PP[1] and PP[2] of the Bezier curve and shifts them back to the center C. That is step 605 computes the final location of the middle control points as follows: P[1] C PP[1] Rotate beta; and P[2] C PP[2] Rotate beta.
After completion of step 605, the sub-process 600 terminates 655, where it returns the values START, and END as the control points defining the generated Bezier curve approximating the circular arc segment.
On the other hand, if the comparison at step 603 reveals that the angle is greater than or equal to 450, the sub-process 600 proceeds to the branch 606-612, where the arc is defined by two adjoined Bezier segments, each defining half the arc. It should be noted that arc has been previously rotated during step 602 see Fig. The step 603 thus defines the first Bezier curve by the AA-PP[3] arc segment, and the second Bezier curve by the PP[3]-BB arc segment, where PP[3] is the mid point of the arc AA-BB, which is 574871:PWM -47lying on the x-axis. Specifically, step 603 sets the following variables in order as follows: PP[3] M (AA+ and M M*R/IMI.
It can be seen that point M is the midpoint of the arc AA-PP[3]. It should be noted that assuming point N is the midpoint of the arc PP[3] BB, then the arc segment M-N is the same as the arc segment AA-PP[3] rotated by the angle(M). The steps 608 to 612 of the sub-process 600 determine the middle control points for the Bezier curve representing the arc segment M-N, then reverse rotate it by the angle(-M) and then reverse rotate it by the angle beta and shift it back to the center C.
That is, the sub-process 600 during step 608 calculates the 2 middle Bezier control points of the arc M-N as follows: PP[1].x AA.x)/3 PP[l].y AA.x*PP[1].x)/AA.y PP[2].x PP[1].x PP[2].y -PP[1].y Eqn (57) After completion of step 608, the sub-process 600 proceeds to step 609. The sub-process 600 during this step 609 computes the rotation angle theta for rotating the Bezier segment M-N back to AA-PP[3]. Specifically, step 609 computes theta as follows: theta= cos-'(M.x/IMI), or alternatively theta sin-'(M.y/IMI). The sub-process 600, after step 609, then rotates at step 610 the Bezier segment M-N to to define arc segment AA- PP[3]. That is, the step 610 sets the following variables as follows: PP[1] PP[1] Rotate(theta); andPP[2] PP[2] Rotate(theta). Thus, at the completion of this step 610, the Bezier segment approximating the arc segment AA-PP[3] is defined by the following control points [AA, PP[1], PP[2], PP[3].
The sub-process 600 after step 610 proceeds to step 611, where step 611 computes the Bezier control points of the Bezier segment approximating the arc segment PP[3]-BB. Specifically, step 611 sets the following variables as follows: PP[4] .x PP[2].x, PP[4].y PP[5] .x PP[1].x, PP[5] .y This is based upon the recognition that the arc segment PP[3] -BB is symmetrical to arc PP[3]-AA about the x-axis. Thus, at the completion of this step 611, the Bezier segment approximating the 574871:PWM -48arc segment PP[3] BB is defined by the following control points PP[4, BB]. After completion of step 611, the sub-process 600 proceeds to step 612.
The sub-process 600 during step 612 reverse rotates by the angle beta the five middle control points PP[1] to PP[5] of the two Bezier curves and shifts them back to the center C. That is step 612 computes the final location of the middle control points of the Bezier curves as follows: P[1] C PP[1] Rotate (beta); P[2] C+ PP[2] Rotate (beta); P[3] C+ PP[3] Rotate (beta); P[4] C+ PP[4] Rotate (beta); and P[5] C+ Rotate (beta).
After completion of step 612, the sub-process 600 terminates 655, where it returns the values (START, and END) as the control points defining the two generated Bezier curves approximating the circular arc segment.
It can thus be seen, the preferred method 10 generates in an efficient manner a transformation invariant outline of a stroked path where the error I L(t) R(t) I W is minimal.
The method of generating an outline of a stroked path is preferably practiced using a conventional general-purpose computer system 1600, such as that shown in Fig.
16 wherein the processes of Figs. 1 may be implemented as software, such as an application program executing within the computer system 1600. In particular, the steps of method of generating an outline of a stroked path are effected by instructions in the software that are carried out by the computer. The software may be divided into two separate parts; one part for carrying out the method of generating an outline of a stroked path; and another part to manage the user interface between the latter and the user. The software may be stored in a computer readable medium, including the storage devices defined 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 generating an outline of a stroked path in accordance with the embodiments of the invention.
574871 :PWM The computer systeml600 comprises a computer modulel601, input devices such as a keyboard 1602 and mouse 1603, and output devices including a printer 1615 and a display device 1614. A Modulator-Demodulator (Modem) transceiver device 1616 is used by the computer module 1601 for communicating to and from a communications network 1620, for example connectable via a telephone line 1621 or other functional medium. The modem 1616 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 1601 typically includes at least one processor unit 1605, a memory unit 1606, for example formed from semiconductor random access memory (RAM) and read only memory (ROM). The computer module 1601 typically also includes input/output interfaces such as a video interface 1607, and an I/O interface 1613 for the keyboard 1602 and mouse 1603, optionally a joystick (not illustrated), and an interface 1608 for the modem 1616. A storage device 1609 is provided and typically includes a hard disk drive 1610 and a floppy disk drive 1611. A magnetic tape drive (not illustrated) may also be used. A CD-ROM drive 1612 is typically provided as a nonvolatile source of data. The components 1605 to 1613 of the computer module 1601, typically communicate via an interconnected bus 1604 and in a manner, which results in a conventional mode of operation of the computer system 1600 known to those in the relevant art. Examples of computers on which the embodiments can be practised include IBM-PC's and compatibles, Sun Sparcstations or alike computer systems evolved therefrom.
Typically, the application program of the preferred embodiment is resident on the hard disk drive 1610 and read and controlled in its execution by the processor 1605.
Intermediate storage of the program and any data fetched from the network 1620 may be accomplished using the semiconductor memory 1606, possibly in concert with the hard disk drive 1610. In some instances, the application program may be supplied to the user encoded on a CD-ROM or floppy disk and read via the corresponding drive 1612 or 1611, or alternatively may be read by the user from the network 1620 via the modem device 1616. Still further, the software can also be loaded into the computer system 1600 from other computer readable medium. Such medium can include magnetic tape, a ROM or 574871:PWM integrated circuit, a magneto-optical disk, a radio or infra-red transmission channel between the computer module 1601 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 mediums may be practiced without departing from the scope and spirit of the invention.
The method of generating an outline of a stroked path may alternatively be implemented in dedicated hardware such as one or more integrated circuits performing the functions or sub functions of generating an outline of a stroked path. Such dedicated hardware may include graphic processors, digital signal processors, or one or more microprocessors and associated memories.
Industrial Applicability It is apparent from the above that the embodiment(s) of the invention are applicable to computer graphics and printing industries. The embodiments of the invention have particular application to line and curve stroking in computer graphics.
Furthermore, in graphic drawing systems such as Microsoft GDI, particularly geometric wide line stroking, the embodiment(s) help to reduce significant number of points for transformation from world coordinates to page coordinates. The embodiment(s) can also be applied in other areas such as hit detection of a stroking path in a CAD system. In a CAD system, where the system has to detect whether a point is outside or inside a stroking path when a high scale factor being applied, the embodiment(s) help in increasing the sensitivity around the outline of the stroking path.
The foregoing defines some embodiment(s) 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.
574871:PWM
Claims (39)
1. A method of generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the method comprising the steps of: inputting a path, wherein the path comprises one or more curve segments; and generating, for each curve segment of the inputted path, a plurality of quadratic or higher order Bezier curves, which form that part of the outline of the stroked path corresponding to the curve segment of the path.
2. A method as claimed in claim 1, wherein the path to be stroked comprises one or more curve segments and one or more line segments, and the method further comprises the step of: generating, for each line segment of the path, two line segments which form that part of the outline of the stroked path corresponding to the line segment of the path.
3. A method as claimed in claim 1, wherein the generated Bezier curves are cubic Bezier curves.
4. A method as claimed in claim 1, wherein the generating step comprises generating control points defining the quadratic or higher order Bezier curves. A method of generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the method comprising the steps of: determining, for each curve segment, one or more first sets of points and one or more second sets of points, wherein each point in said one or more first sets is located on one side of the curve segment, and each point in said one or more second sets is located on an other side of the curve segment, and each point of the one or more first and second sets is spaced a distance W/2 from a corresponding point on the curve segment, where W is constant; and 574871:PWM -52- generating, for each one of the first and second sets, a quadratic or higher order Bezier curve fitting the set of points, wherein the generated Bezier curves form part of the outline of the stroked path.
6. A method as claimed in claim 5, wherein the path to be stroked comprises one or more said curve segments and one or more line segments, and the method further comprises the steps of: determining, for each line segment, a first set of points and a second set of points, wherein each point in said first set is located on one side of the line segment, and each point in said second set is located on an other side of the line segment, and each point of the first and second sets is spaced a distance W/2 from a corresponding point on the line segment, where W is constant; and generating, for each one of the first and second sets, a line segment fitting the set of points, wherein the generated line segments form part of the outline of the stroked path.
7. A method as claimed in claim 5, wherein the generated Bezier curves are cubic Bezier curves.
8. A method as claimed in claim 5, wherein the generating step comprises the sub- step of: generating, for each one of the first and second sets, control points defining the quadratic or higher order Bezier curve fitting the set of points.
9. A method as claimed in claim 5, wherein the path to be stroked is an open path, and the method comprises the step of: generating two end caps, one at a start of the path and one at an end of the path, wherein the end caps form part of the outline of the stroked path. A method as claimed in claim 9, wherein each end cap comprises one or more line segments and/or one or more quadratic or higher order Bezier curves. 574871:PWM -53
11. A method as claimed in claim 9, wherein each end cap is a round end cap, and said step for generating end caps comprises the sub-step of: generating control points of two cubic Bezier curves defining each round end cap.
12. A method as claimed in claim 5, wherein the path comprises a plurality of said curve and/or line segments, and the method comprises the step of: generating a join for each two adjoining said parts of the outline of the path.
13. A method as claimed in claim 12, wherein each said join comprises one or more line segments and/or one or more quadratic or higher order Bezier curves.
14. A method as claimed in claim 12, wherein each join is a round join and the step for generating a join comprises the sub-step of: generating control points of one or more cubic Bezier curves defining the round join. A method of generating an outline of a stroked path, wherein the path to be stroked comprises one or more adjoined cubic Bezier segments, and the method comprising the steps of: segmenting each said cubic Bezier segment into one or more adjoining sub- segments, wherein the cubic Bezier segment is segmented at those points of the segment where the first and second derivatives of the parametric equation of the cubic Bezier segment are zero; determining, for each said sub-segment, a set of points on the sub-segment comprising a starting point of the sub-segment, a first predetermined point intermediate the starting and terminating points, a second predetermined point intermediate the starting and terminating points, and the terminating point of the sub-segment; 574871:PWM -54- determining, for each said sub-segment, a first set of points and a second set of points corresponding to the determined set of points on the sub-segment, wherein the first set of points and the second set of points are located on opposing sides of the sub- segment, and each point of the first and second set is spaced a distance W/2 from a corresponding point of the determined set of points on the sub-segment, where W is constant; and generating, for each said sub-segment, two cubic Bezier curves respectively fitting the first and second set of points, wherein the generated cubic Bezier curves form part of the outline of the stroked path.
16. Apparatus for generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the apparatus comprises: means for inputting a path, wherein the path comprises one or more curve segments; and means for generating, for each curve segment of the path, a plurality of quadratic or higher order Bezier curves, which form that part of the outline of the stroked path corresponding to the curve segment of the path.
17. Apparatus as claimed in claim 16, wherein the path to be stroked comprises one or more curve segments and one or more line segments, and the apparatus further comprises: means for generating, for each line segment of the path, two line segments which form that part of the outline of the stroked path corresponding to the line segment of the path.
18. Apparatus as claimed in claim 16, wherein the generated Bezier curves are cubic Bezier curves.
19. Apparatus as claimed in claim 16, wherein the generating means comprises means for generating control points defining the quadratic or higher order Bezier curves. 574871 :PWM Apparatus for generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the apparatus comprises: means for determining, for each curve segment, one or more first sets of points and one or more second sets of points, wherein each point in said one or more first sets is located on one side of the curve segment, and each point in said one or more second sets is located on an other side of the curve segment, and each point of the one or more first and second sets is spaced a distance W/2 from a corresponding point on the curve segment, where W is constant; and means for generating, for each one of the first and second sets, a quadratic or higher order Bezier curve fitting the set of points, wherein the generated Bezier curves form part of the outline of the stroked path.
21. Apparatus as claimed in claim 20, wherein the path to be stroked comprises one or more said curve segments and one or more line segments, and the apparatus further comprising: means for determining, for each line segment, a first set of points and a second set of points, wherein each point in said first set is located on one side of the line segment, and each point in said second set is located on an other side of the line segment, and each point of the first and second sets is spaced a distance W/2 from a corresponding point on the line segment, where W is constant; and means for generating, for each one of the first and second sets, a line segment fitting the set of points, wherein the generated line segments form part of the outline of the stroked path.
22. Apparatus as claimed in claim 20, wherein the generated Bezier curves are cubic Bezier curves.
23. Apparatus as claimed in claim 20, wherein the generating means comprises: 574871:PWM -56- means for generating, for each one of the first and second sets, control points defining the quadratic or higher order Bezier curve fitting the set of points.
24. Apparatus as claimed in claim 20, wherein the path to be stroked is an open path, and the apparatus comprises: generating two end caps, one at a start of the path and one at an end of the path, wherein the end caps form part of the outline of the stroked path. Apparatus as claimed in claim 24, wherein each end cap comprises one or more line segments and/or one or more quadratic or higher order Bezier curves.
26. Apparatus as claimed in claim 24, wherein each end cap is a round end cap, and said means for generating end caps comprises: means for generating control points of two cubic Bezier curves defining each round end cap.
27. Apparatus as claimed in claim 20, wherein the path comprises a plurality of said curve and/or line segments, and the apparatus comprises: means for generating a join for each two adjoining said parts of the outline of the path.
28. Apparatus as claimed in claim 27, wherein each said join comprises one or more line segments and/or one or more quadratic or higher order Bezier curves.
29. Apparatus as claimed in claim 27, wherein each join is a round join and the means for generating a join comprises: means for generating control points of one or more cubic Bezier curves defining the round join. 574871:PWM -57 Apparatus for generating an outline of a stroked path, wherein the path to be stroked comprises one or more adjoined cubic Bezier segments, and the apparatus compnrises: means for segmenting each said cubic Bezier segment into one or more adjoining sub-segments, wherein the cubic Bezier segment is segmented at those points of the segment where the first and second derivatives of the parametric equation of the cubic Bezier segment are zero; means for determining, for each said sub-segment, a set of points on the sub- segment comprising a starting point of the sub-segment, a first predetermined point intermediate the starting and terminating points, a second predetermined point intermediate the starting and terminating points, and the terminating point of the sub- segment; means for determining, for each said sub-segment, a first set of points and a second set of points corresponding to the determined set of points on the sub-segment, wherein the first set of points and the second set of points are located on opposing sides of the sub-segment, and each point of the first and second set is spaced a distance W/2 from a corresponding point of the determined set of points on the sub-segment, where W is constant; and means for generating, for each said sub-segment, two cubic Bezier curves respectively fitting the first and second set of points, wherein the generated cubic Bezier curves form part of the outline of the stroked path.
31. A computer program for generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the computer program comprises: code for generating, for each curve segment of the path, a plurality of quadratic or higher order Bezier curves, which form that part of the outline of the stroked path corresponding to the curve segment of the path. 574871:PWM -58-
32. A computer program as claimed in claim 31, wherein the path to be stroked comprises one or more curve segments and one or more line segments, and the computer program further comprises: code for inputting a path, wherein the path comprises one or more curve segments; and code for generating, for each line segment of the path, two line segments which form that part of the outline of the stroked path corresponding to the line segment of the path.
33. A computer program as claimed in claim 31, wherein the generated Bezier curves are cubic Bezier curves.
34. A computer program as claimed in claim 31, wherein the generating code comprises generating control points defining the quadratic or higher order Bezier curves. A computer program for generating an outline of a stroked path, wherein the path to be stroked comprises one or more curve segments, and the computer program comprises: code for determining, for each curve segment, one or more first sets of points and one or more second sets of points, wherein each point in said one or more first sets is located on one side of the curve segment, and each point in said one or more second sets is located on an other side of the curve segment, and each point of the one or more first and second sets is spaced a distance W/2 from a corresponding point on the curve segment, where W is constant; and code for generating, for each one of the first and second sets, a quadratic or higher order Bezier curve fitting the set of points, wherein the generated Bezier curves form part of the outline of the stroked path. 574871:PWM -59-
36. A computer program as claimed in claim 35, wherein the path to be stroked comprises one or more said curve segments and one or more line segments, and the computer program further comprises: code for determining, for each line segment, a first set of points and a second set of points, wherein each point in said first set is located on one side of the line segment, and each point in said second set is located on an other side of the line segment, and each point of the first and second sets is spaced a distance W/2 from a corresponding point on the line segment, where W is constant; and code for generating, for each one of the first and second sets, a line segment fitting the set of points, wherein the generated line segments form part of the outline of the stroked path.
37. A computer program as claimed in claim 35, wherein the generated Bezier curves are cubic Bezier curves.
38. A computer program as claimed in claim 35, wherein the generating code comprises: code for generating, for each one of the first and second sets, control points defining the quadratic or higher order Bezier curve fitting the set of points.
39. A computer program as claimed in claim 35, wherein the path to be stroked is an open path, and the computer program comprises: code for generating two end caps, one at a start of the path and one at an end of the path, wherein the end caps form part of the outline of the stroked path. A computer program as claimed in claim 39, wherein each end cap comprises one or more line segments and/or one or more quadratic or higher order Bezier curves.
41. A computer program as claimed in claim 39, wherein each end cap is a round end cap, and said code for generating end caps comprises: 574871:PWM code for generating control points of two cubic Bezier curves defining each round end cap.
42. A computer program as claimed in claim 35, wherein the path comprises a plurality of said curve and/or line segments, and the computer program comprises: code for generating a join for each two adjoining said parts of the outline of the path.
43. A computer program as claimed in claim 42, wherein each said join comprises one or more line segments and/or one or more quadratic or higher order Bezier curves.
44. A computer program as claimed in claim 42, wherein each join is a round join and the code for generating a join comprises: code for generating control points of one or more cubic Bezier curves defining the round join. A computer program for generating an outline of a stroked path, wherein the path to be stroked comprises one or more adjoined cubic Bezier segments, and the computer program comprises: code for segmenting each said cubic Bezier segment into one or more adjoining sub-segments, wherein the cubic Bezier segment is segmented at those points of the segment where the first and second derivatives of the parametric equation of the cubic Bezier segment are zero; code for determining, for each said sub-segment, a set of points on the sub- segment comprising a starting point of the sub-segment, a first predetermined point intermediate the starting and terminating points, a second predetermined point intermediate the starting and terminating points, and the terminating point of the sub- segment; code for determining, for each said sub-segment, a first set of points and a second set of points corresponding to the determined set of points on the sub-segment, 574871:PWM -61 wherein the first set of points and the second set of points are located on opposing sides of the sub-segment, and each point of the first and second set is spaced a distance W/2 from a corresponding point of the determined set of points on the sub-segment, where W is constant; and code for generating, for each said sub-segment, two cubic Bezier curves respectively fitting the first and second set of points, wherein the generated cubic Bezier curves form part of the outline of the stroked path.
46. A method of generating an outline of a stroked path, the method substantially as described herein with reference to Figs. 1, 2, 3, 4A, 4B, 5, and 6 of the accompanying drawings.
47. Apparatus for generating an outline of a stroked path, the apparatus substantially as described herein with reference to Figs. 1, 2, 3, 4A, 4B, 5, and 6 of the accompanying drawings.
48. A computer program for generating an outline of a stroked path, the computer program substantially as described herein with reference to Figs. 1, 2, 3, 4A, 4B, 5, and 6 of the accompanying drawings. DATED this Twenty-Fourth Day of March, 2003 CANON KABUSHIKI KAISHA Patent Attorneys for the Applicant SPRUSON FERGUSON 574871:PWM
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
AU2003202435A AU2003202435A1 (en) | 2002-03-27 | 2003-03-24 | Generating an Outline of a Stroked Path |
Applications Claiming Priority (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
AUPS1401 | 2002-03-27 | ||
AUPS1401A AUPS140102A0 (en) | 2002-03-27 | 2002-03-27 | Generating an outline of a stroked path |
AU2003202435A AU2003202435A1 (en) | 2002-03-27 | 2003-03-24 | Generating an Outline of a Stroked Path |
Publications (1)
Publication Number | Publication Date |
---|---|
AU2003202435A1 true AU2003202435A1 (en) | 2003-10-23 |
Family
ID=34081288
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
AU2003202435A Abandoned AU2003202435A1 (en) | 2002-03-27 | 2003-03-24 | Generating an Outline of a Stroked Path |
Country Status (1)
Country | Link |
---|---|
AU (1) | AU2003202435A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102129710A (en) * | 2010-12-30 | 2011-07-20 | 北京像素软件科技股份有限公司 | Method and system for simulating flight path |
US8907956B2 (en) | 2008-07-14 | 2014-12-09 | Canon Kabushiki Kaisha | Line stroking method and system |
-
2003
- 2003-03-24 AU AU2003202435A patent/AU2003202435A1/en not_active Abandoned
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8907956B2 (en) | 2008-07-14 | 2014-12-09 | Canon Kabushiki Kaisha | Line stroking method and system |
CN102129710A (en) * | 2010-12-30 | 2011-07-20 | 北京像素软件科技股份有限公司 | Method and system for simulating flight path |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US4855939A (en) | 3D Dimensioning in computer aided drafting | |
Farin et al. | The essentials of CAGD | |
Lambert et al. | 3D edge bundling for geographical data visualization | |
Hakimi et al. | Fitting polygonal functions to a set of points in the plane | |
US7535471B1 (en) | Scale-adaptive fonts and graphics | |
JP5721358B2 (en) | Graphics processing system | |
US6268871B1 (en) | Generating a curve for computer graphics through points residing on underlying geometries in a three dimensional space | |
EP1453007A2 (en) | Color gradient paths | |
US6154221A (en) | Parametric function curve editing | |
JP2003505800A (en) | Geometric design and modeling system using control geometry | |
JPH04287292A (en) | Method and device for rendering trimmed parametric surface | |
US20080024499A1 (en) | Method and apparatus of manipulating parameterized surfaces | |
US20070103466A1 (en) | System and Computer-Implemented Method for Modeling the Three-Dimensional Shape of An Object by Shading of a Two-Dimensional Image of the Object | |
US20020012003A1 (en) | Method and apparatus for generating images | |
US6879327B1 (en) | Creating gradient fills | |
AU2003202435A1 (en) | Generating an Outline of a Stroked Path | |
AU669516B2 (en) | Bezier spline to quadratic polynomial fragment conversion | |
Sarfraz | Optimal curve fitting to digital data | |
AU2009202878A1 (en) | A line stroking method and system | |
US6339433B1 (en) | Creating a blend of color and opacity between arbitrary edges | |
Georgiades et al. | Locally manipulating the geometry of curved surfaces | |
US6972764B1 (en) | Method and apparatus for transforming a set of closed curves | |
Bay et al. | Hermite interpolation by planar cubic-like ATPH | |
AU744461B2 (en) | Method and apparatus for transforming a set of closed curves | |
Habib et al. | Family of G/sup 2/cubic transition curves |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
MK1 | Application lapsed section 142(2)(a) - no request for examination in relevant period |