Log-Aesthetic Magnetic Curves and Their Application for CAD Systems

Curves are the building blocks of shapes and designs in computer aided geometric design (CAGD). It is important to ensure these curves are both visually and geometrically aesthetic to meet the high aesthetic need for successful product marketing. Recently, magnetic curves that have been proposed for computer graphics purposes are a particle tracing technique that generates a wide variety of curves and spirals under the influence of a magnetic field. The contributions of this paper are threefold, where the first part reformulates magnetic curves in the form of log-aesthetic curve (LAC) denoting it as log-aesthetic magnetic curves (LMC) and log-aesthetic magnetic space curves (LMSC), the second part elucidates vital properties of LMCs, and the final part proposes G LMC design for CAD applications. The final section shows two examples of LMC surface generation along with its zebra maps. LMC holds great potential in overcoming the weaknesses found in current interactive LAC mechanism where matching a single segment with G Hermite data is still a cumbersome task.


Introduction
Curves are widely used in various fields, most commonly in art and designs.The fairness of a curve dictates the product's quality and, in turn, its sales.The definition of a beautiful curve in the eye of an artist is a curve which exhibits constant variation of curvature monotonically and no part of the curve is a circular arc, as expressed by Ruskin [1].It is the same for aesthetic designs in CAGD.However, lines and circles are considered fair or beautiful because of their simplicity [2].The definition of a fair curve still remains subjective and unclear, which makes the condition required for ending a fairing process seems rather ambiguous.Conventional curves such as NURBS and Bezier have obvious oscillation in their curvature profile making it less visually pleasing.They also have more complex curvature formulas compared to those of natural spirals.
Harada et al. [3] noted that fair curves observed in nature have linear logarithmic curvature histograms (LCHs).It was later that curves which satisfy the stated condition are categorized as log-aesthetic curve (LAC) [4,5] which comprises a huge family of fair curves, including logarithmic spiral, circle involute, and clothoid.LAC is derived from logarithmic curvature graph (LCG) which is the analytic form of logarithmic distribution diagram of curvature (LDDC).Yoshida and Saito [5] also proposed an algorithm for interactive generation of LAC.These curves satisfy G 1 Hermite data.However, due to the scaling of the curve at the end of the algorithm, it is difficult to match G 2 Hermite data with one LAC segment alone, albeit it can be solved by joining two LACs with G 1 -continuity, then scaling one of the triangles such that the joint is G 2 -continuous.
Gobithaasan and Miura [6] proposed the general form of the LAC's formula known as the generalized LAC (GLAC).It has an extra degree of freedom compared to LAC which results in increased flexibility [7].Furthermore, GLAC extends the family of LAC to include generalized cornu spiral [8].Both curves mentioned have great potential for CAGD purposes but are highly compute intensive and time consuming.Recent progresses in this subject matter include the development of log-aesthetic spline and its application in automobile design (see Figure 1).Recently, Gobithaasan et al. [9] proposed Runge Kutta methods to compute LAC/GLAC, proven to achieve tremendous speedup.
There are also curves whose LCGs are approximately linear.These curves are known as quasi-aesthetic curves, coined by Yoshida and Saito [11].They proposed quasiaesthetic curve segments in the form of rational cubic Bézier.The resulting curve has monotone curvatures and has a higher aesthetic value compared to the usual rational Bezier splines.Class A Bézier [12] is another curve with monotonic curvature known to have approximately linear LCG and can be extended to space curves.However, its shape is limited to that of a logarithmic spiral as the degree of the polynomial increases.Furthermore, it is currently difficult to employ Class A Bézier space curve for surface design.Recent study by Nabiyev and Ziatdinov [13] shows that Bézier curves with monotonic curvatures are not always aesthetic in terms of the law of technical aesthetics.A study by Levien and Séquin [14] suggested that LAC is the most promising family of fair curves.Readers are referred to Miura and Gobithaasan [15] for a comprehensive review on aesthetic curves for various design feats.
In 2009, Xu and Mould proposed a particle tracing method to produce magnetic curve which is categorized as fair curve due to the monotonicity of its curvature function.It was inspired by artistic motives and they further showed its practicalities in computer graphics by rendering trees, hairs, water, and fire.Magnetic curves are defined as a particle tracing method that creates curves with constantly varying curvature by utilizing the effect of a magnetic field.This paper aims to reformulate magnetic curves for CAD practicalities and further reformulates to construct splines which satisfy G 2 Hermite data.
Section 1 elaborates in detail the physics behind magnetic curves.The contribution of this paper is threefold; the first part elucidates the connection between magnetic curves and LACs and the second part reformulates magnetic curves in the form of 2D and 3D log-aesthetic curve and denotes it as log-aesthetic magnetic curves (LMC) and log-aesthetic magnetic space curves (LMSC) for CAD applications; finally the third part proposes an algorithm for developing G 2 continuous LMC.

Formulation of Magnetic Curves
In a uniform magnetic field, the motion of a particle of charge  and mass , travelling with velocity ⃗ V under magnetic induction ⃗ , is the result of Lorentz Force [16], which can be rewritten as where × represents the cross product operation.It describes the motion of charged particles experiencing Lorentz force.For convenience, ⃗ V is separated into two components, with the first V || parallel to ⃗  and the second V ⊥ perpendicular to ⃗ .The steps on detailed derivation are omitted for brevity, albeit readers are referred to [17].To vary the curvature of the curve, () is set to be an arbitrary real function of  instead of a constant, .Note that the magnitude of the magnetic field, , should not be confused with its vector ⃗  and  ≥ 0. We obtain the components of magnetic curves as follows: Note that V  () = V  (  ) = V || , and   is the initial time,  of the trajectory.To simplify the expression, we take (())/ = ().By using separation of variables method, we arrive at the following equations: where Ω  () = () and  and  are arbitrary constants.In order to set the point at the origin, the initial conditions are set to be V  (  ) = V ⊥ ≥ 0 and V  (  ) = 0, which are the  and  components of V ⊥ .These values are then substituted to (4).These initial values dictate the direction and magnitude of the velocity vector at the origin of the Cartesian plane which can   be represented as a vector of magnitude V 2 ⊥ = V 2  + V 2  and the direction is parallel to the -axis.Thus we have Expressing  and  in (7) in terms of   and substituting back into (4), we obtain the position of the particle on the Cartesian plane at time, , as where ( 0 ,  0 ,  0 ) is the initial position of the particle.Thus, the magnetic curve is two-dimensional when V || = 0 and three-dimensional otherwise.Note that although in this paper the velocity vector at   is set to be ⟨V ⊥ , 0, 0⟩ to fix the tangential angle to 0 at   at the origin, we can alter the initial values V  (  ) and V  (  ) such that the tangential angle is tan −1 (V  (  )/V  (  )).Figures 2 and 3 depict the concept of particle motion under the influence of a constant magnetic field.
The main idea of magnetic curve is to vary the radius of gyration constantly to obtain a curve with monotonic curvature.The radius of gyration and gyro-frequency of magnetic curves is given by the equations: Note that the radius of gyration is actually the same as the radius of curvature coined in CAGD while the gyrofrequency of the particle is the angular velocity referred to in physical theories.It can also be noted that () = Ω(  ) − Ω() is the tangential angle of the trajectory or curve.Thus, if () is a constant, we will have  as a constant resulting in a circular trajectory.By setting  as a function of , value of  varies with respect to  creating a spiral trajectory.The radius of torsion is governed by Magnetic curves with constant initial velocities and magnetic field have total arc lengths of A summary of the properties of magnetic curves [18] are as follows.
(i) Radius of gyration decreases while curvature increases when () increases.
(ii) The direction of particle acceleration changes when () changes sign.
(iii) Arc length of magnetic curve grows in a constant rate as  increases when V ⊥ is a constant.
Xu and Mould [18] proposed to vary particle charge, (), for creating various spirals: Assuming  = 1 such that the curve is on the - Cartesian plane, the equation of the trajectory is A space curve is obtained by introducing () as stated in (10).
For planar curve, it can also be written in a complex plane as follows: whose gyro-frequency and radius of curvature are Equation ( 16) generates planar trajectories or curves of various shapes mainly spirals and circles.It produces straight lines when  = 1.Note that these curves are well-defined at  = 0 when  ≤ 1; otherwise  1− is not a real number.The particle velocity V ⊥ uniformly scales the entire trajectory and its arc length whereas , the magnitude of magnetic field, uniformly scales the rate of change of curvature.The effects of scaling with  on the curvature and rate of change of curvature can be seen in Figure 4.  is a shape parameter which determines the overall shape of the magnetic curves and is directly related to LCG gradient; its effect on planar curves is shown in Figure 5.The shapes of magnetic curves are further discussed in the following section.

Magnetic Curves with Constant LCG and LTG Gradient
In this section we further investigate the fairness of magnetic curves with particle charge as a variant.Various aesthetic cases of magnetic curves will also be discussed in this section.Shape interrogation tools used in the aesthetic analysis of magnetic curve include curvature profile, logarithmic curvature graph (LCG), and logarithmic torsion graph (LTG).
Given () and () are the radius of curvature and arc length of a curve, the LCG is defined as a graph whose horizontal and vertical axes are the logarithm of ()  ()/  () and (), respectively.A LAC is defined as a curve whose LCG is linear and its gradient function () = , where  is a real constant.A LA space curve is defined as a curve whose LTG is linear.The LCG, LTG, and their respective gradient function [19] of a curve are given as The LCG and its gradient of ( 16) are The LCG and its gradient of (16) are Therefore ( 16) is guaranteed to be log-aesthetic curves or space curves.It is also notable that neither  nor V ⊥ has an influence on the LCG nor LTG gradient.We are able to classify some of the well-known aesthetic curves from their LCG gradients.Xu and Mould's magnetic spirals include clothoid curve, logarithmic spiral, and circle involute which occur when  =  = −1,  =  = 1, and  = 0.5 ( = 2).Generally, these spirals are divergent when  < 0 and convergent when  > 0. The result of the shape and LCG analysis of these plane curves is depicted in Figure 6.
Substituting () = Ω(  ) − Ω() into (8), we employ the general formula of radius of curvature to find Substituting the equations and their derivatives of ( 14) and ( 24) with respect to  into (20) gives which yields the solution where  1 ,  2 , and c 3 are arbitrary constants.Without loss of generality, we can omit  1 as it does not change the overall shape of the curve.Note that (26) can be obtained by translating or scaling  by  1 in the following equation: We let  2 = − and  3 = −Ω(  ) such that () = Ω(  ) − Ω().
Thus we have Definition 1 as follows.Note that (27) has a fixed LCG and LTG gradient of 0; thus this curve will always have the same basic shape despite influences of  and V ⊥ .Figure 7 shows the parametric plots of magnetic curves with ( 27) and ( 16) when  =  = 1 while Figure 8 shows plots of LM space curve with inputs given in Table 1.
Definition 1.The equation of log-aesthetic magnetic curves (LMC) in complex plane is where V || = 0 and  0 is the initial position of the particle, and the equation of log-aesthetic magnetic curve curves (LMSC) is   with The particle charge is is the magnitude of the magnetic field, V ⊥ ≥ 0 is the particle velocity,  0 is the time when the velocity vector is ⟨V ⊥ , 0⟩, and  ∈ R is a parameter used for varying the gyro-frequency to produce trajectories of various shapes.These curves have a total arc length of (13).The curvature and torsion function is given by As magnetic curves share the same general form of equation and differential geometries ( 8)- (11), the influence of  and V ⊥ on the curve's curvature holds for all cases of (30) for LMC.Note that Definition 1 is the formulation of magnetic curves to represent LACs.One of the differences of LMC and LAC equation proposed in [5] is that LMC is unable to form circle with any other  except for  = 0 ( → ∞).However, this formulation allows various parameterization and equation manipulation for different application.The reparameterization of LMC is discussed in Section 5. Figure 7 illustrates two configurations of LMC representing logarithmic spiral and Nielsen's spiral.
Since () can be any arbitrary function, there are many possibilities of magnetic curves that can be generated.Another particle charge function which produces LAC is () = () −1/ .However, it has a LCG gradient of , which means it is essentially the same as () =  − in terms of curve shapes.Note that LMC does include curves with nonlinear LCGs.An example of this case is when () = 2/ + 2  .Figure 8 depicts examples of LMSC with inputs as stated in Table 1.

Properties of Magnetic Curves
This section discusses that the properties which are roundness, monotone curvature and torsion, extensionality, and locality hold for LMC or LMSC.These properties were first introduced by Harary and Tal [20] and Levien and Séquin [14] for CAD applications.However, we need first to determine the bound for  or  such that the resulting curve is regular and well-behaved as shown in Table 2.
The properties of LMC or LMSC are as follows.

Proposition 2. LMC and LMSC exhibit self-affinity property.
Self-similarity is an important fractal geometry characteristic in which the geometry is invariance under uniform Mathematical Problems in Engineering scaling whereas self-affinity preserves the geometry under nonuniform scaling operations.
Proof.These characteristics are inspected mathematically via omitting a front portion of the curve and scaling it by  + .Equation (30) now becomes Inspecting ( + ) and ( + ) for each case we can see that ( + ) = () and ( + ) = ().Thus the original shape is preserved and (30) is proven to be self-affine.Note that (30) becomes a logarithmic spiral when  = 1; therefore it is self-similar and inline as proven by Miura [4].

Proposition 3. LMC or LMCS forms circles (roundness property).
If an interpolation problem involves interpolating a circle, a desirable interpolation spline should form an exact circle.Thus, given any two tangent points on a circle, LMC will be able to form a circular arc and fit into these tangent points.
Proof.LMC readily forms a circular trajectory when  = 0.

Proposition 4. LMC or LMSC has monotonically increasing or decreasing curvature 𝜅(t) and torsion 𝜏(t) (note: set v || = 0 to restrict the curve to 𝑥-𝑦 plane to obtain LMC).
The monotonicity of curvature is the most basic criteria for a fair curve as suggested by many researchers and designers.Since human eyes are very sensitive towards curvature extrema; the extrema should not appear on any point of the curve segment except for its end points [14].
Proof.The rate of change of curvature of ( 30) is given by The values of   () and   () for all  > 0 or  < 0 are as given in Table 3 by inspecting (33) and (34).As the shapes of the curve on the interval  < 0 are either nonexisting or mirror images of those on  > 0 except for 1/ = 1/ =  < 0,  ∈ Z, thus we consider only the interval where  > 0. Since   () and   () are always negative or positive in the interval  > 0, the proposition above holds.Note that the sign of   () and   () may change if the sign of () is inverted.

Proposition 5. LMCs have inflection points.
Inflection points are important in achieving G 2continuous S-shaped splines and connecting a curve to a straight line or vice versa in CAD applications.
Proof.From the inspecting the curvature function, the inflection is most obvious for (1/) =  < 0,  ∈ Z, as these curves' inflection points occur when  = 0 and   () ̸ = 0 elsewhere (see (32) and ( 35)).Note that the circle ( = 0) does not have any inflection points.For the rest of cases of LMC, the inflection points may occur at  → ∞.See Table 2 for more detail.

Proposition 6. Increasing the scaling factor V 1 of any magnetic curves (including LMC) by d will scale the original curvature by a factor of
Proof.Assume a magnetic curve is originally scaled to a factor of V 1 .We have  1 () = (())/V 1 .Increasing the scaling factor (V 1 ) of magnetic curves by , the new curvature at  is Rearranging both  1 () and  2 () such that it forms a relationship, we obtain This relationship aids the process of designing G 2 -continuous aesthetic splines as we may anticipate how scaling affects the curvatures at the end points of the splines.

Proposition 7. LMC is extensible.
When additional data point is placed on a LMC, the shape of the curve does not change if it satisfies the extensionality property.

Proposition 8. LMC has global characteristics.
Good locality is a property where a small local change in the position of one data point will affect only the curve shape near the local change position.
Proof.Similar to log-aesthetic curve, LMC is determined by three control points, with two being the start and end points and the other being the intersection point of the tangents at start and end points.Local changes at any one of the control point change almost the entire curve shape.

Reparameterization of LMC
In this section, the reparameterization of LMC for various design application in two-dimensional spaces is discussed.These parameterizations are tangential angles and end curvature parameterization.
The LMC in the form of tangential angles is parameterized as follows: where   is a user defined time parameter which satisfies the range of  presented in Table 4 which is the same as   stated in the first section of this paper.Fixing   to a real value, the equation can be used to solve G 1 Hermite interpolation problem using Yoshida and Saito's [5] curve generation algorithm.For simplicity, we set   = 1.Instead of searching for the shape parameter Λ in original LAC equation,  in (39) is searched.The boundaries for  are given in Table 4.Note that ()'s sign is changed to negative in (39) so that the curve is on quadrants I and II of the x-y plane.
In order to achieve G 2 -continuity, it is required to manipulate the end curvature of a curve.LMC is parameterized to directly manipulate both end curvatures while satisfying the user defined tangential angles of the curve.The equation of the end curvature parameterized curve is The following equations can be incorporated into (40) to fix the end tangents so that the angle is stated by the user: where  0 ,  1 , and  are the user defined start curvature, end curvature, and end tangential angles.Note that the tangential angle at the origin (starting point of the curve) is always 0 as discussed in Section 1. Figure 9 shows LMC curves plotted with (40) and (41).However,  will not affect the curve shape when (41) is substituted in (40).This is because the  terms in (41) will cancel out in (40) when ( 40) is substituted with (41) and the only parameters left in the resulting equation are  = 1/, ,  0 , and .
We solve G 2 Hermite interpolation for C-shaped curves with the method shown in Algorithm 1.
and   are substituted and used in the equations in the entire algorithm.
The following section presents implementation examples.

Numerical Examples
In this section, three examples of G 2 Hermite interpolation problem are presented.G 2 -continuous LMCs are also shown to indicate the possibilities of joining segments with different  matching end curvatures to produce S-shaped curves.
At the end of this section, LM surfaces are presented and discussed.
Using the method proposed in the previous section, two examples of implementation are provided in Figure 10.The inputs for these figures are provided in Table 5.
We used Mathematica built-in minimization function (Find Minimum) which employs principal axis method [21] for the optimization process as it does not require the computation of derivatives.The two initial search points are set as  = 6 and  = 50 for  = 1/ > 0 and  = −50 and  = −6 for  = 1/ < 0. These initial search points do not determine the boundary of the search area.There are cases where the solution does not exist due to the number of constraints imposed on the curve.For example, it is notable that even though Figure 10(a) seems to coincide with the given end points, in fact, it has approximately 10 −5 error (distance between the given end point and the end point of the curve), which if we set the user tolerance to be below 10 −12 , this curve is not acceptable leading to a conclusion that a solution does not exist.Another obvious example is when the given inputs are  0 = 1.2,  1 = 0.9,  2 = {0.849,0.621}, and  = /3, the solution is  = 0.00904244 with error = 0.0950918 as shown in Figure 11.LMC can be modified to control both start and end curvatures and tangent angle directly using Algorithm 1.The proposed method is to solve G 2 Hermite data with only a single segment of LAC which has not been achieved before.It also preserves curvature monotonicity as only one segment is used.
Figure 12 is a G 2 -continuous LM spline joined together by matching the data points at the joints without using any interpolation methods.It is to show the possibility of creating a G LA curve design.The feature of controlling end curvatures opens up to new possibilities in creating more variation of G 2 splines, such as forming S-shaped G 2 spline with two Cshaped LACs.
Figure 13 shows the two-dimensional LMC profile and reference curve and Figure 14 shows a surface generated using Frenet sweeping method with the curves in Figure 13.The LM surface is generated by sweeping a C-shaped LM profile curve along S-shaped reference curve.This is achieved by translating the profile curve along the reference curve while rotating the profile curve to match the reference curve's Frenet frame.The inputs of the profile and reference LMC    are given in Table 6.Another example where two symmetrical surfaces generated using the same method are joined together with G 2 -continuity in designing a car hood is provided.The reference and profile curves are shown in Figure 15 while the inputs are shown in Table 7.The surface plot is provided in Figure 16.

Conclusion and Future Work
This paper reformulates log-aesthetic curves under the influence of a magnetic field and denotes it as log-aesthetic magnetic curves.The physical analysis provides an insight into various parameters previously regarded as shape parameters.
We derived an end curvature controllable LAC with the formulation of LMC.We have also presented the possibility of interpolating given G 2 Hermite data with a single segment of LMC.The characteristics LMC indicate high potential for CAD applications.Two examples of surface generation using LMC segments illustrated in the final section along with its zebra maps are indicating LMC surfaces are of high quality.Future work includes in-depth analysis of the drawable region of G 2 LMC and the study of the generalization of magnetics curves with various possibilities of () representations.

Figure 2 :
Figure 2: Circular particle (orbs) motion in uniform magnetic field with radius of gyration, .

Figure 3 :
Figure 3: Velocity vectors (arrows) of particle along its trajectory on the Cartesian plane.

Figure 13 :
Figure 13: LMC reference curve (a) and profile curve (b).Note that the reference curve's acceleration direction is in the opposite direction by changing the sign of ().

Figure 16 :
Figure 16: A Frenet swept LM surface rendered in Mathematica (a); its surface analysis using horizontal (upper (b)) and vertical (bottom (b)) zebra mapping.

Table 2 :
Boundaries for both  and  of magnetic curves.* The point where inflection points occur.

Table 3 :
Values of   () and   () with respective  and  values for all  > 0 or  < 0.

Table 4 :
Boundaries for  in set notation.