CN108229018B - A method for simulating rime growth based on fractal and Perlin noise - Google Patents
- ️Tue Apr 13 2021
CN108229018B - A method for simulating rime growth based on fractal and Perlin noise - Google Patents
A method for simulating rime growth based on fractal and Perlin noise Download PDFInfo
-
Publication number
- CN108229018B CN108229018B CN201810001268.5A CN201810001268A CN108229018B CN 108229018 B CN108229018 B CN 108229018B CN 201810001268 A CN201810001268 A CN 201810001268A CN 108229018 B CN108229018 B CN 108229018B Authority
- CN
- China Prior art keywords
- rime
- growth
- point
- wind
- crystalline Prior art date
- 2018-01-02 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
- G06F30/20—Design optimisation, verification or simulation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T19/00—Manipulating 3D models or images for computer graphics
- G06T19/20—Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Architecture (AREA)
- Computer Graphics (AREA)
- Software Systems (AREA)
- Evolutionary Computation (AREA)
- Geometry (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
本发明提出一种基于分形和柏林噪声的模拟雾凇生长的方法。该方法模拟自然界中晶状和针状两种主要类型的雾凇在风场条件下的生长形态与方向。该方法根据柏林噪声的基本理论,通过构造随机噪声函数、余弦插值平滑函数来实现风场的模拟,利用材料力学知识分析风力作用下雾凇的偏移细节,由此计算出风力作用下雾凇沿着生长方向相对于生长点的偏移量。最后利用分形的方法模拟晶状雾凇的形态,利用分节计算生长终点方法来模拟针状雾凇的形态。
The present invention proposes a method for simulating rime growth based on fractal and Perlin noise. This method simulates the growth shape and direction of two main types of rime, crystalline and needle-like, in the wind field. According to the basic theory of Perlin noise, the method realizes the simulation of wind field by constructing random noise function and cosine interpolation smooth function, and uses the knowledge of material mechanics to analyze the migration details of rime under the action of wind. The offset of the growth direction relative to the growth point. Finally, the fractal method is used to simulate the shape of crystalline rime, and the method of segmented growth end point is used to simulate the shape of acicular rime.
Description
Technical Field
The invention relates to a method for simulating the growth of rime, in particular to a method for simulating the growth of acicular rime and rime crystal based on fractal and Berlin noise.
Background
Rime, commonly known as tree hanging, is different from ice and snow, and is recorded in ancient times: "Ice of cold qi is eliminated as pearl sees sunlight, which is called rime" by Qilu, and rime is the result of freezing and adhering on branches and other objects continuously by water vapor which is not yet desublimed in the air at low air temperature. In the 60 s of the 19 th century, people began to study the freezing phenomena of rime, wet snow and the like. On one hand, the freezing phenomena of rime, rime and the like are natural landscapes with great rhymes, and more importantly, the freezing phenomena can form serious natural disasters under certain conditions.
Currently for some natural scenes similar to: flowers, grass, snow and the like have been subjected to reality simulation by a plurality of methods, the effect is very vivid, but the reality simulation of the natural scene of the soft rime is very little, so two main soft rimes in the nature, namely crystalline soft rime and acicular soft rime, are selected to be respectively subjected to the reality simulation, and the method for simulating the soft rime growth based on fractal and Berlin noise is provided by analyzing the biological forms of the two soft rimes.
Disclosure of Invention
In order to show the charm of the rime, a common natural landscape in winter, and provide a decision for the prevention and control of the rime, namely a natural disaster, the invention provides a method for simulating the growth of the rime based on fractal and Berlin noise. The method simulates the growth form and direction of the rime under the condition of a wind field, wherein the rime mainly comprises crystal and needle in nature. According to the method, according to the basic theory of Berlin noise, the simulation of a wind field is realized by constructing a random noise function and a cosine interpolation smoothing function, and the deviation details of the rime under the action of wind power are analyzed by using knowledge of material mechanics, so that the deviation of the rime under the action of wind power relative to a growth point along the growth direction is calculated. And finally simulating the form of the rime by using a fractal method and simulating the form of the rime by using a segmental growth end point calculation method.
The scheme adopted by the invention is as follows:
a method for simulating rime growth based on fractal and Berlin noise comprises the following steps:
1) building tree model
Storing vertex coordinates, texture coordinates and triangular patch data of the tree model in the model;
2) selecting a rime growing point
Randomly taking a limited point on the triangular surface sheet of the tree model as a growth point of rime;
3) selecting the length of rime
Selecting random numbers in the interval of [0.4,0.6] as the numerical value of the length of the rime;
4) determining the growth direction of rime
Growth direction of rime: the sum of the growth direction and the wind direction is taken as the growth direction of the crystal rime,
the method for determining the growth direction of the crystal rime is as follows: selecting a random point E except the current growth point D on a triangular patch of the tree model, and taking a vector DE as a disturbance vector, wherein the sum of the normal direction of the triangular patch where the current growth point is located and the disturbance vector DE is the growth direction of the crystal rime per se on the current growth point;
growth direction of needle-like rime: taking the current wind direction as the growth direction of the acicular rime;
5) form simulating rime growth
Simulating the shape of the rime crystal by adopting a fractal mode;
the irregular bending of the rime during its growth is shown in a sectional manner because the rime has a certain bending degree.
Further, the method also comprises the following steps of simulating the wind field:
since the wind speed and wind direction in nature are non-quantitative, the randomness of the wind in nature is simulated by introducing a Berlin noise function.
Further, the method also comprises the following steps of calculating the offset of rime growth under the action of wind power:
analysis of rime stress by material mechanics, from the Hooke's law, the elasticity F suffered by rimeiMu Q, wherein mu is the rigidity coefficient of the ice crystal, and Q is the deformation amount under the action of force, namely the offset of the rime growth end point relative to the growth point under the action of Q wind power to be obtained.
Further, the method also comprises the following steps of puncture treatment:
judging the position of the current rime growth point before the rime growth for the puncture between the rime and the tree trunk, and if the rime growth point is windward, growing the rime; if the surface is leeward, rime does not grow;
for the puncture between the soft rime and the soft rime, the structure of the needle-shaped soft rime is simple, so that the judgment is directly carried out by judging whether the space line segments are intersected; the rime is complex in structure, and in order to reduce the amount of calculation, the minimum quadrilateral convex hull is obtained for each rime, and then the way of judging whether quadrilaterals intersect is utilized to judge.
Further, the detailed steps of selecting the rime growing point are as follows:
and obtaining vertex data of each triangular patch in the model by importing an OBJ file of the tree model, setting the vertex as A, B, C, randomly taking a point D in the triangular patch as a growth point of the rime, and obtaining coordinates of the point D expressed as D ═ a + A + B × B + C by coordinates of A, B, C, wherein: a + b + c is 1, a, b and c are nonnegative numbers, the numerical values of a and b are randomly generated, the numerical value of c is calculated by a formula, the growing density of the rime is relatively sparse, and therefore 3 points are randomly selected from each triangular face as growing points; the growth density of the needle-shaped rime is relatively dense, so that 5 points are randomly selected from each triangular face as growth points.
Further, the detailed steps of simulating the rime growth form are as follows:
simulating the form of the rime crystal by adopting a fractal mode, wherein the specific calculation process is as follows:
calculating branch starting point and branch length, taking three points between the growth point D and the growth end point G of the current crystal rime as branch starting points, marking as points I, and respectively satisfying I ═ a × G + b × D and length L of each branch
Wherein: a + b is 1, x1,y1,z1Is the coordinate value of the growth point D, x2,y2,z2The Index value is the coordinate value of a growing point G, the values of the indexes are different according to different values of the number of layers of the current branch, the indexes of each layer of branches are reduced from the growing point to the growing end point in sequence, and the indexes belong to (0, 1);
calculating the left and right branch end points, recording the left and right branch end points of the branch starting point I as K, J, the included angles between the branches IJ and IK and the main stem DG as theta, in the three-dimensional space, the main stem DG and the world coordinate horizontal direction also have an included angle beta,
the left branch end point calculation formula is as follows:
Kx=Ix+L*(cosβ*cosθ-sinβ*sinθ)
Ky=Iy+L*(sinβ*cosθ+cosβ*sinθ)
wherein: kxIs the horizontal coordinate of the left branch end point, KyIs the vertical coordinate of the left branch end point;
the right branch end point calculation formula is as follows:
Jx=Ix+L*(cosβ*cosθ+sinβ*sinθ)
Jy=Iy+L*(sinβ*cosθ-cosβ*sinθ)
wherein: j. the design is a squarexIs the abscissa of the right branch end point, JyIs the vertical coordinate of the right branch end point;
calculating branches on the other two layers of branch points on the trunk DG by using the same method, modifying iteration times of fractal calculation, taking the calculated branches as new trunks, and continuing to grow the branches to obtain the final complete shape of the rime;
the irregular bending of the needle-like rime in the growth process is expressed by adopting a sectional mode, which specifically comprises the following steps:
recording the current rime growth point as a point D, and calculating to obtain a growth end point D of the first rime1Then by D1As the growth point, calculating to obtain the growth end point D of the second section2And by analogy, finally connecting each point to obtain the final growth form of the acicular rime.
Further, the detailed steps of the simulated wind field are as follows:
the growth condition of crystal rime is breeze, the growth condition of needle rime is strong wind, and for a strong wind environment, the wind direction of the strong wind at any point in the space is expressed as: phi ═ where t is [0,2 pi ] (sint,0, cost)]Random number between them, thus ensuring the characteristics of strong wind: the wind directions of all points in the space at the same moment are the same and are parallel to the ground; for breeze, the breeze direction at any point in space is expressed as Φ (-cost)1,0,sint2) Here t1,t2∈[0,2π],t2=t1*NrandIn which N israndIs calculated from Berlin noise as [0,1 ]]Random number between them, thus ensuring the characteristics of breeze: the wind direction of each point in the space at the same moment is random and parallel to the ground.
Further, the detailed steps of solving the offset of rime growth under the action of wind power are as follows:
the elastic force F borne by rime according to Huke's lawiIt can also be expressed as:
wherein: siArea of rime, EiThe elastic modulus of ice crystal is the temperature of [ -19.0, -1.0 [ -19.0 ]]The elastic modulus of ice crystals at a temperature of between [5.0,6.0 ]]Thus EiTake [5.0,6.0 ]]Random number between them, Delal is deformation amount of rime under elastic action,LwLength of rime defined in section three. Simplifying to obtain the relation between rime rigidity coefficient and Young modulus as follows: mu-Ei*WiWherein W isiThe width of the soft rime, so the elastic force F borne by the soft rimeiIt can also be expressed as: fi=Ei*WiQ, considering the stress of rime, from momentum law, there are:
wherein: m isgM is the mass of windg=ρSgVwt, ρ is the air density, which is 1.29 in the standard state, SgIs the frontal area, VwIs the wind speed, and the wind speed,
the stress of rime is balanced by Fi=FgFinally, the transverse component Q of the offset Q of the rime growth end point relative to the growth point under the action of wind power is obtainedxComprises the following steps:
longitudinal offset QyComprises the following steps:
wherein, for rime crystalline, Δ αi-gIs the angle between the rime growth direction and the wind direction, for acicular rime, Δ αi-gIs the wind direction;
thus, the offset of the rime growth end point relative to the growth point under the action of wind power is calculated, and then the rime growth end point and the growth end point of each section of the rime are obtained.
Further, the detailed steps of treating the puncture between the rime and the trunk are as follows:
judging the position of the current rime growth point before the rime growth, and if the rime growth point is windward, growing the rime; if the ice fog is a leeward side, the ice fog does not grow, and the condition that whether the triangular patch where the current ice fog growth point is located is the windward side is judged: the dot product of the normal direction of the triangular patch and the wind direction is a windward side as the rule, and a leeward side as the rule.
Further, the detailed steps of the puncture between rimes treatment are as follows:
for needle-like rime, the method for judging whether the space straight line is intersected is directly utilized for judging, and for the needle-like rime which is separated from the current rime by the length d of the current rime, each section is judged, and the judging steps are as follows:
first, whether the two line segments are coplanar is judged. If the two sections are not coplanar, the two sections are out of phase, and if the two sections are coplanar, the judgment is continued;
then judging whether the two coplanar line segments are parallel or not, if so, the two line segments are not crossed, and if not, continuing to judge;
finally, fine judgment is carried out, whether the intersection point of the two line segments exists or not is calculated, if the intersection point does not exist, the two line segments do not intersect, and if the intersection point exists, the two line segments intersect;
for crystalline rime, the minimum quadrilateral convex hull of the crystalline rime is calculated at first, then the intersection judgment of the quadrilateral convex hull is carried out on the crystalline rime which is far away from the current rime and the length d of the current rime, and the judgment steps are as follows:
firstly, judging the intersection of a first edge of a current crystal rime quadrilateral convex hull and a first edge of another crystal rime quadrilateral convex hull, if the two edges are parallel, comparing the first edge of the current crystal rime with a second edge of another crystal rime, and if the two edges are not parallel, carrying out fine judgment;
when the two sides are not parallel, calculating whether the intersection point of the straight lines where the two sides are located occurs in the effective range of the two line segments, if so, judging that the two rimes intersect, and if not, selecting the next side for judgment;
after comparing the four edges of the protruding package of the current crystal soft rime with the other crystal soft rime, if the effective intersection point is not calculated, the two crystal soft rimes are not intersected, otherwise, the two crystal soft rimes are intersected.
The invention has the beneficial effects that: the true rime crystal and rime needle simulation can be provided; the growth simulation of the rime and the rime can be performed according to the temperature and the wind level information input by the user, and the morphological structure of the rime can be observed in a short distance.
Drawings
FIG. 1 is a flow chart of the overall algorithm to which the present invention relates;
FIG. 2 is a flow of selecting the final growth direction of rime crystal in a wind environment;
FIG. 3 is a graph of simulated effects of rime crystal growth morphology;
FIG. 4 is a graph showing the effect of simulating the growth of rime;
FIG. 5 is a diagram of rime growth operation performed by a program;
FIG. 6 is a diagram of the rime operation without growing during program run;
FIG. 7 is a graph of the results for rime in the 4 th wind;
FIG. 8 is a graph of the results for rime in the 6 th wind;
FIG. 9 is a graph of the results for rime crystalline under
grade2 wind;
FIG. 10 is a graph of the results for rime crystalline under grade 3 wind;
FIG. 11 is a simulated complete picture of needle-like rime and a comparison of real needle-like rime;
fig. 12 is a simulated complete picture of rime and a comparison of real rime.
Detailed Description
The invention relates to a fractal and Berlin noise-based rime growth simulation method, which comprises the following steps of:
1) building tree model
Storing vertex coordinates, texture coordinates and triangular patch data of the tree model in the model;
2) selecting a rime growing point
Randomly taking a limited point on the triangular surface sheet of the tree model as a growth point of rime;
3) selecting the length of rime
Selecting random numbers in the interval of [0.4,0.6] as the numerical value of the length of the rime;
4) determining the growth direction of rime
Growth direction of rime: the sum of the growth direction and the wind direction is taken as the growth direction of the crystal rime,
the method for determining the growth direction of the crystal rime is as follows: selecting a random point E except the current growth point D on a triangular patch of the tree model, and taking a vector DE as a disturbance vector, wherein the sum of the normal direction of the triangular patch where the current growth point is located and the disturbance vector DE is the growth direction of the crystal rime per se on the current growth point;
growth direction of needle-like rime: taking the current wind direction as the growth direction of the acicular rime;
5) form simulating rime growth
Simulating the shape of the rime crystal by adopting a fractal mode;
the irregular bending of the rime during its growth is shown in a sectional manner because the rime has a certain bending degree.
Further, the method also comprises the following steps of simulating the wind field:
since the wind speed and wind direction in nature are non-quantitative, the randomness of the wind in nature is simulated by introducing a Berlin noise function.
Further, the method also comprises the following steps of calculating the offset of rime growth under the action of wind power:
analysis of rime stress by material mechanics, from the Hooke's law, the elasticity F suffered by rimeiMu Q, wherein mu is the rigidity coefficient of the ice crystal, and Q is the deformation amount under the action of force, namely the offset of the rime growth end point relative to the growth point under the action of Q wind power to be obtained.
Further, the method also comprises the following steps of puncture treatment:
judging the position of the current rime growth point before the rime growth for the puncture between the rime and the tree trunk, and if the rime growth point is windward, growing the rime; if the surface is leeward, rime does not grow;
for the puncture between the soft rime and the soft rime, the structure of the needle-shaped soft rime is simple, so that the judgment is directly carried out by judging whether the space line segments are intersected; the rime is complex in structure, and in order to reduce the amount of calculation, the minimum quadrilateral convex hull is obtained for each rime, and then the way of judging whether quadrilaterals intersect is utilized to judge.
Further, the detailed steps of selecting the rime growing point are as follows:
and obtaining vertex data of each triangular patch in the model by importing an OBJ file of the tree model, setting the vertex as A, B, C, randomly taking a point D in the triangular patch as a growth point of the rime, and obtaining coordinates of the point D expressed as D ═ a + A + B × B + C by coordinates of A, B, C, wherein: a + b + c is 1, a, b and c are nonnegative numbers, the numerical values of a and b are randomly generated, the numerical value of c is calculated by a formula, the growing density of the rime is relatively sparse, and therefore 3 points are randomly selected from each triangular face as growing points; the growth density of the needle-shaped rime is relatively dense, so that 5 points are randomly selected from each triangular face as growth points.
Further, the detailed steps of simulating the rime growth form are as follows:
simulating the form of the rime crystal by adopting a fractal mode, wherein the specific calculation process is as follows:
calculating branch starting point and branch length, taking three points between the growth point D and the growth end point G of the current crystal rime as branch starting points, marking as points I, and respectively satisfying I ═ a × G + b × D and length L of each branch
Wherein: a + b is 1, x1,y1,z1Is the coordinate value of the growth point D, x2,y2,z2The Index value is the coordinate value of a growing point G, the values of the indexes are different according to different values of the number of layers of the current branch, the indexes of each layer of branches are reduced from the growing point to the growing end point in sequence, and the indexes belong to (0, 1);
calculating the left and right branch end points, recording the left and right branch end points of the branch starting point I as K, J, the included angles between the branches IJ and IK and the main stem DG as theta, in the three-dimensional space, the main stem DG and the world coordinate horizontal direction also have an included angle beta,
the left branch end point calculation formula is as follows:
Kx=Ix+L*(cosβ*cosθ-sinβ*sinθ)
Ky=Iy+L*(sinβ*cosθ+cosβ*sinθ)
wherein: kxIs the horizontal coordinate of the left branch end point, KyIs the vertical coordinate of the left branch end point;
the right branch end point calculation formula is as follows:
Jx=Ix+L*(cosβ*cosθ+sinβ*sinθ)
Jy=Iy+L*(sinβ*cosθ-cosβ*sinθ)
wherein: j. the design is a squarexIs the abscissa of the right branch end point, JyIs the vertical coordinate of the right branch end point;
calculating branches on the other two layers of branch points on the trunk DG by using the same method, modifying iteration times of fractal calculation, taking the calculated branches as new trunks, and continuing to grow the branches to obtain the final complete shape of the rime;
the irregular bending of the needle-like rime in the growth process is expressed by adopting a sectional mode, which specifically comprises the following steps:
recording the current rime growth point as a point D, and calculating to obtain a growth end point D of the first rime1Then by D1As the growth point, calculating to obtain the growth end point D of the second section2And by analogy, finally connecting each point to obtain the final growth form of the acicular rime.
Further, the detailed steps of the simulated wind field are as follows:
the growth condition of crystal rime is breeze, the growth condition of needle rime is strong wind, and for a strong wind environment, the wind direction of the strong wind at any point in the space is expressed as: phi ═ where t is [0,2 pi ] (sint,0, cost)]Random number between them, thus ensuring the characteristics of strong wind: the wind directions of all points in the space at the same moment are the same and are parallel to the ground; for breeze, the breeze direction at any point in space is expressed as Φ (-cost)1,0,sint2) Here t1,t2∈[0,2π],t2=t1*NrandIn which N israndIs calculated from Berlin noise as [0,1 ]]Random number between them, thus ensuring the characteristics of breeze: the wind direction of each point in the space at the same moment is random and parallel to the ground.
Further, the detailed steps of solving the offset of rime growth under the action of wind power are as follows:
the elastic force F borne by rime according to Huke's lawiIt can also be expressed as:
wherein: siArea of rime, EiThe elastic modulus of ice crystal is the temperature of [ -19.0, -1.0 [ -19.0 ]]The elastic modulus of ice crystals at a temperature of between [5.0,6.0 ]]Thus EiTake [5.0,6.0 ]]Random number between them, Δ L is deformation amount of rime under elastic force, LwLength of rime defined in section three. Simplifying to obtain the relation between rime rigidity coefficient and Young modulus as follows: mu-Ei*WiWherein W isiThe width of the soft rime, so the elastic force F borne by the soft rimeiIt can also be expressed as: fi=Ei*WiQ, considering the stress of rime, from momentum law, there are:
wherein: m isgM is the mass of windg=ρSgVwt, ρ is the air density, which is 1.29 in the standard state, SgIs the frontal area, VwIs the wind speed, and the wind speed,
the stress of rime is balanced by Fi=FgFinally, the transverse component Q of the offset Q of the rime growth end point relative to the growth point under the action of wind power is obtainedxComprises the following steps:
longitudinal offset QyComprises the following steps:
wherein, for rime crystalline, Δ αi-gIs the angle between the rime growth direction and the wind direction, for acicular rime, Δ αi-gIs the wind direction;
thus, the offset of the rime growth end point relative to the growth point under the action of wind power is calculated, and then the rime growth end point and the growth end point of each section of the rime are obtained.
Further, the detailed steps of treating the puncture between the rime and the trunk are as follows:
judging the position of the current rime growth point before the rime growth, and if the rime growth point is windward, growing the rime; if the ice fog is a leeward side, the ice fog does not grow, and the condition that whether the triangular patch where the current ice fog growth point is located is the windward side is judged: the dot product of the normal direction of the triangular patch and the wind direction is a windward side as the rule, and a leeward side as the rule.
Further, the detailed steps of the puncture between rimes treatment are as follows:
for needle-like rime, the method for judging whether the space straight line is intersected is directly utilized for judging, and for the needle-like rime which is separated from the current rime by the length d of the current rime, each section is judged, and the judging steps are as follows:
first, whether the two line segments are coplanar is judged. If the two sections are not coplanar, the two sections are out of phase, and if the two sections are coplanar, the judgment is continued;
then judging whether the two coplanar line segments are parallel or not, if so, the two line segments are not crossed, and if not, continuing to judge;
finally, fine judgment is carried out, whether the intersection point of the two line segments exists or not is calculated, if the intersection point does not exist, the two line segments do not intersect, and if the intersection point exists, the two line segments intersect;
for crystalline rime, the minimum quadrilateral convex hull of the crystalline rime is calculated at first, then the intersection judgment of the quadrilateral convex hull is carried out on the crystalline rime which is far away from the current rime and the length d of the current rime, and the judgment steps are as follows:
firstly, judging the intersection of a first edge of a current crystal rime quadrilateral convex hull and a first edge of another crystal rime quadrilateral convex hull, if the two edges are parallel, comparing the first edge of the current crystal rime with a second edge of another crystal rime, and if the two edges are not parallel, carrying out fine judgment;
when the two sides are not parallel, calculating whether the intersection point of the straight lines where the two sides are located occurs in the effective range of the two line segments, if so, judging that the two rimes intersect, and if not, selecting the next side for judgment;
after comparing the four edges of the protruding package of the current crystal soft rime with the other crystal soft rime, if the effective intersection point is not calculated, the two crystal soft rimes are not intersected, otherwise, the two crystal soft rimes are intersected.
In order to make the technical problems, technical solutions and advantages of the present invention more clearly apparent, the present invention is described in detail below with reference to the accompanying drawings and examples.
1 selection and Loading of Tree models
The introduced model is an OBJ type tree model file, the mesh of the model is composed of triangles, therefore, the OBJ file stores the vertex coordinates, texture coordinates and triangular patch data of the tree model, and the normal direction of each vertex of the model and the normal direction data of each triangular patch can be obtained through calculation according to the data.
2 selection of rime growth point
The growth of rime is simulated by firstly determining a growth point. When the growth points are selected, in order to accord with the characteristics of natural distribution, limited points are randomly selected from the triangular surface as the growth points of the rime. And (3) obtaining vertex data of each triangular patch in the model by importing an OBJ file of the tree model, setting the vertex as A, B, C, and randomly taking a point D in the triangular patch as a growth point of the rime. From the coordinates of the three points A, B, C, the coordinates of the point D are expressed by formula (1):
D=a*A+b*B+c*C (1)
wherein a + b + c is 1, and a, b, c are non-negative numbers. In the actual calculation process, the values of a and b are randomly generated, and the value of c is calculated by a formula. The growth density of the crystal rime is relatively sparse, so 3 points are randomly selected from each triangular face as growth points; the growth density of the needle-shaped rime is relatively dense, so that 5 points are randomly selected from each triangular face as growth points.
Selection of 3 rime length
The rime is formed by condensing water vapor continuously released from rivers, rivers and the like between trees and grass on two banks, and the thickness of the rime fluctuates randomly within the range of 40-60 mm. Rime length L of the inventionwThe value of (A) is selected from [0.4, 0.6%]Random numbers within the interval.
The shape of the acicular rime is obtained by calculating the offset of each growth end point under the action of wind power in sections, so the length L of each sectionwiTotal length L of rimewDivided by the number of growing segments r multiplied by a random coefficient lambdawiEnsuring that the sum of the lengths of each section is equal to LwI.e. satisfying formula (2):
where i is 1,2,3, …, r, λw1+λw2+λw3+...+λwi=1。
4 growth direction of rime
The growth environment of the crystalline rime is breeze, and the influence of the wind on the growth direction of the rime is not dominant, so the growth direction of the rime is determined by the growth direction of the rime and the wind direction of the rime. The calculation method of the growth direction of the rime crystal is as follows: and selecting a random point E except the current growth point D on the triangular patch of the tree model, and taking the vector DE as a disturbance vector, wherein the sum of the normal direction of the triangular patch where the current growth point is located and the disturbance vector DE is the growth direction of the rime per se on the current growth point.
The growth environment of the needle-shaped rime is strong wind, the influence of the wind on the growth direction of the rime is far larger than that of the rime itself, and the rime occupies a dominant position, so that the current wind direction is taken as the growth direction of the rime.
5 growth form of rime
The crystal rime is characterized by small density, very similar shape to snowflake and self-similar feature, so the invention adopts fractal mode to simulate the shape of the crystal rime. The specific calculation flow is as follows:
5.1 calculate the branch start and branch length.
Taking three points between a growth point D and a growth end point G of the current crystal rime as branch starting points, and marking as points I, wherein the position of each branch starting point I and the length L of each branch respectively satisfy a formula (3) and a formula (4):
I=a*G+b*D (3)
wherein a + b is 1, a, b > 0, x1,y1,z1Is the coordinate value of the growth point D, x2,y2,z2The Index value is the coordinate value of the growing point G, the values of the indexes are different according to different values of the number of layers of the current branch, the indexes of each layer of branches are reduced from the growing point to the growing end point in sequence, and the indexes belong to (0, 1).
5.2 calculate left and right branch end points.
The left and right branch end points of the branch starting point I are recorded as K, J respectively, and the included angles between the branches IJ and IK and the trunk DG are recorded as theta. In a three-dimensional space, an included angle beta also exists between the main stem DG and the world coordinate horizontal direction, and then the calculation formula of the left branch end point is as follows (5):
wherein KxIs the horizontal coordinate of the left branch end point, KyThe ordinate of the left branch end point is shown.
The right branch end point calculation formula is as follows (6):
wherein, JxIs the abscissa of the right branch end point, JyIs the ordinate of the right branch end point.
And calculating branches on the other two layers of branch points on the main stem DG by using the same method, modifying the iteration times of fractal calculation, taking the calculated branches as new main stems, and continuing to grow the branches to obtain the final complete shape of the rime.
The needle-shaped rime is characterized by high density and very similar shape to the needle, but the needle-shaped rime in nature is not very standard needle-shaped but has a certain bending degree, so that the irregular bending existing in the growth process is expressed by adopting a sectional mode. Recording the current rime growth point as a point D, and calculating to obtain a growth end point D of the first rime1Then by D1As the growth point, calculating to obtain the growth end point D of the second section2And by analogy, finally connecting each point to obtain the final growth form of the acicular rime.
FIG. 7 is a graph of the results for rime in the 4 th wind; FIG. 8 is a graph of the results for rime in the 6 th wind; FIG. 9 is a graph of the results for rime crystalline under
grade2 wind; fig. 10 is a graph of the results for rime crystalline under grade 3 wind.
6 wind field simulation
The invention mainly simulates the rime growth under the wind field condition, the wind speed and the wind direction of the nature cannot be defined by a constant quantity, and the rime growth is an indeterminate quantity with certain randomness, so the randomness of the wind in the nature is simulated by introducing a Berlin noise function.
The growth condition of crystal rime is breeze, and the growth condition of needle rime is strong wind. For a high wind environment, the high wind direction at any point in space is represented as: phi ═ where t is [0,2 pi ] (sint,0, cost)]Random number between them, thus ensuring the characteristics of strong wind: the wind directions of all points in the space at the same moment are the same and are parallel to the ground; for breeze, any one in spaceThe wind direction of a point breeze is expressed as phi (-cost)1,0,sint2) Here t1,t2∈[0,2π],t2=t1*NrandIn which N israndIs calculated from Berlin noise as [0,1 ]]Random number between them, thus ensuring the characteristics of breeze: the wind direction of each point in the space at the same moment is random and parallel to the ground. And the wind speed at any point in space corresponds to the average wind speed given by the user as wind level
And maximum wind speed VmaxRelated to and satisfying relation (7):
average and maximum wind speed reference tables:
7 offset of rime growth under action of wind power
Simulating the growth of rime under the action of wind power needs to obtain the offset of rime growth under the action of wind power. The rime growth method utilizes mechanics of materials to perform stress analysis on the rime, and derives a formula of the offset of rime growth under the action of wind power.
The elastic force F borne by the rime from Huke's lawiSatisfies formula (8):
Fi=μQ (8)
wherein mu is the rigidity coefficient of ice crystal, Q is the deformation under the action of force, namely the offset of the rime growth end point relative to the growth point under the action of wind power. Since no data on the stiffness coefficient of ice crystals was found, equation (8) needs to be deformed.
The elastic force F borne by rime according to Huke's lawiCan also be represented by formula (9):
wherein SiArea of rime, EiThe elastic modulus of ice crystal is the temperature of [ -19.0, -1.0 [ -19.0 ]]The elastic modulus of ice crystals at a temperature of between [5.0,6.0 ]]Thus EiTake [5.0,6.0 ]]Random number between them, Δ L is deformation amount of rime under elastic force, LwLength of rime defined in section three. Simplifying to obtain the relation between rime rigidity coefficient and Young modulus as follows: mu-Ei*WiWherein W isiThe width of the rime. Thus the elastic force F borne by the rimeiCan also be represented by formula (10):
Fi=Ei*Wi*Q (10)
then considering the stress of the rime, the law of momentum is as follows:
wherein m isgM is the mass of windg=ρSgVwt, ρ is the air density, which is 1.29 in the standard state, SgIs the frontal area, VwIs the wind speed.
The stress of rime is balanced by Fi=FgFinally, the transverse component Q of the offset Q of the rime growth end point relative to the growth point under the action of wind power is obtainedxIs represented by formula (12):
longitudinal offset QyIs represented by formula (13):
wherein, for rime crystalline, Δ αi-gThe included angle between the rime growth direction and the wind direction, for acicular rime, Δ αi-gIs the wind direction.
Thus, the offset of the rime growth end point relative to the growth point under the action of wind power can be calculated to obtain the rime growth end point and the growth end point of each section of the acicular rime, and finally the rime form is drawn to obtain the final result.
FIG. 11 is a simulated complete picture of needle-like rime and a comparison of real needle-like rime; fig. 12 is a simulated complete picture of rime and a comparison of real rime.
8 puncturing process
Because the geometrical form is adopted to express the rime form, the result can generate a certain puncture phenomenon. Mainly relates to two kinds of puncture phenomena, namely, the puncture between the rime and the tree trunk, and the puncture between the rime and the rime.
The reason for the puncture between the rime and the tree trunk is: the rime grows on the windward side, so that the rime on the leeward side grows into the trunk, and the puncture phenomenon occurs. Judging the position of the current rime growth point before rime growth, and if the rime growth point is windward, growing the rime; and if the surface is leeward, rime does not grow. The condition of judging whether the triangular patch where the current rime growth point is located is the windward side is as follows: the dot product of the normal direction of the triangular patch and the wind direction is a windward side as the rule, and a leeward side as the rule.
The reason why the puncture between the soft rimes occurs is that: the rime has a certain density, so that collision between the rime and the rime can occur in the simulation process. The needle-like rime and the crystal rime have great difference in structure, so that the mode of judging whether collision occurs is different, and the specific solution is as follows:
1. for needle-like rime, the structure is relatively simple, so that each section of the current needle-like rime is collided with each section of the needle-like rime to be detected. If the two line sections are out of plane, no collision occurs; if the two surfaces are not different, whether the two surfaces are parallel or not is judged, and if the two surfaces are not different but parallel, no collision occurs; if the two lines are not in different planes and are not parallel, the possibility of collision is indicated, fine judgment is carried out, whether the intersection point of the straight lines of the two lines is in the effective area of the two lines is determined, if not, no collision occurs, and if the intersection point is in the effective area, the collision occurs.
2. For the rime crystal, the structure is relatively complex, and collision judgment cannot be performed on each line segment, so that a quadrilateral convex hull is obtained for each rime crystal, and the problem is simplified into a quadrilateral collision problem. And each edge of the current rime crystal convex hull collides with each strip of the rime crystal convex hull to be detected. Firstly, judging whether two edges are parallel or not, and if so, judging that no collision occurs; if the two sides are not parallel, calculating whether the intersection point of the straight lines where the two sides are located is in the effective area of the two sides, if not, no collision occurs, and if so, indicating that the collision occurs.
Through the steps, whether the piercing phenomenon exists between the rimes can be quickly judged. If the puncture phenomenon occurs, a random disturbance is added to the growth direction of the rime, so that the rime deviates from the original growth direction.
The method of operation of the algorithm of the present invention is described below.
Fig. 1 is a flowchart of an overall algorithm according to the present invention. After the program starts, entering a step II, requiring a user to input the current temperature, if the temperature is higher than-2 ℃, not meeting the condition of the growth temperature of the rime, and jumping to a step III to finish the program; if the temperature is lower than-2 ℃, the growth condition of the rime is met, the step three is carried out, and the growth length of the rime is calculated and is a random number in a certain range; and then jumping to the step IV, requiring the user to input the current wind level for judging the type of the grown rime, if the wind level is less than the level 3, the type of the grown rime is crystal rime, and entering a module V for performing the operation related to the growth of the crystal rime: obtaining relatively less growing points due to relatively loose density of the crystal-like rime, then calculating the growing direction, the offset in the XZ direction and the growing end point respectively, finally simulating the shape of the crystal-like rime by utilizing fractal, entering the step (c), and ending the procedure; if the wind level is not less than 3, the kind of the grown soft rime is needle soft rime, and the module enters the module for the relevant operation of the needle soft rime growth: and finally, sequentially connecting the nodes to obtain the final shape of the acicular soft rime, and after the whole process is completed, entering a step (c) and finishing the process.
In the example shown in fig. 5, the user first inputs temperature information according to the prompt information (i), when the temperature meets the conditions for growing rime, the user proceeds to next prompt information (ii) to input the current wind level, and after the input is completed, the user obtains the corresponding rime growth result and displays the program running time (iii).
In the example shown in fig. 6, the user first inputs temperature information according to the prompt information (i), and when the temperature does not meet the rime growth condition, a prompt (ii) is obtained: and (4) the rime cannot grow at the temperature of more than-2 ℃, then displaying the running time of the program and ending the program.
It should be noted that the above-mentioned embodiments are only used for explaining the present invention, and are not used for limiting the present invention.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810001268.5A CN108229018B (en) | 2018-01-02 | 2018-01-02 | A method for simulating rime growth based on fractal and Perlin noise |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810001268.5A CN108229018B (en) | 2018-01-02 | 2018-01-02 | A method for simulating rime growth based on fractal and Perlin noise |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108229018A CN108229018A (en) | 2018-06-29 |
CN108229018B true CN108229018B (en) | 2021-04-13 |
Family
ID=62642376
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810001268.5A Active CN108229018B (en) | 2018-01-02 | 2018-01-02 | A method for simulating rime growth based on fractal and Perlin noise |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108229018B (en) |
Family Cites Families (4)
* Cited by examiner, † Cited by third partyPublication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103020440B (en) * | 2012-12-04 | 2015-12-02 | 河南省电力公司 | A kind of simulation of plant growth optimization method based on Clouds theory |
CN103021012A (en) * | 2012-12-31 | 2013-04-03 | 中国科学院自动化研究所 | Method for combining static structure and utilizing computer to draw dynamic 3D (three-dimension) plant |
CN103679773B (en) * | 2013-12-31 | 2017-03-08 | 中国林业科学研究院资源信息研究所 | A kind of trees morphological Simulation method based on self adaptation fractal algorithm |
EP3368943B1 (en) * | 2015-10-30 | 2021-07-28 | Aptiv Technologies Limited | Method and system for performing panel vibration and selective backlight control to reduce moiré interference in a display system including multiple displays |
-
2018
- 2018-01-02 CN CN201810001268.5A patent/CN108229018B/en active Active
Non-Patent Citations (1)
* Cited by examiner, † Cited by third partyTitle |
---|
Edge detection using the local fractal dimension;K.D.Toennies等;《IEEE Xplore》;20020806;34-39 * |
Also Published As
Publication number | Publication date |
---|---|
CN108229018A (en) | 2018-06-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Makowski et al. | 2019 | Synthetic silviculture: multi-scale modeling of plant ecosystems |
CN103279980B (en) | 2016-02-24 | Based on the Leaf-modeling method of cloud data |
Ball | 2011 | Branches: Nature's patterns: a tapestry in three parts |
CN103745497B (en) | 2017-05-10 | Plant growth modeling method and system |
CN105654543B (en) | 2019-01-22 | Modeling and deformation method of real leaves of broad-leaved trees based on laser point cloud data |
CN101639946A (en) | 2010-02-03 | Plant leaf three-dimensional model geometric description and curved surface reconstruction method and system |
CN101650836A (en) | 2010-02-17 | Self-adaptive gridding method and self-adaptive gridding system of geometric curved surfaces of three-dimensional plant organs |
CN105405163A (en) | 2016-03-16 | Vivid static-state hair modeling method based on multiple direction fields |
CN102254344A (en) | 2011-11-23 | Method for dynamically visualizing interactive virtual plants |
CN102074012A (en) | 2011-05-25 | Method for three-dimensionally reconstructing tender shoot state of tea by combining image and computation model |
CN102855661A (en) | 2013-01-02 | Large-scale forest scene quick generation method based on space similarity |
CN106844979A (en) | 2017-06-13 | A kind of virtual park interactive combination design system in city and method |
Bohl et al. | 2015 | Modeling fruits and their internal structure using parametric 3Gmap L-systems |
CN103337092B (en) | 2015-09-30 | Branches of fruit trees framework extraction method |
CN106874602A (en) | 2017-06-20 | Process meteorological data method and apparatus |
CN108229018B (en) | 2021-04-13 | A method for simulating rime growth based on fractal and Perlin noise |
Joseph et al. | 2021 | Recreating Traditional Indonesian Batik with Neural Style Transfer in AI Artistry |
Hui et al. | 2021 | Power equipment segmentation of 3d point clouds based on geodesic distance with k-means clustering |
CN109446577A (en) | 2019-03-08 | WaterfrontLandscape Design method based on numerical simulation hydrological analysis |
CN104615481B (en) | 2019-02-01 | A kind of wind based on cluster cluster has leaf tree to flicker analogy method |
Li et al. | 2018 | Physically-based algorithm for natural rime growth simulation |
Chaudhury et al. | 2020 | Geometry reconstruction of plants |
CN102663816B (en) | 2017-04-26 | Plant leaf wilting simulation method based on physical model |
Xu et al. | 2020 | Physics-based algorithm to simulate tree dynamics under wind load |
CN119647203A (en) | 2025-03-18 | L-system-based locust degradation overall process modeling method, system, equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
2018-06-29 | PB01 | Publication | |
2018-06-29 | PB01 | Publication | |
2018-07-24 | SE01 | Entry into force of request for substantive examination | |
2018-07-24 | SE01 | Entry into force of request for substantive examination | |
2021-04-13 | GR01 | Patent grant | |
2021-04-13 | GR01 | Patent grant |