Graph distance measurement method and device, computer equipment and storage medium

Through the graphical ranging method, the geometric dimensions and spacing of quantum chip components are automatically measured, which solves the problem of time-consuming and easy errors in manual measurement, and improves design accuracy and efficiency.

CN120047522APending Publication Date: 2025-05-27SHANDONG YUNHAI GUOCHUANG CLOUD COMPUTING EQUIP IND INNOVATION CENT CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510098904.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

In existing quantum chip layout design software, manual measurement of components geometric dimensions and spacing is time-consuming and easy to cause errors, resulting in insufficient design accuracy and affecting chip performance.

Method used

Provide a graphic distance measurement method, by obtaining measurement points, determining the graphic measurement mode, finding the measurement edge, doing vertical line extension, automatically finding intersection points, calculating measurement distances, and ensuring measurement accuracy.

Benefits of technology

It improves the accuracy and efficiency of quantum chip design, reduces manual operation and error, reduces the work burden of designers, and ensures accurate positioning of key geometric points.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120047522A_ABST
    Figure CN120047522A_ABST
Patent Text Reader

Abstract

The invention relates to a graph distance measurement method and device, computer equipment and a storage medium. The method comprises the following steps: acquiring at least one measurement point, wherein the at least one measurement point comprises a first measurement point; determining a graph measurement mode according to the position of the first measurement point; determining a first measurement edge closest to the first measurement point; drawing a vertical line to the first measurement edge according to the first measurement point to obtain a first intersection point which is the intersection point of the first measurement point and the first measurement edge; extending the vertical line according to the first intersection point and the first measurement point to obtain a vertical line extension line; determining a second intersection point and a second measurement edge according to the pattern measurement mode and the vertical line extension line; and determining the distance between the first measurement edge and the second measurement edge according to the first intersection point and the second intersection point. The method can automatically measure the graphic distance and improve the measurement precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of chip design tools, and particularly to a method and device for measuring distances of graphics, a computer device, and a storage medium. Background Art

[0002] Quantum chips are the core of next-generation computing technologies. With the continuous development of quantum computing technologies, chip layout design tools play a crucial role in the manufacturing of quantum chips. Layout design is the last step in chip design, which determines the physical layout of the circuit. In this stage, the effectiveness and accuracy of the design tools directly affect the performance of the chip. In the current development process of quantum chip layout design software, the main technical solution adopted is to locate and measure the starting and ending points of the distance through mouse click events. When the mouse is clicked for the first time, the system records the coordinate point at this time as the starting point coordinate. When the user moves the mouse to the target position and clicks again, the system records the coordinate point at this position as the ending point. By calculating the distance between the two points, the measurement function is realized.

[0003] Manually measuring the geometric dimensions and spacings of components is not only time-consuming but also prone to errors. This will further lead to insufficient design accuracy and affect the overall performance of the chip. Due to design errors caused by measurement errors, repeated modifications or re-fabrications may be required during the chip production process, increasing the manufacturing cost and time. Summary of the Invention

[0004] Based on this, in view of the above technical problems, it is necessary to provide a method and device for measuring distances of graphics, a computer device, and a storage medium that can automatically measure the distances of graphics and improve the measurement accuracy.

[0005] On the one hand, a method for measuring distances of graphics is provided, and the method includes:

[0006] Obtain at least one measurement point, where the at least one measurement point includes a first measurement point;

[0007] Determine a graphics measurement mode according to the position of the first measurement point;

[0008] Determine a first measurement side that is closest to the first measurement point;

[0009] Draw a perpendicular line from the first measurement point to the first measurement side to obtain a first intersection point, where the first intersection point is the intersection point of the first measurement point and the first measurement side;

[0010] Extend the perpendicular line according to the first intersection point and the first measurement point to obtain an extended perpendicular line;

[0011] Determine a second intersection point and a second measurement side according to the graphics measurement mode and the extended perpendicular line;

[0012] Determine the distance between the first measurement side and the second measurement side based on the first intersection point and the second intersection point.

[0013] In one embodiment, it includes:

[0014] The measurement mode includes: in-graphic measurement mode, adjacent-graphic measurement mode, and any-two-graphic measurement mode;

[0015] In response to the measurement points including only the first measurement point and the position of the first measurement point being within the graphic border, the graphic measurement mode is the in-graphic measurement mode;

[0016] In response to the measurement points including only the first measurement point and the position of the first measurement point being outside the graphic border, the graphic measurement mode is the adjacent-graphic measurement mode;

[0017] In response to the measurement points including the first measurement point and the second measurement point, and the first measurement point and the second measurement point being respectively within different graphic borders, the graphic measurement mode is the any-two-graphic measurement mode.

[0018] In one embodiment, obtain the first measurement point and the first measurement side closest to the first measurement point,

[0019] It includes:

[0020] Obtain all sides of the graphic to get a side set;

[0021] Based on the first measurement point, traverse the side set to obtain the perpendicular distance from the first measurement point to each side;

[0022] Sort the distances from the first measurement point to each side to obtain the first measurement side closest to the first measurement point;

[0023] Redraw the line segment of the first measurement side.

[0024] In one embodiment, draw a perpendicular line from the first measurement point to the first measurement side to obtain the first intersection point, including:

[0025] Based on the first measurement side and the first measurement point, respectively obtain the coordinates of point A, point B, and point C, where the first measurement point is point C, the first measurement side includes point A and point B, and the first intersection point is D;

[0026] Based on the coordinates of point A, point B, and point C, obtain and

[0027] Calculate the and the The dot product is as follows: where AC.x and AB.x represent the and components of the vectors in the x-direction, and AC.y and AB.y represent the components of the vectors AC and AB in the y-direction;

[0028] Calculate the modulus of the vector, and the formula is as follows:

[0029] According to the dot product of the vector and the vector and the modulus of the vector, calculate the projection vector, and the formula is as follows:

[0030]

[0031] According to the point A and the projection vector, obtain the coordinates of the first intersection point, and the formula is as follows:

[0032] where is the projection vector.

[0033] In one embodiment, extending the perpendicular line according to the first intersection point and the first measurement point includes:

[0034] According to the coordinates of the point C and the first intersection point, obtain

[0035] According to the extend the perpendicular line to obtain the extended perpendicular line.

[0036] In one embodiment, obtaining the distance between the first measurement side and the second measurement side based on the first measurement point and the second measurement point further includes:

[0037] According to the first intersection point and the second intersection point, obtain the distance between the first intersection point and the second intersection point;

[0038] Draw the second intersection point on the canvas to connect the first intersection point and label the distance.

[0039] In one embodiment,

[0040] In response to the graphic measurement mode being the in-graphic measurement mode, determining the second intersection point and the second measurement side according to the measurement mode and the extended perpendicular line includes:

[0041] Determine the to-be-measured graphic according to the position of the first measurement point;

[0042] Find the intersection points of the perpendicular extension line of the to-be-measured figure with all sides, and determine the intersection point closest to the first measurement side of the to-be-measured figure as the second intersection point and the side where this intersection point is located as the second measurement side;

[0043] In response to the figure measurement mode being the adjacent figure measurement mode, determine the second intersection point and the second measurement side according to the measurement mode and the perpendicular extension line, including:

[0044] Determine the second to-be-measured figure according to the position of the first measurement point;

[0045] Find the intersection points of the perpendicular extension line of the second to-be-measured figure with all figures;

[0046] Determine the figure where the third intersection point closest to the first measurement side of the second to-be-measured figure is located as the third to-be-measured figure;

[0047] The third intersection point closest to the first measurement side of the second to-be-measured figure is the second intersection point of the second to-be-measured figure, and the side of the third to-be-measured figure where this intersection point is located is the second measurement side of the second to-be-measured figure;

[0048] In response to the figure measurement mode being the any two figures measurement mode, determine the second intersection point and the second measurement side according to the measurement mode and the perpendicular extension line, including:

[0049] Determine the fourth to-be-measured figure and the fifth to-be-measured figure according to the position of the first measurement point and the position of the second measurement point;

[0050] Find the intersection points of the perpendicular extension line of the fourth to-be-measured figure with all sides of the fifth to-be-measured figure, and determine the fourth intersection point and the fourth measurement side closest to the first measurement side of the fourth to-be-measured figure;

[0051] Find the intersection points of the perpendicular extension line of the fifth to-be-measured figure with all sides of the fourth to-be-measured figure, and determine the fifth intersection point and the fifth measurement side closest to the first measurement side of the fifth to-be-measured figure;

[0052] Compare the distance between the first intersection point and the fourth intersection point of the fourth to-be-measured figure with the distance between the first intersection point and the fifth intersection point of the fifth to-be-measured figure, and take the intersection point of the figure where the smaller value is located and the other figure as the second intersection point and the side where this intersection point is located as the second measurement side.

[0053] On the other hand, a figure distance measurement device is provided, and the device includes:

[0054] A point position information acquisition module, configured to acquire at least one measurement point, and the at least one measurement point includes a first measurement point;

[0055] A mode selection module, configured to determine a graphic measurement mode according to the position of the first measurement point;

[0056] An edge position information acquisition module, configured to determine a first measurement edge closest to the first measurement point;

[0057] A first intersection point acquisition module, configured to draw a perpendicular line from the first measurement point to the first measurement edge to obtain a first intersection point, where the first intersection point is the intersection point of the first measurement point and the first measurement edge;

[0058] A perpendicular line extension module, configured to extend the perpendicular line according to the first intersection point and the first measurement point to obtain a perpendicular line extension;

[0059] A second intersection point acquisition module, configured to determine a second intersection point and a second measurement edge according to the graphic measurement mode and the perpendicular line extension;

[0060] A measurement module, configured to determine the distance between the first measurement edge and the second measurement edge according to the first intersection point and the second intersection point.

[0061] On the other hand, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

[0062] Obtain at least one measurement point, where the at least one measurement point includes a first measurement point;

[0063] Determine a graphic measurement mode according to the position of the first measurement point;

[0064] Determine a first measurement edge closest to the first measurement point;

[0065] Draw a perpendicular line from the first measurement point to the first measurement edge to obtain a first intersection point, where the first intersection point is the intersection point of the first measurement point and the first measurement edge;

[0066] Extend the perpendicular line according to the first intersection point and the first measurement point to obtain a perpendicular line extension;

[0067] Determine a second intersection point and a second measurement edge according to the graphic measurement mode and the perpendicular line extension;

[0068] Determine the distance between the first measurement edge and the second measurement edge according to the first intersection point and the second intersection point.

[0069] On yet another hand, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0070] Obtain at least one measurement point, where the at least one measurement point includes a first measurement point;

[0071] Determine a graphic measurement mode according to the position of the first measurement point;

[0072] Determine the first measurement side closest to the first measurement point;

[0073] Draw a perpendicular line from the first measurement point to the first measurement side to obtain a first intersection point, where the first intersection point is the intersection point of the first measurement point and the first measurement side;

[0074] Extend the perpendicular line according to the first intersection point and the first measurement point to obtain an extended perpendicular line;

[0075] Determine a second intersection point and a second measurement side according to the graphic measurement mode and the extended perpendicular line;

[0076] Determine the distance between the first measurement side and the second measurement side according to the first intersection point and the second intersection point.

[0077] In the above graphic distance measurement method, by drawing a perpendicular line from the measurement point to the measurement side, the position of the measurement side is determined, the perpendicular line is extended, and the intersection point of the extended perpendicular line and the nearest side is determined. The distance is calculated through the side where the intersection point is located and the measurement side. This ensures the geometric accuracy during the measurement process. This vertical measurement method can avoid inaccurate distance measurement caused by manual operation or angular error, thereby improving the accuracy of quantum chip design. By automatically finding the intersection point of the perpendicular line and the side, the steps of manual search and adjustment are reduced, greatly improving the design efficiency. The system automatically calculates the nearest intersection point and the measurement distance, reducing the workload of designers. The intersection points of the extended perpendicular line and all sides are automatically searched, which can ensure the accurate positioning of every key geometric point in the design, avoiding errors caused by human operation or improper measurement methods. It enables designers to more intuitively understand the distance and layout between components.

[0078] This method can adapt to the complex geometric structures in quantum chip design. Especially when the layout between components is very compact or the angles are complex, the method of automatically finding the intersection point and the foot of the perpendicular can ensure accurate measurement results. By obtaining accurate measurement distances, designers can better adjust the layout of components, avoid affecting chip performance due to improper spacing, and thus improve the overall design quality and stability of quantum chips. Description of the Drawings

[0079] Figure 1 It is an application environment diagram of the graphic distance measurement method in an embodiment;

[0080] Figure 2 It is a flow schematic diagram of the graphic distance measurement method in an embodiment;

[0081] Figure 3 It is a structural block diagram of a graphic ranging device in an embodiment;

[0082] Figure 4 It is a position relationship diagram of the first intersection point and the first measurement side of a graphic ranging method in an embodiment;

[0083] Figure 5 It is an internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0084] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0085] The graphic ranging method provided by the present application can be applied to, for example, Figure 1 the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The user enters the current graphic through the cursor, obtains the edge closest to the cursor position in the current graphic as the measurement edge, makes a perpendicular line from the current point to the measurement edge, and extends the perpendicular line to obtain the intersection point of the extended perpendicular line and other edges in the current graphic. The intersection point closest to the measurement edge is obtained, and the distance between the foot of the perpendicular and the closest intersection point is calculated, that is, the distance between the edge closest to the current measurement edge and the measurement edge is obtained. Among them, the terminal 102 can be, but is not limited to, various personal computers and laptop computers, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0086] In an embodiment, as Figure 2 shown, a graphic ranging method is provided. Taking the case where this method is applied to Figure 1 the terminal in as an example, the method includes the following steps:

[0087] Step 202, obtain at least one measurement point, and the at least one measurement point includes a first measurement point.

[0088] Specifically, enter the current graphic through the cursor, obtain the position of the current cursor as the first measurement point, and obtain at least one measurement point.

[0089] Step 204, determine the graphic measurement mode according to the position of the first measurement point.

[0090] Among them, the user selection positions include: inside the graphic border, outside the graphic border, and the whole graphic; the measurement modes include: in-graphic measurement mode, adjacent graphic measurement mode, and any two graphic distance measurement mode steps.

[0091] Step 206: Determine the first measurement edge closest to the first measurement point.

[0092] Specifically, by moving the cursor into the current graph, the position of the current cursor is automatically obtained as the position of the first measurement point, and the edge closest to this point is automatically obtained as the first measurement edge, enabling designers to avoid manually selecting the edge or guessing the relative position, thus avoiding the possible errors during manual positioning and simplifying the operation process.

[0093] Step 208: Draw a perpendicular line from the first measurement point to the first measurement edge to obtain a first intersection point, which is the intersection point of the first measurement point and the first measurement edge.

[0094] Specifically, by constructing the perpendicular line, the perpendicularity during the measurement process is ensured, providing an accurate reference point for subsequent distance measurement. The foot of the perpendicular coordinates provides a reliable basis for subsequent geometric measurements.

[0095] Step 210: Extend the perpendicular line based on the first intersection point and the first measurement point to obtain an extended perpendicular line.

[0096] Specifically, after extending the perpendicular line, it can help designers align adjacent components more precisely and optimize the layout, ensuring that their positions in the chip design conform to geometric specifications and avoiding interference and irregular arrangements.

[0097] Step 212: Determine a second intersection point and a second measurement edge based on the graph measurement mode and the extended perpendicular line.

[0098] Specifically, by finding the intersection points of all the edges intersecting with the extended perpendicular line in the component, the intersection point closest to the extended perpendicular line is obtained, and the coordinates of this intersection point are acquired. It can provide accurate intersection point coordinates for complex-shaped components in a complex chip layout, ensuring the integrity and rigor of the design.

[0099] Step 214: Determine the distance between the first measurement edge and the second measurement edge based on the first intersection point and the second intersection point.

[0100] Specifically, by precisely calculating the distance between the first intersection point and the second intersection point, designers can precisely control the key geometric dimensions in the layout in a graphical manner. This precision ensures the accurate arrangement of components in actual manufacturing, reducing potential design deviations. The measured distance can be used as a basis for subsequent design verification and optimization. During the verification phase of chip design, it can be determined whether the component layout meets the specification requirements based on these measured distances, and iterative optimization can be carried out in a timely manner to improve the performance and reliability of the chip.

[0101] In the above-mentioned graphic distance measurement method, by drawing a perpendicular line from the measurement point to the measurement side, the position of the measurement side is determined, the perpendicular line is extended, and the intersection point of the extended perpendicular line and the nearest side is determined. The distance is calculated based on the side where the intersection point is located and the measurement side. This ensures the geometric accuracy during the measurement process. This vertical measurement method can avoid inaccurate distance measurement caused by manual operation or angular error, thereby improving the accuracy of quantum chip design. By automatically finding the intersection point of the perpendicular line and the side, the steps of manual search and adjustment are reduced, greatly improving the design efficiency. The system automatically calculates the nearest intersection point and the measurement distance, reducing the workload of designers. Automatically searching for the intersection points of the extended perpendicular line and all sides can ensure the accurate positioning of each key geometric point in the design, avoiding errors caused by human operation or improper measurement methods. This enables designers to more intuitively understand the distances and layout situations between components.

[0102] This method can adapt to the complex geometric structures in quantum chip design. Especially when the layout between components is very compact or the angles are complex, the method of automatically finding the intersection points and the perpendicular feet can ensure accurate measurement results. By obtaining accurate measurement distances, designers can better adjust the layout of components, avoid affecting the chip performance due to improper spacing, and thus improve the overall design quality and stability of quantum chips.

[0103] In one embodiment, the method further includes:

[0104] The measurement modes include: in-graphic measurement mode, adjacent-graphic measurement mode, and any-two-graphic measurement mode;

[0105] In response to the measurement points including only the first measurement point and the position of the first measurement point being within the graphic border, the graphic measurement mode is the in-graphic measurement mode;

[0106] In response to the measurement points including only the first measurement point and the position of the first measurement point being outside the graphic border, the graphic measurement mode is the adjacent-graphic measurement mode;

[0107] In response to the measurement points including the first measurement point and the second measurement point, and the first measurement point and the second measurement point being respectively within different graphic borders, the graphic measurement mode is the any-two-graphic measurement mode.

[0108] Specifically, the position of the first measurement point is determined by the cursor position, and the measurement mode of the graph is judged based on the positional relationship between the first measurement point and the graph to be measured, including: when the cursor is within the graph border, the current measurement mode is the in-graph measurement mode, and the position where the current cursor is located is the first measurement point of the graph to be measured; when the cursor is outside the graph border, the current measurement mode is the adjacent-graph measurement mode, and the position where the current cursor is located is a measurement point of the first graph to be measured; when the cursor separately selects any two graphs by clicking, the current measurement mode is the any-two-graph measurement mode, and the positions where the cursor clicks are respectively the first measurement point of the first graph to be measured and the first measurement point of the second graph to be measured.

[0109] By judging the measurement mode of the current graph based on the positional relationship between the first measurement point and the graph to be measured, and measuring the graph according to the measurement mode, various measurement requirements can be met, the situations of repeated measurement or chaotic measurement results can be avoided, and the measurement results can be made more accurate.

[0110] In one embodiment, the method further includes:

[0111] Step 302: Obtain all the sides of the graph to obtain a side set.

[0112] Among them, obtaining all the sides of the graph means obtaining all the sides of the component to obtain a component-side set.

[0113] Step 304: Traverse the side set according to the first measurement point to obtain the perpendicular distance from the first measurement point to each side; sort the distances from the first measurement point to each side to obtain the first measurement side closest to the first measurement point.

[0114] Specifically, using the first measurement point as the starting point, traverse all the sides of the component and calculate the perpendicular distance between the first measurement point and all the sides of the component, and sort the distances from each side to the first measurement point in ascending order. The side where the closest point is located is the first measurement side.

[0115] Step 306: Redraw the first measurement side.

[0116] Specifically, redraw the first measurement side and highlight the current first measurement side. This can avoid the errors caused by manually positioning the measurement point and the measurement side, and by redrawing the obtained first measurement side, it is visually intuitive and clear, and it can be clearly judged that the current line segment is the reference side for measurement.

[0117] In one embodiment, the method further includes:

[0118] According to the first measurement side and the first measurement point, obtain the coordinates of point A, point B, and point C respectively, where the first measurement point is point C, the first measurement side includes point A and point B, and the first intersection point is D;

[0119] Obtain based on the coordinates of point A, point B, and point C and

[0120] Calculate the and the dot product, and the formula is as follows:

[0121] where AC.x and AB.x represent the components of the vectors and in the x direction, and AC.y and AB.y represent the components of the vectors AC and AB in the y direction;

[0122] Calculate the modulus of the , and the formula is as follows:

[0123] According to the dot product of the vectors and the and the modulus of the calculate the projection , and the formula is as follows:

[0124]

[0125] According to point A and the projection obtain the coordinates of the first intersection point, and the formula is as follows:

[0126] where, is the projection vector.

[0127] Specifically, the coordinates of point A are: A(xA, yA); the coordinates of point B are: B(xB, yB); the coordinates of point C are: C(xC, yC);

[0128] Let A(1, 1); B(4, 1); C(2, 3);

[0129] According to the coordinates of point A, point B, and point C above, calculate and the vector

[0130] is equal to the coordinates of point C minus the coordinates of point A, is equal to the coordinates of point B minus the coordinates of point A;

[0131] That is,

[0132] Calculate and dot product: AC·AB = (1×3)+(2×0) = 3AC·AB = (1×3)+(2×0) = 3

[0133] Calculate modulus of:

[0134] Calculate

[0135] According to and project coordinates of:

[0136] According to the coordinates of point A and the projection coordinates, calculate the coordinates of the first intersection point:

[0137]

[0138] The coordinates of the first intersection point are expressed as: D(xD,yD) = (1,1)+(1,0) = (2,1)

[0139] In one embodiment, the method further includes:

[0140] As Figure 5 shown, according to the coordinates of the point C and the coordinates of the first intersection point, obtain the vector

[0141] According to the vector extend the perpendicular line to obtain the extended perpendicular line.

[0142] Specifically, by calculating the distance from point C to point D and extending the perpendicular line, this operation can not only accurately display geometric relationships, improve the visualization effect of the design, but also effectively support various functions such as design verification, layout adjustment optimization, and collision detection. In geometric analysis, this operation method can significantly improve accuracy and design efficiency.

[0143] In one embodiment, the method further includes:

[0144] Obtain the coordinates of the intersection points of the extended perpendicular line and all sides;

[0145] Specifically, the first intersection point falls on the first measurement side AB, and the first measurement side is expressed as: (Ax,Ay) and (Bx,By), find the intersection points of the perpendicular line DC and each line segment.

[0146] The parametric equations of the line segments DC and AB are as follows:

[0147] Line segment equation of DC:

[0148] LDC: y - Dy Cy - Dy = x - Dx Cx - Dx;

[0149] Line segment equation of AB: LAB: y - Ay By - Ay = x - Ax Bx - Ax;

[0150] Calculate the distance from the coordinates of each of the intersection points to the first intersection point, and store the coordinates of the intersection points and the coordinates of the first intersection point into an intersection point array;

[0151] Sort the coordinates of each of the intersection points and the first intersection point in ascending order of distance according to a sorting algorithm to obtain a sorted intersection point array;

[0152] The first coordinate point in the sorted intersection point array is the coordinates of the first intersection point, and the second coordinate point is the coordinates of the second intersection point closest to the first intersection point.

[0153] Specifically, by finding the intersection points of the perpendicular extension line and all sides, and sorting according to the distances between the first intersection point and all the intersection points, the intersection point closest to the first intersection point is obtained as the second intersection point, that is, the side where the second intersection point is located is obtained.

[0154] In one embodiment, the method further includes:

[0155] Obtain the distance between the coordinates of the first intersection point and the coordinates of the second intersection point according to the coordinates of the first intersection point and the coordinates of the second intersection point;

[0156] Draw a connection between the second intersection point and the first intersection point on the canvas and label the distance.

[0157] Calculate the distance between the two intersection points according to the first corner point coordinates and the second intersection point coordinates, that is, obtain the distance between the first measurement side and the second measurement side. Connecting the two points and labeling the distance on the canvas can greatly enhance the intuitiveness of the measurement result and provide accurate distance data reference for subsequent design of components.

[0158] In one embodiment, it further includes:

[0159] In response to the graphic measurement mode being the in-graphic measurement mode, determine the second intersection point and the second measurement side according to the measurement mode and the perpendicular extension line, including:

[0160] Determine the to-be-measured graphic according to the position of the first measurement point;

[0161] Find the intersection points of the perpendicular extension line of the to-be-measured figure with all sides, and determine that the intersection point closest to the first measurement side of the to-be-measured figure is the second intersection point and the side where this intersection point is located is the second measurement side;

[0162] The determination method of the to-be-measured figure and the judgment conditions of the measurement mode have been elaborated in detail above, so they will not be elaborated here.

[0163] In response to the figure measurement mode being the adjacent figure measurement mode, determine the second intersection point and the second measurement side according to the measurement mode and the perpendicular extension line, including:

[0164] Determine the second to-be-measured figure according to the position of the first measurement point;

[0165] Find the intersection points of the perpendicular extension line of the second to-be-measured figure with all figures;

[0166] Determine that the figure where the third intersection point closest to the first measurement side of the second to-be-measured figure is located is the third to-be-measured figure;

[0167] The third intersection point closest to the first measurement side of the second to-be-measured figure is the second intersection point of the second to-be-measured figure, and the side of the third to-be-measured figure where this intersection point is located is the second measurement side of the second to-be-measured figure;

[0168] Specifically, through the first measurement side of the second to-be-measured figure and the intersection points of the perpendicular extension line of the second to-be-measured figure with all figures, where the intersection point closest to the second to-be-measured figure is the third intersection point, the figure where the third intersection point is located is the third to-be-measured figure, the side where the third intersection point is located is the second measurement side of the second to-be-measured figure, and the third intersection point is the second intersection point of the second to-be-measured figure.

[0169] In response to the figure measurement mode being the any two figures measurement mode, determine the second intersection point and the second measurement side according to the measurement mode and the perpendicular extension line, including:

[0170] Determine the fourth to-be-measured figure and the fifth to-be-measured figure according to the position of the first measurement point and the position of the second measurement point;

[0171] Find the intersection points of the perpendicular extension line of the fourth to-be-measured figure with all sides of the fifth to-be-measured figure, and determine the fourth intersection point and the fourth measurement side closest to the first measurement side of the fourth to-be-measured figure;

[0172] Find the intersection points of the perpendicular extension line of the fifth to-be-measured figure with all sides of the fourth to-be-measured figure, and determine the fifth intersection point and the fifth measurement side closest to the first measurement side of the fifth to-be-measured figure;

[0173] Compare the distance between the first intersection point and the fourth intersection point of the fourth graph to be measured with the distance between the first intersection point and the fifth intersection point of the fifth graph to be measured, and take the intersection point of the graph where the smaller value is located and the other graph as the second intersection point and the side where the intersection point is located as the second measurement side.

[0174] Specifically, find the intersection points with all sides of the fifth graph to be measured according to the extension line of the perpendicular line of the fourth graph to be measured, and obtain the fourth intersection point closest to the first measurement side of the fourth graph to be measured and the fourth measurement side where the fourth intersection point is located; find the intersection points with all sides of the fourth graph to be measured according to the extension line of the perpendicular line of the fifth graph to be measured, and obtain the fifth intersection point closest to the first measurement side of the fifth graph to be measured and the fifth measurement side where the fifth intersection point is located; compare the distance between the first intersection point side of the fourth graph to be measured and the fourth intersection point of the fourth graph to be measured with the distance between the first intersection point side of the fifth graph to be measured and the fifth intersection point of the fifth graph to be measured, and select the intersection point of the graph with the smaller value and the other graph as the second intersection point, and the side where the intersection point is located as the second measurement side.

[0175] By determining the measurement mode based on the position selected by the user, various measurement requirements can be met, thereby increasing the usage scenarios of this method and meeting the needs of designers for graphic measurement in various scenarios.

[0176] In one embodiment, the method further includes:

[0177] According to the and the dot product result, judge the reasonable range of the perpendicular line, where the result of the reasonable range judgment includes: the perpendicular line is within the reasonable range and the perpendicular line is outside the reasonable range;

[0178] In response to then ∠CAB is an obtuse angle, the first intersection point does not fall on the first measurement side, and the perpendicular line is outside the reasonable range;

[0179] In response to then ∠CAB is an obtuse angle, the first intersection point does not fall on the first measurement side, and the perpendicular line is outside the reasonable range;

[0180] In response to then ∠CAB is a right angle, the first intersection point falls on the first measurement side, the perpendicular line is within the reasonable range, and extend the perpendicular line.

[0181] Wherein, if the dot product result is negative or greater than AC 2When it is, it means that the included angle between vector AB and vector AC is greater than 90 degrees, which is an obtuse angle. At this time, the foot of the perpendicular of point C falls on the extension of AB, rather than on the line segment AB itself. That is to say, the first intersection point is not on AB, and the perpendicular line exceeds the effective range. If the dot product is zero, it means and are perpendicular to each other, that is, the included angle is 90 degrees. In this case, the foot of the perpendicular of point C exactly falls on the line segment AB. Therefore, the perpendicular line is within the reasonable range, and the first intersection point is a valid point.

[0182] Based on the dot product judgment, designers can dynamically adjust the position of point C, thereby optimizing the construction of the geometric structure. For example, when the dot product is negative, it can remind the designer to adjust the position of point C so that it falls within the reasonable range. Continue to calculate for those that meet the conditions, and adjust those that do not meet the conditions. By and judging whether the perpendicular line is within the reasonable range through the dot product, it can ensure that the construction of the perpendicular line is based on the actual geometric relationship, meets the conditions for making the perpendicular line, and can avoid errors in the measurement results.

[0183] It should be understood that although Figure 2 the steps in the flowchart of Figure 2 are shown in sequence according to the indication of the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover,

[0184] In one embodiment, as Figure 3 shown, a graphic ranging device is provided, including: a point position information acquisition module 402, a mode selection module 404, a side position information acquisition module 406, a first intersection point acquisition module 408, a perpendicular line extension module 410, a second intersection point acquisition module 412, and a measurement module 414, where:

[0185] The point position information acquisition module 402 is used to acquire at least one measurement point, and the at least one measurement point includes a first measurement point;

[0186] The mode selection module 404 is used to determine the graphic measurement mode according to the position of the first measurement point;

[0187] The side position information acquisition module 406 is used to determine the first measurement side closest to the first measurement point;

[0188] The first intersection point obtaining module 408 is configured to draw a perpendicular line from the first measurement point to the first measurement side to obtain a first intersection point, where the first intersection point is the intersection point of the first measurement point and the first measurement side;

[0189] The perpendicular line extension module 410 is configured to extend the perpendicular line according to the first intersection point and the first measurement point to obtain an extended perpendicular line;

[0190] The second intersection point obtaining module 412 is configured to determine a second intersection point and a second measurement side according to the graphic measurement mode and the extended perpendicular line;

[0191] The measurement module 414 is configured to determine the distance between the first measurement side and the second measurement side according to the first intersection point and the second intersection point.

[0192] In one embodiment, the mode selection module 404,

[0193] is configured to, in response to the measurement points including only the first measurement point and the position of the first measurement point being within the graphic border, the graphic measurement mode being the in-graphic measurement mode;

[0194] is configured to, in response to the measurement points including only the first measurement point and the position of the first measurement point being outside the graphic border, the graphic measurement mode being the adjacent-graphic measurement mode;

[0195] is configured to, in response to the measurement points including the first measurement point and the second measurement point, and the first measurement point and the second measurement point being respectively within different graphic borders, the graphic measurement mode being the any-two-graphic measurement mode.

[0196] In one of the embodiments, the perpendicular line extension module 410,

[0197] is configured to obtain according to the coordinates of point C and the coordinates of the first intersection point,

[0198] is configured to according to the extend the perpendicular line to obtain an extended perpendicular line.

[0199] For the specific limitations on the graphic distance measurement device, reference may be made to the limitations on the graphic distance measurement method in the foregoing text, which will not be elaborated herein. Each module in the foregoing graphic distance measurement device can be implemented in whole or in part by software, hardware, and their combination. The foregoing modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the foregoing respective modules.

[0200] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structural diagram may be as shown in Figure 5 . The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it realizes a graphic ranging method. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device may be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0201] Those skilled in the art can understand that Figure 5 the structure shown in is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0202] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

[0203] Obtain at least one measurement point, where the at least one measurement point includes a first measurement point;

[0204] Determine a graphic measurement mode according to the position of the first measurement point;

[0205] Determine a first measurement side closest to the first measurement point;

[0206] Draw a perpendicular line from the first measurement point to the first measurement side to obtain a first intersection point, where the first intersection point is the intersection point of the first measurement point and the first measurement side;

[0207] Extend the perpendicular line according to the first intersection point and the first measurement point to obtain an extended perpendicular line;

[0208] Determine a second intersection point and a second measurement side according to the graphic measurement mode and the extended perpendicular line;

[0209] Determine the distance between the first measurement side and the second measurement side based on the first intersection point and the second intersection point.

[0210] In one embodiment, when the processor executes the computer program, the following steps are further implemented:

[0211] Obtain all the sides of the graph to get the side set;

[0212] Traverse the side set according to the first measurement point to obtain the perpendicular distance from the first measurement point to each side;

[0213] Sort the distances from the first measurement point to each side to obtain the first measurement side closest to the first measurement point;

[0214] Redraw the line segment of the first measurement side.

[0215] In one embodiment, when the processor executes the computer program, the following steps are further implemented:

[0216] According to the first measurement side and the first measurement point, respectively obtain the coordinates of point A, point B, and point C, where the first measurement point is point C, the first measurement side includes point A and point B, and the first intersection point is D;

[0217] Obtain according to the coordinates of point A, point B, and point C and

[0218] Calculate the and the dot product, the formula is as follows:

[0219] where AC.x and AB.x represent the x-direction components of the vectors and respectively, and AC.y and AB.y represent the y-direction components of the vectors AC and AB;

[0220] Calculate the modulus of the The formula is as follows:

[0221] According to the dot product of the vectors and the and the modulus of the calculate the projection The formula is as follows:

[0222]

[0223] According to point A and the projection obtain the coordinates of the first intersection point. The formula is as follows:

[0224] wherein, is the projection vector.

[0225] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0226] Obtain at least one measurement point, where the at least one measurement point includes a first measurement point;

[0227] Determine a graphic measurement mode according to the position of the first measurement point;

[0228] Determine a first measurement edge closest to the first measurement point;

[0229] Draw a perpendicular line from the first measurement point to the first measurement edge to obtain a first intersection point, where the first intersection point is the intersection point of the first measurement point and the first measurement edge;

[0230] Extend the perpendicular line according to the first intersection point and the first measurement point to obtain an extended perpendicular line;

[0231] Determine a second intersection point and a second measurement edge according to the graphic measurement mode and the extended perpendicular line;

[0232] Determine the distance between the first measurement edge and the second measurement edge according to the first intersection point and the second intersection point.

[0233] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0234] Obtain the coordinates of the intersection points of the extended perpendicular line DC and all sides;

[0235] Calculate the distance from the coordinates of each intersection point to the first intersection point, and store the coordinates of the intersection point and the coordinates of the first intersection point into an intersection point array;

[0236] Sort the coordinates of each intersection point and the first intersection point in ascending order of distance according to a sorting algorithm to obtain a sorted intersection point array;

[0237] The first coordinate point in the sorted intersection point array is the coordinates of the first intersection point, and the second coordinate point is the coordinates of the second intersection point closest to the first intersection point.

[0238] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0239] Obtain the distance between the coordinates of the first intersection point and the coordinates of the second intersection point according to the coordinates of the first intersection point and the coordinates of the second intersection point;

[0240] Draw the second intersection point on the canvas to connect the first intersection point and mark the distance.

[0241] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium used in the various embodiments provided in the present application can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0242] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0243] The above-described embodiments merely represent several implementation manners of the present application. The description is relatively specific and detailed, but it should not be construed as a limitation on the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.

Claims

1. A graphic distance measurement method, characterized in that: include, Acquire at least one measurement point, wherein the at least one measurement point includes a first measurement point; determining a graphic measurement mode according to the position of the first measurement point; determining a first measurement side closest to the first measurement point; Draw a perpendicular line from the first measuring point to the first measuring side to obtain a first intersection point, where the first intersection point is the intersection point of the first measuring point and the first measuring side; Extend the vertical line according to the first intersection point and the first measurement point to obtain an extended vertical line; Determine a second intersection point and a second measurement side according to the graphic measurement mode and the vertical line extension line; The distance between the first measuring side and the second measuring side is determined according to the first intersection point and the second intersection point.

2. A method for measuring distance using a graphic according to claim 1, characterized in that: include: The measurement modes include: intra-graphic measurement mode, adjacent-graphic measurement mode and any two-graphic measurement mode; In response to the measurement points only including the first measurement point and the position of the first measurement point is located within the graphic border, the graphic measurement mode is the in-graphic measurement mode; In response to the measurement points only including the first measurement point and the position of the first measurement point is outside the graphic border, the graphic measurement mode is an adjacent graphic measurement mode; In response to the measurement points including a first measurement point and a second measurement point, and the first measurement point and the second measurement point are respectively located in different graphic frames, the graphic measurement modes are any two graphic measurement modes.

3. A graphic distance measurement method according to claim 1, characterized in that: Determining a first measurement side closest to the first measurement point includes: Get all the edges of the graph and get the edge set; According to the first measuring point, traverse the edge set to obtain the vertical distance from the first measuring point to each edge; sorting the distances from the first measurement point to each of the edges to obtain the first measurement edge closest to the first measurement point; Redraw the line segment of the first measurement edge.

4. A graphic distance measurement method according to claim 1, characterized in that: Drawing a perpendicular line from the first measurement point to the first measurement side to obtain a first intersection point includes: According to the first measurement side and the first measurement point, respectively obtain the coordinates of point A, point B and point C, wherein the first measurement point is point C, the first measurement side includes the point A and the point B, and the first intersection point is D; According to the coordinates of point A, point B and point C, we can get and Calculate the and stated The dot product of is as follows: Where AC.x and AB.x represent vectors and AC.y and AB.y represent the x-component of vectors AC and AB, respectively. Calculate the The modulus is as follows: According to the vector and stated The dot product and the Modulo calculation projection The formula is as follows: According to the point A and the projection The coordinates of the first intersection are obtained using the following formula: in, is the projection vector.

5. A method for measuring distance using a graphic according to claim 3, characterized in that: Extending the vertical line according to the first intersection point and the first measurement point includes: According to the first measurement point and the first intersection point, we get According to the The vertical line is extended to obtain a vertical line extension line.

6. A method for measuring distance using a graphic according to claim 5, characterized in that: Obtaining a distance between the first measuring edge and the second measuring edge based on the first measuring point and the second measuring point, further comprising: Obtaining a distance between the first intersection point and the second intersection point according to the first intersection point and the second intersection point; Draw the second intersection point on the canvas to connect the first intersection point, and mark the distance.

7. A graphic distance measurement method according to claim 2, characterized in that: include: In response to the graphic measurement mode being the intra-graphic measurement mode, determining a second intersection point and a second measurement side according to the measurement mode and the vertical line extension line, including: Determine the figure to be measured according to the position of the first measuring point; Find the intersection points of the extended line of the vertical line of the figure to be measured and all the sides, determine the intersection point closest to the first measurement side of the figure to be measured as the second intersection point and the side where the intersection point is located as the second measurement side; In response to the graphic measurement mode being an adjacent graphic measurement mode, determining a second intersection point and a second measurement side according to the measurement mode and the vertical line extension line, including: Determine a second pattern to be measured according to the position of the first measuring point; Find the intersection points of the extended line of the vertical line of the second figure to be tested and all the figures; Determine that the figure where the third intersection point closest to the first measurement side of the second figure to be measured is located is the third figure to be measured; The third intersection point closest to the first measurement side of the second figure to be measured is the second intersection point of the second figure to be measured, and the side of the third figure to be measured where the intersection point is located is the second measurement side of the second figure to be measured; In response to the graphic measurement mode being any two graphic measurement modes, determining a second intersection point and a second measurement side according to the measurement mode and the vertical line extension line, including: Determine a fourth pattern to be measured and a fifth pattern to be measured according to the position of the first measuring point and the position of the second measuring point; Find the intersection points of the extended line of the vertical line of the fourth figure to be measured and all the sides of the fifth figure to be measured, and determine the fourth intersection point and the fourth measurement side that are closest to the first measurement side of the fourth figure to be measured; Find the intersection points of the extended line of the vertical line of the fifth figure to be measured and all the sides of the fourth figure to be measured, and determine the fifth intersection point and the fifth measuring side that are closest to the first measuring side of the fifth figure to be measured; The distance between the first intersection point and the fourth intersection point of the fourth figure to be tested is compared with the distance between the first intersection point and the fifth intersection point of the fifth figure to be tested, and the intersection point of the figure with the smaller value and the other figure is taken as the second intersection point and the side where the intersection point is located is taken as the second measurement side.

8. A graphic distance measuring device, characterized in that: The device comprises: A point position information acquisition module, used to acquire at least one measurement point, wherein the at least one measurement point includes a first measurement point; A mode selection module, used to determine a graphic measurement mode according to the position of the first measurement point; An edge position information acquisition module, used to determine a first measurement edge closest to the first measurement point; A first intersection point acquisition module, configured to draw a perpendicular line from the first measurement point to the first measurement side to obtain a first intersection point, where the first intersection point is an intersection point of the first measurement point and the first measurement side; A vertical line extension module, used for extending the vertical line according to the first intersection point and the first measurement point to obtain a vertical line extension line; A second intersection point acquisition module, used to determine a second intersection point and a second measurement side according to the graphic measurement mode and the vertical line extension line; A measuring module is used to determine the distance between the first measuring edge and the second measuring edge according to the first intersection point and the second intersection point.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.