CN101551917A - Three-dimensional path drawing system and method - Google Patents

Three-dimensional path drawing system and method Download PDF

Info

Publication number
CN101551917A
CN101551917A CNA2008103008349A CN200810300834A CN101551917A CN 101551917 A CN101551917 A CN 101551917A CN A2008103008349 A CNA2008103008349 A CN A2008103008349A CN 200810300834 A CN200810300834 A CN 200810300834A CN 101551917 A CN101551917 A CN 101551917A
Authority
CN
China
Prior art keywords
bitmap
starting point
straight line
angle
camber line
Prior art date
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.)
Pending
Application number
CNA2008103008349A
Other languages
Chinese (zh)
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.)
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
Original Assignee
Hongfujin Precision Industry Shenzhen Co Ltd
Hon Hai Precision Industry Co Ltd
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.)
Filing date
Publication date
Application filed by Hongfujin Precision Industry Shenzhen Co Ltd, Hon Hai Precision Industry Co Ltd filed Critical Hongfujin Precision Industry Shenzhen Co Ltd
Priority to CNA2008103008349A priority Critical patent/CN101551917A/en
Publication of CN101551917A publication Critical patent/CN101551917A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Processing Or Creating Images (AREA)

Abstract

The invention provides a three-dimensional path drawing method, which comprises the following steps of judging whether the three-dimensional path to be drawn is a straight line or an arc line; obtaining drawing parameters according to the judgement, wherein the drawing parameters of the straight line include bitmap length, the starting point and end point of the straight line, while the drawing parameters of the arc line include bitmap length, the starting point, circle center and circle center angle of the arc line, and the three-dimensional path is spliced by the bitmaps; calculating the number of bitmaps, each bitmap starting point and bitmap angle of the straight line to be drawn, or calculating the bitmap circle center angle, the numbers of bitmaps, each bitmap starting point and bitmap angle of the arc line to be drawn according to the judgement and the obtained drawing parameters; saving each calculated bitmap starting point and bitmap angle; and drawing the three-dimensional path according to each saved bitmap starting point and bitmap angle. The invention further provides a three-dimensional path drawing system. By the three-dimensional path drawing method and system, the three-dimensional path can be drawn conveniently and realistically.

Description

Three-dimensional path drawing system and method
Technical field
The present invention relates to a kind of three-dimensional drawing system and method, particularly about a kind of three-dimensional path drawing system and method.
Background technology
Three-dimensional (3D) path is the path with length visual effect of drawing under three-dimensional environment.When utilizing 3ds Max drawing three-dimensional path, material or the bitmap that the user need be chosen paste on the control, and the three-dimensional path effect of formation is not true to nature.Another method is that the bitmap that the user chooses is stitched together, and the three-dimensional path effect of formation is more true to nature, but user's inconvenient operation, and the three-dimensional path of being drawn is had many restrictions.
Summary of the invention
In view of above content, be necessary to propose a kind of three-dimensional path drawing system and method, can make things convenient for and drawing three-dimensional path realistically.
A kind of three-dimensional path drawing system runs in the computing machine, and this system comprises: judge module is used to judge that the three-dimensional path of being drawn is straight line or camber line; Acquisition module, be used for obtaining diagram parameter according to above-mentioned judged result, the diagram parameter of straight line comprises the starting point and the terminal point of bitmap lengths, straight line, and the diagram parameter of camber line comprises starting point, the center of circle and the central angle of bitmap lengths, camber line, and described three-dimensional path is spliced by described bitmap; Computing module, be used for calculating bitmap number, each bitmap starting point of straight line and the bitmap angle of straight line of drawing straight line, or calculate bitmap central angle, the bitmap number of camber line, each bitmap starting point of camber line and the bitmap angle of camber line of drawing camber line according to above-mentioned judged result and the diagram parameter that obtains; Preserve module, be used to preserve each bitmap starting point and the bitmap angle that calculate; And drafting module, be used for according to each bitmap starting point and the bitmap angle drawing three-dimensional path of preserving.
A kind of three-dimensional path drawing method, the method comprising the steps of: judge that the three-dimensional path of being drawn is straight line or camber line; Obtain diagram parameter according to above-mentioned judged result, the diagram parameter of straight line comprises the starting point and the terminal point of bitmap lengths, straight line, and the diagram parameter of camber line comprises starting point, the center of circle and the central angle of bitmap lengths, camber line, and described three-dimensional path is spliced by described bitmap; Calculate bitmap number, each bitmap starting point of straight line and the bitmap angle of straight line of drawing straight line according to above-mentioned judged result and the diagram parameter that obtains, or calculate bitmap central angle, the bitmap number of camber line, each bitmap starting point of camber line and the bitmap angle of camber line of drawing camber line; Each bitmap starting point and bitmap angle that preservation calculates; And according to each bitmap starting point and the bitmap angle drawing three-dimensional path of preserving.
Compared to prior art, three-dimensional path drawing system provided by the present invention and method are with the bitmap three-dimensional path that is spliced automatically, and method is simple and three-dimensional path effect that draw out is more true to nature.
Description of drawings
Fig. 1 is the functional block diagram of three-dimensional path drawing system preferred embodiment of the present invention.
Fig. 2 is the process flow diagram of three-dimensional path drawing method of the present invention preferred embodiment.
Embodiment
Consulting shown in Figure 1ly, is the functional block diagram of three-dimensional path drawing system preferred embodiment of the present invention.Described three-dimensional path drawing system operates in the computing machine, and it mainly comprises: judge module 100, acquisition module 110, computing module 120, preservation module 130 and drafting module 140.
Described judge module 100 is used to judge that the three-dimensional path of being drawn is straight line or camber line.
Described acquisition module 110 is used to obtain diagram parameter.If draw straight line, this diagram parameter comprises the starting point and the terminal point of bitmap lengths, straight line; If draw camber line, this diagram parameter comprises starting point, the center of circle and the central angle of bitmap lengths, camber line.Described bitmap is a rectangular, three-dimensional file, and the three-dimensional path of being drawn (straight line/camber line) is spliced by this bitmap, establishes its long L of being.
Described computing module 120 is used to calculate the bitmap number that is spliced into straight line/camber line (hereinafter to be referred as the splicing number) and calculates starting point (hereinafter to be referred as bitmap starting point) and the angle of each bitmap when splicing straight line/camber line.To arbitrary three-dimensional path, the starting point of the next bitmap that the terminal point of a bitmap just is adjacent, for example the terminal point of first bitmap is exactly the starting point of second bitmap.If draw straight line, the angle of each bitmap is identical; If draw camber line, the angle of each bitmap is inequality usually.
If draw straight line, by the starting point A of straight line (a1, a2, a3), terminal point B (b1, b2 b2), can get | AB|=sqrt ((a1-b1) * (a1-b1)+(a2-b2) * (a2-b2)+(a3-b3) * (a3-b3)), wherein sqrt represents extraction of square root.The splicing number N=|AB|/L of straight line.If | AB|/L is not an integer, can round up as required or round downwards or a last bitmap is stretched.For straight line, the angle θ of bitmap=atan| (a2-b2)/(a1-b1) |, wherein atan represents arc tangent.Starting point A (a1 with straight line, a2, a3) as first bitmap starting point, according to first bitmap starting point, angle θ and bitmap lengths L, calculate second bitmap starting point, calculate the 3rd bitmap starting point according to second bitmap starting point, angle θ and bitmap lengths L again, the rest may be inferred, up to calculating N bitmap starting point.
If draw camber line, by the starting point C of camber line (c1, c2, c3) and center of circle D (d1, d2 d3), try to achieve the radius R=sqrt ((c1-d1) * (c1-d1)+(c2-d2) * (c2-d2)+(c3-d3) * (c3-d3)) of camber line.Radius R by camber line, bitmap lengths L, can calculate with L is that one section pairing central angle of camber line (hereinafter to be referred as the bitmap central angle) of chord length is 2*asin (L/ (2*R)), wherein asin represents inverse sine, again by the central angle alpha of camber line, bitmap central angle β can calculate the splicing number M=α/β of camber line.If α/β is not an integer, can round up as required or round downwards.With starting point C (c1, c2 is c3) as first bitmap starting point, according to starting point coordinate (c1, c2 c3), β and L, calculates second bitmap starting point, calculate the 3rd bitmap starting point according to second bitmap starting point, β and L again, the rest may be inferred, up to calculating M bitmap starting point.For camber line, the angle of bitmap can be by atan| (y2-y1)/(x2-x1) | determines, wherein y1, y2 are respectively the starting point of a bitmap and the y axial coordinate of terminal point, y2 also is the y axial coordinate of the starting point of the next bitmap adjacent with this bitmap, x1, x2 are respectively the starting point of a bitmap and the x axial coordinate of terminal point, and x2 also is the x axial coordinate of the starting point of the next bitmap adjacent with this bitmap.
Described preservation module 130 is used to preserve each bitmap starting point and angle.If draw straight line, only need to preserve an angle; If draw camber line, need to preserve the pairing angle of each bitmap.
Described drafting module 140 is used for successively each bitmap being plotted to corresponding position according to each bitmap starting point and the angle of being preserved.
Consulting shown in Figure 2ly, is the process flow diagram of three-dimensional path drawing method of the present invention preferred embodiment.
Step S201, judge module 100 judges that the three-dimensional path of being drawn is straight line or camber line.
Step S202, acquisition module 110 obtains diagram parameter.If draw straight line, acquisition module 110 obtains the starting point and the terminal point of bitmap lengths, straight line; If draw camber line, acquisition module 110 obtains starting point, the center of circle and the central angle of bitmap lengths, camber line.Described bitmap is a rectangular, three-dimensional file, and the three-dimensional path of being drawn (straight line/camber line) is spliced by this bitmap, establishes its long L of being.If the starting point of the straight line of being drawn be A (a1, a2, a3), terminal point be B (b1, b2, b2).If the starting point of the camber line of being drawn is that (c3), the center of circle is that (d3), central angle is α to D for d1, d2 to C for c1, c2.
Step S203, computing module 120 calculates the splicing number.
If draw straight line, by the starting point A of straight line (a1, a2, a3), terminal point B (b1, b2 b2), can get | AB|=sqrt ((a1-b1) * (a1-b1)+(a2-b2) * (a2-b2)+(a3-b3) * (a3-b3)), wherein sqrt represents extraction of square root.The splicing number N=|AB|/L of straight line.If | AB|/L is not an integer, can round up as required or round downwards or a last bitmap is stretched.
If draw camber line, by the starting point C of camber line (c1, c2, c3) and center of circle D (d1, d2 d3), try to achieve the radius R=sqrt ((c1-d1) * (c1-d1)+(c2-d2) * (c2-d2)+(c3-d3) * (c3-d3)) of camber line.Radius R by camber line, bitmap lengths L, can calculate with L is that one section pairing central angle of camber line (hereinafter to be referred as the bitmap central angle) of chord length is 2*asin (L/ (2*R)), wherein asin represents inverse sine, again by the central angle alpha of camber line, bitmap central angle β can calculate the splicing number M=α/β of camber line.If α/β is not an integer, can rounds up as required or round downwards or a last bitmap is stretched.
Step S204, computing module 120 calculates each bitmap starting point and angle.
If draw straight line, the angle θ of bitmap=atan| (a2-b2)/(a1-b1) |, starting point A (a1 with straight line, a2 is a3) as first bitmap starting point, according to first bitmap starting point, angle θ and bitmap lengths L, calculate second bitmap starting point, calculate the 3rd bitmap starting point according to second bitmap starting point, angle θ and bitmap lengths L again, the rest may be inferred, up to calculating N bitmap starting point.
If draw camber line, with starting point C (c1, c2 is c3) as first bitmap starting point, according to starting point coordinate (c1, c2, c3), α and L, calculate second bitmap starting point, calculate the 3rd bitmap starting point according to second bitmap starting point, β and L again, the rest may be inferred, up to calculating M bitmap starting point.The angle of bitmap can be by atan| (y2-y1)/(x2-x1) | determines, wherein y1, y2 are respectively the starting point of a bitmap and the y axial coordinate of terminal point, y2 also is the y axial coordinate of the starting point of the next bitmap adjacent with this bitmap, x1, x2 are respectively the starting point of a bitmap and the x axial coordinate of terminal point, and x2 also is the x axial coordinate of the starting point of the next bitmap adjacent with this bitmap.
Step S205 preserves module 130 each bitmap starting point and angle is preserved successively, for example deposits in the chained list.If draw straight line, only need to preserve an angle; If draw camber line, need to preserve the pairing angle of each bitmap.
Step S206, drafting module 140 is plotted to corresponding position with each bitmap successively according to each bitmap starting point and the angle of being preserved.
If straight line/camber line of being drawn does not meet user's demand, then can repeat above-mentioned steps adjustment, for example adjust the length of straight line, or adjust the angle of camber line.
Above embodiment is only unrestricted in order to technical scheme of the present invention to be described, although the present invention is had been described in detail with reference to above preferred embodiment, those of ordinary skill in the art should be appreciated that and can make amendment or be equal to the spirit and scope that replacement should not break away from technical solution of the present invention technical scheme of the present invention.

Claims (8)

1. a three-dimensional path drawing system runs in the computing machine, it is characterized in that, this system comprises:
Judge module is used to judge that the three-dimensional path of being drawn is straight line or camber line;
Acquisition module, be used for obtaining diagram parameter according to above-mentioned judged result, the diagram parameter of straight line comprises the starting point and the terminal point of bitmap lengths, straight line, and the diagram parameter of camber line comprises starting point, the center of circle and the central angle of bitmap lengths, camber line, and described three-dimensional path is spliced by described bitmap;
Computing module, be used for calculating bitmap number, each bitmap starting point of straight line and the bitmap angle of straight line of drawing straight line, or calculate bitmap central angle, the bitmap number of camber line, each bitmap starting point of camber line and the bitmap angle of camber line of drawing camber line according to above-mentioned judged result and the diagram parameter that obtains;
Preserve module, be used to preserve each bitmap starting point and the bitmap angle that calculate; And
Drafting module is used for according to each bitmap starting point and the bitmap angle drawing three-dimensional path of preserving.
2. three-dimensional path drawing system as claimed in claim 1, it is characterized in that, the bitmap number of straight line is determined by the length of straight line and the ratio of bitmap lengths, the bitmap angle of straight line is determined that by the slope of straight line the bitmap starting point of straight line is determined one by one by the starting point of straight line, the bitmap angle and the bitmap lengths of straight line.
3. three-dimensional path drawing system as claimed in claim 1, it is characterized in that, the bitmap central angle of camber line is determined by the length of bitmap and the radius of camber line, the bitmap number of camber line is determined that by the central angle of camber line and the ratio of bitmap central angle the bitmap starting point of camber line is determined one by one by starting point, bitmap central angle and the bitmap lengths of camber line.
4. three-dimensional path drawing system as claimed in claim 1 is characterized in that, each bitmap starting point and angle that described preservation module will calculate deposit chained list in.
5. three-dimensional path drawing method is characterized in that the method comprising the steps of:
Judge that the three-dimensional path of being drawn is straight line or camber line;
Obtain diagram parameter according to above-mentioned judged result, the diagram parameter of straight line comprises the starting point and the terminal point of bitmap lengths, straight line, and the diagram parameter of camber line comprises starting point, the center of circle and the central angle of bitmap lengths, camber line, and described three-dimensional path is spliced by described bitmap;
Calculate bitmap number, each bitmap starting point of straight line and the bitmap angle of straight line of drawing straight line according to above-mentioned judged result and the diagram parameter that obtains, or calculate bitmap central angle, the bitmap number of camber line, each bitmap starting point of camber line and the bitmap angle of camber line of drawing camber line;
Each bitmap starting point and bitmap angle that preservation calculates; And
According to each bitmap starting point and the bitmap angle drawing three-dimensional path of preserving.
6. three-dimensional path drawing method as claimed in claim 5, it is characterized in that, the bitmap number of straight line is determined by the length of straight line and the ratio of bitmap lengths, the bitmap angle of straight line is determined that by the slope of straight line the bitmap starting point of straight line is determined one by one by the starting point of straight line and the bitmap angle and the bitmap lengths of straight line.
7. three-dimensional path drawing method as claimed in claim 5, it is characterized in that, the bitmap central angle of camber line is determined by the radius of bitmap lengths and camber line, the bitmap number of camber line is determined that by the central angle of camber line and the ratio of bitmap central angle the bitmap starting point of camber line is determined one by one by starting point, bitmap central angle and the bitmap lengths of camber line.
8. three-dimensional path drawing method as claimed in claim 5 is characterized in that, each bitmap starting point that described preservation calculates and the step of angle are that each bitmap starting point and the angle that will calculate deposit chained list in.
CNA2008103008349A 2008-04-03 2008-04-03 Three-dimensional path drawing system and method Pending CN101551917A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008103008349A CN101551917A (en) 2008-04-03 2008-04-03 Three-dimensional path drawing system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008103008349A CN101551917A (en) 2008-04-03 2008-04-03 Three-dimensional path drawing system and method

Publications (1)

Publication Number Publication Date
CN101551917A true CN101551917A (en) 2009-10-07

Family

ID=41156145

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008103008349A Pending CN101551917A (en) 2008-04-03 2008-04-03 Three-dimensional path drawing system and method

Country Status (1)

Country Link
CN (1) CN101551917A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013152684A1 (en) * 2012-04-12 2013-10-17 天脉聚源(北京)传媒科技有限公司 Method for dynamically displaying three-dimensional pie chart
CN105844581A (en) * 2016-04-14 2016-08-10 北京极维客科技有限公司 Image drawing method, apparatus and equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013152684A1 (en) * 2012-04-12 2013-10-17 天脉聚源(北京)传媒科技有限公司 Method for dynamically displaying three-dimensional pie chart
CN105844581A (en) * 2016-04-14 2016-08-10 北京极维客科技有限公司 Image drawing method, apparatus and equipment
CN105844581B (en) * 2016-04-14 2019-04-30 北京极维科技有限公司 A kind of image drawing method, device and equipment

Similar Documents

Publication Publication Date Title
CN103889032B (en) A kind of terminal and network selecting method
CN102542901B (en) Line segment vacuating device for electronic map and method thereof
CN102999880B (en) Based on electric power WebGIS vector real-time drawing method and the device of GPU
CN104574495A (en) Method and device for rendering image
CN113256782B (en) Three-dimensional model generation method and device, storage medium and electronic equipment
CN106649404A (en) Session scene database creation method and apparatus
CN103793140A (en) Application icon arranging method and mobile terminal
CN101551917A (en) Three-dimensional path drawing system and method
CN113329373A (en) Vehicle machine interconnection method and device
CN106844841A (en) A kind of tunnel cross-section method for drafting for parameterizing Tunneling by mining method
CN106649410A (en) Method and device for obtaining chitchat reply content
CN105704168A (en) Method and device for adjusting relationships between network nodes in Internet of things
CN103517297B (en) A kind of method for displaying signal intensity and device
CN113093686B (en) SCADA-based automatic configuration modeling method and related device
CN104283792B (en) WInternet pipelined communication protocols routing algorithms based on content
CN100438667C (en) User terminal and its method for processing message
CN105306503B (en) Regional analysis figure implementation method and its system
CA2881329C (en) Method and device for grouping contacts in social network
CN100578999C (en) multiplexing method for multi-user signal
CN106874009B (en) Network layer ICD packaging method and device
CN112614209B (en) Element redrawing method and system during flow chart refreshing
CN115207421A (en) Energy supply method and device for battery system, electronic equipment and storage medium
CN109685875B (en) GPU line rasterization boundary calculation optimization method
TWI399702B (en) System and method for drawing a three-dimensional path
CN103379018B (en) The processing method of application message and system

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C12 Rejection of a patent application after its publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20091007