patents.google.com

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 PDF

Info

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
Application number
CN201810001268.5A
Other languages
Chinese (zh)
Other versions
CN108229018A (en
Inventor
李晔
杨猛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Forestry University
Original Assignee
Beijing Forestry University
Priority date (The priority date 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 date listed.)
2018-01-02
Filing date
2018-01-02
Publication date
2021-04-13
2018-01-02 Application filed by Beijing Forestry University filed Critical Beijing Forestry University
2018-01-02 Priority to CN201810001268.5A priority Critical patent/CN108229018B/en
2018-06-29 Publication of CN108229018A publication Critical patent/CN108229018A/en
2021-04-13 Application granted granted Critical
2021-04-13 Publication of CN108229018B publication Critical patent/CN108229018B/en
Status Active legal-status Critical Current
2038-01-02 Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/20Design optimisation, verification or simulation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing 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

本发明提出一种基于分形和柏林噪声的模拟雾凇生长的方法。该方法模拟自然界中晶状和针状两种主要类型的雾凇在风场条件下的生长形态与方向。该方法根据柏林噪声的基本理论,通过构造随机噪声函数、余弦插值平滑函数来实现风场的模拟,利用材料力学知识分析风力作用下雾凇的偏移细节,由此计算出风力作用下雾凇沿着生长方向相对于生长点的偏移量。最后利用分形的方法模拟晶状雾凇的形态,利用分节计算生长终点方法来模拟针状雾凇的形态。

Figure 201810001268

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.

Figure 201810001268

Description

Fractal and Berlin noise-based rime growth simulation method

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

Figure GDA0002958742200000031

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:

Figure GDA0002958742200000041

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:

Figure GDA0002958742200000042

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:

Figure GDA0002958742200000043

longitudinal offset QyComprises the following steps:

Figure GDA0002958742200000044

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

grade

2 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

Figure GDA0002958742200000071

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:

Figure GDA0002958742200000081

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:

Figure GDA0002958742200000082

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:

Figure GDA0002958742200000083

longitudinal offset QyComprises the following steps:

Figure GDA0002958742200000084

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):

Figure GDA0002958742200000101

where i is 1,2,3, …, r, λw1w2w3+...+λ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)

Figure GDA0002958742200000102

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):

Figure GDA0002958742200000111

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):

Figure GDA0002958742200000112

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

grade

2 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

Figure GDA0002958742200000113

And maximum wind speed VmaxRelated to and satisfying relation (7):

Figure GDA0002958742200000114

average and maximum wind speed reference tables:

Figure GDA0002958742200000121

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):

Figure GDA0002958742200000122

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:

Figure GDA0002958742200000123

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):

Figure GDA0002958742200000131

longitudinal offset QyIs represented by formula (13):

Figure GDA0002958742200000132

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)

1.一种基于分形和柏林噪声的模拟雾凇生长的方法,其特征在于包括以下步骤:1. a method for simulating rime growth based on fractal and Perlin noise, is characterized in that comprising the following steps: 1)建立树木模型1) Build a tree model 在该模型中储存树木模型的顶点坐标、纹理坐标以及三角面片数据;Store vertex coordinates, texture coordinates and triangular patch data of the tree model in this model; 2)选取雾凇生长点2) Select the rime growth point 在所述的树木模型三角面片上随机取有限个点作为雾凇的生长点;Randomly select a limited number of points as the growth points of the rime on the triangular patch of the tree model; 3)选取雾凇的长度3) Select the length of the rime 雾凇长度的数值选取[0.4,0.6]区间内的随机数;The value of the rime length is selected as a random number in the interval [0.4, 0.6]; 4)确定雾凇的生长方向4) Determine the growth direction of rime 晶状雾凇:以自身生长方向与风向之和作为晶状雾凇的生长方向,确定晶状雾凇自身生长方向的方法是:在树木模型的三角面片上选取一个除当前生长点D之外的随机点E,将向量DE作为一个扰动向量,则当前生长点所在三角面片的法向与扰动向量DE之和即为当前生长点上晶状雾凇自身的生长方向;Crystalline rime: The sum of its own growth direction and wind direction is used as the growth direction of crystalline rime. The method to determine the growth direction of crystalline rime is: Select a random point other than the current growth point D on the triangular patch of the tree model. E, taking the vector DE as a disturbance vector, 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 crystalline rime on the current growth point; 针状雾凇:将当前风向作为针状雾凇的生长方向;Needle rime: take the current wind direction as the growth direction of needle rime; 5)模拟风场5) Simulate the wind field 自然界的风速和风向存在随机性的不定量,通过引入柏林噪声函数来模拟自然界的风存在的这种随机性,模拟风场详细步骤是:The wind speed and wind direction in nature have indefinite randomness. By introducing the Perlin noise function to simulate the randomness of wind in nature, the detailed steps for simulating the wind field are: 晶状雾凇的生长条件是微风,针状雾凇的生长条件是大风,对于大风环境,将空间中任意一点的大风风向表示为:Φ=(sin t,0,cos t),其中t是[0,2π]之间的随机数,这样保证大风的特点:同一时刻空间中各个点的风向相同并与地面平行;对于微风,空间中任意一点微风风向表示为Φ=(-cos t1,0,sin t2),这里t1,t2∈[0,2π],t2=t1*Nrand,其中Nrand是通过柏林噪声计算得到的[0,1]之间的随机数,这样保证微风的特点:同一时刻空间中各个点的风向具有随机性并与地面平行;The growth condition of crystalline rime is light wind, and the growth condition of needle-like rime is strong wind. For the strong wind environment, the strong wind direction at any point in the space is expressed as: Φ=(sin t, 0, cost t), where t is [0 , 2π], which ensures the characteristics of the strong wind: the wind direction of each point in the space at the same time is the same and parallel to the ground; for the breeze, the wind direction of the breeze at any point in the space is expressed as Φ=(-cos t 1 , 0, sin t 2 ), where t 1 , t 2 ∈ [0, 2π], t 2 =t 1 *N rand , where N rand is a random number between [0, 1] calculated by Perlin noise, which ensures that The characteristics of the breeze: the wind direction of each point in the space at the same time is random and parallel to the ground; 6)求取风力作用下雾凇生长的偏移量6) Calculate the offset of rime growth under the action of wind 利用材料力学对雾凇进行受力分析,由胡克定律,雾凇所受的弹力Fi=μQUsing material mechanics to analyze the force of rime, according to Hooke's law, the elastic force of rime is F i = μQ 其中μ是冰晶的刚度系数,Q是在风力作用下雾凇生长终点相对于生长点的偏移量,where μ is the stiffness coefficient of ice crystals, Q is the offset of the rime growth end point relative to the growth point under the action of wind, 求取风力作用下雾凇生长的偏移量的步骤是:The steps to find the offset of rime growth under the action of wind are: 根据胡克定律,雾凇所受弹力Fi还可以表示为:According to Hooke's law, the elastic force F i on the rime can also be expressed as:

Figure FDA0002958742190000021

Figure FDA0002958742190000021

其中:Si为雾凇的面积,Ei为冰晶的弹性模量,气温在[-19.0,-1.0]摄氏度之间时冰晶的弹性模量为[5.0,6.0],因此Ei取[5.0,6.0]之间的随机数,Δl为弹力作用下雾凇的形变量,Lw为雾凇的长度,化简得到雾凇刚度系数与冰晶的弹性模量之间的关系为:μ=Ei*Wi,其中Wi为雾凇的宽度,因此雾凇所受弹力Fi还可以表示为:Fi=Ei*Wi*Q,再考虑雾凇的受力,由动量定律,有:

Figure FDA0002958742190000022

其中:mg为风的质量,满足mg=ρSgVwt,ρ为空气密度,取标准状态下空气密度,值为1.29,Sg为迎风面积,Vw是风速,
Among them: S i is the area of rime, E i is the elastic modulus of ice crystal, the elastic modulus of ice crystal is [5.0, 6.0] when the temperature is between [-19.0, -1.0] degrees Celsius, so E i is taken as [5.0, 6.0], Δl is the deformation of the rime under the action of the elastic force, Lw is the length of the rime, and the relationship between the rime stiffness coefficient and the elastic modulus of the ice crystal is obtained by simplification: μ=E i * W i , where Wi is the width of the rime, so the elastic force F i on the rime can also be expressed as: F i =E i *W i * Q , and then consider the force on the rime, from the law of momentum, there are:

Figure FDA0002958742190000022

Among them: m g is the mass of the wind, satisfying m g = ρS g V w t, ρ is the air density, taking the air density in the standard state, the value is 1.29, S g is the windward area, V w is the wind speed,
由雾凇的受力平衡,有Fi=Fg,最终求得风力作用下雾凇生长终点相对于生长点的偏移量Q的横向分量Qx为:

Figure FDA0002958742190000023

纵向偏移量Qy为:

Figure FDA0002958742190000024

其中,对于晶状雾凇,Δαi-g是雾凇生长方向与风向的夹角,对于针状雾凇,Δαi-g是风向;
According to the force balance of the rime, there is F i =F g , and finally the lateral component Q x of the offset Q of the end point of the rime growth relative to the growth point under the action of wind is obtained as:

Figure FDA0002958742190000023

The longitudinal offset Q y is:

Figure FDA0002958742190000024

Among them, for crystalline rime, Δαig is the angle between the growth direction of the rime and the wind direction, and for acicular rime, Δαig is the wind direction;
由此计算出风力作用下雾凇生长终点相对于生长点的偏移量后,就得到晶状雾凇的生长终点,以及针状雾凇每一节的生长终点;From this, after calculating the offset of the rime growth end point relative to the growth point under the action of wind, the growth end point of the crystalline rime and the growth end point of each section of the needle rime are obtained; 7)模拟雾凇生长的形态7) Simulate the shape of rime growth 采用分形的方式模拟晶状雾凇的形态,计算流程是:The fractal method is used to simulate the shape of crystalline rime. The calculation process is as follows: 计算分支起点及分支长度,在当前晶状雾凇的生长点D和生长终点G之间取三个点作为分支起点,记为点I,每个分支起点I的位置以及每个分支的长度L分别满足I=a*G+b*D和

Figure FDA0002958742190000025

其中:a和b为随机正整数且满足a+b=1,x1,y1,z1是生长点D的坐标值,x2,y2,z2是生长点G的坐标值,Index的值根据当前分支的层数不同取值不同,从生长点到生长终点,每层分支Index依次减小,并且Index∈(0,1);
Calculate the branch starting point and branch length, and take three points between the growth point D and the growth end point G of the current crystalline rime as the branch starting point, denoted as point I, the position of each branch starting point I and the length L of each branch respectively. Satisfy I=a*G+b*D and

Figure FDA0002958742190000025

Where: a and b are random positive integers and satisfy a+b=1, x 1 , y 1 , z 1 are the coordinate values of the growing point D, x 2 , y 2 , z 2 are the coordinate values of the growing point G, Index The value of is different according to the number of layers of the current branch. From the growth point to the growth end point, the Index of each layer of branches decreases in turn, and Index∈(0,1);
计算左右分支终点,记分支起点I的左右两个分支终点分别为K、J,分支IJ、IK与主干DG的夹角为θ,在三维空间中,主干DG与世界坐标水平方向也存在夹角β,Calculate the end points of the left and right branches, record the end points of the left and right branches of the branch start point I as K and J, respectively, and the angle between the branches IJ, IK and the trunk DG is θ. In three-dimensional space, the trunk DG also has an included angle with the horizontal direction of the world coordinate. β, 左分支终点计算公式如下:The calculation formula for the end point of the left branch is as follows: Kx=Ix+L*(cosβ*cosθ-sinβ*sinθ)K x =I x +L*(cosβ*cosθ-sinβ*sinθ) Ky=Iy+L*(sinβ*cosθ+cosβ*sinθ)K y =I y +L*(sinβ*cosθ+cosβ*sinθ) 右分支终点计算公式如下:The calculation formula for the end point of the right branch is as follows: Jx=Ix+L*(cosβ*cosθ+sinβsinθ)J x =I x +L*(cosβ*cosθ+sinβsinθ) Jy=Iy+L*(sinβ*cosθ-cosβsinθ)J y =I y +L*(sinβ*cosθ-cosβsinθ) 其中:Kx为左分支终点横坐标,Ky为左分支终点纵坐标,Jx为右分支终点横坐标,Jy为右分支终点纵坐标,Where: K x is the abscissa of the end point of the left branch, Ky is the ordinate of the end point of the left branch, J x is the abscissa of the end point of the right branch, J y is the ordinate of the end point of the right branch, 再利用相同的方法计算主干DG上另两层分支点上的分支,通过修改分形计算的迭代次数,将计算得到的分支作为新的主干,继续生长分支,得到最后的晶状雾凇完整形态;Then use the same method to calculate the branches on the other two layers of branch points on the trunk DG. By modifying the number of iterations of the fractal calculation, the calculated branch is used as the new trunk, and the branch is continued to grow to obtain the final complete form of crystalline rime; 因针状雾凇具有一定的弯曲程度,故采用分节的方式来表示针状雾凇在生长过程中存在的不规则的弯曲,具体为:Because the needle-shaped rime has a certain degree of curvature, the segmented method is used to represent the irregular bending of the needle-shaped rime during the growth process, specifically: 记当前雾凇的生长点为点D,计算得到第一节雾凇的生长终点D1,再以D1做为生长点,计算得到第二节的生长终点D2,以此类推,最终将每个点连接起来得到针状雾凇最终的生长形态。Denote the growth point of the current rime as point D, calculate the growth end point D 1 of the first rime, and then use D 1 as the growth point to calculate the growth end point D 2 of the second section, and so on, and finally put each Connect the dots to get the final growth form of acicular rime. 2.如权利要求1所述的基于分形和柏林噪声的模拟雾凇生长的方法,其特征在于还包括以下穿刺处理的步骤:2. the method for simulating rime growth based on fractal and Perlin noise as claimed in claim 1, it is characterized in that also comprising the step of following puncture processing: 对于雾凇与树干之间发生的穿刺,在生长雾凇之前对当前雾凇生长点所在位置进行判断,若为迎风面,则生长雾凇;若为背风面,则不生长雾凇;For the puncture that occurs between the rime and the trunk, the location of the current rime growth point is judged before the rime grows. If it is the windward side, the rime will grow; if it is the leeward side, the rime will not grow; 对于雾凇与雾凇之间发生的穿刺,因针状雾凇的结构比较简单,故直接利用判断空间线段是否相交的方式进行判断;晶状雾凇结构复杂,为减少计算量,首先为每一个晶状雾凇求得最小四边形凸包,再利用判断四边形是否相交的方式进行判断。For the puncture between rime and rime, because the structure of needle-like rime is relatively simple, it is directly judged by judging whether the space line segments intersect; the structure of crystalline rime is complex, in order to reduce the amount of calculation, first of all for each crystalline rime Find the minimum quadrilateral convex hull, and then use the method of judging whether the quadrilaterals intersect. 3.如权利要求1所述的基于分形和柏林噪声的模拟雾凇生长的方法,其特征在于:3. the method for the growth of simulated rime based on fractal and Perlin noise as claimed in claim 1, is characterized in that: 所述选取雾凇生长点的详细步骤是:The detailed steps of selecting the rime growth point are: 通过导入树木模型的.OBJ文件,得到模型中每一个三角面片的顶点数据,设顶点为A、B、C,在这个三角面片内随机取一点D作为雾凇的生长点,由A、B、C三点的坐标,得到D点坐标表达为D=a*A+b*B+c*C,其中:a+b+c=1,且a、b、c为非负数,a、b的数值随机生成,c的数值由公式计算得到,晶状雾凇生长密度相对比较稀疏,因此每个三角面片上随机取3个点作为生长点;针状雾凇生长密度相对比较密集,因此每个三角面片上随机取5个点作为生长点。By importing the .OBJ file of the tree model, the vertex data of each triangular patch in the model is obtained, and the vertices are set as A, B, and C, and a point D is randomly selected as the growth point of the rime in this triangular patch. , the coordinates of the three points C, the coordinates of the D point are expressed as D=a*A+b*B+c*C, where: a+b+c=1, and a, b, c are non-negative numbers, a, b The value of is randomly generated, and the value of c is calculated by the formula. The growth density of crystalline rime is relatively sparse, so 3 points are randomly selected as growth points on each triangular facet; the growth density of needle rime is relatively dense, so each triangle Randomly select 5 points on the patch as growth points. 4.如权利要求2所述的基于分形和柏林噪声的模拟雾凇生长的方法,其特征在于:4. the method for simulating rime growth based on fractal and Perlin noise as claimed in claim 2, is characterized in that: 所述处理雾凇与树干之间的穿刺的详细步骤是:The detailed steps of processing the puncture between the rime and the trunk are: 在生长雾凇之前对当前雾凇生长点所在位置进行判断,若为迎风面,则生长雾凇;若为背风面,则不生长雾凇,判断当前雾凇生长点所在的三角面片是否为迎风面的条件是:三角面片的法向与风向的点积为正则为迎风面,为负则为背风面。Before the rime grows, judge the location of the current rime growing point. If it is the windward side, the rime will grow; if it is the leeward side, the rime will not grow, and the condition for judging whether the triangle patch where the current rime growing point is located is the windward side is: : If the dot product of the normal direction of the triangular patch and the wind direction is positive, it is the windward side, and if it is negative, it is the leeward side. 5.如权利要求2所述的基于分形和柏林噪声的模拟雾凇生长的方法,其特征在于:5. the method for simulating rime growth based on fractal and Perlin noise as claimed in claim 2, is characterized in that: 所述处理雾凇与雾凇之间穿刺的详细步骤是:The detailed steps of the described processing smog and the puncture between the smog are: 对于针状雾凇,直接利用判断空间直线是否相交的方法进行判断,对于当前针状雾凇和与其相距为当前雾凇的长度的针状雾凇,每一节都进行判断,判断步骤如下:For the needle-shaped rime, the method of judging whether the space straight lines intersect is directly used to judge. For the current needle-shaped rime and the needle-shaped rime whose distance is the length of the current rime, each section is judged, and the judgment steps are as follows: 判断两线段是否共面,若不共面则为异面,两线段不相交,若共面,则继续进行判断;Determine whether the two line segments are coplanar, if not, they are different planes, and the two line segments do not intersect, if they are coplanar, continue to judge; 判断共面的两线段是否平行,若平行则两线段不相交,若不平行,则继续进行判断;Determine whether two coplanar line segments are parallel, if they are parallel, the two line segments do not intersect, if not, continue to judge; 进行精细判断,计算两线段的交点是否存在,若不存在,则两线段不相交,若存在,则两线段相交;Make a fine judgment to calculate whether the intersection of the two line segments exists, if not, the two line segments do not intersect, if so, the two line segments intersect; 对于晶状雾凇,首先计算其最小四边形凸包,然后对于当前晶状雾凇和与其相距为当前雾凇的长度的晶状雾凇进行凸包四边形相交判断,判断步骤如下:For the crystalline rime, first calculate its minimum quadrilateral convex hull, and then judge the intersection of the convex hull quadrilaterals for the current crystalline rime and the crystalline rime whose distance is the length of the current rime. The judgment steps are as follows: 首先将当前晶状雾凇四边形凸包的第一条边与另一晶状雾凇四边形凸包的第一条边进行相交判断,若两边平行,则将当前晶状雾凇的第一条边与另一晶状雾凇的第二条边进行比较,若两边不平行,则进行精细判断;First, judge the intersection of the first edge of the convex hull of the current crystalline rime quadrilateral with the first edge of the convex hull of another crystalline rime quadrilateral. The second side of the crystalline rime is compared, and if the two sides are not parallel, a fine judgment is made; 当两边判断为不平行时,则计算两边所在直线交点是否发生在两线段的有效范围内,若在有效范围内,则判断为两雾凇相交,若不在有效范围内,则选取下一条边进行判断;When the two sides are judged to be non-parallel, it is calculated whether the intersection of the two lines is within the valid range of the two line segments. If it is within the valid range, it is judged that the two rimes intersect. If it is not within the valid range, the next edge is selected for judgment. ; 当前晶状雾凇与另一晶状雾凇凸包的四条边都比较后,若未计算出有效相交点,则说明两晶状雾凇不相交,否则相交。After comparing the four sides of the convex hull of the current crystalline rime with another crystalline rime, if no valid intersection point is calculated, it means that the two crystalline rimes do not intersect, otherwise they intersect.
CN201810001268.5A 2018-01-02 2018-01-02 A method for simulating rime growth based on fractal and Perlin noise Active CN108229018B (en)

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 party
Publication 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

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
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