Linear scale adaptive calculation method suitable for two-dimensional and three-dimensional coordinate axes in engineering field

By adopting adaptive calculation methods in the engineering field, the problem of time-consuming, inaccurate and inability to adapt to complex data in the prior art is solved, and efficient, accurate and flexible coordinate axes design is achieved.

CN119941919APending Publication Date: 2025-05-06CHINA TRANSPORT INFORMATION TECH GRP CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510168372.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2024-11-15
Filing Date
2025-02-17
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the engineering field, the prior art has the characteristics of manual calculation of axis scale calculations that are time-consuming and prone to errors, fixed intervals cannot adapt to data changes, the rough calculation method causes the scale to be unsightly and unfavorable for readability, and the inability to flexibly adapt to complex geological data.

Method used

It provides an adaptive calculation method for linear scales of two- and three-dimensional coordinate axes suitable for engineering fields. Adaptive calculation is realized through steps such as inputting data files, determining data ranges, preprocessing, setting expected scale numbers, calculating scale intervals and orders of magnitude, optimizing scale interval coefficients, calculating ideal scale intervals and quantities, and generating scale lists.

Benefits of technology

Reduce manual participation in calculations, improve scale accuracy and chart aesthetics, realize adaptive adjustment, optimize coefficient settings, adapt to the characteristics of complex geological data, and improve the efficiency, accuracy and flexibility of coordinate axis design.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119941919A_ABST
    Figure CN119941919A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of engineering graphic design, in particular to a two-dimensional and three-dimensional coordinate axis linear scale self-adaptive calculation method suitable for the engineering field, which comprises the following steps: S1, inputting a data file for drawing a coordinate axis; s2, determining a single-direction data range of the coordinate file; s3, preprocessing a data range; s4, setting an expected scale number; s5, calculating the order of magnitude of the scale interval; s6, calculating a normalized scale interval coefficient; s7, setting a scale interval coefficient list, and calculating an ideal scale interval coefficient; s8, calculating an ideal scale interval; s9, calculating an ideal scale number; s10, optimizing a scale interval coefficient; s11, calculating a scale initial value; and S12, generating a scale list.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of engineering graphic design, and in particular to a two-dimensional and three-dimensional coordinate axis linear scale adaptive calculation method applicable to the engineering field. Background Art

[0002] Coordinate axes are used in mathematics and physics to represent the position of spatial points. In the field of engineering geology, accurate data visualization and data presentation are essential for the aesthetics, safety, and reliability of engineering design. Coordinate scale axes, as a basic component of data visualization, are used to represent the range of measurements and variables in charts, drawings, and reports. Traditional axis scale calculation methods usually have the following problems: 1. Manual calculation: In early engineering geological practice, the determination of scale values ​​often relied on manual calculation by professionals, which was time-consuming and prone to errors; 2. Fixed interval: Traditional scale axis design usually adopts fixed interval, such as one scale every 10 or 100 units. This approach cannot adapt to the variation range of all data sets and is not accurate enough to express subtle changes in values. 3. Rough calculation method: Most software will use rough calculation method to obtain the scale of a certain direction when drawing plane coordinate system or space coordinate system. This kind of rough calculation usually reads the maximum and minimum values ​​of the corresponding axis data, subtracts the difference as the data range, and finally divides it by the number of divisions according to the preset scale to get the scale interval. The coordinate scale obtained in this way is very unsightly and is not conducive to the readability of charts and modeling coordinates.

[0003] 4. Complexity of geological data: Engineering geological data often contain multiple types of attribute data, such as groundwater level, seismic wave velocity, apparent resistivity, magnetic permeability, etc. The diversity and complexity of these data require that the scale axis calculation method can flexibly adapt to the characteristics of different data sets; 5. Balance between precision and readability: When designing the scale axis, professionals who design charts need to find a balance between precision and readability of the chart, and this process often relies on the subjective feelings of professionals. In the process of manual setting, too many scales may make the chart confusing and complicated, while too few scales may not accurately convey data information.

[0004] Although the previous scale axis calculation methods have met the needs of the engineering field to a certain extent, they still have limitations, especially in terms of adaptability, accuracy and automation. Therefore, it is necessary to develop a new calculation method to improve the efficiency, accuracy and flexibility of coordinate axis design.

[0005] The information disclosed in this background technology section is only intended to deepen the understanding of the overall background technology of the present invention, and should not be regarded as acknowledging or suggesting in any form that the information constitutes the prior art already known to those skilled in the art. Summary of the invention

[0006] The purpose of the present invention is to provide a method for adaptively calculating linear scales of two- and three-dimensional coordinate axes applicable to the engineering field, so as to solve the technical problems existing in the prior art.

[0007] In order to achieve the above object, the present invention adopts the following technical solutions: The present invention provides a method for adaptively calculating linear scales of two-dimensional and three-dimensional coordinate axes in the engineering field, which comprises: S1. Input the data file for drawing coordinate axes; S2, determine the data range of a single direction of the coordinate file; S3, data range preprocessing; S4. Set the expected number of scales; S5. Calculate the order of magnitude of the scale interval; S6, calculating the normalized scale interval coefficient; S7, set the scale interval coefficient list and calculate the ideal scale interval coefficient; S8, calculating the ideal scale interval; S9, calculating the ideal number of scales; S10, optimize scale interval coefficient; S11, calculating the scale starting value; S12. Generate a scale list.

[0008] Preferably, step S1 comprises: Obtain the data file of the initial drawing coordinate axis, including plane coordinate data and space coordinate data; The plane graphics drawn in engineering geology include curve graphs, cross-section graphs and plan views. Such graphics require the drawing of plane coordinate axes. When three-dimensional visualization modeling is performed, the model body requires the use of spatial coordinate axes.

[0009] Preferably, step S2 includes: reading coordinate data of the file. In the reference system, the spatial coordinates have three vector direction data of x, y and z, and the coordinates need to be calculated in sequence.

[0010] Preferably, step S3 comprises: Preliminary judgment on the data range and preprocessing; Under normal circumstances, the axis scale of each data file will have a scale range greater than zero. At this time, go directly to the next step. Special cases require special processing. When all data in a single direction are equal: If the data range is 0, it means that all data points in this direction are the same. At this time, there are two cases: Case 1: If the coordinate data are all 0, then directly output the scale list [0-, 0, 0+]; Case 2: If the coordinate data are not 0, then directly output the data list [0, x, 2x], where x is the coordinate data value.

[0011] Preferably, step S5 includes: a rough scale interval needs to be calculated, and the calculation formula is to use the difference obtained by subtracting 1 from the expected number of scales, and then divide the data range by the difference to obtain the rough scale interval. The specific formula is as follows: Rough tick interval = data range / (expected number of ticks - 1).

[0012] Preferably, step S6 includes: calculating a normalized scale interval coefficient, which is used to calculate the normalized scale interval by dividing the roughly calculated scale interval by the order of magnitude to obtain the normalized scale interval. The specific formula is as follows: Normalized scale interval coefficient = rough scale interval / order of magnitude.

[0013] Preferably, step S8 comprises: The ideal scale interval is calculated by multiplying the ideal scale interval coefficient by the order of magnitude. The calculation formula is as follows: Ideal scale interval = ideal scale interval coefficient * order of magnitude.

[0014] Preferably, step S9 includes: dividing the data range by the ideal scale interval, rounding up the quotient, and finally adding 1 to obtain the ideal scale number, and the calculation formula is as follows: Ideal scale number = ceil(data range / ideal scale interval) + 1; Among them, ceil: round up.

[0015] Preferably, step S10 includes: adding two conditional judgments to perform step jump.

[0016] Condition judgment 1: when the number of ideal scales is greater than 6 and the selected ideal scale interval coefficient is less than 10, jump from step S10 to S7, and then select a larger ideal scale interval coefficient from the scale interval coefficient list, otherwise enter condition judgment 2; Condition judgment 2: When the number of ideal scales is less than 3 and the selected ideal scale interval coefficient is greater than 1, jump back to S7 from step S10, and then select a smaller ideal scale interval coefficient from the scale interval coefficient list, otherwise enter S11.

[0017] Preferably, step S11 includes: during the calculation process, it is necessary to ensure that the starting value is an integer multiple of the scale interval, and the method is to use the minimum value of the coordinate data divided by the ideal scale interval, and the obtained quotient needs to be rounded down, and finally multiplied back by the ideal scale interval to obtain the scale starting value. The calculation formula is as follows: Scale start value = floor (data minimum value / ideal scale interval) * ideal scale interval; floor: round down; Step S12 includes: calculating all scale values ​​on a scale axis in a coordinate direction, and then storing them in a scale list. The specific formula is as follows: The i-th scale value = scale start value + (i-1) * ideal scale interval; Cycle i = 1 ~ ideal number of ticks.

[0018] By adopting the above technical solution, the present invention has the following beneficial effects: The present invention provides a method for automatically calculating and adjusting the scale value and scale quantity of coordinate axes for engineering graphics and modeling coordinate system interface design, which is specifically used to solve the problems of manual estimation and rough calculation in coordinate scale. Compared with the traditional scale value algorithm, since the data range in the calculation process involved in the present invention is dynamically acquired, the subsequent steps will adaptively calculate the rough scale interval, order of magnitude, normalized scale interval coefficient, ideal scale interval coefficient, ideal scale interval, ideal scale quantity, starting scale value, and scale value stored in the scale list, so it has the following technical advantages in adaptive calculation of scale: 1. Reduce manual participation in calculations: scale values ​​no longer need to be calculated manually, reducing manual intervention and subjective settings can effectively reduce the probability of errors; High-quality coordinate axes: In the face of various complex data in the engineering field, even slight changes in values ​​can maintain a certain scale accuracy, and set a reasonable number of scales to ensure the beauty and readability of graphics and images; 2. Adaptive adjustment: The coefficient used for each calculation of the scale value is not fixed, but dynamically adjusted according to the size difference of the input data. The adaptive mechanism of the present invention enables the algorithm to be flexible and adaptable to the actual situation when facing most data; Coefficient setting optimization: Reduced reliance on coefficients used in scale calculations, since most coefficients are calculated adaptively, thus optimizing the algorithm's coefficient setting process. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0020] Figure 1 A diagram showing the steps of a method for adaptively calculating a linear scale of a coordinate axis according to an embodiment of the present invention; Figure 2 The X-axis model of the embodiment of the present invention; Figure 3 The Y-axis scale model of the embodiment of the present invention; Figure 4 A one-dimensional curve graph coordinate system model according to an embodiment of the present invention; Figure 5 It is a two-dimensional black and white contour map coordinate system model of an embodiment of the present invention; Figure 6 This is a scattered point attribute model of a three-dimensional space coordinate system according to an embodiment of the present invention. DETAILED DESCRIPTION

[0021] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0022] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0023] This embodiment provides a method for adaptively calculating the linear scale of coordinate axes in the field of engineering geological graphic design and modeling. It should be noted that this method calculates the scale of coordinate axes and calculates the scale of coordinate axes in a single direction in sequence. Figure 1 As shown, the following steps are included: S1. Input the data file for drawing the coordinate axis.

[0024] This step aims to obtain the data file for the initial drawing of the coordinate axis. Generally, it is plane (xy) coordinate data and space (xyz) coordinate data. This type of data is generally composed of pure numbers. When using this data, it is necessary to distinguish the data columns in each direction.

[0025] The plane figures drawn in engineering geology usually include curve diagrams, cross-section diagrams and plan views. Such figures require the drawing of plane coordinate axes; when performing three-dimensional visualization modeling, the model body requires the use of spatial coordinate axes.

[0026] S2. Determine the data range of a single direction of the coordinate file.

[0027] This step is to determine the scale axis range in a certain direction. Read the coordinate data of the file. In a general coordinate system, the spatial coordinates have three vector direction data of x, y and z, and the coordinates need to be calculated in sequence. For example, read the maximum and minimum values ​​of all the x-axis coordinate data, and then subtract the two to get the x-axis data range. Then read and calculate the y-axis and z-axis. The calculation formula is as follows: Data range = maximum data value - minimum data value.

[0028] S3. Data range preprocessing.

[0029] This step is to make a preliminary judgment on the data range and perform preprocessing. Under normal circumstances, the axis scale of each data file will have a scale range greater than zero. At this point, you can go directly to the next step. However, there are some special cases. For example, all data in a single direction are equal, so we need to handle special cases: if the data range is 0, it means that all data points in this direction are the same. There are two cases. Case 1: If the coordinate data are all 0, then directly output the scale list [0-, 0, 0+]; Case 2: If the coordinate data are not 0, then directly output the data list [0, x, 2x] (x is the coordinate data value).

[0030] S4. Set the expected number of scales.

[0031] This step is to set the expected number of scales in a single direction. The number of scales on an axis will affect the user's perception, so setting a reasonable number of scales will reduce the user's viewing pressure and improve the aesthetics of the graphic image. The expected number of scales is set to n by default. For example, if we want 5 intervals on the coordinate axis, we need to set n=6, which means 6 scales.

[0032] S5. Calculate the order of magnitude of the scale interval.

[0033] This step aims to find the order of magnitude of the scale interval. First, a rough scale interval needs to be calculated. The calculation formula is to use the difference obtained by subtracting 1 from the expected number of scales mentioned above, and then divide the difference by the data range to get the rough scale interval. The specific formula is as follows: Roughly calculated scale interval = data range / (expected number of scales-1); Common orders of magnitude are 1, 10, 100, 1000, etc. Their exponential forms are 100, 101, 102, 103, where 10 is the base and the number in the upper right corner is the exponent. We can get an exponent by taking the logarithm of the scale interval and rounding it down, and then combine it with the base 10 to get the order of magnitude of the scale interval. In summary, the calculation formula is: Order of magnitude = 10^floor(log10(rough scale interval)) (floor: round down; log: logarithm, the inverse operation of power.) S6. Calculate the normalized scale interval coefficient.

[0034] This step is used to calculate the normalized scale interval coefficient. This coefficient is used to calculate the normalized scale interval by dividing the rough scale interval by the order of magnitude to get the normalized scale interval. The specific formula is as follows: Normalized scale interval coefficient = rough scale interval / order of magnitude.

[0035] S7. Set the scale interval coefficient list and calculate the ideal scale interval coefficient.

[0036] This step is used to set a scale interval coefficient list and calculate the ideal scale interval coefficient.

[0037] Set the scale interval coefficient list: scale interval coefficient list = [1,2,2.5,5,10].

[0038] The method of selecting the ideal scale interval coefficient is to compare the difference between the normalized scale interval coefficient and a series of scale interval coefficients in the scale list, and select the coefficient with the smallest absolute value of the result difference as the ideal scale interval coefficient.

[0039] Note that the coefficients in the scale interval coefficient list need to be set with caution, as this will affect the final output of the drawing. The coefficients set in this step are relatively reasonable.

[0040] S8. Calculate the ideal scale interval.

[0041] This step is used to calculate the ideal scale interval. A good scale interval can make the value of the data point easier to distinguish and reduce the cognitive burden of the user when interpreting the chart. The way to calculate the ideal scale interval is to multiply the ideal scale interval coefficient by the order of magnitude. The calculation formula is as follows: Ideal scale interval = ideal scale interval coefficient * order of magnitude S9. Calculate the ideal number of scales.

[0042] This step will adjust the expected number of scales according to the ideal scale interval to get the ideal number of scales. The expected number of scales set by humans is not perfect. Therefore, this step can be done by dividing the data range by the ideal scale interval, rounding up the quotient, and finally adding 1 to get the ideal number of scales. The calculation formula is as follows: Ideal scale number = ceil (data range / ideal scale interval) + 1 (ceil: round up.) S10. Optimize the scale interval coefficient.

[0043] This step is used to adjust the ideal scale interval coefficient. Too many or too few scales make it difficult to display graphic images well, and the factors that affect the number of scales are strongly related to the ideal scale interval coefficient. Therefore, in this step, two conditional judgments are added to jump to the step. Conditional judgment 1: When the ideal number of scales is greater than 6 and the selected ideal scale interval coefficient is less than 10, it will jump from step S10 to S7, and then select a larger ideal scale interval coefficient from the scale interval coefficient list, otherwise enter conditional judgment 2; Conditional judgment 2: When the ideal number of scales is less than 3 and the selected ideal scale interval coefficient is greater than 1, it will jump back to S7 from step S10, and then select a smaller ideal scale interval coefficient from the scale interval coefficient list, otherwise enter S11; S11, calculate the scale starting value.

[0044] This step is used to calculate the starting value of the scale. During the calculation process, it is necessary to ensure that the starting value is an integer multiple of the scale interval. The method is to use the minimum value of the coordinate data divided by the ideal scale interval, and the quotient obtained needs to be rounded down, and finally multiplied back to the ideal scale interval to get the starting value of the scale. The calculation formula is as follows: Scale starting value = floor (data minimum value / ideal scale interval) * ideal scale interval (floor: round down.) S12. Generate a scale list.

[0045] This step is used to calculate all the scale values ​​on a coordinate axis and store them in a scale list. In step S11, the starting value of the scale has been calculated. This step will calculate the subsequent scale values ​​​​accumulatively based on the ideal scale number. The specific formula is as follows: The i-th scale value = scale start value + (i-1) * ideal scale interval (Cycle i=1~ideal number of scales.) In this way, the value of each scale on the scale axis in a single direction can be obtained, and the graphic coordinate system is reasonable and beautiful. At this time, the scale axes in other dimensional directions can be further calculated as needed.

[0046] The above description is the application of the technical principle method and its core idea of ​​the present invention. It should be pointed out that ordinary technicians in this technical field should understand that without departing from the technical principle of the present invention, other improved and modified technical solutions of any combination of the above technical features or similar features also fall within the protection scope of the claims of the present invention.

[0047] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for adaptively calculating linear scales of two- and three-dimensional coordinate axes in the engineering field, characterized in that: include: S1. Input the data file for drawing coordinate axes; S2, determine the data range of a single direction of the coordinate file; S3, data range preprocessing; S4. Set the expected number of scales; S5. Calculate the order of magnitude of the scale interval; S6, calculating the normalized scale interval coefficient; S7, set the scale interval coefficient list and calculate the ideal scale interval coefficient; S8, calculating the ideal scale interval; S9, calculating the ideal number of scales; S10, optimize scale interval coefficient; S11, calculating the scale starting value; S12. Generate a scale list.

2. The method for adaptively calculating linear scales of two- and three-dimensional coordinate axes applicable to engineering fields according to claim 1, characterized in that: Step S1 includes: Obtain the data file of the initial drawing coordinate axis, including plane coordinate data and space coordinate data; The plane graphics drawn in engineering geology include curve graphs, cross-section graphs and plan views. Such graphics require the drawing of plane coordinate axes. When three-dimensional visualization modeling is performed, the model body requires the use of spatial coordinate axes.

3. The method for adaptively calculating linear scales of two- and three-dimensional coordinate axes applicable to engineering fields according to claim 1, characterized in that: Step S2 includes: reading the coordinate data of the file. In the reference system, the spatial coordinates have three vector direction data of x, y and z, and the coordinates need to be calculated in sequence.

4. The method for adaptively calculating linear scales of two- and three-dimensional coordinate axes applicable to engineering fields according to claim 1, characterized in that: Step S3 includes: Preliminary judgment on the data range and preprocessing; Under normal circumstances, the axis scale of each data file will have a scale range greater than zero. At this time, go directly to the next step. Special cases require special processing. When all data in a single direction are equal: If the data range is 0, it means that all data points in this direction are the same. At this time, there are two cases: Case 1: If the coordinate data are all 0, then directly output the scale list [0-, 0, 0+]; Case 2: If the coordinate data are not 0, then directly output the data list [0, x, 2x], where x is the coordinate data value.

5. The method for adaptively calculating linear scales of two- and three-dimensional coordinate axes applicable to engineering fields according to claim 1, characterized in that: Step S5 includes: a rough scale interval needs to be calculated, and the calculation formula is to use the difference obtained by subtracting 1 from the expected number of scales, and then divide the data range by the difference to obtain the rough scale interval. The specific formula is as follows: Rough tick interval = data range / (expected number of ticks - 1).

6. The method for adaptively calculating linear scales of two- and three-dimensional coordinate axes applicable to engineering fields according to claim 1, characterized in that: Step S6 includes: calculating a normalized scale interval coefficient, which is used to calculate the normalized scale interval in a manner of using the roughly calculated scale interval divided by the order of magnitude to obtain the normalized scale interval. The specific formula is as follows: Normalized scale interval coefficient = rough scale interval / order of magnitude.

7. The method for adaptively calculating linear scales of two- and three-dimensional coordinate axes applicable to engineering fields according to claim 1, characterized in that: Step S8 includes: The ideal scale interval is calculated by multiplying the ideal scale interval coefficient by the order of magnitude. The calculation formula is as follows: Ideal scale interval = ideal scale interval coefficient * order of magnitude.

8. The method for adaptively calculating linear scales of two- and three-dimensional coordinate axes applicable to engineering fields according to claim 1, characterized in that: Step S9 includes: dividing the data range by the ideal scale interval, rounding up the quotient, and finally adding 1 to obtain the ideal scale number. The calculation formula is as follows: Ideal scale number = ceil(data range / ideal scale interval) + 1; Among them, ceil: round up.

9. The method for adaptively calculating linear scales of two- and three-dimensional coordinate axes applicable to engineering fields according to claim 1, characterized in that: Step S10 includes: adding two conditional judgments to perform step jump; Condition judgment 1: when the number of ideal scales is greater than 6 and the selected ideal scale interval coefficient is less than 10, jump from step S10 to S7, and then select a larger ideal scale interval coefficient from the scale interval coefficient list, otherwise enter condition judgment 2; Condition judgment 2: When the number of ideal scales is less than 3 and the selected ideal scale interval coefficient is greater than 1, jump back to S7 from step S10, and then select a smaller ideal scale interval coefficient from the scale interval coefficient list, otherwise enter S11.

10. The method for adaptively calculating linear scales of two- and three-dimensional coordinate axes applicable to engineering fields according to claim 1, characterized in that: Step S11 includes: during the calculation process, it is necessary to ensure that the starting value is an integer multiple of the scale interval. The method is to use the minimum value of the coordinate data divided by the ideal scale interval, and the obtained quotient needs to be rounded down, and finally multiplied back by the ideal scale interval to obtain the scale starting value. The calculation formula is as follows: Scale starting value = floor (data minimum value / ideal scale interval) * ideal scale interval; floor: round down; Step S12 includes: calculating all scale values ​​on a scale axis in a coordinate direction, and then storing them in a scale list. The specific formula is as follows: The i-th scale value = scale start value + (i-1) * ideal scale interval; Cycle i = 1 ~ ideal number of ticks.

Citation Information

Cited By

  • Hydrological data process line range calculation method, device and equipment

    CN121388336A