Lead mark arrangement method and device, electronic equipment and storage medium
By automating the determination of leader points and text positions, a leader line annotation layout method has been developed, which solves the problems of unclear views and low efficiency caused by dense leader line annotations in construction drawings, and achieves efficient and aesthetically pleasing annotation layout results.
Patent Information
- Application Number
- CN202511537058.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-24
- Publication Date
- 2026-01-23
AI Technical Summary
In existing technologies, the number of leader lines in construction drawings is large and densely distributed, resulting in poor view display and difficulty in clearly expressing the relationship between the leader lines and their corresponding objects. Furthermore, traditional manual adjustment is inefficient and prone to errors.
This paper provides a method for arranging leader lines and text. By automatically determining the leader point and text position, and combining the user-selected arrangement method, it generates a variety of arrangement effects, including outer arrangement and nearest arrangement, and optimizes the arrangement results of leader lines and text.
It significantly improves the production efficiency of construction drawings, reduces errors and labor costs, ensures the clarity and aesthetics of annotations, and enhances user operation efficiency.
Smart Images

Figure CN121389217A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computers, in particular to the fields of engineering drawing, computer-aided design, etc., and can be applied to application scenarios such as lead note arrangement of drawings, and specifically relates to a lead note arrangement method and device, an electronic device, and a storage medium. BACKGROUND
[0002] In common construction drawings, the number of lead notes is large and the distribution is dense, the view display effect is poor, and it is difficult to clearly express the relationship between the lead and its corresponding object. In the traditional computer-aided design (CAD) software, the user generally needs to complete the arrangement by manually selecting the lead text and dragging to adjust the position. This way is low in efficiency and difficult to meet the needs of complex drawings. SUMMARY
[0003] The present disclosure provides a lead note arrangement method, device, electronic device, and storage medium.
[0004] According to a first aspect of the present disclosure, a lead note arrangement method is provided, including: obtaining a plurality of to-be-arranged lead notes and a plurality of note objects; the to-be-arranged lead notes and the note objects are one-to-one corresponding; the lead note includes a lead and a text; for each to-be-arranged lead note, determining a lead-out point coordinate of the lead based on the corresponding note object; in response to a user-selected text arrangement mode, determining a text coordinate according to the lead-out point coordinate; the text arrangement mode at least includes an outside arrangement and a nearby arrangement; and generating a lead note arrangement result according to the lead-out point coordinate and the text coordinate corresponding to each to-be-arranged lead note.
[0005] According to a second aspect of the present disclosure, a lead note arrangement device is provided, including: a target determination module configured to obtain a plurality of to-be-arranged lead notes and a plurality of note objects; the to-be-arranged lead notes and the note objects are one-to-one corresponding; the lead note includes a lead and a text; a lead-out positioning module configured to determine a lead-out point coordinate of the lead for each to-be-arranged lead note based on the corresponding note object; a text positioning module configured to determine a text coordinate according to the lead-out point coordinate in response to a user-selected text arrangement mode; the text arrangement mode at least includes an outside arrangement and a nearby arrangement; and a result generation module configured to generate a lead note arrangement result according to the lead-out point coordinate and the text coordinate corresponding to each to-be-arranged lead note.
[0006] According to a third aspect of the present disclosure, an electronic device is provided, including: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method of any of the embodiments of the present disclosure.
[0007] According to a fourth aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method according to any of the embodiments of the present disclosure.
[0008] By using the scheme of the present disclosure, the lead text labeling arrangement can be quickly performed, and various arrangement effects can be obtained by simple setting of the arrangement mode, thereby greatly improving the operation efficiency of the user in arranging and labeling when drawing.
[0009] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present disclosure, nor to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0010] The accompanying drawings are used to better understand the present scheme and do not constitute a limitation on the present disclosure. Among them: Figure 1 is a flowchart of a lead labeling arrangement method according to an embodiment of the present disclosure; Figure 2 is a structural schematic diagram of lead labeling according to an embodiment of the present disclosure; Figure 3 is a structural schematic diagram of a lead according to an embodiment of the present disclosure; Figure 4 is another flowchart of a lead labeling arrangement method according to an embodiment of the present disclosure; Figure 5 is a structural schematic diagram of a lead labeling arrangement device according to an embodiment of the present disclosure; Figure 6 is a scene schematic diagram of a lead labeling arrangement method according to an embodiment of the present disclosure; Figure 7 is a structural diagram of an electronic device for implementing a lead labeling arrangement method according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0011] Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, which include various details of the embodiments of the present disclosure to help understanding, and should be considered as merely exemplary. Therefore, those of ordinary skill in the art should recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of the present disclosure. Also, in order to be clear and concise, the description below omits the description of well-known functions and structures.
[0012] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. Those skilled in the art should understand that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, elements and circuits that are well known to those skilled in the art are not described in detail in order to highlight the main ideas of the present disclosure.
[0013] Before introducing the technical solutions of the embodiments of the present disclosure, the technical terms that can be used in the present disclosure are further explained: Lead annotation refers to a form of annotation in which a specific object in a drawing is annotated by drawing an annotation line and adding a textual explanation.
[0014] In the related art, the drawing is edited only by manually adjusting the lead text, which is low in efficiency and high in operation cost, especially when the drawing contains a large number of lead texts. In addition, the types of graphic elements in the construction drawing are various, which can include lead texts, dimension annotations and model legends, etc. During the manual selection and editing process, misoperation is easy to occur, which leads to failure of arrangement or reduction of accuracy. Therefore, a more convenient and efficient way is needed to quickly arrange the lead annotation, so as to improve the work efficiency and reduce the risk of errors.
[0015] The present disclosure proposes a lead annotation arrangement method to at least partially solve one or more of the above problems and other potential problems. The lead annotation arrangement method can quickly arrange lead text annotations, and various arrangement effects can be obtained by simply setting the arrangement method, which greatly improves the operation efficiency of the user when arranging annotations.
[0016] The embodiment of the present disclosure provides a lead annotation arrangement method, Figure 1 is a flowchart of the lead annotation arrangement method according to the embodiment of the present disclosure. The lead annotation arrangement method can be applied to a lead annotation arrangement device. The lead annotation arrangement device is located in an electronic device. The electronic device includes but is not limited to a fixed device and / or a mobile device. For example, the fixed device includes but is not limited to a server, which can be a cloud server or a general server. For example, the mobile device includes but is not limited to a drawing lead annotation arrangement device, which can be a mobile phone, a tablet computer, a vehicle-mounted terminal, etc. In some possible implementation manners, the lead annotation arrangement method can also be realized by calling the computer readable instructions stored in the memory by the processor. As shown in the figure, the lead annotation arrangement method includes: Figure 1 S101, obtaining a plurality of to-be-arranged lead annotations and a plurality of annotation objects.
[0017] S102, for each to-be-arranged lead annotation, determining the lead-out point coordinates of the lead based on the corresponding annotation object.
[0018] S103, in response to the text arrangement mode selected by the user, determining text coordinates according to the lead-out point coordinates.
[0019] S104, generating a lead line label arrangement result according to the corresponding lead-out point coordinates and text coordinates of each to-be-arranged lead line label.
[0020] Here, the to-be-arranged lead line label refers to a lead line label that needs to be arranged in a construction drawing or other engineering drawing, such as Figure 2 As shown, the lead line label includes a lead line 201 and a text 202. The lead line 201 is used to connect the labeled object and the corresponding text, and serves as a guide and explanation. The text 202 is attached to the lead line, and is used to describe or explain the labeled object or area. Here, the labeled object refers to a specific element that needs to be labeled in the drawing, which can be a certain part, a structural part, a size position, or other graphical content. The labeled object corresponds to the to-be-arranged lead line label. As shown, Figure 3 As shown, the lead-out point 301 is the starting point of the lead line label for connecting the labeled object and the text. The desired lead-out point 301 is expected to be drawn from the center of the labeled object as much as possible without affecting the aesthetics, so as to ensure that the lead line can clearly and accurately point to the target area. The lead-out point coordinates refer to the two-dimensional or three-dimensional position information of the lead-out point, which can be represented in the form of (x, y) or (x, y, z), and can be selected according to the dimension of the drawing. Here, the text arrangement mode refers to the text layout strategy selected by the user or defined by the template, which at least includes outside arrangement and nearby arrangement. The outside arrangement refers to an arrangement mode in which the lead line is pulled outside the view from the lead-out point coordinates, and the text is placed outside the view. The nearby arrangement refers to an arrangement mode in which the text is placed near the labeled object from the lead-out point coordinates. Here, the text coordinates refer to the anchor point coordinates of the text, that is, the coordinates of the text box reference point and the necessary rotation angle and offset information. Here, the lead line label arrangement result refers to the final determined geometric and attribute set for each label, including the lead-out point, the lead line path, the text position and style, and ensures that the overall layout is not conflicting, readable, and aesthetic.
[0021] In the embodiments of the present disclosure, all to-be-arranged lead line label information and corresponding labeled objects can be first obtained from the input drawing data or external files. For example, in the drawing, all lead line labels and their related labeled objects (such as straight lines, circles, polygons, etc.) can be read. In particular, the lead line label and its related labeled object can be stored in the form of coordinates and carry text content, object association information and other related information. By analyzing and processing these information, the lead line label and the corresponding labeled object can be identified.
[0022] In the embodiments of the present disclosure, the coordinates of the lead-out points of each lead label to be arranged can be determined based on the geometric characteristics of the labeled object. Specifically, the optimal coordinates of the lead-out points can be calculated using a geometric algorithm according to predefined rules and input parameters of the user, and stored as the basis data for subsequent arrangement. For example, if the labeled object is a rectangle, the center point, the midpoint of the top edge or the midpoint of the bottom edge can be calculated as the lead-out point; if it is a circle, the center position or a certain point on the circumference can be selected as the lead-out point, and then the coordinates of the lead-out point can be determined according to the position of the lead-out point.
[0023] In the embodiments of the present disclosure, the positions of the text of each lead label can be calculated and determined according to the user-preselected text arrangement mode in combination with the determined coordinates of the lead-out points. For example, for outside arrangement, a candidate ring can be first formed by outward expansion of the object's bounding box or convex hull, or a set of sector search directions can be constructed with the lead-out point as the pole point, and then an arrangeable outside region can be constructed; subsequently, the text can be placed radially from the lead-out point along each direction while performing collision detection; finally, the position and orientation of the text with the minimum cost can be selected as the text coordinates by comprehensively considering the minimum lead length, angle preference, and distance to other texts. For example, for nearby arrangement, a concentric ring or grid can be first constructed around the lead-out point to determine the available local neighborhood; subsequently, the text can be placed in the default manner to determine the feasibility, and if the text collides, the available local neighborhood can be iteratively expanded by rotating and trying; finally, the position and orientation of the text with the minimum cost can be selected as the text coordinates by minimizing the cost function mainly based on the total length of the lead and the minimum distance to other texts.
[0024] In the embodiments of the present disclosure, the complete lead label arrangement result can be generated according to the coordinates of the lead-out points and the text coordinates of each lead label in combination with predefined rules such as avoiding intersection and keeping simplicity. Specifically, a line can be drawn from the lead-out point to the text position for each lead, and it can be ensured that all leads and texts are uniformly distributed in the drawing without interfering with each other. In particular, the lead label arrangement result can be an optimized data set including all arranged lead labels, or an optimized construction drawing or engineering drawing.
[0025] The technical solutions of the embodiments of the present disclosure can automatically determine the lead-out points and the text positions, and quickly generate an arrangement scheme according to the user's needs, which can significantly improve the production efficiency of the construction drawing or engineering drawing. Compared with the traditional manual adjustment method, the operation cost of the user is reduced, the errors caused by misoperation are avoided, and complex arrangement tasks can be completed in a short time. In addition, by sequentially determining the coordinates of the lead-out points and the text coordinates, the clarity and aesthetics of the labels can be ensured, thereby improving the professionalism and readability of the drawing.
[0026] In some embodiments, the plurality of lead marks to be arranged and the plurality of mark objects are acquired by: in response to a function activation instruction triggered by the user, taking all the lead marks as a selected lead mark set; in response to a filtering instruction triggered by the user, removing the lead marks that do not meet the filtering requirements from the selected lead mark set; in response to a cancel selection instruction triggered by the user, removing the lead marks selected by the user from the selected lead mark set; and in response to a confirmation instruction triggered by the user, taking each lead mark in the selected lead mark set as a lead mark to be arranged, and taking the object corresponding to the lead mark to be arranged as a mark object.
[0027] Here, the function activation instruction refers to the user starting or activating a function module related to the lead mark to be arranged by clicking a button, executing a shortcut key or other specific interaction mode. The function activation instruction can be the user clicking an "automatic lead arrangement" button. Here, the selected lead mark set refers to a group of lead mark data that needs to be arranged, which is initialized as all possible lead marks after the function is activated. Here, the filtering instruction refers to the user further filtering or screening the currently selected lead marks according to the requirements, and only retaining the lead marks that meet the specific conditions. The filtering instruction can include the lead mark label that needs to be removed. Here, the cancel selection instruction refers to the user manually removing the mark that does not need to be arranged from the selected lead mark set. The cancel selection instruction can be an instruction manually removed by the user in the case of misselection or special requirements. Here, the confirmation instruction refers to an operation performed by the user after completing the selection and adjustment of the lead marks. The confirmation instruction can be the user clicking a "confirm" button, and then taking the finally filtered lead marks as the lead marks to be arranged.
[0028] In the embodiments of the present disclosure, when the function activation instruction triggered by the user is received, the related function module can be started first. Subsequently, all the lead marks existing in the current drawing or database can be automatically read and stored in the selected lead mark set.
[0029] In the embodiments of the present disclosure, when the filtering instruction triggered by the user is received, the lead mark label included in the filtering instruction can be parsed first, and then the filtering condition is generated. Subsequently, each lead mark can be checked one by one according to the filtering condition, and the mark that does not meet the requirement is removed from the set.
[0030] In the embodiments of the present disclosure, when the cancel selection instruction triggered by the user is received, the specific lead mark can be removed from the set according to the cancel selection instruction. In particular, the user finds that some lead marks that have been added to the selected lead mark set do not need to be arranged, and can execute the cancel selection instruction by manual operation.
[0031] In the embodiments of the present disclosure, when the user triggers the confirmation instruction, all the lead marks in the current selected lead mark set can be determined as the final lead marks to be arranged. In particular, the user can issue the confirmation instruction by clicking the confirmation button after completing all the screening and adjustment.
[0032] In the embodiments of the present disclosure, after determining the final lead marks to be arranged, the mark object corresponding to the lead marks to be arranged can be associated for subsequent arrangement processing.
[0033] In this way, the user can dynamically adjust the range to be arranged according to actual needs, and can automatically filter out the content that does not meet the conditions through the screening instruction, or manually remove the unnecessary part through the unselected instruction. The lead marks to be arranged are determined only when the user initiates the confirmation instruction, which allows the user to make multiple adjustments and corrections before confirmation, thereby reducing the risk of errors caused by misselection or multiple selection. Through automatic data processing and user-friendly interaction design, the time from data acquisition to actual arrangement is shortened, and the user's repetitive labor is reduced, thereby improving the overall task execution efficiency and user experience.
[0034] In some embodiments, for each lead mark to be arranged, the lead-out point coordinates of the lead are determined based on the corresponding mark object, including: rasterizing the markable surface of the mark object to generate a plurality of discretized grids; calculating the score of each discretized grid, and determining the lead-out point coordinates according to the discretized grid with the highest score.
[0035] Here, the markable surface (refFace) refers to the surface or contour surface of the mark object that can be used to attach the lead arrow. The markable surface is generated in advance during the drawing process, and can be the surface of the marked object that is visible in the current view and allows the placement of the mark arrow, including the outer surface of the entity, the visible surface of the plate, the outer contour of the face domain, or the markable contour band of the two-dimensional object in the view. Here, the discretized grid refers to a plurality of regular small areas divided from a continuous space or region, and the continuous refFace is discretized into a limited number of discrete positions.
[0036] In the embodiments of the present disclosure, the markable surface corresponding to each mark object can be determined first. For example, the visible and allowed markable surface can be selected from the topology structure of the object as the refFace. In particular, for a two-dimensional mark object, the contour can be expanded to determine the markable band, and then the markable band is used as the refFace. Subsequently, a regular grid can be laid on the face domain of the refFace to implement the rasterization process, and then a plurality of discretized grids are generated. In particular, each grid can be a square, rectangular or other appropriate shape area.
[0037] In the embodiments of the present disclosure, one grid can be taken as one possible candidate position of the lead-out point, and then the score thereof is calculated according to a preset rule or algorithm. For example, the score calculation process can be based on geometric factors, typesetting requirements, and user preferences, etc. The geometric factors can be the distance from the center of the labeled object, whether it is located in a conspicuous position, etc. The typesetting requirements can be to ensure that the lead line label does not overlap with other elements or is not too crowded. The user preferences can be combined with the user's custom settings, such as preferring horizontal or vertical connection points. Further, the score can be calculated by a weighted formula, or it can be predicted by a machine learning model. Finally, the scores of all grids can be traversed, and the one with the highest score can be selected as the final lead-out point position. In particular, if multiple grids have the same highest score, the rules can be further refined (such as preferentially selecting a position closer to the center) to select the most suitable candidate point.
[0038] In this way, by discretizing the labelable surface of the labeled object into small grids and combining multi-dimensional evaluation indicators, the selection efficiency and accuracy of the lead-out point position are significantly improved. The discretization method divides the originally complex geometric region into a limited number of points, reducing the need for human intervention and improving the speed of algorithm processing. By calculating the score of each grid and selecting the optimal position, it can be ensured that the lead line label does not conflict with other elements, and the overall typesetting consistency and aesthetics are maintained. The discretization method can be flexibly applied to labeled objects of different shapes and complexity, especially to complex geometric bodies such as polygons and curved surfaces.
[0039] In some embodiments, the score of each discretized grid is calculated, and the lead-out point coordinates are determined based on the discretized grid with the highest score, including: determining the overlap score of the discretized grid based on the preset prohibited area and the lead line label of other labeled objects; determining the geometric score based on the distance between the discretized grid and the center point of the labeled object; calculating the score of any discretized grid by weighting the overlap score and the geometric score; and determining the lead-out point coordinates based on the discretized grid with the highest score based on the score of each discretized grid.
[0040] Here, the preset prohibited area refers to a specific area in the design or drawing that is pre-set as an area where the lead line label cannot be placed. The preset prohibited area can be to avoid conflicts with other graphic elements, or to reserve a blank space according to design specifications. Here, the overlap score refers to an indicator for measuring the degree of overlap between a grid and all prohibited areas and other existing lead line labels. The lower the overlap score, the higher the degree of overlap between the grid and other objects. Here, the geometric score refers to an indicator calculated based on the distance between the discretized grid and the center point of the labeled object, which is used to evaluate whether the grid position is appropriate. The higher the geometric score, the closer the distance between the grid and the center point of the labeled object.
[0041] In the embodiments of the present disclosure, the position information of the preset prohibited area and other existing lead annotations can be determined first. Then, the distance between each discretized grid and all prohibited areas and other lead annotations can be checked. Then, scores can be assigned according to the distance or a distance-based function can be used to calculate the overlap score, so that the grids farther away from the preset prohibited area and other lead annotations obtain higher overlap scores.
[0042] In the embodiments of the present disclosure, the distance from each discretized grid to the center point of the annotated object can be calculated first. Then, scores can be assigned according to the distance or a distance-based function can be used to calculate the geometric score, so that the grids closer to the center point of the annotated object obtain higher geometric scores.
[0043] In the embodiments of the present disclosure, the weights of the overlap score and the geometric score can be preset according to historical data, and then the overlap score and the geometric score are weighted and averaged according to the weights to obtain the comprehensive score of each grid.
[0044] In the embodiments of the present disclosure, the final scores of all discretized grids can be traversed, and the grid with the highest score is selected, and then the center point of the grid is taken as the lead-out point coordinate. In particular, if there are multiple grids with the same highest score, further screening can be performed according to other rules. For example, the grid closest to the center point of the annotated object can be selected preferentially, and then the lead-out point coordinate is determined.
[0045] In this way, by comprehensively considering the overlap and geometric factors, it is ensured that the arrangement of the lead annotations meets the requirements and avoids conflicts with other elements. By calculating the overlap score, the overlap or too close of the lead annotations with the prohibited area or other objects can be effectively prevented, and the layout disorder can be avoided. The introduction of the geometric score ensures that the lead-out point is as close as possible to the center area of the annotated object, so that the overall arrangement is more reasonable and aesthetic. When determining the score of the discretized grid, the weight ratio can be adjusted according to actual needs to improve adaptability and flexibility.
[0046] In some embodiments, in response to the user-selected text arrangement manner, the text coordinates are determined according to the lead-out point coordinates, including: when the text arrangement manner is outside arrangement, determining the text arrangement order of all to-be-arranged lead annotations according to the lead-out point coordinates; and based on the text arrangement order, determining the text coordinates corresponding to each to-be-arranged lead annotation in sequence according to the lead-out point coordinates.
[0047] Here, the text arrangement order refers to the order and positional relationship of the explanatory texts of all to-be-arranged lead annotations arranged around the annotated object. Since overlap or coverage may occur when the text is arranged, the text arrangement order determines the layout order of each text on the drawing to ensure that the overall visual effect is not affected.
[0048] In the embodiments of the present disclosure, when the user selects the outside arrangement as the text arrangement manner through a graphical interface or other input manner, all parts in the current drawing that need to be text labeled can be traversed first, and the related information of each to-be-arranged lead line and the corresponding lead-out point coordinates can be recorded. Subsequently, the lead-out points can be sorted according to their positions. For example, the bounding contour and the barycenter of the labeled object can be calculated first, a direction vector pointing to the outside is formed between each lead-out point and the barycenter, and it is determined which side, i.e., the upper, lower, left or right side, or the adjacent sector, the lead-out point is more suitable for being classified into according to the direction vector. Subsequently, the lead-out points in each side can be monotonically sorted according to the projection coordinates of the main shaft of the side, and the labeling priority can be superimposed to maintain a stable order. For example, the lead-out points above or below can be arranged in the order from left to right on the x-axis, and the lead-out points on the left or right can be arranged in the order from bottom to top on the y-axis. In particular, if the capacity of a certain direction is insufficient, the excess items can be transferred to the adjacent side and reordered based on the principle of minimum cost, and finally the local sequences of each side are merged into a global and repeatable text arrangement order according to the side or the total angle.
[0049] In the embodiments of the present disclosure, the texts can be placed one by one according to the arrangement order. Specifically, the arrangement tracks of each side can be first established outside the bounding contour of the object with a certain distance offset, and then the base point of the current text is projected onto the track of the corresponding side and orthogonally aligned with the lead-out point as the initial position. Subsequently, collision detection can be performed, if overlapping with the placed texts or forbidden boundaries, the nearest empty space that satisfies the minimum distance is found along the monotonic direction of the track, and if necessary, the next track is switched to relieve congestion, so as to determine the text coordinates corresponding to each to-be-arranged lead line. In particular, the texts can be automatically wrapped according to the line width and the alignment mode can be adjusted to reduce the backfolding during the placement process; when the cumulative offset of a certain side is too large or the lead line is too long, the inter-side rebalancing is triggered, the end text is transferred to the empty track of the adjacent side and is partially rearranged, while the positions and orders of the placed elements are kept stable as much as possible.
[0050] In this way, by determining the repeatable text arrangement order in advance, and then incrementally placing and locally avoiding obstacles according to the order, the global coupling problem of the outside arrangement is transformed into a controllable linear process, which reduces the lead line intersection and text collision while ensuring the monotonicity of the same side and the balance of the divided sides. The track and rebalancing mechanism make the layout still readable and aesthetically pleasing in dense scenes, and the algorithm mainly relies on sorting and lightweight collision detection, which has low complexity, easy-to-adjust parameters, stable results, and traceability, can effectively reduce the cost of manual fine-tuning and rework, and maintain the consistency and maintainability of the layout when the geometry or lead-out point changes slightly.
[0051] In some embodiments, when the text arrangement manner is the outside arrangement, the text arrangement order of all the to-be-arranged lead mark is determined according to the lead-out point coordinates, including: determining a distance score according to the lead-out distance of the lead-out point coordinates and the view edge; constructing a simulation lead line by using the lead-out point coordinates, and determining a crossing score according to the crossing degree of the simulation lead line relative to the lead mark of other mark objects; and arranging the to-be-arranged lead mark according to the distance score and the crossing score to obtain the text arrangement order.
[0052] Here, the lead-out distance refers to the distance from the lead-out point of each to-be-arranged lead mark to the view edge, and the lead-out distance determines the position of the text in the outside arrangement and is the basis for calculating the distance score. Here, the distance score refers to an index for scoring each to-be-arranged lead mark based on the lead-out distance, and the closer the lead-out distance, the higher the distance score. Here, the simulation lead line refers to a virtual lead line path, which is constructed according to the lead-out point coordinates, and the simulation lead line can be used to test and evaluate whether the actual lead line may cross or overlap with other mark objects. Here, the crossing degree refers to the degree of crossing of the simulation lead line relative to other mark objects or other mark lead lines, and the higher the crossing degree, the more likely the simulation lead line path causes layout confusion or covers key content. Here, the crossing score refers to the influence of the degree of interaction of the simulation lead line of a certain to-be-arranged lead mark with other marks on the arrangement order, and a lower crossing degree will get a higher crossing score.
[0053] In the embodiments of the present disclosure, the vertical or horizontal distance from the lead-out point of each to-be-arranged lead mark to the view edge can be measured first. Then, these distances can be converted into uniform distance scores according to the set standard. For example, the distance score can be calculated by scoring or using a distance-based function according to the distance, so that the closer the lead-out distance, the higher the distance score.
[0054] In the embodiments of the present disclosure, a virtual path can be first extended from the lead-out point of each to-be-arranged lead line to test the route that may be experienced in the actual layout. Then, for each simulation lead line, the crossing between it and other existing mark objects or mark lead lines can be checked. For example, the number of crossings of the simulation lead line with other existing content can be counted. Then, the crossing degree can be quantitatively evaluated according to the number of crossings. For example, the crossing score can be calculated by scoring or using a distance-based function according to the number of crossings, so that the fewer the number of crossings, the higher the crossing score.
[0055] In the embodiments of the present disclosure, the distance score and the crossing score can be first weighted according to a certain weight coefficient to calculate the comprehensive score of each to-be-arranged lead mark. Then, these marks can be sorted in descending order of the comprehensive score to generate the final text arrangement order.
[0056] Thus, by prioritizing the content with smaller crossing degree and larger leading distance, the mutual interference between the annotated texts is effectively reduced, ensuring that the final arrangement is clear and orderly. The automatic calculation of the distance score and the crossing score provides an objective basis for determining the arrangement order, minimizing the tedious work brought by traditional manual adjustment. Through the evaluation and sorting of the simulated leads, the optimal text arrangement scheme can be quickly generated, shortening the design cycle. Regardless of the number and distribution of annotations in the drawing, a reasonable arrangement order can be generated through dynamic evaluation and sorting, with good universality and adaptability.
[0057] In some embodiments, based on the text arrangement order, the text coordinates corresponding to each to-be-arranged lead annotation are determined in sequence according to the leading point coordinates, including: determining the actual distance between the center point position of the annotation object and the edge of the view; in response to the preference weight input by the user, determining the lead pulling direction according to the actual distance; determining the text coordinates according to the leading point coordinates and the lead pulling direction.
[0058] Here, the actual distance refers to the actual measured distance value from the current center point position of the annotation object to the edge of the view, and the actual distance can reflect the positional relationship of the annotation object relative to the view boundary. Here, the preference weight refers to the priority or preference degree of the user for different lead pulling directions, and the preference weight includes the upper weight, the lower weight, the left weight and the right weight. Here, the lead pulling direction refers to the direction formed by the path from the annotation object to the outside arranged text description, and the lead pulling direction can include the upper, the lower, the left and the right, and the lead pulling direction can directly affect the position and layout of each annotation text and the overall coherence of the layout.
[0059] In the embodiments of the present disclosure, the geometric center coordinates of all annotation objects in the current chart can be determined first. Then, based on these center coordinates, the actual distances to the view boundary can be measured, including the upper distance, the lower distance, the left distance and the right distance.
[0060] In the embodiments of the present disclosure, according to the preference weight input by the user, the actual distance data and the user's preference set can be combined to determine the optimal lead pulling direction of each annotation object through weighted calculation.
[0061] In the embodiments of the present disclosure, according to the determined lead pulling direction, a length is extended from the leading point coordinates in the corresponding direction to obtain the final text placement position. In particular, the extension length can be a preset length, or can be dynamically adapted according to the view space.
[0062] In this way, the user can set the preference weight according to the specific needs, so that the arrangement is closer to the personal habits or project requirements. Through actual distance measurement and direction determination, it can effectively avoid text overlap or excessive concentration, and ensure the overall aesthetic and readability. The automatic process significantly reduces the time and effort required to adjust the position of the annotation text in traditional manual layout. Based on comprehensive consideration of user preferences, actual distance and other parameters, it can flexibly cope with different sizes and complexities of chart content, and ensure reasonable layout.
[0063] In some embodiments, in response to the user input preference weight, the lead pull direction is determined according to the actual distance, including: determining a preference distance coefficient according to the preference weight; determining a preference distance according to the actual distance and the preference distance coefficient; and determining the direction with the shortest preference distance as the lead pull direction.
[0064] Here, the preference distance coefficient refers to the adjustment coefficient of the preference degree for different directions obtained by mapping based on the user input preference weight. Here, the preference distance refers to the effective comparison value obtained by adjusting the actual distance by the corresponding preference distance coefficient in a certain candidate direction. The preference distance is not the physical length itself, but a weighted distance used for sorting and selecting directions.
[0065] In the embodiments of the present disclosure, the user input preference weight can be normalized for each direction to ensure that the sum of each direction is 1 or mapped to the [0, 1] interval. Subsequently, the weight can be mapped to the preference distance coefficient. Exemplarily, the weight can be converted to the coefficient by monotonic mapping, so that the larger the weight, the smaller the coefficient; or a softened exponential mapping can be used to enhance the adjustability.
[0066] In the embodiments of the present disclosure, the actual distance can be multiplied by the corresponding preference distance coefficient to obtain the preference distance. In particular, to improve robustness, an upper limit can be cut off for extremely long paths, and a large penalty value can be assigned to infeasible paths.
[0067] In the embodiments of the present disclosure, all possible preference distance values in each direction can be traversed, and the direction with the smallest value is selected as the final lead pull direction.
[0068] In this way, through parameter setting, flexible and diverse typesetting requirements are realized. By considering the actual distance and user preferences, it is ensured that each annotation can be clearly presented in the shortest path, avoiding unnecessary space occupation and visual interference. The text arrangement is automatically calculated and optimized, reducing the time and effort of manual adjustment and trial and error, and improving the typesetting quality and generation efficiency.
[0069] In some embodiments, in response to the text arrangement mode selected by the user, the text coordinates are determined according to the lead-in point coordinates, including: when the text arrangement mode is the nearby arrangement, at least three text arrangement sequences are generated according to a preset rule; the at least three text arrangement sequences are taken as an initial population, and a genetic algorithm is used for iterative calculation to determine the text coordinates.
[0070] Here, the initial population refers to all possible individuals generated initially in the genetic algorithm, and the initial population can represent the possibility of multiple text arrangement sequences. Here, the genetic algorithm refers to an optimization algorithm simulating the biological evolution process, gradually improving the quality of the population individuals, and finally finding the optimal solution. The genetic algorithm can be used to find the best text coordinate arrangement mode.
[0071] In the embodiments of the present disclosure, when the user explicitly selects the nearby arrangement mode, at least three possible text arrangement sequences can be automatically generated according to a predefined rule (such as in a clockwise direction, counterclockwise direction, or other geometric relationship). For example, the predefined rule can be in a clockwise direction, counterclockwise direction, or other geometric relationship, etc.
[0072] In the embodiments of the present disclosure, the at least three generated arrangement schemes can be first taken as the starting point of the genetic algorithm. Then, the genetic algorithm can be applied for iterative calculation. Finally, after several generations of optimization, a comprehensive performance optimal arrangement scheme can be screened out, and the specific coordinate position of each annotation text is calculated according to the scheme to ensure that the optimization target of the overall layout is achieved.
[0073] In this way, the genetic algorithm can jump out of the local optimal trap and explore more possibilities by simulating the biological evolution process, so as to find a better global solution. By generating multiple initial arrangement schemes and combining the genetic variation mechanism, various complex scenarios and user customization requirements can be flexibly handled. The finally determined arrangement scheme has better text spacing, arrangement sequence, etc., greatly improving the aesthetics and information transmission efficiency of professional charts. The automated genetic algorithm replaces the traditional manual adjustment mode, shortens the graphic drawing period, and improves the production efficiency.
[0074] In some embodiments, the text arrangement sequence includes at least a text arrangement sequence based on complexity, a text arrangement sequence based on direction, and a random text arrangement sequence. The at least three text arrangement sequences are generated according to a preset rule, including: determining the complexity of the region where the annotation object is located according to the lead-in point coordinates, and arranging the to-be-arranged lead annotation according to the complexity to obtain the text arrangement sequence based on complexity; arranging the to-be-arranged lead annotation according to a preset direction sequence according to the lead-in point coordinates to obtain the text arrangement sequence based on direction; and arranging each to-be-arranged lead annotation based on random number generation to obtain the random text arrangement sequence.
[0075] Here, the complexity refers to a comprehensive index formed by the number, density or relationship between the labeled objects in a region, and the complexity can be used to evaluate the crowdedness or processing difficulty of the region. Here, the preset direction sequence refers to a predefined arrangement rule, and the preset direction sequence can be a specific geometric path such as a clockwise direction, a counterclockwise direction, or from top to bottom, from left to right. Here, the random number generation refers to generating a set of irregular numbers by using a computer algorithm, and the random number generation can be used to determine the arrangement order between the labeled objects to ensure diversity or avoid layout problems caused by fixed patterns.
[0076] In the embodiments of the present disclosure, all the labeled objects to be arranged in the region can be counted first, and then the number, density and distance between the objects and other parameters are calculated to obtain the complexity index of the region. Subsequently, the complexity can be classified from high to low or from low to high, and the text can be arranged in sequence based on this to obtain the text arrangement order based on complexity. Exemplarily, the labeled objects with higher complexity can be arranged first to avoid subsequent layout difficulties.
[0077] In the embodiments of the present disclosure, all the labeled objects to be arranged can be arranged in order according to the preset direction rule to obtain the text arrangement order based on direction. Exemplarily, the arrangement can be from bottom left to top right.
[0078] In the embodiments of the present disclosure, a random position index can be assigned to each labeled object by using a random number generation algorithm, and the arrangement order can be reorganized according to the indexes to obtain a random text arrangement order.
[0079] In this way, through three different arrangement strategies, various scenarios can be flexibly coped with to meet the needs of different users. Generating multiple initial arrangement orders provides rich possibilities for subsequent optimization, meets the diversified population required by the genetic algorithm, and increases the probability of finding a better solution. The arrangement strategy based on complexity can be targeted to solve dense or complex labeling regions; the direction-ordered arrangement method helps to build a natural information browsing path, improves the professionalism and readability of the chart; and the random arrangement strategy breaks the limitation of fixed patterns and can avoid layout bottlenecks that may occur in some cases, increasing the overall robustness.
[0080] In some embodiments, at least three text arrangement sequences are used as initial population, and a genetic algorithm is used for iterative calculation to determine the text coordinates, including: calculating the fitness of each population based on a preset scoring rule; selecting at least two populations with high fitness from the current population into a mating pool according to the fitness, generating multiple new populations through crossover operation, and eliminating populations with low fitness; the new population includes part of the text coordinates in any population with high fitness and part of the text coordinates in another population with high fitness; the number of new populations is consistent with the number of eliminated populations; introducing the new text arrangement sequence into the current population, repeating the above steps until a preset stopping condition is met, and obtaining the text coordinates.
[0081] Here, the preset scoring rule refers to the standard or algorithm used to evaluate the quality of the population. The scoring rule can be set based on design goals or user requirements, such as text clarity, layout neatness, and avoidance of overlap. In particular, the higher the score, the more likely the population meets the requirements. Here, the new population refers to the new text arrangement sequence generated through crossover operation in the genetic algorithm. The new population includes part of the text coordinates in any population with high fitness and part of the text coordinates in another population with high fitness. Here, the preset stopping condition refers to the triggering condition for terminating the iteration of the genetic algorithm.
[0082] In the embodiments of the present disclosure, each text arrangement sequence can be evaluated using a preset scoring rule and assigned a fitness score. The higher the fitness score, the more likely the population meets the design goals. Illustratively, the preset scoring rule can set an initial score, and then deduct points when the population overlaps, deduct points when the leads cross, and score based on the proximity of the text to the respective labeled objects.
[0083] In the embodiments of the present disclosure, at least two populations with high fitness can be selected from the current population into a mating pool according to the fitness score. Subsequently, the selected two or more high fitness populations can be subjected to crossover operation. Illustratively, part of the text coordinates of one population can be combined with part of the text coordinates of another population to form a new population. Finally, to maintain the stability of the population size, populations with low fitness are eliminated. In particular, the number of low fitness populations eliminated is consistent with the number of new populations.
[0084] In the embodiments of the present disclosure, the new text arrangement sequence is introduced into the current population, and the process of calculating fitness, selecting a mating pool, generating new populations, and eliminating low fitness populations is repeated until the preset stopping condition is met. Illustratively, the preset stopping condition can be reaching a set maximum number of iterations, the optimal fitness no longer significantly improving over several iterations, or other user-defined goals. Finally, when the stopping condition is met, the text arrangement sequence with the highest score in the current population will be selected as the final text arrangement scheme, and its specific text coordinates will be determined.
[0085] In this way, the genetic algorithm continuously improves the overall fitness of the population through iterative optimization, thereby significantly improving the quality of the text layout. The final text coordinates can be displayed more clearly and neatly on the drawing. Using genetic algorithms, new populations can be generated through various crossover combinations, thereby dealing with complex and variable design scenarios and ensuring that reasonable layout solutions can be found under different conditions. The automated optimization process of the genetic algorithm reduces the need for manual adjustment of text layout, saving time and effort and improving work efficiency. By retaining high fitness populations and eliminating low fitness populations, the algorithm can quickly converge to a better solution in fewer iterations, improving overall efficiency.
[0086] In some embodiments, the text layout mode further includes flexible layout; when the text layout mode is flexible layout, in response to the user-selected text layout mode, the text coordinates are determined according to the anchor point coordinates, including: determining a global bounding box according to all objects in the view; the global bounding box includes the bounding box of each object in the view; in response to the user inputted demarcation range, generating a demarcation bounding box according to the global bounding box; when the anchor point coordinates are within the demarcation bounding box, generating the text coordinates using the nearest layout; when the anchor point coordinates are outside the demarcation bounding box, generating the text coordinates using the outside layout.
[0087] Here, the global bounding box refers to the smallest rectangular area containing all objects in the view, and the global bounding box includes the bounding box of each object in the view, which is a virtual boundary box that can cover all drawing elements. Here, the demarcation range refers to the area limit defined by the user, and the demarcation range is a proportion that can be expressed in percentage or decimal. Here, the demarcation bounding box refers to a virtual boundary box generated based on the demarcation range, and the demarcation bounding box is determined based on the user inputted demarcation range and the position of the global bounding box, which can divide the view into two regions, inside and outside.
[0088] In the embodiments of the present disclosure, all objects in the current view can be traversed first, then the minimum bounding rectangle of each object is calculated, and the maximum range of these rectangles is found to form a virtual boundary box containing all objects, which is taken as the global bounding box.
[0089] In the embodiments of the present disclosure, a new virtual boundary box is generated according to the user-given demarcation range and the position of the global bounding box, and the new virtual boundary box is taken as the demarcation bounding box. Exemplarily, the four corner coordinates of the global bounding box can be scaled proportionally based on the demarcation range to obtain the demarcation bounding box.
[0090] In the embodiments of the present disclosure, if the point is within the demarcation bounding box, the nearest layout is used to generate the text coordinates. If the point is outside the demarcation bounding box, the outside layout is used to generate the text coordinates.
[0091] In this way, the arrangement mode is flexibly selected according to the position of the lead-out point, ensuring that the text in the internal and external regions is placed in the most reasonable position. In this way, the text is not stacked to affect the display of the drawing object, nor is the information display too scattered. The user can set the demarcation range according to actual needs, flexibly adjust the layout strategy, and meet different drawing needs.
[0092] In some embodiments, the lead mark arrangement result is generated according to the corresponding lead-out point coordinates and text coordinates of each lead mark to be arranged, including: in response to the user-selected connection mode, determining the connection point coordinates of the lead according to the text coordinates; in response to the user-selected turning mode, determining the turning point coordinates of the lead according to the connection point coordinates; generating the lead according to the lead-out point coordinates, the connection point coordinates and the turning point coordinates; generating the text according to the text arrangement scheme; and generating the lead mark arrangement result according to the lead and the text of each lead mark to be arranged.
[0093] Here, as shown in FIG. 3, the connection point 303 refers to the joint position between the lead and the text, and the connection point 303 refers to the end of the horizontal segment of the lead, i.e., the end close to the text. The connection point coordinates refer to the specific numerical representation of the connection point 303 in the coordinate system, which can be given in the form of (x, y). Here, as shown in FIG. 3, the turning point 302 refers to the corner point where the direction of the lead path changes, and the turning point 302 refers to the intersection of the vertical segment and the horizontal segment of the lead. The turning point coordinates refer to the specific numerical representation of the turning point 302 in the coordinate system, which can be given in the form of (x, y). Figure 3 Figure 3 In the embodiments of the present disclosure, the relative position of the corresponding connection point and the text can be first determined according to the user-selected connection mode. Subsequently, the connection point position can be determined according to the text coordinates and the relative position, and the connection point coordinates can be obtained by mapping.
[0094] In the embodiments of the present disclosure, the relative position of the corresponding turning point and the connection point can be first determined according to the user-selected turning mode. Subsequently, the turning point position can be determined according to the connection point coordinates and the relative position, and the turning point coordinates can be obtained by mapping.
[0095] In the embodiments of the present disclosure, the complete lead can be drawn through the coordinate information of the lead-out point, the connection point and the turning point. Subsequently, the annotation text can be placed in the appropriate position according to the text arrangement scheme, and the font size, color, alignment mode and other attributes can be adjusted to ensure clear readability and consistent with the overall design. Finally, the drawn lead and the corresponding text can be combined to form an attractive and accurate lead mark graphic.
[0096] In the embodiments of the present disclosure, the complete lead can be drawn through the coordinate information of the lead-out point, the connection point and the turning point. Subsequently, the annotation text can be placed in the appropriate position according to the text arrangement scheme, and the font size, color, alignment mode and other attributes can be adjusted to ensure clear readability and consistent with the overall design. Finally, the drawn lead and the corresponding text can be combined to form an attractive and accurate lead mark graphic.
[0097] In this way, the connection point coordinates and the turning point coordinates are accurately calculated according to the input of the user and the preset rules, ensuring that the lead line marking is both beautiful and accurate, meeting the high-precision requirements of engineering drawings, design drawings, and the like. The user can select different connection modes and turning modes according to actual needs, can flexibly cope with complex scenarios, and provides a highly customized solution, adapting to different types of drawing needs. The rationally designed lead line path and turning point position avoid overlapping with other objects or text, making the marking clearer and more intuitive.
[0098] In some embodiments, the connection mode includes center connection and lower connection, and in response to the user-selected connection mode, the connection point coordinates of the lead line are determined according to the text coordinates, including: when the connection mode is center connection, the connection point coordinates are determined by offsetting from the vertical center point on the left side of the text arrangement according to a preset center offset distance; and when the connection mode is lower connection, the connection point coordinates are determined by offsetting from the vertical lowest point on the right side of the text arrangement according to a preset lower offset distance.
[0099] Here, the preset center offset distance refers to a preconfigured spacing parameter for moving the connection point away from the vertical center point on the left vertical edge of the text along the normal direction outside the vertical edge by a distance to avoid overlapping the lead line with the text. The preset center offset distance can be bound with the font height, the drawing scale, or the marking style, or can be set as a fixed value. Here, the preset lower offset distance refers to a preconfigured spacing parameter for moving the connection point away from the lowest point on the right vertical edge of the text in the vertical downward direction by a distance to avoid overlapping the lead line with the text. The preset lower offset distance can be bound with the font height, the drawing scale, or the marking style, or can be set as a fixed value.
[0100] In the embodiments of the present disclosure, when the connection mode is center connection, the left vertical center anchor point coordinates can be first calculated according to the text coordinates. Subsequently, the x-axis coordinate of the left vertical center anchor point coordinates can be offset according to the preset center offset distance, and the connection point coordinates are further determined.
[0101] In the embodiments of the present disclosure, the right vertical lowest anchor point coordinates can be first calculated according to the text coordinates. Subsequently, the x-axis coordinate and the y-axis coordinate of the right vertical lowest anchor point coordinates can be offset according to the preset lower offset distance, and the connection point coordinates are further determined.
[0102] Thus, by setting a parameterizable offset distance for the center connection and the lower connection, the connection point is stably moved outward based on a clear geometric anchor point, avoiding the overlap of the lead line and the text, and ensuring a clear and consistent relationship with the text. By presetting the center offset distance and the lower offset distance, a unified visual spacing can be obtained in different map and density scenarios, and the position of the connection point is easy to batch generate and fine-tune, significantly improving the neatness and readability of the annotation, reducing cross and overlap, and reducing the cost of manual correction.
[0103] In some embodiments, in response to the user-selected turning mode, the turning point coordinates of the lead line are determined according to the connection point coordinates, including: when the turning mode is orthogonal turning, determining a first coordinate based on the connection point coordinates; determining the first coordinate according to the lead-out point coordinates; determining the turning point coordinates according to the horizontal coordinate and the vertical coordinate.
[0104] In the embodiments of the present disclosure, when the turning mode is orthogonal turning, the y-axis coordinate of the connection point can be directly taken as the first coordinate of the turning point, that is, the y-axis coordinate, and then the x-axis coordinate of the lead-out point is taken as the second coordinate of the turning point, that is, the x-axis coordinate, and the turning point coordinates are determined according to the x-axis coordinate and the y-axis coordinate of the turning point. For example, when the lead-out direction is upward or downward, if the connection point coordinates are (x1, y1) and the turning point coordinates are (x2, y2), the turning point coordinates can be (x2, y1).
[0105] Thus, the turning point coordinates are divided into vertical coordinates and horizontal coordinates to generate the turning point with deterministic geometric intersection, which is simple, stable and repeatable, while ensuring that the final path is strictly orthogonal, so that the horizontal section is naturally close to the connection height of the text, and the vertical section is directly led out from the lead-out point, reducing the number of turning angles and visual complexity.
[0106] In some embodiments, in response to the user-selected turning mode, the turning point coordinates of the lead line are determined according to the connection point coordinates, including: when the turning mode is flexible turning, the turning point coordinates are determined according to the connection point coordinates in response to the user-input turning distance.
[0107] Here, the turning distance refers to the straight-line distance between the turning point and the connection point.
[0108] In the embodiments of the present disclosure, when the turning mode is flexible turning, the y-axis coordinate of the connection point can be directly taken as the y-axis coordinate of the turning point, and then the x-axis coordinate of the connection point is calculated with the turning distance, and the calculation result is taken as the x-axis coordinate of the turning point, and the turning point coordinates are determined according to the x-axis coordinate and the y-axis coordinate of the turning point.
[0109] Thus, by parameterizing the turning point position with the turning distance, the user can finely control the spacing and turning position of the lead line and the text to quickly achieve consistent visual effects.
[0110] In some embodiments, the lead annotation arrangement method further comprises: generating a real-time preview according to the lead annotation arrangement result; and determining the lead annotation arrangement result corresponding to the real-time preview as the final lead annotation arrangement result in response to a save instruction of the user.
[0111] Here, the real-time preview refers to a dynamic display function that allows the user to immediately see the immediate effect of the lead annotation arrangement when setting or adjusting parameters. Here, the save instruction refers to an operation instruction of the user for confirming and locking the current real-time preview content as the final design result. The user can issue the save instruction by clicking a button, pressing a shortcut key, or the like.
[0112] In the embodiments of the present disclosure, when the user adjusts any setting related to the lead annotation, the calculation module can be immediately invoked to regenerate the current lead annotation arrangement, and after the calculation is completed, the new result is immediately drawn on the graphical interface, thereby generating a real-time preview, allowing the user to observe the modified effect in real time.
[0113] In the embodiments of the present disclosure, after the user confirms the real-time preview effect, the user can issue a save instruction by clicking a “save” button or performing other specified operations. After receiving the save instruction, the currently displayed lead annotation arrangement result can be stored in a database, a file, or other storage medium as the formal design achievement.
[0114] In this way, through the real-time preview, the user can observe the effect of parameter adjustment in real time, reducing unnecessary repeated modification and verification links. The real-time feedback mechanism allows the user to intuitively see the design achievement, improving the overall use experience. The final result can be confirmed through the real-time preview before saving to see whether it meets the expectations, reducing the probability of errors due to misoperation.
[0115] In some embodiments, the lead annotation arrangement method further comprises: generating a new lead annotation arrangement result in response to a parameter adjustment instruction of the user; and generating a new real-time preview according to the new lead annotation arrangement result.
[0116] Here, the parameter adjustment instruction refers to an operation of adjusting parameters issued by the user through an interface or other means.
[0117] In the embodiments of the present disclosure, after the user inputs an adjustment operation, the parameter change can be captured in real time and processed as a new condition. The lead-out point coordinates and / or text coordinates and / or connection point coordinates and / or turning point coordinates are recalculated according to the latest parameters, and then the lead and / or text direction and layout are adjusted, and the new result is immediately displayed on the interface after the calculation is completed, allowing the user to see the adjusted effect.
[0118] In this way, real-time feedback visualizes each step of adjustment of the user, improving the user's interactive experience. By automatically generating a new real-time preview, there is no need for manual multiple rendering or refreshing, saving time and resources and improving work efficiency.
[0119] Figure 4 Another flowchart of the lead annotation arrangement method of the embodiments of the present disclosure is shown, as shown in the figure, the lead annotation arrangement method comprises: Figure 4 S401, activating the function. That is, the user activates the arrangement function.
[0120] S402, selecting the lead annotation to participate in the arrangement. All lead text annotations in the view can be selected by default, and filtering capability is provided to support filtering by annotation type or custom dimension, including manual annotation and automatic annotation. Automatic annotation can be further subdivided according to paving information, commodity information, custom model information, custom material information, etc., and the user can select only a part of them as needed to participate in the arrangement.
[0121] S403, setting the arrangement rules. Three types of constraints are applied to each annotation participating in the arrangement: lead-out face constraint of lead-out point, lead line path constraint, and text placement position constraint. The typical process is: first, determine the lead-out point position of all annotations; avoid lead line crossing as much as possible under the premise of readability; if necessary, pull the lead line out of the view and determine the text position accordingly.
[0122] Specifically, the confirmation of the lead-out point position depends on the refFace of the annotation object. The feasible domain where the lead-out point can be placed can be calculated based on the refFace first, the feasible domain is rasterized and discretized, each grid is scored and the grid point with the highest score is selected as the candidate lead-out point. The scoring rules take into account aesthetics and reasonableness: on the one hand, the degree of overlap between the grid and the "legal area / illegal area" is investigated, the more legal overlap, the higher the score, the more illegal overlap, the lower the score (whether it is legal is determined by whether there are other object elements in the grid and whether the user has preset position requirements); on the other hand, the distance between the grid and the center of the feasible domain is considered, and under the premise of not affecting the aesthetics, the lead-out point is expected to be as close to the center of the annotation object as possible.
[0123] Further, the user selects the text placement position in three modes: outside placement, nearest placement, and flexible adjustment.
[0124] When the user selects the outside placement, the text can be pulled out of the view, and the goal is to ensure that the lead does not cross while allowing the text to be as close to the lead-out point as possible. The user can specify the preference weight of each direction. In particular, the user can also specify the pulling direction by setting the weight of the three directions to zero. The default pulling direction is determined by the distance from the center of the arrangement node feasible region to each edge of the view. When the preference weight is set, the value of the preference weight can be inverted to obtain a preference distance coefficient. The higher the weight, the smaller the distance coefficient. The actual distance is multiplied by the coefficient to obtain the preferred distance for comparison. The direction and position with the shortest preferred distance are selected for placement. In particular, there is a sequence when placing the text. The sequence is determined by the score of the lead-out point: the closer the lead-out point is to the boundary of the view, the higher the score; at the same time, it is estimated how many placed labels will be crossed when pulling the lead out of the lead-out point. The more the score is lower, so as to reduce the subsequent conflict.
[0125] When the user selects the nearest placement, a heuristic search genetic algorithm can be used to iteratively optimize the text position. First, perform heuristic initialization of the population. Different text generation orders are regarded as different individuals. Several preset orders are provided to accelerate convergence, such as ordering by region complexity (more adjacent arrangement nodes are placed first) and from left to right. The remaining individuals are generated in random order. Then, the fitness of the population is evaluated, taking into account the deduction of text overlap, the deduction of lead crossing, and the score of the distance between the text and the respective label object. Select high fitness individuals to enter the mating pool in the crossover stage. Some text positions are inherited from the parent, and the other part is inherited from different parents to generate offspring. At the same time, individuals with low fitness are eliminated to maintain the population size. In the mutation stage, the individual position is randomly updated with a certain probability, introducing new patterns, encouraging search in unknown areas, and avoiding local optimization. After several iterations, the solution with the highest fitness is selected as the nearest placement scheme.
[0126] When the user selects flexible placement, a global bounding box containing all models can be used as a reference. According to the user input of the demarcation range, the demarcation bounding box is calculated by equal reduction. If the center point of the label object falls in the area outside the demarcation bounding box, the text is generated outside; if the center point is located in the area within the demarcation bounding box, it is generated according to the nearest principle, thereby allowing the user to quickly demarcate different arrangement styles in different regions with geometric boundaries.
[0127] S404, confirm the arrangement effect. The user clicks “finish” to make the arrangement setting effective. At this time, the obtained lead-out point, lead path and text position can be applied and the view is updated; if “cancel” is clicked, the arrangement effect of this time is not saved, and the screen returns to the label position before setting.
[0128] S405, exit the function. After confirming the arrangement effect, the function is automatically exited.
[0129] It should be understood that Figures 2 to 4 The schematic diagram shown is merely exemplary and not restrictive, and is extensible, and those skilled in the art can make various obvious changes and / or replacements based on the examples Figures 2 to 4 The resulting technical solutions still belong to the disclosure range of the embodiments of the present disclosure.
[0130] The embodiments of the present disclosure provide a lead annotation arrangement device, which can include: a target determination module 501 configured to obtain a plurality of to-be-arranged lead annotations and a plurality of annotation objects; the to-be-arranged lead annotations and the annotation objects are in one-to-one correspondence; the lead annotation includes a lead and text; a lead positioning module 502 configured to determine, for each to-be-arranged lead annotation, a lead-out point coordinate of the lead based on the corresponding annotation object; a text positioning module 503 configured to determine a text coordinate according to the lead-out point coordinate in response to a text arrangement mode selected by a user; the text arrangement mode at least includes an outside arrangement and a nearby arrangement; and a result generation module 504 configured to generate a lead annotation arrangement result according to the lead-out point coordinate and the text coordinate of each to-be-arranged lead annotation. Figure 5 In some embodiments, the target determination module 501 includes: a lead annotation full selection submodule configured to, in response to a function activation instruction of a user, regard all lead annotations as a selected lead annotation set; a lead annotation filtering submodule configured to, in response to a filtering instruction of a user, remove lead annotations that do not meet the filtering requirements from the selected lead annotation set; a lead annotation removal submodule configured to, in response to a de-selection instruction of a user, remove lead annotations selected by the user from the selected lead annotation set; a lead annotation selection submodule configured to, in response to a confirmation instruction of a user, regard each lead annotation in the selected lead annotation set as a to-be-arranged lead annotation; and an annotation object correspondence submodule configured to regard an object corresponding to the to-be-arranged lead annotation as an annotation object.
[0131] In some embodiments, the lead positioning module 502 includes: a rasterization submodule configured to rasterize a markable surface of the annotation object to generate a plurality of discretized grids; and a lead positioning submodule configured to calculate a score of each discretized grid and determine the lead-out point coordinate according to the discretized grid with the highest score.
[0132] In some embodiments, the lead positioning submodule is configured to: determine an overlap score of the discretized grid based on a preset prohibited area and lead annotations of other annotation objects; determine a geometric score according to a distance between the discretized grid and a center point of the annotation object; perform weighted calculation on the overlap score and the geometric score to determine the score of any discretized grid; and determine the lead-out point coordinate according to the discretized grid with the highest score based on the score of each discretized grid.
[0133]
[0134] In some embodiments, the text positioning module 503 comprises: an outside ordering sub-module, configured to, when the text arrangement manner is outside arrangement, determine a text arrangement order of all to-be-arranged lead mark annotations according to the lead-out point coordinates; and an outside positioning sub-module, configured to determine, based on the text arrangement order, a text coordinate corresponding to each to-be-arranged lead mark annotation according to the lead-out point coordinates.
[0135] In some embodiments, the outside ordering sub-module is configured to determine a distance score according to a lead-out distance of the lead-out point coordinates from the view edge; construct a simulated lead line using the lead-out point coordinates, and determine a crossing score according to a crossing degree of the simulated lead line relative to lead mark annotations of other mark objects; and arrange the to-be-arranged lead mark annotations according to the distance score and the crossing score to obtain the text arrangement order.
[0136] In some embodiments, the outside positioning sub-module is configured to determine an actual distance between a center point position of the mark object and the view edge, determine a lead line pulling direction according to the actual distance in response to a preference weight input by a user, and determine the text coordinate according to the lead-out point coordinates and the lead line pulling direction.
[0137] In some embodiments, the outside positioning sub-module is further configured to determine a preference distance coefficient according to the preference weight, determine a preference distance according to the actual distance and the preference distance coefficient, and determine the lead line pulling direction as a direction with the shortest preference distance.
[0138] In some embodiments, the text positioning module 503 comprises: a nearby ordering sub-module, configured to, when the text arrangement manner is nearby arrangement, generate at least three text arrangement orders according to a preset rule; and a nearby positioning sub-module, configured to take the at least three text arrangement orders as an initial population, perform iterative calculation using a genetic algorithm, and determine the text coordinate.
[0139] In some embodiments, the text arrangement order comprises at least a complexity-based text arrangement order, a direction-based text arrangement order, and a random text arrangement order; the nearby ordering sub-module is configured to determine a complexity of a region where the mark object is located according to the lead-out point coordinates, arrange the to-be-arranged lead mark annotations according to the complexity to obtain the complexity-based text arrangement order, arrange the to-be-arranged lead mark annotations according to a preset direction order according to the lead-out point coordinates to obtain the direction-based text arrangement order, and arrange each to-be-arranged lead mark annotation based on random number generation to obtain the random text arrangement order.
[0140] In some embodiments, the near positioning sub-module is configured to: calculate the fitness of each population based on a preset scoring rule; select at least two populations with high fitness from the current population into a mating pool according to the fitness, generate a plurality of new populations through a crossover operation, and eliminate populations with low fitness; the new populations include part of the text coordinates in any population with high fitness and part of the text coordinates in another population with high fitness; the number of generated populations is consistent with the number of eliminated populations; introduce the new text arrangement order into the current population, repeat the above steps until a preset stop condition is reached, and obtain the text coordinates.
[0141] In some embodiments, the text arrangement mode further includes: flexible arrangement; the text positioning module 503 includes: a global bounding box sub-module configured to determine a global bounding box according to all objects in the view; the global bounding box includes the bounding box of each object in the view; a division bounding box sub-module configured to generate a division bounding box according to the global bounding box in response to a division range input by a user; a first flexible positioning sub-module configured to generate text coordinates using the near arrangement when the lead-out point coordinates are located within the division bounding box; and a second flexible positioning sub-module configured to generate text coordinates using the outside arrangement when the lead-out point coordinates are located outside the division bounding box.
[0142] In some embodiments, the result generation module 504 includes: a connection positioning sub-module configured to determine the connection point coordinates of the lead line according to the text coordinates in response to a connection mode selected by a user; a turning positioning sub-module configured to determine the turning point coordinates of the lead line according to the connection point coordinates in response to a turning mode selected by a user; a lead line generation sub-module configured to generate the lead line according to the lead-out point coordinates, the connection point coordinates, and the turning point coordinates; a text generation sub-module configured to generate the text according to the text arrangement scheme; and a label arrangement sub-module configured to generate the lead line label arrangement result according to the lead line and the text of each to-be-arranged lead line label.
[0143] In some embodiments, the connection mode includes: center connection and lower connection; the connection positioning sub-module is configured to: when the connection mode is center connection, offset from the vertical center point on the left side of the text arrangement by a preset center offset distance to determine the connection point coordinates; and when the connection mode is lower connection, offset from the vertical lowest point on the right side of the text arrangement by a preset lower offset distance to determine the connection point coordinates.
[0144] In some embodiments, the turning positioning sub-module is configured to: when the turning mode is orthogonal turning, determine the vertical coordinates based on the connection point coordinates; determine the horizontal coordinates according to the lead-out point coordinates; and determine the turning point coordinates according to the horizontal coordinates and the vertical coordinates.
[0145] In some embodiments, the turning positioning submodule is configured to: when the turning mode is flexible turning, determine the turning point coordinates according to the connection point coordinates in response to a turning distance input by the user.
[0146] In some embodiments, the lead label arrangement device further comprises a real-time preview module 505 (not shown in the figure) configured to generate a real-time preview according to the lead label arrangement result. Figure 5 In some embodiments, the lead label arrangement device further comprises a result saving module 506 (not shown in the figure) configured to determine the lead label arrangement result corresponding to the real-time preview as the final lead label arrangement result in response to a saving instruction of the user. Figure 5 In some embodiments, the lead label arrangement device further comprises a result saving module 506 (not shown in the figure) configured to determine the lead label arrangement result corresponding to the real-time preview as the final lead label arrangement result in response to a saving instruction of the user.
[0147] In some embodiments, the lead label arrangement device further comprises a re-generation module 507 (not shown in the figure) configured to generate a new lead label arrangement result in response to a parameter adjustment instruction of the user. Figure 5 In some embodiments, the lead label arrangement device further comprises a preview refreshing module 508 (not shown in the figure) configured to generate a new real-time preview according to the new lead label arrangement result. Figure 5 In some embodiments, the lead label arrangement device further comprises a preview refreshing module 508 (not shown in the figure) configured to generate a new real-time preview according to the new lead label arrangement result.
[0148] The specific functions and examples of the modules and sub-modules of the device in the embodiments of the present disclosure are described above in the corresponding steps of the method embodiments, which will not be described here.
[0149] The lead label arrangement device in the embodiments of the present disclosure can automatically determine the lead-out points and text positions, and quickly generate an arrangement scheme according to the user's needs, which can significantly improve the production efficiency of construction drawings or engineering drawings. Compared with the traditional manual adjustment mode, it reduces the operation cost of the user, avoids errors caused by misoperation, and can complete complex arrangement tasks in a short time. In addition, by sequentially determining the lead-out point coordinates and the text coordinates, the clarity and aesthetics of the label can be ensured, thereby improving the professionalism and readability of the drawings.
[0150] The embodiments of the present disclosure provide a scene schematic diagram of a lead label arrangement method, as shown in Figure 6 .
[0151] As described above, the lead label arrangement method provided by the embodiments of the present disclosure is applied to an electronic device. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers.
[0152] Specifically, the electronic device can specifically perform the following operations: A plurality of to-be-arranged lead annotations and a plurality of annotation objects are acquired; for each to-be-arranged lead annotation, a lead-out point coordinate of a lead is determined based on a corresponding annotation object; in response to a text arrangement mode selected by a user, a text coordinate is determined according to the lead-out point coordinate; and a lead annotation arrangement result is generated according to the lead-out point coordinate and the text coordinate corresponding to each to-be-arranged lead annotation.
[0153] It should be understood that Figure 6 The scene diagram shown is merely illustrative and non-limiting, and those skilled in the art can make various obvious changes and / or replacements based on the examples Figure 6 The resulting technical solutions still belong to the disclosure range of the embodiments of the present disclosure.
[0154] In the technical solutions of the present disclosure, the acquisition, storage and application of user personal information involved are in line with relevant laws and regulations and do not violate public order and good customs.
[0155] According to the embodiments of the present disclosure, the present disclosure further provides an electronic device and a readable storage medium.
[0156] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the present disclosure described and / or claimed in this document.
[0157] As Figure 7 The device 700 includes a computing unit 701 that can perform various appropriate actions and processes according to a computer program stored in a Read-Only Memory (ROM) 702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. Various programs and data required for the operation of the device 700 can also be stored in the RAM 703. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An Input / Output (I / O) interface 705 is also connected to the bus 704.
[0158] A plurality of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a magnetic disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0159] The computing unit 701 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various special-purpose Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 701 performs various methods and processes described above, such as the lead marking arrangement method. For example, in some embodiments, the lead marking arrangement method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as the storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 700 via the ROM 702 and / or the communication unit 709. When the computer program is loaded to the RAM 703 and executed by the computing unit 701, one or more steps of the lead marking arrangement method described above can be performed. Alternatively, in other embodiments, the computing unit 701 can be configured to perform the lead marking arrangement method by any other appropriate means, such as by means of firmware.
[0160] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps recited in the present disclosure can be performed in parallel, in series, or in a different order, without limitation herein, as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
[0161] The specific embodiments described above do not constitute an limitation on the scope of the present disclosure. Those skilled in the art will readily understand that various modifications, combinations, sub-combinations, and alternatives can be made to the specific embodiments disclosed without departing from the principles of the present disclosure. Any such modifications, equivalents, and alternatives are intended to fall within the scope of the present disclosure.
Claims
1. A method of arranging lead markings, characterized by, The method comprises the following steps: obtaining a plurality of to-be-arranged lead annotations and a plurality of annotation objects; the to-be-arranged lead annotations and the annotation objects are one-to-one corresponding; the lead annotation comprises a lead and text; for each to-be-arranged lead annotation, determining the lead-out point coordinates of the lead based on the corresponding annotation object; in response to a user-selected text arrangement mode, determining the text coordinates according to the lead-out point coordinates; the text arrangement mode at least includes outside arrangement and nearby arrangement; generating a lead annotation arrangement result according to the lead-out point coordinates of each to-be-arranged lead annotation and the text coordinates.
2. The method of claim 1, wherein, The method comprises the following steps: in response to a user's function activation instruction, all lead annotations are selected as a selected lead annotation set; in response to a user's screening instruction, lead annotations that do not meet the screening requirements are removed from the selected lead annotation set; in response to a user's unselected instruction, the lead annotations selected by the user are removed from the selected lead annotation set; in response to a user's confirmation instruction, each lead annotation in the selected lead annotation set is taken as the to-be-arranged lead annotation; the object corresponding to the to-be-arranged lead annotation is taken as the annotation object.
3. The method of claim 1, wherein, The method comprises the following steps: gridizing the markable surface of the annotation object to generate a plurality of discrete grids; calculating the score of each discrete grid, and determining the lead-out point coordinates according to the discrete grid with the highest score.
4. The method of claim 3, wherein, The method comprises the following steps: based on the preset prohibited area and the lead annotations of other annotation objects, the overlap score of the discrete grid is determined; the geometric score is determined according to the distance between the discrete grid and the center point of the annotation object; the overlap score and the geometric score are weighted to determine the score of any discrete grid; based on the score of each discrete grid, the lead-out point coordinates are determined according to the discrete grid with the highest score.
5. The method of claim 1, wherein, The method comprises the following steps: when the text arrangement mode is outside arrangement, the text arrangement order of all to-be-arranged lead annotations is determined according to the lead-out point coordinates; based on the text arrangement order, the text coordinates corresponding to each to-be-arranged lead annotation are determined in turn according to the lead-out point coordinates.
6. The method of claim 5, wherein, The method comprises the following steps: according to the lead-out distance between the lead-out point coordinates and the view edge, the distance score is determined; analog lead lines are constructed by using the lead-out point coordinates, and the penetration score is determined according to the penetration degree of the analog lead lines relative to the lead annotations of other annotation objects; according to the distance score and the penetration score, the to-be-arranged lead annotations are arranged to obtain the text arrangement order.
7. The method of claim 5, wherein, The text coordinates of each of the to-be-arranged annotation labels are determined according to the lead-out point coordinates in sequence based on the text arrangement order, and the method comprises the following steps: determining the actual distance between the center point position of the annotation object and the edge of the view; determining the lead line pulling direction according to the actual distance in response to the preference weight input by the user; determining the text coordinates according to the lead-out point coordinates and the lead line pulling direction.
8. The method of claim 7, wherein, The method for determining the lead line pulling direction according to the actual distance in response to the preference weight input by the user comprises the following steps: determining a preference distance coefficient according to the preference weight; determining a preference distance according to the actual distance and the preference distance coefficient; determining the direction with the shortest preference distance as the lead line pulling direction.
9. The method of claim 1, wherein, The method for determining the text coordinates according to the lead-out point coordinates in response to the text arrangement mode selected by the user comprises the following steps: generating at least three text arrangement orders according to a preset rule when the text arrangement mode is the nearby arrangement; determining the text coordinates by iterative calculation of a genetic algorithm using the at least three text arrangement orders as an initial population.
10. The method of claim 9, wherein, The text arrangement order comprises at least a text arrangement order based on complexity, a text arrangement order based on direction and a random text arrangement order; The method for generating at least three text arrangement orders according to a preset rule comprises the following steps: determining the complexity of the region where the annotation object is located according to the lead-out point coordinates, and arranging the to-be-arranged annotation labels according to the complexity to obtain the text arrangement order based on complexity; arranging the to-be-arranged annotation labels according to a preset direction order to obtain the text arrangement order based on direction according to the lead-out point coordinates; generating the random text arrangement order by arranging each of the to-be-arranged annotation labels based on a random number.
11. The method of claim 9, wherein, The method for determining the text coordinates by iterative calculation of a genetic algorithm using the at least three text arrangement orders as an initial population comprises the following steps: calculating the fitness of each population based on a preset scoring rule; selecting at least two populations with high fitness from the current population into a mating pool according to the fitness, generating a plurality of new populations by crossover operation, and eliminating populations with low fitness; the new populations include part of the text coordinates in any of the populations with high fitness and part of the text coordinates in another population with high fitness; the number of generated populations is consistent with the number of eliminated populations; introducing new text arrangement orders into the current population, and repeating the above steps until a preset stop condition is reached to obtain the text coordinates.
12. The method of claim 1, wherein, The text arrangement mode further comprises flexible arrangement; The method for determining the text coordinates according to the lead-out point coordinates in response to the text arrangement mode selected by the user when the text arrangement mode is flexible arrangement comprises the following steps: determining a global bounding box according to all objects in the view; the global bounding box comprises a bounding box of each of the objects in the view; generating a demarcation bounding box according to the global bounding box in response to a demarcation range input by the user; generating the text coordinates by the nearby arrangement when the lead-out point coordinates are located within the demarcation bounding box; When the lead-out point coordinate is located outside the boundary bounding box, the text coordinate is generated by using the outside arrangement.
13. The method of claim 1, wherein, The lead-out point coordinate and the text coordinate corresponding to each to-be-arranged lead line label are determined to generate a lead line label arrangement result. In response to a user-selected connection mode, the connection point coordinate of the lead line is determined according to the text coordinate. In response to a user-selected turning mode, the turning point coordinate of the lead line is determined according to the connection point coordinate. The lead line is generated according to the lead-out point coordinate, the connection point coordinate and the turning point coordinate. The text is generated according to the text arrangement scheme. The lead line and the text of each to-be-arranged lead line label are used to generate the lead line label arrangement result.
14. The method of claim 13, wherein, The connection mode includes center connection and lower connection. In response to a user-selected connection mode, the connection point coordinate of the lead line is determined according to the text coordinate. When the connection mode is the center connection, the connection point coordinate is determined by offsetting from the vertical center point on the left side of the text arrangement according to a preset center offset distance. When the connection mode is the lower connection, the connection point coordinate is determined by offsetting from the vertical lowest point on the right side of the text arrangement according to a preset lower offset distance.
15. The method of claim 13, wherein, In response to a user-selected turning mode, the turning point coordinate of the lead line is determined according to the connection point coordinate. When the turning mode is orthogonal turning, a first coordinate is determined based on the connection point coordinate. A second coordinate is determined according to the lead-out point coordinate. The turning point coordinate is determined according to the first coordinate and the second coordinate.
16. The method of claim 13, wherein, In response to a user-selected turning mode, the turning point coordinate of the lead line is determined according to the connection point coordinate. When the turning mode is flexible turning, the turning point coordinate is determined according to the connection point coordinate in response to a user-input turning distance.
17. The method of claim 1, wherein, Further comprising: Real-time preview is generated according to the lead line label arrangement result. In response to a user's save instruction, the lead line label arrangement result corresponding to the real-time preview is determined as the final lead line label arrangement result.
18. The method of claim 17, wherein, Further comprising: In response to a user's parameter adjustment instruction, a new lead line label arrangement result is generated. A new real-time preview is generated according to the new lead line label arrangement result.
19. A lead labeling arrangement comprising: Comprising: A target determination module is configured to acquire a plurality of to-be-arranged lead line labels and a plurality of label objects. The to-be-arranged lead line labels and the label objects are in one-to-one correspondence. The lead line label includes a lead line and a text. A lead-out positioning module is configured to determine, for each to-be-arranged lead line label, a lead-out point coordinate of the lead line based on the label object corresponding thereto. A text positioning module is configured to determine a text coordinate according to the lead-out point coordinate in response to a user-selected text arrangement mode; the text arrangement mode at least includes outside arrangement and nearby arrangement. A result generation module is configured to generate a lead line label arrangement result according to the lead-out point coordinate and the text coordinate corresponding to each to-be-arranged lead line label.
20. An electronic device, comprising: Comprising: At least one processor; And A memory in communication connection with the at least one processor; wherein, The memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of any of claims 1-18.
21. A non-transitory computer-readable storage medium having stored thereon computer instructions, wherein, The computer instructions are for causing a computer to perform the method of any of claims 1-18.
Citation Information
Cited By
Geometric evaluation label arrangement method and device, computer equipment, computer readable storage medium and computer program product
CN121957595A