Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
The solution of the embodiment of the present invention is mainly: to be marked by analyzing when carrying out length mark to straightway
The line and curve connection type for the adjoining lines that the straightway of length is connect with its two-end-point determines the straightway both ends of length to be marked
The corresponding mark point of point calculates the corresponding mark length of straightway of length to be marked, then root according to identified mark point
According to the straightway two-end-point of length to be marked it is corresponding mark point and length to be marked the corresponding mark length of straightway,
Length mark is carried out to the straightway of length to be marked.Compared at present directly according to the two-end-point of straightway be mark point, it is right
The mode of straightway progress length mark;Or by user be manually operated choose straightway both ends mark point, to straightway into
The mode of row length mark has taken into account the accuracy and high efficiency that length mark is carried out to straightway.Through the embodiment of the present invention
Technical solution, solve the problems, such as to carry out straightway the accuracy of length mark and inefficient.
The embodiment of the present invention proposes a kind of length annotation equipment.
Referring to Fig.1, Fig. 1 is the length annotation equipment structural representation for the hardware running environment that the embodiment of the present invention is related to
Figure.
In subsequent description, it is only using the suffix for indicating such as " module ", " component " or " unit " of element
Be conducive to explanation of the invention, itself there is no a specific meaning.Therefore, " module ", " component " or " unit " can mix
Ground uses.
As shown in Figure 1, the length annotation equipment may include: processor 1001, communication bus 1002, user interface
1003, network interface 1004, memory 1005.Wherein, communication bus 1002 is for realizing the connection communication between these components.
User interface 1003 may include display screen (Display), input unit such as keyboard (Keyboard), optional user interface
1003 can also include standard wireline interface and wireless interface.Network interface 1004 optionally may include that the wired of standard connects
Mouth, wireless interface (such as WI-FI interface).Memory 1005 can be high speed RAM memory, be also possible to stable memory
(non-volatile memory), such as magnetic disk storage.Memory 1005 optionally can also be independently of aforementioned processor
1001 storage device.
Length is marked it will be understood by those skilled in the art that length annotation equipment structure shown in Fig. 1 is not constituted
The restriction of device may include perhaps combining certain components or different component cloth than illustrating more or fewer components
It sets.
As shown in Figure 1, as may include that operating system, network are logical in a kind of memory 1005 of computer storage medium
Believe module and length marking program.
In the present invention, the length annotation equipment calls the length stored in memory 1005 mark by processor 1001
Program, and execute following operation:
Choose the straightway of length to be marked;
The line and curve connection type of the straightway, the adjoining lines connecting with the straightway two-end-point is analyzed respectively;
If the line and curve connection type is chamfering connection, the straightway end is determined according to the type analysis of adjacent lines
The corresponding mark point of point;
It is mark point with the straightway endpoint if the line and curve connection type is not chamfering connection;
According to the mark point at the straightway both ends, the corresponding mark length of the straightway is calculated;
According to the mark point at the straightway both ends and the mark length, length mark is carried out to the straightway.
Further, processor 1001 can call the length marking program stored in memory 1005, also execute following
Operation includes:
If the adjacent lines are circular arc lines, and the circular arc lines and the straightway are tangent, then determine the line
Connection type is chamfering connection.
Further, processor 1001 can call the length marking program stored in memory 1005, also execute following
Operation includes:
If the adjacent lines are straightway, and are 45 degree with the straight line angle of the length to be marked, then institute is determined
Line and curve connection type is stated as chamfering connection.
Further, processor 1001 can call the length marking program stored in memory 1005, also execute following
Operation:
If the line and curve connection type is chamfering connection, the first end point of the adjacent lines is determined as the straight line
The corresponding mark point of Duan Duandian;Wherein, the straightway is connect with the second endpoint of the adjacent lines.
Further, processor 1001 can call the length marking program stored in memory 1005, also execute following
Operation:
The coordinate value of the mark point at the straightway both ends is obtained respectively;
It is corresponding with straightway described in straight linear direction calculating according to the coordinate value of the mark at straightway both ends point
Mark length.
The present embodiment through the above scheme, when carrying out length mark to straightway, passes through the straight of analysis length to be marked
The line and curve connection type for the adjoining lines that line segment is connect with its two-end-point determines that the straightway two-end-point of length to be marked is corresponding
Point is marked, the corresponding mark length of straightway of length to be marked is calculated according to identified mark point, further according to be marked
The corresponding mark length of straightway of the corresponding mark point of the straightway two-end-point of length and length to be marked, to be marked
The straightway of length carries out length mark.Compared at present directly according to the two-end-point of straightway be mark point, to straightway into
The mode of row length mark;Or the mark point for choosing straightway both ends is manually operated by user, long scale is carried out to straightway
The mode of note has taken into account the accuracy and high efficiency that length mark is carried out to straightway.
Based on above-mentioned terminal hardware structure and communications network system, each implementation of length mask method of the present invention is proposed
Example.
It is the flow diagram of length mask method first embodiment of the present invention referring to Fig. 2, Fig. 2.
In the present embodiment, the length mask method the following steps are included:
Step S10 chooses the straightway of length to be marked;
In the present embodiment, the length mask method is optional to be applied to terminals such as PC (personal computers), optionally, terminal packet
Length annotation equipment described in above-described embodiment is included, terminal carries out length mark to straightway by the length annotation equipment.Tool
Body, in the present embodiment, when user needs to a certain straightway progress length mark in editing graph, for example, user couple
When straight line section in a certain CAD (Computer Aided Design, CAD) figure carries out length mark,
User executes chooses the selection operation of the straightway that will use when terminal detects the selection operation of user as clicked accordingly
The straightway that family is chosen is determined as the straightway for the length to be marked chosen.
Step S20 analyzes the line and curve connection of the straightway, the adjoining lines connecting with the straightway two-end-point respectively
Type;
Step S30, if the line and curve connection type is chamfering connection, according to the type analysis determination for abutting lines
The corresponding mark point of straightway endpoint;It is mark with the straightway endpoint if the line and curve connection type is not chamfering connection
Note point;
After the straightway for having chosen length to be marked, terminal divides the line and curve connection situation at the straightway both ends
Analysis, optionally, the line and curve connection type of analysis straightway, the adjoining lines being connect with straightway two-end-point.In general, actually answering
In scene, the wherein any end at straightway both ends may be that chamfering connection circular arc lines or chamfering connect other
Straightway, or other straightways are vertically connected, or be not connected with any lines, in the present embodiment, terminal is for straightway
The case where every one end, is analyzed respectively, determines the line and curve connection type of straightway and adjacent lines, wherein line and curve connection type
Including but not limited to rounded corner type, bevelling type etc..
Optionally, when the adjoining lines of the straightway of length to be marked are circular arc lines, and circular arc lines and length to be marked
The straightway of degree is tangent, then determines that the straightway of length to be marked is connect with the line and curve connection type of adjacent lines for rounded corner.
Optionally, when the adjoining lines of the straightway of length to be marked are straightway, and the straight line of itself and length to be marked
Section angle is 45 degree, then determines that the straightway of length to be marked is connect with the line and curve connection type of adjacent lines for bevelling.
A kind of situation, if the straightway of length to be marked is that chamfering connect (rounding with the line and curve connection type of adjacent lines
Angle connection or bevelling connection), then terminal determines the straightway endpoint pair of length to be marked according to the type analysis of adjacent lines
The circular arc line analysis that the mark point namely terminal answered are connected according to rounded corner determines that the straightway endpoint of length to be marked is corresponding
Mark point, alternatively, the straight line piecewise analysis that terminal is connected according to bevelling determines that the straightway endpoint of length to be marked is corresponding
Mark point.
Another situation, if the straightway of length to be marked is not that chamfering is connect with the line and curve connection type of adjacent lines,
Then terminal is mark point with the straightway endpoint of length to be marked.
Still another situation, if the straightway of length to be marked is not connected with any lines, terminal is with length to be marked
Straightway endpoint is mark point.
Step S40 calculates the corresponding mark length of the straightway according to the mark point at the straightway both ends;
After the mark point that the straightway both ends of length to be marked have been determined respectively through the above way, terminal is according to wait mark
The mark point for infusing the straightway both ends of length, calculates the corresponding mark length of straightway of length to be marked.
Optionally, the step S40 includes:
Step a obtains the coordinate value of the mark point at the straightway both ends respectively;
Step b, according to the coordinate value of the mark at straightway both ends point, with straightway described in straight linear direction calculating
Corresponding mark length.
Optionally, after the mark point that the straightway both ends of length to be marked have been determined respectively through the above way, terminal
The coordinate value of the mark point at the straightway both ends of length to be marked is obtained respectively.Later, terminal is according to the straight line of length to be marked
The coordinate value of the mark point at section both ends, the corresponding mark length of straightway that length to be marked is calculated with straight linear telegoniometer.
For example, it is assumed that terminal obtain respectively the straightway both ends of length to be marked mark point coordinate value be (x1, y1), (x2, y2),
Then terminal is according to formulaCalculate the corresponding mark length L of straightway of length to be marked.
Step S50 carries out the straightway according to the mark point at the straightway both ends and the mark length
Length mark.
Terminal is corresponding in the straightway of the mark point and length to be marked that obtain the straightway both ends of length to be marked
After marking length, according to the mark point at the straightway both ends of length to be marked and the corresponding mark of straightway of length to be marked
Length is infused, length mark is carried out to the straightway of length to be marked.
Scheme provided in this embodiment, when carrying out length mark to straightway, by the straight line for analyzing length to be marked
The line and curve connection type of the adjoining lines of Duan Yuqi two-end-point connection, determines the corresponding mark of straightway two-end-point of length to be marked
Point is infused, the corresponding mark length of straightway of length to be marked is calculated according to identified mark point, further according to length to be marked
The corresponding mark length of straightway of the corresponding mark point of the straightway two-end-point of degree and length to be marked, to length to be marked
The straightway of degree carries out length mark.Compared at present directly according to the two-end-point of straightway be mark point, to straightway carry out
The mode of length mark;Or the mark point for choosing straightway both ends is manually operated by user, length mark is carried out to straightway
Mode, taken into account to straightway carry out length mark accuracy and high efficiency.
Further, as shown in figure 3, proposing length mask method second embodiment of the present invention based on first embodiment.?
In length mask method second embodiment, the step S30 includes:
Step S31 is mark point with the straightway endpoint if the line and curve connection type is not chamfering connection;If
The line and curve connection type is chamfering connection, then it is corresponding the first end point of the adjacent lines to be determined as the straightway endpoint
Mark point;Wherein, the straightway is connect with the second endpoint of the adjacent lines.
In the present embodiment, if the straightway of length to be marked is that chamfering is connect with the line and curve connection type of adjacent lines, this
In the case of kind, terminal will abut against the endpoint of the straightway for being not connected with length to be marked of lines, be determined as the straight of length to be marked
The corresponding mark point of line segment endpoint.For ease of description, it hereafter will abut against the straightway for being not connected with length to be marked of lines
Endpoint is known as first end point, and the endpoint that will abut against the straightway of the connection length to be marked of lines is known as the second endpoint, namely to
The straightway for marking length is connect with the second endpoint of adjacent lines, the first end of the straightway of length to be marked and adjacent lines
Point is not connected to.
For example, if the straightway rounded corner of length to be marked connects circular arc lines, the straightway and circular arc of length to be marked
The first end point of lines is not connected to, and is connect with the second endpoint of circular arc lines, then terminal is by the first end point of circular arc lines, really
It is set to the corresponding mark point of straightway endpoint of length to be marked.
For another example, if a certain other straightways of the straightway bevelling connection of length to be marked, the straight line of length to be marked
Section and the first end points of other straightways are not connected to, and are connect with the second endpoint of other straightways, then terminal is by other straight lines
The first end point of section, is determined as the corresponding mark point of straightway endpoint of length to be marked.
Several specific examples are set forth below length mask method of the present invention is described in detail:
Example one, the straightway both ends of length to be marked vertically connect two other straightways, for example, as shown in figure 4, to
The straightway two-end-point P1 point and P2 point for marking length are separately connected two other straightways, then with straightway two-end-point P1 point and
P2 point is the mark point at the straightway both ends of length to be marked.Later, according to P1 point and P2 point, the straight of length to be marked is calculated
The corresponding mark length L1 of line segment, and according to the mark point P1 point and P2 point at the straightway both ends of length to be marked, and wait mark
The corresponding mark length L1 of straightway for infusing length carries out length mark to the straightway of length to be marked.
The straightway both ends rounded corner of example two, length to be marked connects circular arc lines, for example, as shown in figure 5, to be marked
The straightway both ends of length are separately connected the P3 point and P4 point of two circular arc lines, then respectively by the P5 point of two circular arc lines and
P6 point is determined as the mark point at the straightway both ends of length to be marked.Later, according to P5 point and P6 point, length to be marked is calculated
The corresponding mark length L2 of straightway, and according to the mark point P5 point and P6 point at the straightway both ends of length to be marked, and
The corresponding mark length L2 of the straightway of length to be marked carries out length mark to the straightway of length to be marked.
The straightway both ends bevelling of example three, length to be marked connects straightway, for example, as shown in fig. 6, length to be marked
The straightway both ends of degree are separately connected the P7 point and P8 point of two straightways, then respectively by the P9 point of two straightways and P10 point
It is determined as the mark point at the straightway both ends of length to be marked.Later, according to P9 point and P10 point, length to be marked is calculated
The corresponding mark length L3 of straightway, and according to the mark point P9 point and P10 point at the straightway both ends of length to be marked, and to
The corresponding mark length L3 of straightway for marking length carries out length mark to the straightway of length to be marked.
Example four, one end chamfer of straightway of length to be marked connects adjacent lines, and (such as bevelling connects straightway, or falls
Fillet connects circular arc lines), the other end does not have chamfering to connect adjacent lines (as vertically connected other straightways, or not connected neighbour
Terminal strip), then it will abut against the endpoint of the straightway for being not connected with length to be marked of lines, be determined as the straightway of length to be marked
The corresponding first mark point in one end, the endpoint with the straightway other end (connecting adjacent lines without chamfering) of length to be marked are
Second mark point according to the first mark point and the second mark point, calculates the corresponding mark of straightway of length to be marked later
Length, and according to the corresponding mark length of straightway of the first mark point and the second mark point and length to be marked, treat mark
The straightway for infusing length carries out length mark.
Scheme provided in this embodiment is chamfering in the straightway of length to be marked and the line and curve connection type of adjacent lines
When connection, the endpoint of the straightway for being not connected with length to be marked of lines will abut against, be determined as the straightway end of length to be marked
The corresponding mark point of point, and then according to the determining corresponding mark length of straightway for marking point and calculating length to be marked, and
According to mark point and mark length, length mark is carried out to the straightway of length to be marked, rather than directly with length to be marked
The endpoint of the straightway of degree is mark point, carries out length mark to the straightway of length to be marked, this improves to straightway
Carry out the accuracy of length mark.
In addition, the embodiment of the present invention also proposes a kind of computer readable storage medium, the computer readable storage medium
On be stored with length marking program, following operation is realized when the length marking program is executed by processor:
Choose the straightway of length to be marked;
The line and curve connection type of the straightway, the adjoining lines connecting with the straightway two-end-point is analyzed respectively;
If the line and curve connection type is chamfering connection, the straightway end is determined according to the type analysis of adjacent lines
The corresponding mark point of point;
It is mark point with the straightway endpoint if the line and curve connection type is not chamfering connection;
According to the mark point at the straightway both ends, the corresponding mark length of the straightway is calculated;
According to the mark point at the straightway both ends and the mark length, length mark is carried out to the straightway.
Further, following operation is also realized when the length marking program is executed by processor:
If the adjacent lines are circular arc lines, and the circular arc lines and the straightway are tangent, then determine the line
Connection type is chamfering connection.
Further, following operation is also realized when the length marking program is executed by processor:
If the adjacent lines are straightway, and are 45 degree with the straight line angle of the length to be marked, then institute is determined
Line and curve connection type is stated as chamfering connection.
Further, following operation is also realized when the length marking program is executed by processor:
If the line and curve connection type is chamfering connection, the first end point of the adjacent lines is determined as the straight line
The corresponding mark point of Duan Duandian;Wherein, the straightway is connect with the second endpoint of the adjacent lines.
Further, following operation is also realized when the length marking program is executed by processor:
The coordinate value of the mark point at the straightway both ends is obtained respectively;
It is corresponding with straightway described in straight linear direction calculating according to the coordinate value of the mark at straightway both ends point
Mark length.
Scheme provided in this embodiment, when carrying out length mark to straightway, by the straight line for analyzing length to be marked
The line and curve connection type of the adjoining lines of Duan Yuqi two-end-point connection, determines the corresponding mark of straightway two-end-point of length to be marked
Point is infused, the corresponding mark length of straightway of length to be marked is calculated according to identified mark point, further according to length to be marked
The corresponding mark length of straightway of the corresponding mark point of the straightway two-end-point of degree and length to be marked, to length to be marked
The straightway of degree carries out length mark.Compared at present directly according to the two-end-point of straightway be mark point, to straightway carry out
The mode of length mark;Or the mark point for choosing straightway both ends is manually operated by user, length mark is carried out to straightway
Mode, taken into account to straightway carry out length mark accuracy and high efficiency.
It should be noted that, in this document, the terms "include", "comprise" or its any other variant are intended to non-row
His property includes, so that the process, method, article or the device that include a series of elements not only include those elements, and
And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including being somebody's turn to do
There is also other identical elements in the process, method of element, article or device.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal (can be mobile phone, computer, service
Device, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
The embodiment of the present invention is described with above attached drawing, but the invention is not limited to above-mentioned specific
Embodiment, the above mentioned embodiment is only schematical, rather than restrictive, those skilled in the art
Under the inspiration of the present invention, without breaking away from the scope protected by the purposes and claims of the present invention, it can also make very much
Form, all of these belong to the protection of the present invention.