
ARTICLE IN PRESS Computers & Graphics 30 (2006) 834–842 www.elsevier.com/locate/cag Chaos and Graphics Spiral packing Cameron Brownea,Ã, Paul van Wamelenb aSWiSHzone.com Pty Ltd, The Basement, 33 Ewell Street, Balmain, NSW 2041, Australia bDepartment of Mathematics, Louisiana State University, Baton Rouge, LA 70803-4918, USA Abstract We present a simple method for creating artistic space-filling designs based on spiral packings. Connected spiral sets are generated by successively branching child spirals from parent spirals, constrained to fit nearby neighbors in their environment. The underlying geometry is discussed in detail and a number of color examples generated by the algorithm are given. r 2006 Elsevier Ltd. All rights reserved. Keywords: Archimedes’ spiral; Apollonian circle packing; Fractal; Art 1. Archimedes’ spiral 2. Spiral packing The Archimedean spiral is a spiral with the polar We wish to pack a given area with connected sets of equation Archimedes’ spiral. This will be achieved by successively 1=n branching child spirals from parent spirals until the target r ¼ ay , (1) area is filled to some desired level of coverage (Fig. 2). The where r is the radial distance, y the polar angle, and n is a following constraints must be met: constant which determines how tightly the spiral is ‘‘wrapped’’ [1]. When this constant n ¼ 1, the resulting 1. Each child may have at most one parent (though parents spiral is known as Archimedes’ spiral: may have multiple children), r ¼ ay. (2) 2. Each child must meet its parent tangentially, and be rotated such that its end point lies on the line between Archimedes’ spiral (Fig. 1, left) can be defined in cartesian the spiral centers, coordinates by the properties (x, y, w, y, T, o) where (x, y) 3. A child’s width w must never exceed its parent’s width, is the spiral’s center, w is the width of one rotation, y is the and starting angle or phase, T is the total sweep or number of 4. Spirals may touch neighboring spirals tangentially but rotations, and o is the spiral’s orientation (o ¼1 for may not intersect them. clockwise and o ¼ 1 for counterclockwise). Defining functions Other potential constraints are relaxed to allow flex- xsðtÞ¼x þ wt cosðy þ 2potÞ, (3) ibility of design: a child may be of a greater total radius than its parent if T c4Tp, a child need not be the same ysðtÞ¼y þ wt sinðy þ 2potÞ, (4) orientation as its parent, and so on. Archimedes’ spiral was chosen as the most suitable form for both its aesthetic and then the spiral is paramaterized by ðx ðtÞ; y ðtÞÞ for 0 t T. s s p p well-behaved mathematical qualities. We describe the area enclosed by the spiral’s outer 3601 The packing starts with a seed pair of opposed matching sweep as its footprint (Fig. 1, right). spirals S1 and S2 (Fig. 2a) with identical w, T, o, opposed à y, and tangential end points such that x ðTÞ¼x ðT À 1Þ, Corresponding author. Tel.: +61 7 3371 1576. s1 s2 y ðTÞ¼y ðT À Þ x ðT À Þ¼x ðTÞ y ðT À Þ¼ E-mail addresses: [email protected] (C. Browne), s1 s2 1 , s1 1 s2 , and s1 1 [email protected] (P. van Wamelen). xs2 ðTÞ. Fig. 2b shows a child spiral branching from a single 0097-8493/$ - see front matter r 2006 Elsevier Ltd. All rights reserved. doi:10.1016/j.cag.2006.07.010 ARTICLE IN PRESS C. Browne, P. van Wamelen / Computers & Graphics 30 (2006) 834–842 835 parent. For the sake of clarity, the parent spiral is deemed 3. Numerical solution to remain a complete spiral in subsequent operations even though part of it is clipped by the child spiral. We now consider the solution of case III, the most Next is shown a further child spiral that touches one difficult. We will write down the equations resulting from other spiral (Fig. 2c), and a smaller child that touches two the cartesian coordinates of the relevant intersections and other spirals (Fig. 2d). This process continues within the tangential points, and discuss the solution of the resulting (decreasing) target area until a packing of the desired system of equations. density is achieved. There will be as many distinct We have the following ten variables: connected spiral sets within a packing as there are seed pairs. 1. x, y, w and y describe the spiral we are looking for, and 0 There are therefore three general geometric cases to 2. ti and t i are real numbers such that S at ti touches Si at 0 consider, as shown in Fig. 3: t i, for i ¼ 1, 2, 3. 1. Case I: Child spiral S branching from existing parent Each pair of touching spirals give three equations. The x- spiral S1 (Fig. 3a). The child spiral is of a specified width coordinates must agree and the y-coordinates must agree: w, number of turns T, orientation o, and direction 0 relative to the parent. xsðtiÞ¼xsi ðtiÞ, (5) 2. Case II: Child spiral S of a specified width w, number of y ðt Þ¼x ðt0Þ, (6) turns T and orientation o branching from parent S1 to s i si i touch one other spiral S2 (Fig. 3b). and the slopes of touching pairs must be equal: 3. Case III: Child spiral S of a specified number of turns T 0 0 qxsðtiÞ qy ðt Þ qxs ðt Þ qy ðtiÞ and orientation o branching from parent S1 to touch si i i i s 0 ¼ 0 . (7) two other spirals S2 and S3 (Fig. 3c). qti qti qti qti Another equation specifies that the child spiral to be fitted The bottom row of Fig. 3 shows the underlying geometry should be rotated such that its end point lies on the line of these relationships. In each case, S is rotated to lie between the centers of S and S1: tangent to S1 such that its end point T lies on the line between the spiral centers. The child is clipped at the sinðyÞðx1 À xÞ¼cosðyÞðy1 À yÞ. (8) intersection point U and the parent is clipped along the Note that although the child’s end point lies on the line interval between the tangent point V and intersection point between the centers, the tangent point does not necessarily U. Following clipping, there should be no intersection do so; it does not necessarily occur at precisely TsÀ1. between any pair of spirals within the packing. In all cases, We therefore have ten equations with ten unknowns. the parent spiral is deemed to remain complete even though Trying to solve this set of equations algebraically is intervals along its sweep may be clipped by children. probably a hopeless endeavor, but there are well-known techniques for solving such systems numerically. We will T describe one of the simplest, Newton’s Method for Systems. w 0 0 0 We define v ¼ðx; y; w; y; t1; t1; t2; t2; t3; t3Þ, a vector con- taining all of our variables, and denote its components by v1, v2 etc. Rewriting the ten equations gives (x,y) O 0 f 1ðvÞ¼xsðt1Þxs1 ðt1Þ, (9) f ð Þ¼y ðt Þy ðt0 Þ 2 v s 1 s1 1 , (10) qy ðt0 Þ 0 qxsðt1Þ s1 1 qxs1 ðt1Þ qysðt1Þ f 3ðvÞ¼ 0 À 0 , (11) Fig. 1. Archimedes’ spiral and its footprint. qt1 qt1 qt1 qt1 (a) (b) (c) (d) Fig. 2. Spiral packing: (a) a seed pair, (b) simple branch, (c) fitting to one other, and (d) fitting to two others. ARTICLE IN PRESS 836 C. Browne, P. van Wamelen / Computers & Graphics 30 (2006) 834–842 S 2 S 2 S S S S3 S1 S1 S1 Q Q W W C C V V V C T T T X P U P U P U R (a) (b) (c) Fig. 3. Branch geometry: (a) simple branch, (b) fitting to one other, and (c) fitting to two others. 0 f 4ðvÞ¼xsðt2Þxs2 ðt2Þ, (12) column vector y and then setting v1 ¼ v0+y. It is known that this iteration converges quadratically to a solution for f ð Þ¼y ðt Þy ðt0 Þ 5 v s 2 s2 2 , (13) our system, provided that our initial guess is good enough. Note that the system can also be written in the form qy ðt0 Þ 0 qxsðt2Þ s2 2 qxs2 ðt2Þ qysðt2Þ f 6ðvÞ¼ À , (14) À1 0 0 v þ ¼ v À Jðv Þ Fðv Þ, (20) qt2 qt2 qt2 qt2 i 1 i i i which makes its similarity to the usual one-dimensional f ðvÞ¼x ðt Þx ðt0 Þ, (15) 7 s 3 s3 3 Newton’s Method more apparent. 0 The functions occurring in the Jacobian matrix are f 8ðvÞ¼ysðt3Þys ðt Þ, (16) 3 3 simple enough that their derivatives can be determined qy ðt0 Þ 0 symbolically, hence the Jacobian matrix can be precom- qxsðt3Þ s3 3 qxs3 ðt3Þ qysðt3Þ f 9ðvÞ¼ 0 À 0 , (17) puted explicitly. The implementation of a method to solve qt3 qt qt qt3 3 3 this set of equations numerically should be relatively straightforward. The solutions of the simpler cases I and f 10ðvÞ¼sinðyÞðx1 À xÞcosðyÞðy1 À yÞ. (18) II involve similar, but simplified, applications of this ð Þ¼ð ð Þ ð Þ ð ÞÞT Let F v f 1 v ; f 2 v ; ...; f 10 v be the column vector process. containing our functions.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages9 Page
-
File Size-