Summary of the invention
The present invention proposes a kind of drawing three-dimensional sphere method and system regarding to the issue above, and it is visual to solve conventional three-dimensional
The problem of drawing sphere with single grid method in change, present invention employs hexagons as configurational base unit, shows
Three-dimensional sphere it is more beautiful and clear.
A kind of method for drafting of three-dimensional sphere, comprising:
Determine the two-dimensional coordinate of each first nodes, method particularly includes:
Preset total columns value be m, head office's numerical value be n, then when i be even number when, then the i-th row j column coordinate be A (i, j)=
(-180+j*360/m,-90+i*180/n);When i is odd number, then the coordinate of the i-th row j column is A (i, j)=(- 180+j*360/
m+360/(2*m),-90+i*180/n);
By the conversion formula of two dimension and three-dimensional coordinate, the three-dimensional coordinate for calculating each first nodes is respectively A.x,
A.y, A.z determine the three-dimensional coordinate of two-level node, method particularly includes: find out three required first nodes, wherein when p is surprise
When number, the coordinate of pth row q column is A (p, q), the two-dimensional coordinate of three required first nodes are as follows: [A (p, q), A (p, q+1), A
(p+1, q+1)], when p is even number, the coordinate of pth row q column is A (p, q), the two-dimensional coordinate point of three required first nodes
It Wei [A (p, q), A (p, q+1), A (p+1, q)];Two are calculated according to the three-dimensional coordinate for the three required first nodes found out
The three-dimensional coordinate of grade node;
Determine the three-dimensional coordinate of three-level node, method particularly includes: it is sat by the three-dimensional to all fixed first nodes
The three-dimensional coordinate of mark and two-level node carries out the three-dimensional coordinate that three-level node is calculated;
Successively identify the attribute of all first nodes, two-level node and three-level node;The attribute of node includes: node place
Level, node ID, adjacent first nodes, two neighboring stages node and adjacent three-level node;
Each three-level node is looped through, the two-level node and three being sequentially connected in each three-level node and its nodal community
Grade node to get arrive three-dimensional sphere.
Further, the three-dimensional of two-level node is calculated according to the three-dimensional coordinate for the three required first nodes found out to sit
Mark, calculation formula are as follows:
Two-level node X axis coordinate: B.x=(A (p, q) .x+A (p, q+1) .x+A (p+1, q+1) .x)/3;
Two-level node Y axis coordinate: B.y=(A (p, q) .y+A (p, q+1) .y+A (p+1, q+1) .y)/3;
Two-level node Z axis coordinate: B.z=(A (p, q) .z+A (p, q+1) .z+A (p+1, q+1) .z)/3;
The two-dimensional coordinate A (p, q) that wherein A (p, q) .x, A (p, q) .y, A (p, q) .z respectively indicates first nodes is converted into
The value of corresponding x-axis, y-axis, z-axis after three-dimensional coordinate.
Further, it is carried out by the three-dimensional coordinate of three-dimensional coordinate and two-level node to all fixed first nodes
The calculation formula of calculating are as follows:
Three-level nodes X coordinate: C.x=A.x+ (B.x-A.x) * 0.25;
Three-level node Y-coordinate: C.y=A.y+ (B.y-A.y) * 0.25;
Three-level node Z coordinate: C.z=A.z+ (B.z-A.z) * 0.25.
A kind of drawing system of three-dimensional sphere, comprising:
First nodes drafting module, for determining the two-dimensional coordinate of each first nodes, method particularly includes:
Preset total columns value be m, head office's numerical value be n, then when i be even number when, then the i-th row j column coordinate be A (i, j)=
(-180+j*360/m,-90+i*180/n);When i is odd number, then the coordinate of the i-th row j column is A (i, j)=(- 180+j*360/
m+360/(2*m),-90+i*180/n);
Conversion module calculates the three-dimensional of each first nodes and sits for the conversion formula by two dimension and three-dimensional coordinate
Mark is respectively A.x, A.y, A.z;
Two-level node drafting module, for determining the three-dimensional coordinate of two-level node, method particularly includes: find out three it is required
First nodes, wherein when p is odd number, the coordinate of pth row q column is A (p, q), the two-dimensional coordinate of three required first nodes
Are as follows: [A (p, q), A (p, q+1), A (p+1, q+1)], when p is even number, the coordinate of pth row q column is A (p, q), and three are required
The two-dimensional coordinate of first nodes is [A (p, q), A (p, q+1), A (p+1, q)];
The three-dimensional coordinate of two-level node is calculated according to the three-dimensional coordinate for the three required first nodes found out;
Three-level node drafting module, for determining the three-dimensional coordinate of three-level node, method particularly includes: by it is all really
The three-dimensional coordinate of fixed first nodes and the three-dimensional coordinate of two-level node carry out the three-dimensional coordinate that three-level node is calculated;
Mark module, for successively identifying the attribute of all first nodes, two-level node and three-level node;The attribute of node
It include: level where node, node ID, adjacent first nodes, two neighboring stages node and adjacent three-level node.
Link block is sequentially connected in each three-level node and its nodal community for looping through each three-level node
Two-level node and three-level node to get arrive three-dimensional sphere.
It further, further include computing module one, for the three-dimensional coordinate according to the three required first nodes found out
Calculate the three-dimensional coordinate of two-level node, calculation formula are as follows:
Two-level node X axis coordinate: B.x=(A (p, q) .x+A (p, q+1) .x+A (p+1, q+1) .x)/3;
Two-level node Y axis coordinate: B.y=(A (p, q) .y+A (p, q+1) .y+A (p+1, q+1) .y)/3;
Two-level node Z axis coordinate: B.z=(A (p, q) .z+A (p, q+1) .z+A (p+1, q+1) .z)/3;
The two-dimensional coordinate A (p, q) that wherein A (p, q) .x, A (p, q) .y, A (p, q) .z respectively indicates first nodes is converted into
The value of corresponding x-axis, y-axis, z-axis after three-dimensional coordinate.
Further, further include computing module two, for by three-dimensional coordinate to all fixed first nodes with
The calculation formula that the three-dimensional coordinate of two-level node is calculated are as follows:
Three-level nodes X coordinate: C.x=A.x+ (B.x-A.x) * 0.25;
Three-level node Y-coordinate: C.y=A.y+ (B.y-A.y) * 0.25;
Three-level node Z coordinate: C.z=A.z+ (B.z-A.z) * 0.25.
The invention proposes a kind of three-dimensional sphere method for drafting, the method, which passes through, determines first nodes two-dimensional coordinate, and
By the conversion formula of two dimension and three-dimensional coordinate, and then determines the three-dimensional coordinate of two-level node and three-level node and identify institute respectively
There is nodal community, loops through each three-level node, the two-level node being sequentially connected in each three-level node and its nodal community
With three-level node, three-dimensional sphere can be obtained.The present invention also provides corresponding system structures, by means of the invention it is possible to draw
It is beautiful clear unique using hexagon as the sphere of configurational base unit out, it solves previous conventional mesh and draws the single of sphere
Property.
Specific embodiment
Technical solution in embodiment in order to enable those skilled in the art to better understand the present invention, and make of the invention
Above objects, features, and advantages can be more obvious and easy to understand, makees with reference to the accompanying drawing to technical solution in the present invention further detailed
Thin explanation.
The invention proposes a kind of three-dimensional sphere method for drafting, the method, which passes through, determines first nodes two-dimensional coordinate, and
By the conversion formula of two dimension and three-dimensional coordinate, and then determines the three-dimensional coordinate of two-level node and three-level node and identify institute respectively
There is nodal community, loops through each three-level node, the two-level node being sequentially connected in each three-level node and its nodal community
With three-level node, three-dimensional sphere can be obtained.The present invention also provides corresponding system structures, by means of the invention it is possible to draw
It is beautiful clear unique using hexagon as the sphere of configurational base unit out, it solves previous conventional mesh and draws the single of sphere
Property.
A kind of three-dimensional sphere method for drafting, as shown in Figure 1, comprising:
S101: determining the two-dimensional coordinate of each first nodes, method particularly includes:
Preset total columns value be m, head office's numerical value be n, then when i be even number when, then the i-th row j column coordinate be A (i, j)=
(-180+j*360/m,-90+i*180/n);When i is odd number, then the coordinate of the i-th row j column is A (i, j)=(- 180+j*360/
m+360/(2*m),-90+i*180/n);
Specifically, it is assumed that m=22, n=11, then such as Fig. 3 is schemed in the two-dimensional coordinate display of first nodes;
S102: by the conversion formula of two dimension and three-dimensional coordinate, the three-dimensional coordinate for calculating each first nodes is respectively
A.x, A.y, A.z;Then the three-dimensional coordinate of first nodes shows that the main view of figure and top view are as shown in Figure 4, Figure 5.
S103: determining the three-dimensional coordinate of two-level node, method particularly includes: find out three required first nodes, wherein when
When p is odd number, three required first nodes are as follows: [A (p, q), A (p, q+1), A (p+1, q+1)], and when p is even number, three
Required first nodes are [A (p, q), A (p, q+1), A (p+1, q)];Then the three-dimensional coordinate of first nodes and two-level node is shown
The main view of figure and top view are as shown in Figure 6, Figure 7.
S104: the three-dimensional coordinate of two-level node is calculated according to the three-dimensional coordinate for the three required first nodes found out;
S105: determining the three-dimensional coordinate of three-level node, method particularly includes: pass through three to all fixed first nodes
The three-dimensional coordinate of dimension coordinate and two-level node carries out the three-dimensional coordinate that three-level node is calculated;Then first nodes and two-level node
And the three-dimensional coordinate of three-level node shows that the main view of figure and top view are as shown in Figure 8, Figure 9;
S106: the attribute of all first nodes, two-level node and three-level node is successively identified;The nodal community includes:
Level where node, node ID, adjacent first nodes, two neighboring stages node and adjacent three-level node.
Specifically, first nodes attribute is as follows:
{
Level:1, level where // node are the first level;
ID:12, // indicate the first level the 13rd node created (node ID that the level first creates is set as 0)
AdjoinNodeLevel_1:[0,1,2,13,23,11], // indicate adjacent node ID in the first level
AdjoinNodeLevel_2:[0,1,20,22,3,2], // indicate adjacent node ID in the second level
AdjoinNodeLevel_3:[0,1,2,3,4,5], // indicate adjacent node ID in third level
}
Two-level node attribute is as follows:
{
Level:2, // indicate that place level is the second level
ID:3, // indicate the first level the 4th node created (node ID that the level first creates is set as 0)
AdjoinNodeLevel_1:[2,12,13], // indicate adjacent node ID in the first level
}
Three-level nodal community is as follows:
{
Level:2, // indicate that place level is third level;
ID:0, // indicate the first level first node created (node ID that the level first creates is set as 0)
AdjoinNodeLevel_1:[0,1,12], // indicate adjacent node ID in the first level
AdjoinNodeLevel_2:[0], // indicate adjacent node ID in the second level
AdjoinNodeLevel_1:[1,5], // indicate adjacent node ID in third level
}
S107: looping through each three-level node, the second level section being sequentially connected in each three-level node and its nodal community
Point and three-level node, can be obtained three-dimensional sphere.Main view, top view and the partial enlarged view of the three-dimensional sphere of drafting be divided into as
Shown in Figure 10, Figure 11, Figure 12.
Further, the three-dimensional of two-level node is calculated according to the three-dimensional coordinate for the three required first nodes found out to sit
Mark, calculation formula are as follows:
Two-level node X axis coordinate: B.x=(A (p, q) .x+A (p, q+1) .x+A (p+1, q+1) .x)/3;
Two-level node Y axis coordinate: B.y=(A (p, q) .y+A (p, q+1) .y+A (p+1, q+1) .y)/3;
Two-level node Z axis coordinate: B.z=(A (p, q) .z+A (p, q+1) .z+A (p+1, q+1) .z)/3.
Further, it is carried out by the three-dimensional coordinate of three-dimensional coordinate and two-level node to all fixed first nodes
The calculation formula of calculating are as follows:
Three-level nodes X coordinate: C.x=A.x+ (B.x-A.x) * 0.25;
Three-level node Y-coordinate: C.y=A.y+ (B.y-A.y) * 0.25;
Three-level node Z coordinate: C.z=A.z+ (B.z-A.z) * 0.25.
A kind of three-dimensional sphere drawing system, as shown in Figure 2, comprising:
First nodes drafting module 201, for determining the two-dimensional coordinate of each first nodes, method particularly includes:
Preset total columns value be m, head office's numerical value be n, then when i be even number when, then the i-th row j column coordinate be A (i, j)=
(-180+j*360/m,-90+i*180/n);When i is odd number, then the coordinate of the i-th row j column is A (i, j)=(- 180+j*360/
m+360/(2*m),-90+i*180/n);
Conversion module 202 calculates the three-dimensional of each first nodes for the conversion formula by two dimension and three-dimensional coordinate
Coordinate is respectively A.x, A.y, A.z, and successively identifies the nodal community of all level-ones;The nodal community includes: node place
Level, node ID, adjacent first nodes, two neighboring stages node and adjacent three-level node.
Two-level node drafting module 203, for determining the three-dimensional coordinate of two-level node, method particularly includes: find out three institutes
The first nodes needed, wherein when p is odd number, three required first nodes are as follows: [A (p, q), A (p, q+1), A (p+1, q+
1)], when p is even number, three required first nodes are [A (p, q), A (p, q+1), A (p+1, q)];
The three-dimensional coordinate and successively of two-level node is calculated according to the three-dimensional coordinate for the three required first nodes found out
Identify the nodal community of all second levels;
Three-level node drafting module 204, for determining the three-dimensional coordinate of three-level node, method particularly includes: by all
The three-dimensional coordinate of fixed first nodes and the three-dimensional coordinate of two-level node carry out the three-dimensional coordinate that three-level node is calculated
And successively identify the nodal community of all three-levels;
Mark module 205, for successively identifying the attribute of all first nodes, two-level node and three-level node;The section
Point attribute includes: level where node, node ID, adjacent first nodes, two neighboring stages node and adjacent three-level node.
Link block 206 is sequentially connected with each three-level node and its nodal community for looping through each three-level node
In two-level node and three-level node, three-dimensional sphere can be obtained.
It further, further include computing module one, for the three-dimensional coordinate according to the three required first nodes found out
Calculate the three-dimensional coordinate of two-level node, calculation formula are as follows:
Two-level node X axis coordinate: B.x=(A (p, q) .x+A (p, q+1) .x+A (p+1, q+1) .x)/3;
Two-level node Y axis coordinate: B.y=(A (p, q) .y+A (p, q+1) .y+A (p+1, q+1) .y)/3;
Two-level node Z axis coordinate: B.z=(A (p, q) .z+A (p, q+1) .z+A (p+1, q+1) .z)/3.
Further, further includes: computing module two, for by three-dimensional coordinate to all fixed first nodes with
The calculation formula that the three-dimensional coordinate of two-level node is calculated are as follows:
Three-level nodes X coordinate: C.x=A.x+ (B.x-A.x) * 0.25;
Three-level node Y-coordinate: C.y=A.y+ (B.y-A.y) * 0.25;
Three-level node Z coordinate: C.z=A.z+ (B.z-A.z) * 0.25.
As seen through the above description of the embodiments, those skilled in the art can be understood that the present invention can
It realizes by means of software and necessary general hardware platform.Based on this understanding, technical solution of the present invention essence
On in other words the part that contributes to existing technology can be embodied in the form of software products, the computer software product
It can store in storage medium, such as ROM/RAM, magnetic disk, CD, including some instructions are used so that a computer equipment
(can be personal computer, server or the network equipment etc.) executes the certain of each embodiment or embodiment of the invention
Method described in part.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment
Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for system reality
For applying example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to embodiment of the method
Part explanation.
The present invention can be used in numerous general or special purpose computing system environments or configuration.Such as: personal computer, service
Device computer, handheld device or portable device, laptop device, multicomputer system, microprocessor-based system, top set
Box, programmable consumer-elcetronics devices, network PC, minicomputer, mainframe computer, including any of the above system or equipment
Distributed computing environment etc..
The present invention can describe in the general context of computer-executable instructions executed by a computer, such as program
Module.Generally, program module includes routines performing specific tasks or implementing specific abstract data types, programs, objects, group
Part, data structure etc..The present invention can also be practiced in a distributed computing environment, in these distributed computing environments, by
Task is executed by the connected remote processing devices of communication network.In a distributed computing environment, program module can be with
In the local and remote computer storage media including storage equipment.
Although depicting the present invention by embodiment, it will be appreciated by the skilled addressee that the present invention there are many deformation and
Variation is without departing from spirit of the invention, it is desirable to which the attached claims include these deformations and change without departing from of the invention
Spirit.