Automatic legend adjustment method based on BIM forward design
Through the automatic adjustment method of legends in BIM forward design, the problem of confusing legends after data interaction is solved. Through classification and positioning point adjustment, the legend layout is ensured to be clear, the user experience and chart readability are improved, and manual adjustment is reduced. and improve the adaptability of the chart.
Patent Information
- Application Number
- CN202411268760.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2024-12-27
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
During the data interaction between the user and the chart, the layout of the legend is prone to disorder, causing the legend to be placed beyond the container range, which in turn causes overlap and layout errors.
The legend automatic adjustment method based on BIM forward design is adopted. By obtaining legend data, classification, calculating interval values and positioning points, moving the legend and performing adaptability detection, ensuring that the legend remains clearly laid out after data interaction.
Improves the readability and user experience of the chart, reduces the workload of manual adjustments, improves the adaptability of the chart, and ensures that the legend remains clear and orderly layout after data interaction.
Smart Images

Figure CN119203923A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image processing, and in particular to a method for automatically adjusting a legend based on BIM forward design. Background Art
[0002] In the data report display of large-scale commercial systems, various charts are often needed to show the development trend of various data indicators over a period of time.
[0003] Currently, after the legend container is generated, the legend height is usually fixed. However, as the user interacts with the data in the chart, the number of legends changes dynamically. Sometimes the placement of the legend exceeds the range of the legend container, resulting in a disordered layout of the legend, and then causing the legends to overlap. Summary of the invention
[0004] The purpose of the present invention is to provide a method for automatically adjusting a legend based on BIM forward design, aiming to solve the problem that the layout of the legend may be disordered when data interaction between users and diagrams occurs.
[0005] To achieve the above object, the present invention provides a method for automatically adjusting a legend based on BIM forward design, comprising the following steps:
[0006] Get the legend data of all legends in the legend container;
[0007] Classify the legend data based on each legend to obtain classified data;
[0008] Calculating interval values based on the classification data, and obtaining interval means based on the interval data;
[0009] Establishing a positioning point based on the interval mean;
[0010] Each legend is moved and adjusted based on the positioning points, and a degree of adaptation is detected.
[0011] Among them, in “obtaining legend data of all legends in a legend container”, the legend data includes shape, size and perimeter.
[0012] Among them, in "Getting legend data of all legends in the legend container", the following steps are included:
[0013] Using the BIM model to go through all the legends in the legend;
[0014] The shape data, size data and perimeter data in all said legends are extracted.
[0015] Among them, in “classifying the legend data based on each legend to obtain classified data”, the following steps are included:
[0016] Set classification standards according to design requirements;
[0017] Select a corresponding algorithm based on the classification standard to classify all the illustrations to obtain a classification result;
[0018] The classification results are stored and each classification and its corresponding legend list are marked.
[0019] Among them, in “selecting a corresponding algorithm based on the classification standard to classify all the legends and obtain classification results”, the corresponding algorithms include K-means clustering algorithm and decision tree classification algorithm.
[0020] The step of “calculating the interval value based on the classified data, and obtaining the interval mean based on the interval data” includes the following steps:
[0021] Calculate the interval values between adjacent legends in the classification result;
[0022] For each set of interval values of each category, calculate its average value to obtain the interval mean of each category.
[0023] Among them, in “moving and adjusting each legend based on the positioning point and performing adaptation detection”, it includes:
[0024] updating the current coordinates of each legend based on the positioning point while ensuring that the original attributes of the legend remain unchanged;
[0025] Check whether the moved legend conflicts with other elements. If so, make fine adjustments as needed.
[0026] The invention discloses a method for automatically adjusting legends based on BIM forward design, comprising the following steps: obtaining legend data of all legends in a legend container; classifying the legend data of each legend to obtain classified data; calculating interval values based on the classified data, and obtaining interval mean values based on the interval data; setting up positioning points based on the interval mean values; moving and adjusting each legend based on the positioning points, and performing fitness detection. The method automatically adjusts the layout of the legend to ensure that the legend can still maintain a clear and orderly layout after the user interacts with the chart, thereby improving the user experience and the readability of the chart, reducing the workload of manual adjustment, improving the adaptive ability of the chart, and promoting the in-depth data interaction, thereby solving the problem that the layout of the legend may be disordered when the user interacts with the chart. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The present invention is further illustrated by means of the non-limiting examples given in the accompanying drawings.
[0028] Figure 1 The present invention is a flow chart of a method for automatically adjusting a legend based on BIM forward design.
[0029] Figure 2 It is a flowchart for obtaining legend data of all legends in the legend container.
[0030] Figure 3 The flowchart is a flowchart for obtaining classified data by classifying the legend data of each legend.
[0031] Figure 4 The present invention is a flow chart for calculating interval values based on the classification data and obtaining interval mean values based on the interval data.
[0032] Figure 5 It is a flow chart for moving and adjusting each legend based on the positioning point and performing adaptation detection. DETAILED DESCRIPTION
[0033] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0034] See also Figures 1 to 5 The present invention provides a method for automatically adjusting a legend based on BIM forward design, comprising the following steps:
[0035] S1 obtains the legend data of all legends in the legend container;
[0036] The legend data includes shape, size and perimeter.
[0037] S11 uses the BIM model to traverse all the legends in the legend;
[0038] Specifically, the BIM model containing the legend is accessed through the API or SDK of the BIM software. In the BIM model, the legend is usually organized in a specific view or layer. By traversing the element tree or layer list of the BIM model, the container or view containing the legend is located, and the legend container is found. The traversal mechanism provided by the BIM model is used to traverse all the legend elements therein. During the traversal process, the reference of each legend element is collected so that the detailed data of these legends can be accessed in subsequent steps.
[0039] S12 extracts the shape data, size data and perimeter data in all the legends.
[0040] Specifically, using the legend references collected in step S11, access each legend element one by one, and for each legend element, query its shape attributes. This usually involves reading the geometric representation of the legend, obtaining parameters describing the shape (vertex coordinates, radius, width, height, etc.), and extracting size data: for rectangular legends, directly read its width and height as size data; for circular legends, read its radius and calculate the diameter or circumference based on the shape data. The extracted shape data, size data, and circumference data are stored in a data structure for subsequent processing or display.
[0041] S2 classifies the legend data of each legend to obtain classified data;
[0042] S21 sets classification standards based on design requirements;
[0043] Specifically, based on the demand analysis, define the dimensions or features used for classification. You can classify based on the data type, color, shape, size, position or function in the chart, etc., and formulate specific classification standards based on the classification dimensions.
[0044] S22 selects a corresponding algorithm based on the classification standard to classify all the illustrations to obtain a classification result;
[0045] The corresponding algorithms include K-means clustering algorithm and decision tree classification algorithm.
[0046] Specifically, a suitable classification algorithm is selected according to the classification criteria set in S21. If the classification rule is based on numerical features, the K-means clustering algorithm is used; if the classification criteria contain complex decision logic or hierarchical structure, the decision tree classification algorithm is used. The relevant data of the legend (shape data, size data, etc. obtained in step S12) are extracted from the BIM model, and preprocessed (normalized, encoded, etc.) according to the classification criteria, and the preprocessed data is input into the selected classification algorithm for classification to obtain the classification result.
[0047] S23 stores the classification results and marks each classification and its corresponding legend list.
[0048] Specifically, the classification results obtained in step S22 are sorted, including the identifier, description information and legend columns contained in each category; an appropriate data storage method is selected to store the classification results and related information; a tag or index is created for each category and its corresponding legend list, so that the legend under a specific category can be quickly located later; a document is written to record the classification criteria, algorithm selection, data processing process and storage method of the classification results for later maintenance and expansion.
[0049] S3 calculates the interval value based on the classification data, and obtains the interval mean based on the interval data;
[0050] S31 calculates the interval values between adjacent legends in the classification result;
[0051] Specifically, the specific position information of each legend in the chart is obtained from the BIM model (the position information includes the coordinates of the legend). For each legend, the adjacent legends are identified according to their positions in the chart. For each pair of adjacent legends, the interval value between them is calculated, and the calculated interval value between each adjacent legend is recorded. It can usually be stored in a list, in which each element corresponds to the interval between a pair of adjacent legends.
[0052] S32 calculates the average value of the interval value set of each category to obtain the interval mean of each category.
[0053] Specifically, according to the result of step S31, the interval values between adjacent legends are grouped according to the categories to which they belong to form multiple interval value sets, each set corresponding to a category, and for each category's interval value set, the mean value of the interval of the category is calculated using the average value calculation method, and the calculated mean value of the interval of each category is recorded.
[0054] S4 establishes a positioning point based on the interval mean;
[0055] Specifically, the mean intervals of each classification legend calculated in step S32 are analyzed, and the initial positioning point coordinates of each classification legend are calculated according to the positioning point strategy and the mean intervals selected according to the mean intervals and layout requirements. These coordinates should be able to reflect the mean intervals between categories and ensure that the distribution of the legends in the chart is neither crowded nor scattered. After the initial positioning points are calculated, optimization adjustments are performed.
[0056] S5: moving and adjusting each legend based on the positioning point, and performing a degree of adaptation detection.
[0057] S51 updates the current coordinates of each legend based on the positioning point, while ensuring that the original attributes of the legend remain unchanged;
[0058] Specifically, one or more positioning points are assigned to each legend. Based on the assigned positioning points, the new coordinates of each legend are calculated. During the calculation process, it is ensured that the boundaries of the legend do not exceed the boundaries of the chart. While updating the legend coordinates, the original attributes of the legend (such as shape, size, color, label, etc.) are ensured to remain unchanged. The calculated new coordinates are applied to the BIM model to update the location information of each legend. This usually involves modifying the relevant element attributes or data structures in the BIM model.
[0059] S52 checks whether the moved legend conflicts with other elements. If so, fine-tuning is performed as needed.
[0060] Specifically, check whether there are position conflicts between legends; for each position conflict detected, evaluate its severity and scope of impact. Determine whether fine-tuning is needed and the priority and order of fine-tuning; based on the evaluation results, fine-tune the legends with conflicts; after fine-tuning, re-check conflicts to ensure that all conflicts have been resolved. If conflicts still exist, continue fine-tuning until all legends meet layout requirements; record changes and decisions made during the fine-tuning process for later review and backtracking. At the same time, provide feedback to the administrator to inform them of updates to the legend positions and any changes that may affect the interpretation of the chart.
[0061] The method for automatically adjusting a legend based on BIM forward design provided by the present invention has the following beneficial effects:
[0062] 1. The method for automatically adjusting the legend based on BIM forward design provided by the present invention enhances the user experience: by automatically adjusting the layout of the legend, it is ensured that after the user interacts with the chart (such as filtering, sorting, updating data, etc.), the legend can still maintain a clear and orderly layout. This avoids the confusion and inconvenience caused by the disordered layout of the legend, and improves the fluency and satisfaction of the user's interaction with the chart.
[0063] 2. The present invention provides a method for automatically adjusting legends based on BIM forward design to improve the readability of charts: Legends are an important part of explaining the meaning of data series in charts. When the legends are neatly laid out and logically clear, users can understand the information conveyed by the charts more quickly. The automatic adjustment mechanism in this method ensures the readability of the legends after data interaction, allowing users to more accurately grasp the changes and trends of the data.
[0064] 3. The automatic legend adjustment method based on BIM forward design provided by the present invention reduces the workload of manual adjustment: In the absence of an automatic adjustment mechanism, whenever the user interacts with the chart data and causes the legend layout to be disordered, the designer or user needs to manually adjust the position and layout of the legend. This is not only time-consuming and labor-intensive, but also prone to errors. The automatic adjustment process in this method greatly reduces the workload of such manual adjustment and improves work efficiency.
[0065] 4. The method for automatically adjusting legends based on BIM forward design provided by the present invention improves the adaptive ability of charts: With the change of data and the adjustment of user needs, charts may need to be updated and modified frequently. The automatic legend adjustment mechanism in this method enables charts to better adapt to these changes, keeping the layout of the legend reasonable and beautiful in the updated chart. This adaptive ability is of great significance for improving the flexibility and usability of charts.
[0066] What is disclosed above is only one or more preferred embodiments of the present application, and cannot be used to limit the scope of rights of the present application. Ordinary technicians in this field can understand that all or part of the processes of implementing the above embodiments and equivalent changes made according to the claims of the present application are still within the scope covered by the present application.
Claims
1. A method for automatically adjusting legends based on BIM forward design, characterized in that: The following steps are involved: Get the legend data of all legends in the legend container; Classify the legend data based on each legend to obtain classified data; Calculating interval values based on the classification data, and obtaining interval means based on the interval data; Establishing a positioning point based on the interval mean; Each legend is moved and adjusted based on the positioning points, and a degree of adaptation is detected.
2. The method for automatically adjusting legends based on BIM forward design according to claim 1, characterized in that: In "Getting legend data of all legends in a legend container", the legend data includes shape, size and perimeter.
3. The method for automatically adjusting legends based on BIM forward design according to claim 2, characterized in that: In "Get legend data for all legends in a legend container", include the following steps: Using the BIM model to go through all the legends in the legend; The shape data, size data and perimeter data in all said legends are extracted.
4. The method for automatically adjusting legends based on BIM forward design according to claim 3, characterized in that: In "classifying the legend data based on each legend to obtain classified data", the following steps are included: Set classification standards according to design requirements; Select a corresponding algorithm based on the classification standard to classify all the illustrations to obtain a classification result; The classification results are stored and each classification and its corresponding legend list are marked.
5. The method for automatically adjusting legends based on BIM forward design according to claim 4, characterized in that: In “selecting a corresponding algorithm based on the classification standard to classify all illustrations to obtain classification results”, the corresponding algorithms include a K-means clustering algorithm and a decision tree classification algorithm.
6. The method for automatically adjusting legends based on BIM forward design according to claim 5, characterized in that: In "calculating the interval value based on the classification data, and obtaining the interval mean based on the interval data", the following steps are included: Calculate the interval values between adjacent legends in the classification result; For each set of interval values of each category, calculate its average value to obtain the interval mean of each category.
7. The method for automatically adjusting legends based on BIM forward design according to claim 6, characterized in that: In "moving and adjusting each legend based on the positioning point and performing fitness detection", it includes: updating the current coordinates of each legend based on the positioning point while ensuring that the original attributes of the legend remain unchanged; Check whether the moved legend conflicts with other elements. If so, make fine adjustments as needed.
Citation Information
Patent Citations
Heat map data extraction method and system based on pixel scanning
CN116308981A
Automatic legend adjustment method based on BIM forward design
CN116843797A
Method and system for automatically generating legend for visual chart
CN117788632A
Cited By
Method, device and equipment for generating legend table of drawing based on airport engineering BIM forward design
CN120995571A