COMPUTERIZED GENERATION OF ORNAMENTAL DESIGNS BY PLACING INSTANCES OF SIMPLE SHAPES IN ACCORDANCE WITH A DIRECTION GUIDE
20180322612 ยท 2018-11-08
Assignee
Inventors
- Paul ASENTE (Redwood City, CA, US)
- Craig Kaplan (Waterloo, CA)
- Radomir M{hacek over (e)}ch (San Jose, CA, US)
- Reza Adhitya Saputra (Waterloo, CA)
Cpc classification
G06T3/04
PHYSICS
G06T11/40
PHYSICS
G06T3/4038
PHYSICS
International classification
Abstract
Systems and methods for computerized drawing of ornamental designs consisting of placed instances of simple shapes. The shapes, called elements, are selected from a small library of templates. The elements are deformed to flow along a direction field interpolated from user-supplied strokes, giving a sense of visual flow to the final composition, and constrained to lie within a container region. In an implementation, a vector field is computed based on user strokes. Streamlines that conform to the vector field are constructed, and an element is placed over each streamline. The shape of the elements may be modified such as by bending, stretching or enlarging to reduce spacing between elements and to minimize variations in spacing to improve aesthetic appearance.
Claims
1. A computerized method for generating two-dimensional ornamental designs comprising: receiving one or more target containers, each represented by an associated simple closed curve which may form an irregular and asymmetrical shape; receiving one or more ornamental elements; receiving one or more direction guides corresponding to the target containers, the direction guides indicating desired directional flows of the ornamental elements; and placing, in accordance with directions indicated by the direction guides, the ornamental elements one or more times, in a non-overlapping manner, within boundaries of the target containers to generate an aesthetic arrangement of a plurality of placed ornamental elements.
2. The computerized method of claim 1 wherein placing, in accordance with directions indicated by the direction guides, the ornamental elements one or more times, in a non-overlapping manner, within boundaries of the target containers to generate an aesthetic arrangement of a plurality of placed ornamental elements comprises: generating a vector field within each target container as a function of direction guides associated with the target container; generating a plurality of streamlines in each vector field as a function of a desired space between the streamlines, a maximum desired streamline length and a minimum desired streamline length; dividing each target container into a plurality of placement areas, each placement area representing an area that will contain an ornamental element, organized around the streamlines; matching an ornamental element to each placement area; and placing an ornamental element into each matched placement area.
3. The computerized method of claim 2 wherein generating a plurality of streamlines in each vector field as a function of a desired space between the streamlines, a maximum desired streamline length and a minimum desired streamline length comprises: generating an initial streamline placed on a first direction guide; and generating subsequent streamlines placed on one or more additional direction guides, a boundary of an associated target container or at a position that is at the desired space between an existing streamline and the subsequent streamline.
4. The computerized method of claim 2 wherein placing an ornamental element in a matched placement area comprises: associating a spine with the ornamental element; and placing the spine upon the corresponding streamline, deforming the spine to match a path of the corresponding streamline, and deforming the ornamental element according to the deformation of its spine.
5. The computerized method of claim 2 wherein placing an ornamental element in a matched placement area comprises adjusting the size of the ornamental element so that it completely fits within boundaries of the matched placement area and does not overlap any other placed ornamental element.
6. The computerized method of claim 2 further comprising receiving a plurality of direction guides corresponding to each target container and wherein at least one of the direction guides follows boundaries of the target container.
7. The computerized method of claim 2 wherein matching an ornamental element to each placement area is performed by: constructing a shape descriptor for each element; constructing a shape descriptor for each placement area; and matching an ornamental element to a placement area having a shape descriptor that most closely matches the shape descriptor of the ornamental element.
8. The computerized method of claim 7, wherein constructing a shape descriptor for each element and constructing a shape descriptor for each placement area comprises: associating a spine with an element; measuring at a plurality of points on the spine, spine distances that the element extends to the left and to the right of the spine; normalizing the spine distances; measuring at a plurality of points on a streamline associated with a placement area, streamline distances that the placement area extends to the left and to the right of the streamline; and normalizing the streamline distances.
9. The computerized method of claim 2 further comprising: stretching a streamline to cause ends of the streamline to extend to ends of the matched placement area.
10. The computerized method of claim 2 further comprising adjusting positioning of a streamline to cause the entire streamline to be substantially aligned with a perimeter of an associated element if a substantial portion of the streamline is already positioned on the perimeter of the associated element.
11. The computerized method of claim 1 wherein placing, in accordance with directions indicated by the direction guides, the ornamental elements one or more times, in a non-overlapping manner, within boundaries of the target containers to generate an aesthetic arrangement of a plurality of placed ornamental elements comprises: modifying shape of at least a subset of the placed ornamental elements in accordance with the direction guide to reduce uniformity of arrangement of the placed ornamental elements.
12. The computerized method of claim 1 wherein placing, in accordance with directions indicated by the direction guides, the ornamental elements one or more times, in a non-overlapping manner, within boundaries of the target containers to generate an aesthetic arrangement of a plurality of placed ornamental elements comprises: modifying shape of at least a subset of the placed ornamental elements in accordance with the direction guide to reduce spacing between the placed ornamental elements.
13. The computerized method of claim 1 wherein placing, in accordance with directions indicated by the direction guides, the ornamental elements one or more times, in a non-overlapping manner, within boundaries of the target containers to generate an aesthetic arrangement of a plurality of placed ornamental elements comprises: modifying shape of at least a subset of the placed ornamental elements in accordance with the direction guide to reduce variation in spacing between the placed ornamental elements.
14. The computerized method of claim 1 further comprising: receiving a fixed element corresponding to the target container; and wherein the plurality of placed ornamental elements do not overlap the fixed element.
15. The computer-implemented method of claim 1 wherein the one or more ornamental elements comprise ornamental elements of one or more shapes.
16. A computer system for generating ornamental designs comprising: data storage containing a library of closed containers, and element templates; and a processor operatively coupled to the data storage, the processor configured to execute instructions that when executed cause the processor to: retrieve a selected closed container and a selected element template; receive one or more user-supplied inputs to define one or more direction fields within the selected closed container; and place the selected element template in a plurality of locations within the selected closed container in accordance with directions defined by the direction fields.
17. The computer system of claim 16 wherein each closed container comprises a visual representation of an irregularly shaped simple closed curve.
18. The computer system of claim 17 wherein the selected element template comprises a first selected element template and wherein the processor is further configured to execute instructions that when executed cause the processor to: retrieve a selected second element template; and place the selected second element template in a plurality of locations within the selected closed container.
19. A computer-implemented method to generate an ornamental design comprising: receiving an image container that provides a representation of a closed shaped object; receiving one or more irregularly shaped decorative elements; receiving a set of direction guides that provide visual flow for an initial placement of the decorative elements within the image container; and placing the decorative elements multiple times in a non-overlapping manner within the image container in accordance with directions indicated by the direction guides.
20. The computer-implemented method of claim 19 further comprising: placing a received fixed element within the image container; and wherein placing the decorative elements multiple times in a non-overlapping manner within the image container in accordance with directions indicated by the direction guides is performed by placing the decorative elements around the fixed element without overlapping the fixed element.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The accompanying drawings, which are incorporated in and constitute a part of this specification exemplify the embodiments of the present invention and, together with the description, serve to explain and illustrate principles of the inventive techniques disclosed herein. Specifically:
[0012]
[0013]
[0014]
[0015]
[0016]
[0017]
[0018]
[0019]
[0020]
[0021]
[0022]
[0023]
[0024]
DETAILED DESCRIPTION
[0025] In the following detailed description, reference will be made to the accompanying drawings, in which identical functional elements are designated with like numerals. The aforementioned accompanying drawings show by way of illustration, and not by way of limitation, specific embodiments and implementations consistent with principles of the present invention. These implementations are described in sufficient detail to enable those skilled in the art to practice the invention and it is to be understood that other implementations may be utilized and that structural changes and/or substitutions of various elements may be made without departing from the scope and spirit of present invention. The following detailed description is, therefore, not to be construed in a limited sense.
[0026] The systems and methods disclosed herein permit computerized drawing of ornamental designs consisting of placed instances of simple shapes. These shapes, called elements, may be selected from a small library of templates. The elements are deformed to flow along a direction field interpolated from user-supplied strokes, giving a sense of visual flow to the final composition, and constrained to lie within a container region. In an implementation, a vector field is computed based on the user-supplied strokes. Streamlines that conform to the vector field are constructed, and an element is placed over each streamline.
[0027] An ornamental element packing system 100 that operates as described above is shown in
[0028] The user 101 may cause the system 100 to generate an ornamental design 106 by selecting a container 104. The container 104 selected by the user 101 in
[0029] The resulting ornamental design 106 for container 104 may be stored in storage 103 and/or made available to the user 101 for other uses such as transmission to others, further editing, printing, etc. Digital storage 103 is shown generally but can take a variety of forms of storage for digital content including storage that is spread physically across numerous storage devices and also that is partially or wholly distant physically from other portions of system 100.
[0030]
[0031] The results of the system 100 also avoid packing elements via rigid motions that lead to high uniformity but insufficient variety. The system 100 provides systematic modes of geometric deformation that can generate plausible families of related decorative elements from a single input shape. The system 100 focuses on packing large numbers of small elements to generate compositions of large, visually distinct elements. The packing is not too dense so that every single shape is recognizable.
[0032]
[0033] In instances where there are multiple containers to be filled, the operations described herein are performed for each container. A variable, input_size is defined to be the maximum of the combined width or height of all the target containers and fixed elements as laid out by the user 101. This will be used to set various parameters in the synthesis process.
[0034] Ornamental elements 105 take the form of one or more closed curves that may be irregularly shaped. Placement of the elements 105 requires deformation of many if not most placed elements employing a simple skeletal stroke algorithm such as described by S. C. Hsu, I. H. H. Lee, and N. E. Wiseman in Skeletal strokes, in Proceedings of the 6th Annual ACM Symposium on User Interface Software and Technology, UIST '93, pp. 197-206. ACM, New York, N.Y., USA, 1993. doi: 10.1145/168642.168662. Such a technique employs a straight spine, such as spine 109 to guide the deformation. The spine 109 does not need to go through the center of the element 105; it can be anywhere. Examples of spines 109 (specifically, 109.1-109.6) corresponding to elements 105 can be seen in
[0035] For each element, a simple shape descriptor called an LR function is created. This will later be used to choose which element to place.
[0036] Intuitively, LR functions take up an approximate area of an ornamental element.
[0037] To place the elements 105 in accordance with the user-defined flows, as defined by direction guides 114, each target container 104 is filled with a vector field, constrained by the direction guides 114 in that container. The directional guides 114, D={d1, d2, . . . , dn} are each sampled and the tangent at every sampled point is used as a directional constraint. A vector field, shown generally at 310 in
[0038]
[0039] In one embodiment, the streamline tracing algorithm described by B. Jobard and W. Lefer, Creating evenly-spaced streamlines of arbitrary density, in W. Lefer and M. Grave, eds., Visualization in Scientific Computing '97: Proceedings of the Eurographics Workshop in Boulogne-sur-Mer France, Apr. 28-30, 1997, pp. 43-55. Springer Vienna, Vienna, 1997. doi: 10.1007/978-3-7091-6876-9_5, is adapted and implemented as shown in the pseudocode below. A set of potential seed points P={p1, p2, . . . , pn} is generated by densely resampling the target container 104 boundary T and the directional guides 114 in D. By way of example, a sampling distance of 0.005 input_size may be used. An empty set of streamlines is created and the potential seed points of P are randomly ordered. A new streamline s is generated by randomly removing a seed point from P and following the vector field until one of the following conditions holds: [0040] 1. the length of s would exceed s_max. [0041] 2. s would come within d_stop of another streamline. [0042] 3. s would cross T, leaving the container 104. [0043] 4. s would cross the boundary of a fixed element 112.
[0044] The length of s is tested and if the length of s is less than s_min, it is discarded. Otherwise s is sampled again using 0.005 input_size, and at each point two more potential seeds are generated that are d_gap away from s on either side. If a seed is inside the container 104, it is added to P. The process is repeated until P is empty. Note that the d_stop distance test combined with the s_min length test implies that many attempts to form streamlines will stop immediately, especially as the container fills with streamlines. P is sorted to order the points in P according to their distance from the boundary T and the directional guides in D, with closer points first and equally distant points ordered randomly. Because the initial points are all on T or on a path in D, their sort value is zero, and they will be processed before any derived points.
[0045] The target containers 104 are filled with vector fields (step 310 of
TABLE-US-00001 Tracing streamlines Create a seed list P = {p1, p2,..., pn} by uniformly resampling T and the guides in D. Create an empty set S of streamlines. Randomly order the elements of P. while P is not empty do Generate a new streamline s from p1. Remove p1 from P. if s is longer than s_min then Add s to S. Create seed points that are d_gap away from s and add them to P. SORT(P). end if end while Copyright 2016 Adobe Systems Inc.
[0046]
[0047] The next step is to place an ornamental element 105 in each blob, such as shown in
where
.sub.l is the element left function
.sub.r is the element right function
.sub.l is the blob left function
.sub.r is the blob right function
[0048] Each element 105 is evaluated for placement in four orientations: as drawn, as reflected across its spine, as reflected along its spine, and as reflected both across and along its spine. To reflect across the spine, the left and right functions are swapped. To reflect along the spine, the left and right functions are reparameterized to go from 1 to 0 instead of 0 to 1. Note that this matching method automatically places half elements along streamlines that follow a container boundary, visually reinforcing the overall shape.
[0049] An alternative for shape matching may be employed using an approach discussed by R. Gal, O. Sorkine, T. Popa, A. Sheffer, and D. Cohen-Or in 3D collage: Expressive non-realistic modeling, in Proceedings of the 5.sup.th International Symposium on Non-photorealistic Animation and Rendering, NPAR '07, pp. 7-14. ACM, New York, N.Y., USA, 2007, doi: 10.1145/1274871.1274873. Such an approach tries to fill a sub-region blob as much as possible, with heavy penalties if a part of an element protrudes outside the boundary of the blob. However, this has been found to make computation more expensive without providing significant advantages over the LR functions disclosed herein.
[0050]
[0051]
[0052]
[0053] The containers and decorative elements may be designed in a vector graphics editor such as Adobe Illustrator, available from Adobe Systems Incorporated, and then used as inputs to a C++ program that outputs final placed elements in an SVG file. The Clipper library as described by A. Johnson, Clipperan open source freeware library for clipping and offsetting lines and polygons, http://www.angusj.com/delphi/clipper.php, 2014, may be used for calculation of LR functions and for testing polygon intersections during deformation and growth. As a post-process, optionally outlines may be smoothed and polygonal paths may be replaced with Bzier curves. Finally, colors and other treatments may be applied in an editor.
[0054] The techniques disclosed herein may be used with a variety of container shapes, and many different ornamental elements with varying amounts of geometric complexity.
[0055] In certain embodiments, extensions may be added to the pipeline to enhance aesthetic value and flexibility. For example, as shown in
[0056] The embodiments disclosed herein create ornamental packings, in which vector fields are used to provide a sense of visual flow. A degree of uniformity is achieved by using repeated copies of a small set of initial decorative elements, but that uniformity is balanced with variety by deforming those elements. In other embodiments, multiple shorter elements may be threaded along streamlines instead of requiring elements to completely fill streamlines.
[0057]
[0058] Computing system 1300 may have additional features such as for example, storage 1310, one or more input devices 1314, one or more output devices 1312, and one or more communication connections 1316. An interconnection mechanism (not shown) such as a bus, controller, or network interconnects the components of the computing system 1300. Typically, operating system software (not shown) provides an operating system for other software executing in the computing system 1300, and coordinates activities of the components of the computing system 1300.
[0059] The tangible storage 1310 may be removable or non-removable, and includes magnetic disks, magnetic tapes or cassettes, CD-ROMs, DVDs, or any other medium which can be used to store information in a non-transitory way and which can be accessed within the computing system 1300. The storage 1310 stores instructions for the software implementing one or more innovations described herein.
[0060] The input device(s) 1314 may be a touch input device such as a keyboard, mouse, pen, or trackball, a voice input device, a scanning device, or another device that provides input to the computing system 1300. For video encoding, the input device(s) 1314 may be a camera, video card, TV tuner card, or similar device that accepts video input in analog or digital form, or a CD-ROM or CD-RW that reads video samples into the computing system 1300. The output device(s) 1312 may be a display, printer, speaker, CD-writer, or another device that provides output from the computing system 1300.
[0061] The communication connection(s) 1316 enable communication over a communication medium to another computing entity. The communication medium conveys information such as computer-executable instructions, audio or video input or output, or other data in a modulated data signal. A modulated data signal is a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media can use an electrical, optical, RF, or another carrier.
[0062] The innovations can be described in the general context of computer-executable instructions, such as those included in program modules, being executed in a computing system on a target real or virtual processor. Generally, program modules include routines, programs, libraries, objects, classes, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The functionality of the program modules may be combined or split between program modules as desired in various embodiments. Computer-executable instructions for program modules may be executed within a local or distributed computing system.
[0063] The terms system and computing device are used interchangeably herein. Unless the context clearly indicates otherwise, neither term implies any limitation on a type of computing system or computing device. In general, a computing system or computing device can be local or distributed, and can include any combination of special-purpose hardware and/or general-purpose hardware with software implementing the functionality described herein.
[0064] While the invention has been described in connection with a preferred embodiment, it is not intended to limit the scope of the invention to the particular form set forth, but on the contrary, it is intended to cover such alternatives, modifications, and equivalents as may be within the spirit and scope of the invention as defined by the appended claims.