Method for generating hexahedral mesh based on closed-form polycube

Information

  • Patent Grant
  • 10366535
  • Patent Number
    10,366,535
  • Date Filed
    Friday, November 25, 2016
    7 years ago
  • Date Issued
    Tuesday, July 30, 2019
    5 years ago
Abstract
A method for generating a hexahedral mesh based on a closed-form polycube includes steps of: converting a surface triangular mesh into a tetrahedral mesh; obtaining an initial 3-dimensional frame field; according surface normal constraint, generating a smooth frame field without singular line inside the model; extracting a transition relation on the cut surface based on the smooth frame field; providing Poisson optimization on cut model based on the frame field for obtaining a preliminary parameterized result; using L1-optimization for forming a final closed-form polycube; optimizing with an mixed integer for obtaining a final parameterized result; and extracting the hexahedral mesh. The method automatically generates the hexahedral mesh from the triangular mesh, and has nothing to do with an initial position of an object, which is able to better satisfy a characteristic constraint of the model; and for a model with complex topology, high quality hexahedral mesh is available.
Description
CROSS REFERENCE OF RELATED APPLICATION

This is a U.S. National Stage under 35 U.S.C 371 of the International Application PCT/CN2016/107179, filed Nov. 25, 2016, which claims priority under 35 U.S.C. 119(a-d) to CN 201610273300.6, filed Apr. 27, 2016.


BACKGROUND OF THE PRESENT INVENTION

Field of Invention


The present invention relates to a method for processing a 3-dimensional mesh, and more particularly to a method for generating a hexahedral mesh based on a closed-form polycube.


Description of Related Arts


Hexahedral meshes have a wide range of applications in computer graphics and in industries such as CAD, physical simulation, geometrical construction, and so on. However, there are still many problems in automating the generation of hexahedral meshes, such as the low degree of automation and the inability to avoid global degradation, and the resulting hexahedral mesh quality is not high. Conventionally, fully automatic hexahedral mesh generation is still a big challenge.


The conventional hexahedral mesh generation methods have their own shortcomings:


1, For a hexahedral mesh generation method based on polycubes, it is necessary to assume that the initial orientation of the model is good, see [Gregson et al. 2011 All-hex mesh generation via volumetric polycube deformation In Computer graphics forum, vol. 30, Wiley Online Library, 1407-1416]. Furthermore, the method lacks user control, see [Gregson et al. 2011 All-hex mesh generation via volumetric polycube deformation In Computer graphics forum, vol. 30, Wiley Online Library, 1407-1416. Tarini et al. 2004 Polycube-maps. In ACM Transactions on Graphics (TOG), vol. 23, ACM, 853-860].


2, For complex models, such as high genus and models with complex feature line constraint, it is impossible to get a high-quality hexahedral mesh based on polycube. [Huang et al 2014. L1 based construction of polycube maps from complex shapes. ACM TOG 33, 3, 25:1-11] discloses a polycube generation method based on L1 optimization, which can be used for hexahedral mesh generation. However, the method is based on the global uniform frame field, and the quality of the hexahedral mesh is not high.


3, [Li et al. 2012. All-hex meshing using singularity-restricted field. ACM TOG 31, 6, 177:1-11] discloses a hexahedral mesh generation method based on a three-dimensional frame field with singularity. However, the method requires a grid modification operation for many degradations, and has poor robustness, leading to difficulty in handling of complex global degradation.


SUMMARY OF THE PRESENT INVENTION

According to defects of conventional technologies, an object of the present invention is to provide a method for generating a hexahedral mesh based on a closed-form polycube which not only automatically generates a closed-form polycube by mapping from a triangular mesh, but also is independent of a position of a model, so as to obtain a high quality hexahedral mesh for a model with a complex topological structure.


Accordingly, in order to accomplish the above object, the present invention comprises steps of:


1) inputting a triangular mesh model, and converting into a tetrahedral mesh model;


2) obtaining all handles on surface meshes, and using the handles as a boundary of a cut surface; establishing a fitting surface and cutting the fitting surface to obtained the cut surface; cutting the tetrahedral mesh model into a model Mc with a first Betti number of 0;


3) defining a frame Rt in each of tetrahedrons of the model Mc, wherein the frame Rt is a 3×3 matrix; using a method in [Huang et al. 2011. Boundary aligned smooth 3d cross-frame field. ACM TOG] for obtaining an initial 3-dimensional frame field R, establishing a minimum spanning tree with the tetrahedrons as nodes in the model Mc which is cut, and globally aligning for the 3-dimensional frame field R, so as to obtain an aligned 3-dimensional frame field;


4) according to cut tetrahedral mesh model surface normal alignment constraint and cut model internal frame field smoothness requirements both inputted by a user, establishing and solving a frame field optimizing formula, so as to obtain a smooth frame field without singular line inside the model;


5) extracting a transition relation on the cut surface based on the smooth frame field obtained in the step 4);


6) providing Poisson reconstruction based on the smooth frame field obtained in the step 4) and the transition relation on the cut surface obtained in the step 5); constructing and solving a Poisson optimizing formula for obtaining a preliminary parameterized result;


7) according to the transition relation obtained in the step 5) and a polycube generating method optimized by a norm l1 according to [Huang et la. 2014. l1 based construction of polycube maps from complex shapes. ACM TOG], establishing and solving a L1-optimized formula for forming the closed-form polycube, wherein the L1-optimized formula is:









min

χ





E
arap


+


w
align



E
align


+


w
diff



E
diff














s
.
t
.






A
_

(






χ
_



(
M
)


)


=

A


M











Π

a
,
b










χ
_

a



(
e
)



=







χ
_

b



(
e
)



,







e



t
a



t
b



C






wherein Ā(χ(M)) represents a surface area of the tetrahedral mesh model in a parameter domain, A∂M represents a surface area of an original tetrahedral mesh model, χ represents a mapping relation, C represents a collection of cut surface pieces; Earap represents ARAP energy, Ealign represents normal alignment energy, Ediff represents normal difference energy, walign represents a normal alignment weight, wdiff represents a normal difference weight, Πa,b represents a public plane transfer relation from a tetrahedron ta to a tetrahedron tb, χa(e) represents an image of an edge e in a parameter domain of ta, χb(e) represents an image of the edge e in a parameter domain of tb, and e represents the edge of the cut surface;


8) according to a polycube result generated in the step 7), extracting a polycube surface normal; according to the polycube surface normal and the transition relation on the cut surface, optimizing with an mixed integer for obtaining a final parameterized result; and


9) extracting according to the final parameterized result for generating the hexahedral mesh.


In the step 4), the frame field optimizing formula is:








min
R




w
f



E
s



+


w
c



E
c


+


w
a



E
A


+


w
d



E
d


+


w
R



E
R






wherein wf is a frame field smoothness weight, wc is a frame field smoothness weight at the cut surface, wa is a surface normal alignment weight, wd is a surface normal smoothness weight, wR is a frame field orthogonal constraint weight, Es is frame field smoothness energy, Ec is frame field smoothness energy at the cut surface, EA normal alignment energy, Ed is surface normal smoothness energy, and ER is frame field orthogonal constraint energy.


In the step 5), the transition relation on the cut surface is extracted with a following formula, and an optimized rotation of 24 kinds of cube symmetrical rotations is selected as an optimized Πk:







Π
k

=


argmin

Π
k









t
i



t
j




c
k






A


t
i



t
j










Π
k



R

t
i



-

R

t
j





2








wherein ck is a piece collection of a number k cut surface, ti∩tj is a public plane of a tetrahedron ti and a tetrahedron tj, Ati∩tj is an area of the public plane, Rti is a frame defined in the tetrahedron ti, and Rtj is a frame defined in the tetrahedron tj.


In the step 6), the Poisson optimizing formula is:







min

χ







M







V






χ
_


-
R



2











s
.
t
.





Π

a
,
b











χ
_

a



(
e
)



=







χ
_

b



(
e
)



,



e



t
a



t
b



C






wherein Πa,b represents the public plane transfer relation from the tetrahedron ta to the tetrahedron tb, χ represents mapping defined on the model, e represents the edge of the cut surface, C represents the collection of the cut surface pieces, ∇χ represents a deformation gradient of mapping, R represents the smooth frame field obtained in the step 4), and M represents an inputted tetrahedral mesh model.


The frame field smoothness energy Es, the frame field smoothness energy Ec at cut boundaries, the normal alignment energy EA, the surface normal smoothness energy Ed, and the frame field orthogonal constraint energy ER are calculated as follows:


the frame field smoothness energy Es is:











t
i



t
j




F

\

C








V

t
i


+

V

t
j




4






V
F



d


t
i

,

t
j


2









R

t
i


-

R

t
j





2






wherein C is the collection of the cut surface pieces, dti,tj is a barycenter distant between a tetrahedron ti and a tetrahedron ti, h(r) is a rotation-irrelevant function, Vti is a volume of ti, Vti is a volume of tj, and VF is a normalized weight of the frame field smoothness energy Es;


the frame field smoothness energy Ec at the cutting boundaries is:











t
i



t
j



C







V

t
i


+

V

t
j




4






V
C



d


t
i

,

t
j


2








k
=
0

3



h


(


(


R

t
i

T



R

t
j



)

k

)








wherein C is the collection of the cut surface pieces, dti,tj is the barycenter distant between the tetrahedron ti and the tetrahedron tj, h(r) is the rotation-irrelevant function, VC is a normalized weight of the frame field smoothness energy Ec at the cut surface, k is a column number of a matrix RtiTRti, RtiT is transition of Rti;


the normal alignment energy EA is:









f



M







A
f


A


M









R
t



n
f




1






wherein ∥.∥1 is the norm l1, ∂M is a boundary of a tetrahedral mesh M, Rt is a frame defined in a tetrahedron t, f is a public plane of the tetrahedron t and ∂M, Af is an area of the public plane f of the tetrahedron t and ∂M, nf is a normal of the public plane f;


the above formula is optimized using an approximate replacement ∥u∥1≈√{square root over (u2+ϵ)}, ϵ=10−3;


the surface normal smoothness energy Ed is:












f
i



f
j


=

e



M









A

f
i


+

A

f
j




3






A


M











R

t
i




n

f
i



-


R

t
j




n

f
j






2



,






f
i

=


t
i




M



,


f
j

=


t
j




M







wherein ∂M is the boundary of the tetrahedral mesh M, fi is a public plane of the tetrahedron ti and ∂M, f1 is a public plane of the tetrahedron tj and ∂M, nfi and nfi are a normal of fi and a normal of fj, Afi is an area of fi, Afi is an area of fj, Rti is a frame defined i the tetrahedron ti, and Rti is a frame defined i the tetrahedron tj;


the frame field orthogonal constraint energy ER is:









t

M






V
t


V
M









R
t
T



R
t


-
I



2






wherein t is a tetrahedron in an inputted tetrahedral mesh, Vt is a volume of t, VM is a total volume of the inputted tetrahedral mesh M, and I is a 3×3 unit matrix.


Weights of the above energy are:








w
a

=
0.1

,


w
d

=
0.01

,


w
R

=
1

,


V
F

=


Σ



t
i



t
j




F

\

C







V

t
i


+

V

t
j




4


d


t
i

,

t
j


2





,






V
C

=


Σ



t
i



t
j



C






V

t
i


+

V

t
j




4


d


t
i

,

t
j


2





,


w
f

=


V
F



V
F

+

V
C




,


w
c

=


V
C



V
F

+

V
C




,





wherein Vti is the volume of the tetrahedron ti, Vti is the volume of the tetrahedron tj, VC is the normalized weight of the frame field smoothness energy Ec at the cut surface, and VF is the normalized weight of the frame field smoothness energy Es .


The rotation-irrelevant function h(r) is calculated by:

h(r)=rx2ry2+ry2rz2+rz2rx2,r=(rx,ry,rz)


wherein r=(rx,ry,rz) is a 3-dimensional vector, rx, ry, rz are respectively x, y and z coordinates of the 3-dimensional vector.


In the step 4), the aligned 3-dimensional frame field obtained in the step 3) is used as an initial value, and an LBFGS optimizer in a public database Alglib is used to optimize the frame field optimizing formula.


In the step 6), an IPOPT method is used for solving.


In the step 7), solving the L1-optimized formula specifically comprises a step of solving the preliminary parameterized result in the step 6) with an SQP method for obtaining the closed-form polycube.


In the step 7), energy in the L1-optimized formula is defined as follows.


The ARAP (as-rigid-as-possible) energy Earap is:







E
arap

=




t

M






V
t


V
M










V
χ

_

t

-

polar


(



V
χ

_

t

)





2







wherein polar(∇102t) is a rotation portion of the deformation gradient ∇102t, Vt is the volume of t, and VM is the total volume of the inputted tetrahedral mesh M.


The normal alignment energy Ealign is:







E
align

=




f



M






1

2


A


M










(



x
_

j
f

-


x
_

i
f


)

×

(



x
_

k
f

-


x
_

i
f


)




1







wherein A∂M is a total surface area of M, ∂M is a surface triangular mesh of the inputted tetrahedral mesh, Af is the area of f, and (xif, xjf, xkf) is three vertex coordinates of the surface piece f in the parameter domain.


The normal difference energy Ediff is:







E
diff

=







f
i



f
j


=

e


F

\

C









A

f
i


+

A

f
j




3


A


M











n
_

i

-


n
_

j




2



+






f
i



f
j


=

e

C








A

f
i


+

A

f
j




3


A


M











Π
ij




n
_

i


-


n
_

j




2








wherein ni and nj are normals of the surface piece fi and the surface piece fi in the parameter domain, Πij is a transition relation between the two surface pieces, Afdi is the area of fi, Afi is the area of fi, and F is a surface piece collection of the model M.


Compared with conventional technologies, the present invention has advantages as follows:


The method of the present invention has nothing to do with an initial position of an object, and is able to better satisfy a characteristic constraint of the model; further, for a model with complex topology, or a model with a characteristic line, high quality hexahedral mesh is available; L1-optimization is similar to allowing the user to control details of the polycube, thereby controlling a structure of the hexahedral mesh.





BRIEF DESCRIPTION OF THE DRAWINGS


FIG. 1 is a flow chart of the present invention.



FIG. 2 illustrates an inputted model according to an embodiment of the present invention.



FIG. 3 illustrates a cut surface result according to the embodiment when converting the inputted model to a tetrahedral mesh.



FIG. 4 is a sketch view of an optimized 3-dimensional frame field according to the embodiment.



FIG. 5 illustrates a result of Poisson reconstruction according to the embodiment.



FIG. 6 illustrates a closed-from polycube according to the embodiment.



FIG. 7 illustrates a final hexahedral mesh according to the embodiment.





DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

Referring to the drawings, the present invention is further illustrated.


An embodiment of a method of the present invention is as follows:


1) inputting a triangular mesh model as shown in FIG. 2, and converting into a tetrahedral mesh model as shown in FIG. 3;


2) obtaining all handles on surface meshes, and using the handles as a boundary of a cut surface; establishing a fitting surface and cutting the fitting surface to obtained the cut surface; referring to FIG. 4, cutting the tetrahedral mesh model into a model Mc with a first Betti number of 0;


3) defining a frame Rt in each of tetrahedrons t of a tetrahedral mesh M of the model Mc, wherein the frame Rt is a 3×3 matrix; using a method in [Huang et al. 2011. Boundary aligned smooth 3d cross-frame field. ACM TOG] for obtaining an initial 3-dimensional frame field R, establishing a minimum spanning tree with the tetrahedrons as nodes in the model Mc which is cut, and globally aligning for the 3-dimensional frame field R, so as to obtain an aligned 3-dimensional frame field as shown in FIG. 5;


4) according to cut tetrahedral mesh model surface normal alignment constraint and cut model internal frame field smoothness requirements both inputted by a user, establishing a frame field optimizing formula, wherein the aligned 3-dimensional frame field obtained in the step 3) is used as an initial value, and an LBFGS optimizer in a public database Alglib is used to solve the frame field optimizing formula, so as to obtain a smooth frame field without singular line inside the model;


5) extracting a transition relation on the cut surface based on the smooth frame field obtained in the step 4), wherein according to the embodiment, the transition relation is a rotation matrix:







[



0


0



-
1





0


1


0




1


0


0



]

;




6) providing Poisson reconstruction based on the smooth frame field obtained in the step 4) and the transition relation on the cut surface obtained in the step 5); constructing and solving a Poisson optimizing formula with an IPOPT method for obtaining a preliminary parameterized result as shown in FIG. 5;


7) according to the transition relation obtained in the step 5) and a polycube generating method optimized by a norm l1 according to [Huang et la. 2014. l1 based construction of polycube maps from complex shapes. ACM TOG], establishing a L1-optimized formula, solving the preliminary parameterized result in the step 6) with an SQP method for obtaining the closed-form polycube as shown in FIG. 6;


8) according to a polycube result generated in the step 7), extracting a polycube surface normal; according to the polycube surface normal and the transition relation on the cut surface, optimizing with a mixed integer for obtaining a final parameterized result; and


9) extracting according to the final parameterized result for generating the hexahedral mesh as shown in FIG. 7.


Compared with conventional polycube based method, the final hexahedral mesh considers topological constraints, and has fewer angular points, wherein hexahedral units are of higher quality and features of the model are better kept.


The embodiments have been shown and described for the purposes of illustrating the functional and structural principles of the present invention and is subject to change without departure from such principles. Therefore, this invention includes all modifications encompassed within the spirit and scope of the following claims.

Claims
  • 1. A method for generating a hexahedral mesh based on a closed-form polycube, comprising steps of: 1) inputting a triangular mesh model, and converting into a tetrahedral mesh model;2) obtaining all handles on surface meshes, and using the handles as a boundary of a cut surface; establishing a fitting surface and cutting the fitting surface to obtained the cut surface; cutting the tetrahedral mesh model into a model Mc with a first Betti number of 0;3) defining a frame Rt in each of tetrahedrons of the model Mc , wherein the frame Rt is a 3×3 matrix; using a method for obtaining an initial 3-dimensional frame field R, establishing a minimum spanning tree with the tetrahedrons as nodes in the model Mc which is cut, and globally aligning for the 3-dimensional frame field R, so as to obtain an aligned 3-dimensional frame field;4) according to cut tetrahedral mesh model surface normal alignment constraint and cut model internal frame field smoothness requirements both inputted by a user, establishing and solving a frame field optimizing formula, so as to obtain a smooth frame field without singular line inside the model;5) extracting a transition relation on the cut surface based on the smooth frame field obtained in the step 4);6) providing Poisson reconstruction based on the smooth frame field obtained in the step 4) and the transition relation on the cut surface obtained in the step 5); constructing and solving a Poisson optimizing formula for obtaining a preliminary parameterized result;7) according to the transition relation obtained in the step 5) and a polycube generating method optimized by a norm l1, establishing and solving a L1-optimized formula for forming the closed-form polycube, wherein the L1-optimized formula is:
  • 2. The method, as recited in claim 1, wherein in the step 4), the frame field optimizing formula is:
  • 3. The method, as recited in claim 2, wherein the frame field smoothness energy Es, the frame field smoothness energy Ec at cutting boundaries, the normal alignment energy EA, the surface normal smoothness energy Ed, and the frame field orthogonal constraint energy ER are calculated as follows: the frame field smoothness energy Es is:
  • 4. The method, as recited in claim 3, wherein the rotation-irrelevant function h(r) is calculated by: h(r)=rx2ry2+ry2rz2+rz2rx2,r=(rx,ry,rz)wherein r=(rx, ry, rz) is a 3-dimensional vector, rx, ry, rz, are respectively x, y and z coordinates of the 3-dimensional vector.
  • 5. The method, as recited in claim 1, wherein in the step 5), the transition relation on the cut surface is extracted with a following formula, and an optimized rotation of 24 kinds of cube symmetrical rotations is selected as an optimized Πk:
  • 6. The method, as recited in claim 1, wherein in the step 6), the Poisson optimizing formula is:
  • 7. The method, as recited in claim 1, wherein in the step 4), the aligned 3-dimensional frame field obtained in the step 3) is used as an initial value, and an LBFGS optimizer in a public database Alglib is used to solve the frame field optimizing formula.
  • 8. The method, as recited in claim 1, wherein in the step 6), an IPOPT method is used for solving.
  • 9. The method, as recited in claim 1, wherein in the step 7), solving the L1-optimized formula specifically comprises a step of solving the preliminary parameterized result in the step 6) with an SQP method for obtaining the closed-form polycube.
Priority Claims (1)
Number Date Country Kind
2016 1 0273300 Apr 2016 CN national
PCT Information
Filing Document Filing Date Country Kind
PCT/CN2016/107179 11/25/2016 WO 00
Publishing Document Publishing Date Country Kind
WO2017/185730 11/2/2017 WO A
US Referenced Citations (4)
Number Name Date Kind
9972128 Gregson May 2018 B2
20140028673 Gregson et al. Jan 2014 A1
20160240001 Sheffer Aug 2016 A1
20170024931 Sheffer Jan 2017 A1
Foreign Referenced Citations (4)
Number Date Country
102254351 Nov 2011 CN
103824331 May 2014 CN
105957151 Sep 2016 CN
2012198847 Oct 2012 JP
Non-Patent Literature Citations (7)
Entry
Huang, Jin, et al. “L1-Based Construction of Polycube Maps from Complex Shapes.”;ACM Transactions on Graphics (TOG);33.3 (2014): 25. (Year: 2014).
Gregson, James, Alla Sheffer, and Eugene Zhang. “All-hex mesh generation via volumetric polycube deformation.”; Computer graphics forum. vol. 30. No. 5. Oxford, UK: Blackwell Publishing Ltd, 2011. (Year: 2011).
Li, Yufei, et al. “All-hex meshing using singularity-restricted field.”;ACM Transactions on Graphics (TOG);31.6 (2012): 177. (Year: 2012).
Huang, Jin, et al. “Boundary aligned smooth 3D cross-frame field.”;ACM transactions on graphics (TOG). vol. 30. No. 6. ACM, 2011. (Year: 2011).
Jiang, Tengfei, et al. “Frame field singularity correctionfor automatic hexahedralization.”; IEEE Transactions on Visualization and Computer Graphics; 20.8 (2014): 1189-1199. (Year: 2014).
Sorkine, Olga, and Marc Alexa. “As-rigid-as-possible surface nnodeling.”;Symposiunn on Geometry processing. vol. 4. 2007. (Year: 2007).
Peng et al., Local to Global Optimization Algorithm for Hexahedral Mesh Quality. Journal of Mechanical Engineering, Dec. 31, 2014, vol. 50, No. 23, p. 140-146.
Related Publications (1)
Number Date Country
20190096127 A1 Mar 2019 US