Mathematical and Computer Modelling 58 (2013) 564–572
Contents lists available at SciVerse ScienceDirect
Mathematical and Computer Modelling journal homepage: www.elsevier.com/locate/mcm
Geometric modeling of broad-leaf plants leaf based on B-spline Xiaogang Wang, Li Li ∗ , Wenting Chai College of Information and Electrical Engineering, China Agricultural University, Beijing 100083, China
article
info
Article history: Received 30 September 2011 Accepted 27 October 2011 Keywords: B-spline Reverse engineering Curve interpolation NURBS surfaces Surface interpolation Leaf
abstract Realistic rendering of plants has practical value for digital plant research, where plant leaves play an important role in the construction of virtual plants. The fact is that plant leaves are diversified in structure and geometric shape, which usually makes the realistic rendering of plants leaves very difficult. Many existed modeling and simulation methods have been focused on the organs of plant models, in which leaves are modeled using simple 2D polygons and the thickness of leaves are neglected. Such models are far from realistic. This paper proposes a new modeling method of broad-leaf plants, based on the theory of reverse engineering. A leaf model is established by acquiring data on the characteristic points from the leaf of the sample part and combining the advantages of OpenGL and NURBS functions. © 2011 Elsevier Ltd. All rights reserved.
0. Introduction A leaf is a main organ for external expression of plant and accurate simulation of leaves is a key to highly realistic rendering of the plant. At present, there are many ways to model leaves both at home and abroad, including L-system, particle systems, image-based methods, Skeleton-based methods, parametric modeling and others. Guerra [1] constructed geometrical appearance of grass using a polygon mesh, and achieved a better realistic effect of closer grass. Some researchers [2–4] constructed leaf veins with the particle system on the premise of the given leaf shape and petiole point. Runion [5] added a biology algorithm based on this, and simulated the interaction of leaf growth, distribution of growth hormone and generation of veins to produce a variety of realistic vein textures. American biologist Aristid Lindenmayer proposed L-system [6–8]. Its main function was to use formal language to describe the growth process of plants [9]. This L-system is of pure formulation, mechanical, and ineffective at realistic expression meaning it cannot satisfy the needs of realistic leaf modeling. Some researchers [10–14] generated leaf contours and veins (skeleton) using the Bezier or spline on this basis to subdivide and generate a leaf surface. The above methods focused on different aspects of geometric modeling and visualization of plants and have their own advantages. However, most of them simplified the leaf or vein to a surface or a curve, which is far from actual morphology of the leaf and only suitable for rendering complex scenes. They failed to show the geometric model of the leaf accurately. In fact, the leaf is not a complete surface, especially the veins that are a linear cylinder with the change of thickness. It is therefore necessary to exploit a new method for accurate geometric modeling of a leaf vein. Based on this idea, data on the main vein, lateral veins and leaf edges are acquired, and using Interpolation Ball B-Spline Curve (IBBSC) [15] and Interpolation NURBS, a surface model is reconstructed.
∗ Correspondence to: 53 Mailbox, East Campus of China Agricultural University, No 17, Tsinghua East Road, Haidian District, Beijing 100083, China. Tel.: +86 62736973; fax: +86 010 950507. E-mail addresses:
[email protected],
[email protected] (L. Li). 0895-7177/$ – see front matter © 2011 Elsevier Ltd. All rights reserved. doi:10.1016/j.mcm.2011.10.064
X. Wang et al. / Mathematical and Computer Modelling 58 (2013) 564–572
565
Fig. 1. Structure of the leaf.
Fig. 2. Distribution of marks on the leaf.
1. Structure of the leaf and data acquisition Liriodendron leaves, usually 4–18 cm in length and 5–19 cm in width, often have two lobes on each side, with a pink–white back and 4–8 cm petiole. Fig. 1 is a typical Liriodendron leaf structure. Based on the relationship between leaf veins and the shape of the leaf, data on leaf veins and leaf edges are collected. They include: three-dimensional coordinates (x, y, z ) and thickness (r ) of marker points and complete image information of leaf. Fig. 2 shows the distribution of marks on the leaf. There are 49(7*7) data points. For the values of each point, see Table 1. 2. Geometric model of the leaf The leaf model consists of two parts: leaf veins and leaf surfaces. Among them, the leaf veins are constructed using Interpolation Ball B-Spline Curve (IBBSC). Experimental data show that the thickness of leaf surfaces varies only 2.6% about the average, so the leaf surfaces are constructed with an Interpolation NURBS surface. According to the geometric model of the leaf, it is modeled in the following three steps: modeling leaf veins, modeling leaf surfaces, and leaf synthesis. Table 2 is the flow chart of leaf modeling.
566
X. Wang et al. / Mathematical and Computer Modelling 58 (2013) 564–572
Table 1 Values of each data point (49). 1
2
3
4
x y z r
−1.340
−0.810
−0.370
4.450 0.000 0.005
4.430 −0.020 0.000
4.300 0.000 0.000 10
11
x y z r
−1.320
−0.860
−0.470
3.980 0.000 0.000
4.220 0.000 0.010
3.800 0.000 0.015
0.090 3.400 −0.050 0.020
15
16
17
18
x y z r
−1.210
−0.380
−0.500
3.530 0.000 0.005
3.640 0.000 0.010
3.000 0.000 0.015
0.080 2.460 −0.010 0.020
22
23
24
x y z r
−1.100
−0.650
−0.310
3.090 0.000 0.000
2.660 0.000 0.010
2.140 0.000 0.015
29
30
31
x y z r
−1.260
−1.300
−0.660
2.970 0.000 0.000
2.400 0.000 0.010
1.810 0.000 0.015
36
37
38
x y z r
−1.65
−1.49
−0.63
3.01 0.00 0.00
1.68 0.00 0.01
0.88 0.00 0.02
43
44
45
x y z r
−2.300
−2.080
−1.390
2.880 0.000 0.005
1.720 0.000 0.000
0.760 0.000 0.000
8
9
5
0.150 4.150 −0.100 0.000
0.630 4.260 −0.050 0.000
6 1.100 4.420 −0.020 0.000
7 1.650 4.510 0.000 0.005
12
13
14
0.510 3.730 0.000 0.015
0.880 4.040 0.000 0.010
1.600 4.010 0.000 0.000
19
20
21
0.660 2.920 0.000 0.015
1.140 3.640 0.000 0.010
1.460 3.470 0.000 0.005
25
26
27
28
0.070 1.950 0.000 0.020
0.570 2.330 0.000 0.015
1.070 2.970 0.000 0.010
1.330 3.010 0.000 0.000
32
33
34
35
0.050 1.100 0.000 0.020
0.610 1.640 0.000 0.015
1.320 2.310 0.000 0.010
1.560 2.870 0.000 0.000
39
40
41
42
0.01 0.24 0.00 0.02
0.71 1.07 0.00 0.02
1.64 1.70 0.00 0.01
2.01 2.92 0.00 0.00
46
47
48
49
0.000 0.000 0.000 0.000
1.460 0.720 0.000 0.000
2.210 1.710 0.000 0.000
2.470 2.840 0.000 0.005
Table 2 Flow chart of leaf modeling.
Modeling leaf veins
Modeling leaf surfaces
Leaf synthesis
2.1. Modeling leaf veins Leaf veins are near the cylinder, and must be interpolated among the measured data points. Geometric modeling of cylindrical leaf vein is constructed using the Interpolation Ball B-Spline Curve (IBBSC). 2.1.1. Ball B-Spline Curve (BBSC) The difference of Ball B-Spline Curve from the B-spline curve is that the former is three-dimensional tubular solid, while the latter is a curve. Ball B-Spline Curve can be defined as:
⟨C ; r ⟩ = {x ∈ R3 | |x − C | ≤ r , C ∈ R3 , r ∈ R+ } where C is the center of the sphere, and r is the radius of the sphere.
(1)
X. Wang et al. / Mathematical and Computer Modelling 58 (2013) 564–572
567
Fig. 3. Order of determining interpolation curve parameters.
Ni,p (t ) is a P-order B-spline basis function on the vector of nodes [u0 , . . . , um ] = {a, . . . , a, up+1 , . . . , um−p−1 , b, . . . , b}.
p+1
p+1
Then, ball B-spline curve is defined as: n
⟨B⟩ (t ) =
Ni,p (t ) ⟨Pi ; ri ⟩
(2)
i=0
where Pi is the ith control point, and ri is the radius of the ith control point. 2.1.2. B-spline interpolation curve If curve control points are given, a free curve in accordance with the requirements can be fitted using the defined B-spline curves, and the B-spline curve be calculated; If curve data points (curves and surfaces must be interpolated the points) are given, a control mesh can be formed using inverse algorithms to find the control points. Then, the required free curve can be fitted and the NURBS surfaces (leaf modeling) as well, using B-spline curves defined in Eq. (3). Assuming that there are n + 1 data points, i.e., k = 0, 1, . . . , n, the P-order B-spline equation can be written as: P (u) =
n
Pi Ni,p (u) u ∈ (0, 1).
(3)
i =0
The data points corresponding to the parameters uk , followed by substituting into Eq. (3), should satisfy the interpolation conditions: Qk = P (uk ) =
n
Pi Ni,p (uk )
k = 0, 1, . . . , n.
(4)
i=0
Eq. (4) may be written in matrix: Q0 Q1
N0,p (u0 ) N0,p (u1 )
N1,p (u0 ) N1,p (u1 )
N0,p (un )
N1,p (un )
. = . . . . . Qn
.. .
··· ··· .. . ···
P0 Nn,p (u0 ) Nn,p (u1 ) P1
.. .
Nn,p (un )
. . . .
(5)
Pn
Elements in Eq. (5) coefficient matrix are B-spline basis function values at the parameter uk , only depending on the parameters uk and its knot location in the vector U. Fig. 3 shows the strike sequence. (1) Converting data point Qk parameter into uk Data points of parametric methods are the following: uniform parameter method, accumulated chord length parameter method, and centripetal parameter method. Among them, the centripetal parameter method is defined as: u0 = 0
un = 1 |Qk − Qk−1 |1/2
uk = uk−1 +
n
1/2 .
(6)
Qj − Qj−1
j=1
As the centripetal parameter method has a good effect for non-uniform data points, it is used to determine the data point Qk corresponding to parameter uk . (2) Determining the knot vector U To reflect the distribution of the parameters Qk in the parameter domain, the algebraic average is used to construct node vector U: u0 = · · · = up = 0
um−p = · · · = um = 1
j+p+1
uj + p =
1 p
ui
(7)
j = 1, . . . , n − p.
i=j
Node vector: U = {0 = u0 = · · · = up , uj+p , um−p = · · · = um = 1},
m = n + p + 1.
(8)
568
X. Wang et al. / Mathematical and Computer Modelling 58 (2013) 564–572
Fig. 4. Leaf veins generated using Interpolation Ball B-Spline Curve (IBBSC).
(3) Determining the basis function It is a recursive process to determine the basis function. De Boor and Cox’s recursive formula is defined as:
1, ui ≤ u ≤ ui+1 N ( u ) = i , 0 0, otherwise ui+k+1 − u u − ui Ni,k−1 (u) + Ni+1,k−1 (u) Ni,k (u) = ui+k − ui ui+k+1 − ui+1 0 = 0
(9)
0
where k is a power and the nodes ui (i = 0, 1, . . . , m) is the knot vector U. (4) Determining the control vertices Vi Given that data points Qk , parameters uk , node vector U, and basis function Ni,p are known, and each element of in the Eq. (5) coefficient matrix is non-negative and reversible, Gaussian elimination may be used to solve all the control points and find out the interpolation curve. Fig. 4 shows the leaf veins obtained using Interpolation Ball B-spline Curve (IBBSC). 2.2. Modeling leaf surfaces Experimental data show that leaf surface only about 2.6% of the average thickness of the leaf, the leaf surfaces are constructed by using the Interpolation NURBS surface. 2.2.1. Non-uniform rational B-spline (NURBS) surface NURBS surface with sub-rational polynomial representation can be defined as: m n
P (u, v) =
wi,j pi,j Ni,k (u)Nj,l (v)
i =0 j =0 m n
.
(10)
wi,j Ni,k (u)Nj,l (v)
i=0 j=0
In Eq. (10), the control points showed a topology rectangular array and formed a control mesh. wi,j is a weight factor associated with the vertices. Set the weight factor of the four corner vertex w0,0 , wm,0 , w0,n , wm,n > 0, and wi,j ≥ 0 for other points. Ni,k (u), i = 0, 1, . . . , m and Nj,l (v), j = 0, 1, . . . , n are k order B-spline basis in U parameter direction and l order B-spline basis in V parameter direction respectively. Basis functions Ni,k (u) and Nj,l (v) are decided respectively by node vector U and V according to recurrence formula (9). 2.2.2. NURBS surface interpolation The NURBS surface interpolation process is based on given data points of topological matrix array, and the interpolation method is used to construct mathematical models. A more general algorithm is expressed as the reverse process of tensor product surface, and the reverse calculation of the surface is transformed into two-stage reverse calculation of the curve.
X. Wang et al. / Mathematical and Computer Modelling 58 (2013) 564–572
569
Fig. 5. Leaf surface mesh.
(1) Parameter direction and parameter selection The data points Qi,j , i = 0, 1, . . . , m; j = 0, 1, . . . , n, the i (i = 0, 1, . . . , m) line data points Qi,j , j = 0, 1, . . . , n are the cross-sectional data points. There are m + 1 cross-sections denoted as U, and the column direction as the longitudinal parameter direction denoted as V . (2) Determining knot vector U , V Centripetal parameter method is used to parameterize the data points Qi,j , j = 0, 1, . . . , n of the i row in the U parameter direction. Set parameters of the data points ui,j , j = 0, 1, . . . , n:
u0 , j = 0 um,j = 0
Qi,j − Qi−1,j 1/2 ui,j = ui,j + m Qi,j − Qi−1,j 1/2
(11)
j =1
where i = 0, 1, . . . , m. The parameters of the common U parameter direction are the arithmetic average of the same column parameters,
u0 = 0 um = 0 ui =
1
m
m + 1 i =0
i = 1, . . . , m − 1
.
(12)
ui , j
Similarly, the parameters of the common V parameter direction can be calculated. The node vectors U = {u0 , u1 , . . . , um+k+1 } and V = {v0 , v1 , . . . , vn+l+1 } are determined. (3) Determining basis functions Ni,p , Nj,q Knowing node vector U , V , the process to find basis functions Ni,p , Nj,q is the same as with the B-spline basis function (9). (4) Determining control vertices Pi,j On the node vector U , p-order, using inverse algorithms to find the control vertices Di,j (j = 0, 1, . . . , n) to construct the i (i = 0, 1, . . . , m) row cross-section line for the i (i = 0, 1, . . . , m) row data points; Fixed j, on the node vector V , q-order, control points of the j (j = 0, 1, . . . , n) column Di,j (j = 0, 1, . . . , n) as ‘‘data points’’, using inverse algorithms to find the control points Pi,j , i = 0, 1, . . . , m of the j (j = 0, 1, . . . , n) column. Pi,j , i = 0, 1, . . . , m, j = 0, 1, . . . , n are the surface control points to determine the NURBS surface. Fig. 5 shows the leaf mesh using NURBS surface interpolation. 2.3. Leaf synthesis Leaf veins and leaf surfaces will be simply combined to construct a complete leaf model. As the leaf surface and veins were generated using the same set of control points, only rendering the veins and leaf surfaces respectively, will enable the synthesis results to be completed. Compared to texture mapping, this method has obvious body shape characteristics, and requires less data that are easy to access and modify. Fig. 6 shows the view of the synthesized leaf.
570
X. Wang et al. / Mathematical and Computer Modelling 58 (2013) 564–572
Fig. 6. Synthetic leaf model.
Fig. 7. Gold and silver wood leaf.
3. Model validations Using the same method, the geometric model of the gold and silver wood leaf is reconstructed. Table 3 shows the values of each data point. Fig. 7 shows the gold and silver wood leaf. Fig. 8 shows the results of leaf synthesis. 4. Conclusion and discussion A leaf model is constructed by using Interpolation Ball B-Spline Curve (IBBSC) and Interpolation NURBS surface. Based on the relationship between the veins and leaf shape, data on the vein and leaf surface are used to construct the leaf model. According to the body shape characteristics of veins, the control ball information of veins are used as inputs, the Interpolation
X. Wang et al. / Mathematical and Computer Modelling 58 (2013) 564–572
571
Table 3 Value data point’s value (54).
x y z r
1
2
3
4
0.400 4.250 0.000 0.000
0.440 4.380 0.000 0.000
0.480 4.530 0.000 0.000
0.550 4.650 0.000 0.000
5 0.610 4.760 −0.050 0.000
6
7
8
9
0.690 4.650 0.000 0.000
0.730 4.540 0.000 0.000
0.780 4.410 0.000 0.000
0.820 4.240 0.000 0.000
10
11
12
13
14
15
16
17
18
x y z r
0.270 4.010 0.000 0.003
0.270 3.790 0.000 0.006
0.220 3.560 0.000 0.009
0.270 3.250 0.000 0.012
0.460 3.070 0.000 0.015
0.670 3.250 0.000 0.012
0.790 3.440 0.000 0.009
0.830 3.730 0.000 0.006
0.930 3.970 0.000 0.003
19
20
21
22
x y z r
−0.040
−0.080
−0.070
3.470 0.000 0.003
3.100 0.000 0.007
2.660 0.000 0.010
0.080 2.310 −0.010 0.013
28
29
30
31
x y z r
−0.420
−0.420
−0.260
−0.040
2.900 0.000 0.004
2.440 0.000 0.007
1.870 0.000 0.011
1.530 0.000 0.014
37
38
39
40
x y z r
−0.720
−0.570
−0.390
−0.210
2.300 0.000 0.003
1.550 0.000 0.007
1.200 0.000 0.011
0.660 0.000 0.013
46
47
48
49
x y z r
−0.760
−0.620
−0.440
−0.220
1.020 0.000 0.000
0.640 0.000 0.010
0.390 0.000 0.015
0.170 0.000 0.020
23
24
25
26
27
0.370 2.050 0.000 0.016
0.660 2.460 0.000 0.013
0.870 2.730 0.000 0.010
0.990 2.990 0.000 0.006
1.100 3.350 0.000 0.003
32
33
34
35
36
0.270 1.100 0.000 0.017
0.650 1.130 0.000 0.013
0.970 1.580 0.000 0.010
1.300 2.000 0.000 0.007
1.460 2.570 0.000 0.003
41
42
43
44
45
0.720 1.830 0.000 0.011
1.070 1.190 0.000 0.008
1.530 1.720 0.000 0.004
0.100 0.250 0.000 0.017
0.390 0.520 0.000 0.014
50
51
52
53
54
0.000 0.000 0.000 0.015
0.330 0.060 0.000 0.010
0.670 0.200 0.000 0.000
0.980 0.460 0.000 0.000
1.170 0.740 0.000 0.000
Fig. 8. Synthesized leaf model.
BBSC method is applied to construct tubular vein model, and an Interpolation NURBS surface is used to construct the model of the leaf surface. Finally, both models are simply combined to obtain a complete leaf model. Experiments show that the method can simulate the three-dimensional model of the tulip tree leaves realistically, fully reflecting the detailed
572
X. Wang et al. / Mathematical and Computer Modelling 58 (2013) 564–572
characteristics of the leaf, and the required data are only three-dimensional coordinates of the control points of the leaf and the corresponding thickness. As most three-dimensional shapes of plant leaves and veins are closely related, the method provides a reference for virtual realization of other plant leaves. Further studies are required to incorporate agricultural knowledge into the modeling method. Acknowledgment Funding for this research was provided by the National Key Technology R&D Program Grant No. 2008BADA4B02. References [1] S. Guerra, F. Perbet, D. Raulo, et al., A procedural approach to animate interactive natural sceneries, in: Proceedings of the 16th International Conference on Computer Animation and Social Agents, IEEE Computer Society, Washington, DC, 2003, pp. 73–78. [2] Y. Rodkaew, P. Chongstitvatana, S. Siripant, et al. Modeling plant leaves in marble-patterned colours with particle transportation system, in: Proceedings of the 4th International Workshop on Functional—Structural Plant Models, Montpellier, France, 2004, pp. 391–397. [3] Y. Rodkaew, S. Siripant, C. Lursinsap, et al. An algorithm for generating vein images for realistic modeling of a leaf, in: Proceedings of Computational Mathematics and Modeling, Bangkok, Thailand, 2002. [4] W.T. Reeves, R. Blau, Approximate and probabilistic algorithms for shading and rendering structured particle systems, Computer Graphics 21 (4) (1985) 313–322. [5] A. Runions, M. Fuhrer, B. Lane, et al., Modeling and visualization of leaf venation patterns, ACM Transactions on Graphics 24 (3) (2005) 702–711. [6] A. Lindenmayer, Mathematical models for cellular interaction in development. Parts I and II, Journal of Theoretical Biology 18 (1968) 280–289. [7] G. Rozenberg, A. Lindenmayer, A developmental systems with locally catenative formulas, Acta Informatica 2 (1973) 214–248. [8] A. Lindenmayer, Paracladial relationships in leaves, Berichte der Deutschen Botanischen Gesellschaft 90 (1977) 287–301. [9] P. Prusinkiewicz, A. Lindenmayer, The Algorithmic Beauty of Plants, Springer-Verlag, New York, 1990. [10] Xiaohong Ye, Study on realistic meadow synthesis, Hang Zhou: Zhe Jiang University, 2001 (in Chinese). [11] Changbo Wang, Studies on physically based realistic rendering of nature phenomena, Hang Zhou: Zhe Jiang University, 2006 (in Chinese). [12] Yumei Wang, Research and implement of simulation technology of realistic grassland scenes, Su Zhou: Su Zhou University, 2009 (in Chinese). [13] Xiao-jin Jin, Yao-hai Mia, Realistic simulation of three-dimensional trees, Computer Engineering and Design 31 (8) (2010) 1753–1756. [14] Y.T. Chi, C.F. Chien, T. Lin, Leaf shape modeling and analysis using geometric descriptors derived from Bezier curves, Transactions of the ASAE 46 (2003) 175–185; Zhenjie Ma, Yuming Jiang, Chinar leaf simulation, Computer Simulation 26 (2) (2009) 221–224. [15] Yunyun Wang, Weiliang Wen, Xinyu Guo, Virtual realization of tobacco leaves based on ball B-spline function, Transactions of the CSAE 27 (1) (2011) 230–235.