Arrangement method and device, computer equipment and storage medium
通过获取目标单体的排布指令和最小排布距离,生成表征排布样式的几何图形并进行目标单体排布,解决了设计领域中单体排布效率低和效果不佳的问题,实现 Efficient and accurate arrangement results.
Patent Information
- Application Number
- CN202310532124.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-11
- Publication Date
- 2024-11-12
AI Technical Summary
In the field of design, the monomer arrangement efficiency is inefficient and poor, manual operation efficiency is low, computer generated results are affected by complex constraints and fuzzy design concepts, making it difficult to generate satisfactory results.
By obtaining the arrangement instructions and minimum arrangement distance of the target monomer, a geometric figure representing the arrangement style is generated, and the arrangement of the target monomer is performed based on this, and the interface displays the geometric figure and minimum arrangement distance determine the arrangement result. Ensure that the layout results comply with specifications and improve efficiency.
It improves the efficiency and accuracy of single-unit arrangement, solves the problems of low manual operation efficiency and poor computer generation results, and ensures that the arrangement results meet specifications and user needs.
Smart Images

Figure CN118940350A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer-aided design, and in particular to an arrangement method, an apparatus, a computer device and a storage medium. Background Art
[0002] Arrangement is an unavoidable problem in the field of design (especially architectural design). For example, the arrangement of multiple buildings on a plot, the arrangement of rooms, the arrangement of tables and chairs, etc. Among them, the objects of these arrangements are called monomers. At present, there are two types of solutions to the monomer arrangement problem: the first type is that all arrangements are completed manually by the user. The second type is that multiple arrangement results are completely generated by the computer and then given to the user to choose.
[0003] Both current methods have some defects. If they are completely operated manually by users, the efficiency is very low. If they are completely generated by computers, complex constraints and vague design concepts make it difficult to generate good results. Summary of the invention
[0004] In view of this, the present invention provides an arrangement method, apparatus, computer equipment and storage medium to solve the problems of low arrangement efficiency and poor effect.
[0005] In a first aspect, the present invention provides an arrangement method, the method comprising:
[0006] Obtaining an arrangement instruction and a minimum arrangement distance of a target monomer, wherein the arrangement instruction is used to generate a geometric figure representing an arrangement style, and the minimum arrangement distance is an arrangement distance of adjacent target monomers along the geometric figure, and the minimum arrangement distance is determined based on a specification description document;
[0007] Displaying the geometric figure on the interface;
[0008] The target monomer is arranged based on the minimum arrangement distance and the geometric figure, and an arrangement result is determined and displayed.
[0009] The arrangement method provided by the embodiment of the present invention displays geometric figures on the interface according to the arrangement instructions. The geometric figures represent the arrangement style, which is equivalent to the arrangement style being specified by the user. On this basis, the target monomers are arranged along the geometric figures with the minimum arrangement distance as a constraint, which not only solves the problem of low efficiency of completely manual arrangement, but also solves the problem of poor effect caused by completely computer generation.
[0010] In some optional implementations, obtaining the minimum arrangement distance includes:
[0011] Obtaining a minimum distance input instruction and a specification description document, wherein the minimum distance input instruction is used to determine a preset minimum distance;
[0012] Parsing the specification description document to determine the minimum distance in a preset direction;
[0013] Based on the minimum distance in the preset direction and the geometric figure, determining a minimum distance along the geometric figure;
[0014] The minimum arrangement distance is determined based on the size relationship between the preset minimum distance and the minimum distance along the geometric figure.
[0015] The arrangement method provided in the embodiment of the present invention obtains the minimum distance of a preset direction defined in the specification by parsing the specification description document, and obtains the minimum arrangement distance by utilizing the size relationship between the minimum distance and the preset minimum distance, thereby ensuring that the target monomer is constrained by the minimum arrangement distance during arrangement, and that the constraint also meets the requirements of the specification, thereby improving the accuracy of the arrangement while ensuring the efficiency of the arrangement.
[0016] In some optional implementations, determining the minimum arrangement distance based on the size relationship between the preset minimum distance and the minimum distance along the geometric figure includes:
[0017] If the minimum distance along the geometric figure is greater than the preset minimum distance, determining the preset minimum distance as the minimum arrangement distance;
[0018] If the minimum distance along the geometric figure is less than the preset minimum distance, the minimum distance along the geometric figure is determined to be the minimum arrangement distance.
[0019] The arrangement method provided by the embodiment of the present invention provides a minimum preset distance. Even if there are no constraints that meet any specification description document, a certain distance must be maintained between the two target monomers. The two target monomers cannot be directly connected together with a distance of 0, thereby ensuring the accuracy of the arrangement result.
[0020] In some optional implementations, if the geometric figure is a line or a two-dimensional figure, arranging the target monomer based on the minimum arrangement distance and the geometric figure, and determining and displaying the arrangement result, includes:
[0021] Get the center point of the target monomer;
[0022] Based on the minimum arrangement distance, determining the position of the center point of the adjacent target monomer in the geometric figure;
[0023] The target monomers are arranged based on the determined positions, and the arrangement results are displayed.
[0024] The arrangement method provided in the embodiment of the present invention has a geometric figure representing the arrangement style given in advance, and the arrangement interval is constrained by a minimum arrangement distance, thereby further improving the accuracy of the target monomer center point determined in the geometric figure, thereby improving the accuracy of the arrangement.
[0025] In some optional implementations, if the geometric figure is a curve, determining the positions of the center points of adjacent target monomers in the geometric figure based on the minimum arrangement distance includes:
[0026] Obtaining the length of a unit line segment in the curve, where the unit line segment is obtained by dividing the curve into preset equal parts;
[0027] Get the position of the center point of the current target monomer in the curve;
[0028] Based on the length of the unit line segment, the minimum arrangement distance, and the position of the center point of the current target monomer in the curve, the position of the center point of the next target monomer in the curve is determined.
[0029] The arrangement method provided by the embodiment of the present invention, for arrangement along a curve, obtains the length of a unit line segment in the curve, that is, divides the curve to accurately obtain the position of the center point of the next target monomer in the curve from the center point of the current target monomer.
[0030] In some optional implementations, if the geometric figure is a two-dimensional figure, determining the positions of the center points of adjacent target monomers in the geometric figure based on the minimum arrangement distance includes:
[0031] Obtaining a first dimension direction and a second dimension direction of the two-dimensional graph;
[0032] Taking the minimum point of the second dimension as the starting point and the intersection of the first dimension and the two-dimensional figure as the end point, a current arrangement straight line is generated;
[0033] Based on the minimum arrangement distance, determining the arrangement position of the target monomer in the current arrangement straight line;
[0034] The distance along the second dimension from the current arrangement straight line is the minimum arrangement distance, and the next arrangement straight line is determined;
[0035] Based on the minimum arrangement distance, the arrangement position of the target monomer in the next arrangement straight line is determined.
[0036] The arrangement method provided in the embodiment of the present invention arranges from the first dimension direction and the second dimension direction respectively, and constrains the minimum arrangement distance and the two-dimensional directions, thereby realizing the arrangement style of two-dimensional graphics and improving the arrangement efficiency.
[0037] In some optional embodiments, the method further comprises:
[0038] Obtaining an adjustment instruction for the geometric figure, wherein the adjustment instruction is used to adjust the geometric figure to obtain an adjusted geometric figure;
[0039] Get the number of target monomers that have been arranged before adjustment;
[0040] Based on the adjusted geometric figure and the number of arranged target monomers, determining an adjusted minimum arrangement distance;
[0041] Based on the adjusted geometric figure and the adjusted minimum arrangement distance, the target monomer is arranged, and the adjusted arrangement result is determined and displayed.
[0042] The arrangement method provided in the embodiment of the present invention adjusts the minimum arrangement distance accordingly according to the adjustment of the geometric figure. The reason is that the arrangement is performed as evenly as possible along the adjusted geometric figure while keeping the number of arranged target monomers unchanged.
[0043] In a second aspect, the present invention provides an arrangement device, the device comprising:
[0044] An arrangement instruction acquisition module, used to acquire an arrangement instruction and a minimum arrangement distance of a target monomer, wherein the arrangement instruction is used to generate a geometric figure representing an arrangement style, and the minimum arrangement distance is an arrangement distance of adjacent target monomers along the geometric figure, and the minimum arrangement distance is determined based on a specification description document;
[0045] A first display module, used for displaying the geometric figure on an interface;
[0046] The second display module is used to arrange the target monomer based on the minimum arrangement distance and the geometric figure, and determine and display the arrangement result.
[0047] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the arrangement method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0048] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the arrangement method of the first aspect or any corresponding embodiment thereof.
[0049] It should be noted that, for the corresponding beneficial effects of the arrangement device, computer equipment and computer-readable storage medium provided in the embodiments of the present invention, please refer to the description of the corresponding beneficial effects of the arrangement method above, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 is a schematic flow chart of an arrangement method according to an embodiment of the present invention;
[0052] Figure 2 is a flow chart of another arrangement method according to an embodiment of the present invention;
[0053] Figure 3 is a schematic diagram of arrangement along a two-dimensional graph according to an embodiment of the present invention;
[0054] Figure 4 is a flow chart of another arrangement method according to an embodiment of the present invention;
[0055] Figure 5a-Figure 5b is a schematic diagram of arrangement results of geometric figures before and after adjustment according to an embodiment of the present invention;
[0056] Figure 6 is a structural block diagram of an arrangement device according to an embodiment of the present invention;
[0057] Figure 7 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0059] The embodiment of the present invention provides an arrangement method, which obtains a geometric figure representing an arrangement style under an arrangement instruction, arranges a target monomer along the geometric figure, and obtains an arrangement result. The method arranges the target monomer by specifying a geometric figure, thereby achieving the effect of improving arrangement efficiency and arrangement accuracy.
[0060] According to an embodiment of the present invention, an arrangement method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0061] In this embodiment, an arrangement method is provided, which can be used for the above-mentioned computer devices, such as computers, mobile phones, tablet computers, etc. Figure 1 is a flow chart of an arrangement method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0062] Step S101, obtaining the arrangement instruction and the minimum arrangement distance of the target monomer.
[0063] The arrangement instruction is used to generate a geometric figure representing the arrangement style, and the minimum arrangement distance is the arrangement distance of adjacent target monomers along the geometric figure, and the minimum arrangement distance is determined based on a specification description document.
[0064] The target monomer is the monomer to be arranged, for example, a floor, a room, a chair, etc. The specific type is set according to the actual design requirements.
[0065] The arrangement instruction is triggered by the user's interaction with the interface. Accordingly, the arrangement instruction of the target monomer is obtained, and the arrangement instruction is used to generate a geometric figure that represents the arrangement style. For example, an arrangement tag is set on the interface, and the user can draw a geometric figure on the interface by selecting the arrangement tag. Selecting the arrangement tag and drawing the geometric figure is equivalent to triggering the arrangement instruction of the target monomer. The geometric figure represents the arrangement style of the target monomer. For example, if the geometric figure is a point, the target monomer is arranged along the point; if the geometric figure is a straight line, the target monomer is arranged along the straight line.
[0066] The specification description document represents the arrangement rules. Different specification description documents correspond to different specification parsing algorithms. The specification parsing algorithm is used to determine the minimum arrangement distance. The specification description document will provide a calculation method for the minimum distance. Accordingly, the minimum arrangement distance between adjacent target monomers is obtained.
[0067] It should be noted that the arrangement here refers to replicating the target monomer along the direction of the geometric figure with the minimum arrangement distance as a constraint.
[0068] Step S102, displaying geometric figures on the interface.
[0069] After the geometric figure is determined, the geometric figure is displayed on the interface for the user to confirm. If the geometric figure determined in the above step S101 does not meet the user's needs, the user adjusts it through interactive operations here to obtain a geometric figure for arranging the target monomer. Of course, the adjustment of the geometric figure can also be after arranging the target monomer, adjusting the geometric figure according to the arrangement result of the target monomer, thereby adjusting the arrangement result, and so on. The specific adjustment timing of the geometric figure is not limited here, and it can be set according to actual needs.
[0070] Step S103, arranging the target monomers based on the minimum arrangement distance and the geometric figures, and determining and displaying the arrangement result.
[0071] When arranging target monomers, first determine the position of the first target monomer and set it at the starting point of the geometric figure. Based on the position of the first target monomer and with the minimum arrangement distance as a constraint, determine the position of the second target monomer; then, based on the position of the second target monomer and with the minimum arrangement distance as a constraint, determine the position of the third target monomer; and so on, until the arrangement is completed. After the target monomers are arranged, the arrangement results are displayed on the interface.
[0072] The position of the target monomer may be determined by the center point of the target monomer, or the vertex of the target monomer, or the characteristic point of the target monomer, etc., which is specifically selected according to actual needs.
[0073] Taking the center point of the target monomer as an example, if the geometric figure is a point, the center point of the target monomer is made to coincide with the point during arrangement. If the geometric figure is a straight line, the minimum arrangement distance is used to determine the position points of two adjacent target monomers on the straight line during arrangement, and then the center point of the target monomer is made to coincide with the determined position point.
[0074] The arrangement method provided in this embodiment displays geometric figures on the interface according to the arrangement instructions. The geometric figures represent the arrangement style, which is equivalent to the arrangement style being specified by the user. On this basis, the target monomers are arranged along the geometric figures with the minimum arrangement distance as a constraint, which not only solves the problem of low efficiency of completely manual arrangement, but also solves the problem of poor effect caused by completely computer generation.
[0075] In this embodiment, an arrangement method is provided, which can be used for the above-mentioned computer devices, such as computers, mobile phones, tablet computers, etc. Figure 2 is a flow chart of an arrangement method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0076] Step S201, obtaining the arrangement instruction and minimum arrangement distance of the target monomer.
[0077] The arrangement instruction is used to generate a geometric figure representing the arrangement style, and the minimum arrangement distance is the arrangement distance of adjacent target monomers along the geometric figure, and the minimum arrangement distance is determined based on the specification description document. For a detailed description of the arrangement instruction, please refer to Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0078] In some optional implementations, the above-mentioned obtaining the minimum arrangement distance includes:
[0079] Step a1, obtaining a minimum distance input instruction, where the minimum distance input instruction is used to determine a preset minimum distance.
[0080] Step a2: parse the specification description document to determine the minimum distance in the preset direction.
[0081] Step a3, based on the minimum distance in a preset direction and the geometric figure, determine the minimum distance along the geometric figure.
[0082] Step a4, determining the minimum arrangement distance based on the relationship between the preset minimum distance and the minimum distance along the geometric figure.
[0083] The minimum distance is a distance constraint given by the user through interactive operation. For example, the user inputs the minimum distance through interactive operation, and accordingly, the minimum distance input instruction is triggered to obtain the preset minimum distance. The preset minimum distance is used to constrain the minimum distance when the minimum distance cannot be determined using the specification description document.
[0084] As mentioned above, the specification constraint document provides a method for calculating the minimum distance. The method for calculating the minimum distance is obtained by parsing the specification constraint document, and the minimum distance is calculated based on this, so as to obtain the minimum distance in the preset direction. Since the specification constraint document is independent of the geometric figure, the method for calculating the minimum distance given in the specification constraint document calculates the minimum distance in the preset direction, rather than the minimum distance along the geometric figure. Based on this, after calculating the minimum distance in the preset direction, it is necessary to combine the geometric figure and map the minimum distance in the preset direction to the geometric figure to obtain the minimum distance along the geometric figure.
[0085] The preset direction includes but is not limited to the horizontal direction or the vertical direction, etc., which is set according to the actual project requirements and is not limited here.
[0086] If the preset direction is the horizontal direction, the minimum distance in the horizontal direction determined based on the specification description document is 6. If the geometric figure is a straight line, the minimum distance in the horizontal direction 6 is mapped to the straight line to obtain the minimum distance along the straight line. If the geometric figure is a curve, the minimum distance in the horizontal direction 6 is mapped to the curve to obtain the minimum distance along the curve.
[0087] After obtaining the minimum distance along the geometric figure, the minimum distance is compared with the preset minimum distance to obtain the minimum arrangement result. For example, if the minimum distance along the geometric figure is greater than the preset minimum distance, the preset minimum distance is determined as the minimum arrangement distance. If the minimum distance along the geometric figure is less than the preset minimum distance, the minimum distance along the geometric figure is determined as the minimum arrangement distance.
[0088] For example, according to the specification description document, if one of the two adjacent buildings is 6 floors and the other is 11 floors, the minimum distance between the two buildings is 6 meters. If both buildings are 11 floors, the minimum distance between the two buildings is 9 meters. If the preset minimum distance entered by the user through interactive operation is 7 meters, for the two adjacent buildings, one is 6 floors and the other is 11 floors, the corresponding minimum arrangement distance is 6 meters, and for both buildings are 11 floors, the corresponding additional arrangement distance is 7 meters.
[0089] The purpose of giving the minimum preset distance is that, even if there are no constraints that meet any specification description document, a certain distance must be maintained between the two target monomers, and the two target monomers cannot be directly connected together with a distance of 0, thereby ensuring the accuracy of the arrangement results.
[0090] The minimum distance of the preset direction defined in the specification is obtained by parsing the specification description document, and the minimum arrangement distance is obtained by using the relationship between the minimum distance and the preset minimum distance, so as to ensure that the target monomer is constrained by the minimum arrangement distance during arrangement, and the constraint also meets the requirements of the specification, thereby improving the accuracy of arrangement while ensuring the efficiency of arrangement.
[0091] Step S202: Display the geometric figure on the interface. Figure 1 Step S102 of the illustrated embodiment will not be described in detail here.
[0092] Step S203, arranging the target monomers based on the minimum arrangement distance and the geometric figures, and determining and displaying the arrangement result.
[0093] Specifically, the above step S203 includes:
[0094] Step S2031, obtaining the center point of the target monomer.
[0095] For the target monomer, its center point is determined when drawing the target monomer. Alternatively, when encapsulating each monomer, the center point attribute is encapsulated together. Of course, other methods can also be used to obtain the center point of the target monomer, which is not limited here and is set according to actual needs.
[0096] Step S2032, based on the minimum arrangement distance, determine the position of the center point of the adjacent target monomer in the geometric figure.
[0097] According to the above description, if the geometric figure is a line or a two-dimensional figure, the starting point of the geometric figure is determined to be the position of the center point of the first target monomer, and then the position of the center point of the second target monomer in the geometric figure is obtained based on the position of the center point of the first target monomer and the minimum arrangement distance; ...; and so on.
[0098] In some optional implementations, if the geometric figure is a curve, the above step S2032 includes:
[0099] Step b1, obtaining the length of a unit line segment in the curve, where the unit line segment is obtained by dividing the curve into preset equal parts.
[0100] Step b2, obtaining the position of the center point of the current target monomer in the curve.
[0101] Step b3, based on the length of the unit line segment, the minimum arrangement distance and the position of the center point of the current target monomer in the curve, determine the position of the center point of the next target monomer in the curve.
[0102] Since the mathematical expression of a curve may or may not exist, for example, an irregular curve cannot be represented by a mathematical expression. Based on this, the curve is discretized by dividing it into preset equal parts to obtain a unit line segment. Of course, a single pixel point in the curve can also be used as a unit line segment. When the resolution of the computer device is known, the length of a single pixel point is determined.
[0103] Taking the position of the center point of the current target monomer in the curve as the starting point and adding the minimum arrangement distance determined along the geometric figure, the position of the center point of the next target monomer in the curve is obtained.
[0104] For example, the horizontal coordinate of the center point of the current target monomer is 5. If the minimum arrangement distance is determined based on the minimum distance in the preset direction, and the minimum distance in the preset direction is 6, then the horizontal coordinate of the center of the next target monomer is 5+6=11. Then, the value of the vertical coordinate corresponding to the horizontal coordinate of 11 is calculated based on the mathematical expression of the curve, thereby determining the position of the center point of the next target monomer in the curve. Alternatively, after obtaining the horizontal coordinate of the center point of the next target monomer as 11, walk along the curve until you find a point with a horizontal coordinate of 11.
[0105] Alternatively, after the center point of the current target monomer is determined, the center point is used as the starting point to query along the direction of the curve, according to the length of the unit line segment, until the minimum arrangement distance is reached.
[0106] For the arrangement along the curve, the position of the center point of the next target monomer in the curve is accurately obtained from the center point of the current target monomer by obtaining the length of the unit line segment in the curve, that is, dividing the curve.
[0107] It should be noted that when determining the position of the center point of the next target monomer, it may be impossible to determine it. This is because the length of the remaining unarranged target monomers in the curve is less than the minimum arrangement distance. In this case, the arrangement of the target monomers is stopped, indicating that the arrangement of the target monomers is completed.
[0108] In some optional implementations, if the geometric figure is a two-dimensional figure, the above step S2032 includes:
[0109] Step c1, obtaining the first dimension direction and the second dimension direction of the two-dimensional figure.
[0110] Step c2, taking the minimum point in the second dimension as the starting point and the intersection of the first dimension and the two-dimensional figure as the end point, to generate the current arrangement straight line.
[0111] Step c3, based on the minimum arrangement distance, determine the arrangement position of the target monomer in the current arrangement straight line.
[0112] Step c4, determining the next arrangement straight line along the second dimension and whose distance from the current arrangement straight line is the minimum arrangement distance.
[0113] Step c5, based on the minimum arrangement distance, determining the arrangement position of the target monomer in the next arrangement straight line.
[0114] The geometric figure is a two-dimensional figure, which can also be understood as the current target monomer is arranged in a plane. The first dimension direction and the second dimension direction can be specified by the user or by default. For example, the default first dimension direction and second dimension direction are as follows Figure 3 As shown,.
[0115] In this case, the minimum point in the second dimension is used as the starting point, and the intersection of the first dimension and the two-dimensional figure is used as the end point to generate the current arrangement straight line. After obtaining the current arrangement straight line, the target monomers are arranged on the current arrangement straight line with the minimum arrangement distance as a constraint. The specific arrangement direction is described above and will not be repeated here.
[0116] After the target monomers on the current arrangement line are arranged, the next arrangement line is determined. Specifically, the distance along the second dimension and from the current arrangement line is the minimum arrangement distance, and the next arrangement line is obtained. Then, on the next arrangement line, the target monomers are arranged with the minimum arrangement distance as a constraint.
[0117] The method of arranging the target monomers on the current arrangement straight line and the next arrangement straight line is similar to the above description, and the arrangement position of the target monomers is first determined on the current arrangement straight line or the next arrangement straight line.
[0118] Arrangement is performed from the first dimension and the second dimension respectively, and constraints are imposed on the minimum arrangement distance and the two-dimensional directions, thereby realizing the arrangement style of two-dimensional graphics and improving the arrangement efficiency.
[0119] Step S2033: Arrange the target monomers based on the determined positions and display the arrangement results. Figure 1 Step S103 of the illustrated embodiment will not be described in detail here.
[0120] The arrangement method provided in this embodiment, since the geometric figure representing the arrangement style is given in advance, constrains the arrangement interval through the minimum arrangement distance, thereby further improving the accuracy of the target monomer center point determined in the geometric figure, thereby improving the accuracy of the arrangement.
[0121] In some optional embodiments, the geometric figures may also include three-dimensional figures. When the target monomers are arranged based on the three-dimensional figures, the arrangement is similar to that of the two-dimensional figures. The difference is that three dimensional directions are defined, and the rest is similar to the two-dimensional figures, which will not be repeated here.
[0122] In this embodiment, an arrangement method is provided, which can be used for the above-mentioned computer devices, such as computers, mobile phones, tablet computers, etc. In addition to the above-mentioned Figure 1 or Figure 2 In addition to the method steps of the embodiment shown, the method also includes Figure 4 is a process according to an embodiment of the present invention, such as Figure 4 As shown, the method also includes the following steps:
[0123] Step S401, obtaining geometric figure adjustment instructions.
[0124] The adjustment instruction is used to adjust the geometric figure to obtain the adjusted geometric figure.
[0125] As described above, the arrangement result is displayed on the interface. If the user is not satisfied with the arrangement result, the geometric figure is adjusted through interactive operations with the interface. Accordingly, an adjustment instruction of the geometric figure is triggered, and the adjusted geometric figure is obtained through the adjustment instruction.
[0126] Step S402, obtaining the number of target monomers arranged before adjustment.
[0127] Before adjusting the geometric figure, count the number of target monomers arranged on the geometric figure. For example, maintain a parameter and modify the value of the parameter each time a target monomer is arranged. At this time, by obtaining the value of the parameter, the number of target monomers arranged before the adjustment can be obtained.
[0128] Step S403: determining an adjusted minimum arrangement distance based on the adjusted geometric figure and the number of arranged target monomers.
[0129] Combined with the adjusted geometric figure and the number of arranged target monomers, the preset minimum distance input by the user is adjusted. Specifically, if the geometric figure is a line, the preset minimum distance is adjusted to: the length of the adjusted line / the number of arranged target monomers. If the geometric figure is a two-dimensional figure, the preset minimum distance is adjusted to: the longest distance in the second dimension of the adjusted line / the number of arranged straight lines.
[0130] After obtaining the adjusted preset minimum distance, the preset minimum distance is compared with the minimum distance along the geometric figure obtained according to the specification description document, and the minimum arrangement distance is re-determined to obtain the adjusted minimum arrangement distance.
[0131] Step S404, arranging the target monomers based on the adjusted geometric figure and the adjusted minimum arrangement distance, and determining and displaying the adjusted arrangement result.
[0132] This step is similar to the above Figure 2 S203 of the illustrated embodiment is similar and will not be described in detail here.
[0133] In a specific embodiment, Figure 5a The result of the arrangement before adjusting the geometry is shown. Figure 5b The resulting arrangement after adjusting the geometry is shown.
[0134] The arrangement method provided in this embodiment adjusts the minimum arrangement distance accordingly according to the adjustment of the geometric figure, and the reason is that the arrangement is uniformly arranged along the adjusted geometric figure as much as possible while keeping the number of target monomers that have been arranged unchanged. By adopting the meta-arrangement solution, the entire arrangement process is divided into three stages: geometric figure determination, generation of arrangement results, and adjustment of arrangement results. The arrangement styles represented by the geometric figure include point arrangement, straight line arrangement, arc arrangement, curve arrangement, free curve arrangement, and surface arrangement, etc. The entire arrangement process is completed by the collaboration of the user and the computer device, and the geometric figure can be adjusted at any time to update the arrangement result.
[0135] In the present embodiment, a kind of arrangement device is also provided, and this device is used to realize the above-mentioned embodiment and preferred implementation mode, and what has been described is not repeated here. As used below, the term "module" can realize the combination of software and / or hardware of predetermined function. Although the device described in the following embodiment is preferably realized by software, the realization of hardware, or the combination of software and hardware is also possible and conceived.
[0136] This embodiment provides an arrangement device, such as Figure 6 As shown, including:
[0137] The arrangement instruction acquisition module 501 is used to obtain the arrangement instruction and minimum arrangement distance of the target monomer. The arrangement instruction is used to generate a geometric figure representing the arrangement style. The minimum arrangement distance is the arrangement distance of adjacent target monomers along the geometric figure. The minimum arrangement distance is determined based on the specification description document.
[0138] The first display module 502 is used to display the geometric figure on the interface.
[0139] The second display module 503 is used to arrange the target monomer based on the minimum arrangement distance and the geometric figure, and determine and display the arrangement result.
[0140] In some optional implementations, the arrangement instruction acquisition module 501 includes:
[0141] The input instruction acquisition unit is used to acquire a minimum distance input instruction, where the minimum distance input instruction is used to determine a preset minimum distance.
[0142] The document parsing unit is used to parse the specification description document to determine the minimum distance in a preset direction.
[0143] The minimum distance determining unit is used to determine the minimum distance along the geometric figure based on the minimum distance in the preset direction and the geometric figure.
[0144] The minimum arrangement distance determination unit is used to determine the minimum arrangement distance based on the size relationship between the preset minimum distance and the minimum distance along the geometric figure.
[0145] In some optional implementations, the minimum arrangement distance determination unit includes:
[0146] The first determining subunit is used to determine the preset minimum distance as the minimum arrangement distance if the minimum distance along the geometric figure is greater than the preset minimum distance.
[0147] The second determining subunit is used to determine that the minimum distance along the geometric figure is the minimum arrangement distance if the minimum distance along the geometric figure is less than the preset minimum distance.
[0148] In some optional implementations, if the geometric figure is a line or a two-dimensional figure, the second display module 503 includes:
[0149] The center point acquisition unit is used to acquire the center point of the target monomer.
[0150] A position determination unit is used to determine the position of the center point of the adjacent target monomer in the geometric figure based on the minimum arrangement distance.
[0151] The first display unit is used to arrange the target monomers based on the determined positions and display the arrangement results.
[0152] In some optional implementations, if the geometric figure is a curve, the position determination unit includes:
[0153] The length acquisition subunit is used to acquire the length of a unit line segment in the curve, where the unit line segment is obtained by dividing the curve into preset equal parts.
[0154] The position acquisition unit is used to acquire the position of the center point of the current target monomer in the curve.
[0155] The first position determination subunit is used to determine the position of the center point of the next target monomer in the curve based on the length of the unit line segment, the minimum arrangement distance and the position of the center point of the current target monomer in the curve.
[0156] In some optional implementations, if the geometric figure is a two-dimensional figure, the position determination unit includes:
[0157] A direction acquisition subunit, used for acquiring a first dimension direction and a second dimension direction of the two-dimensional graph;
[0158] The arrangement straight line generating subunit is used to generate a current arrangement straight line with the minimum point of the second dimension as a starting point and the intersection of the first dimension and the two-dimensional figure as an end point.
[0159] The current arrangement position determination subunit is used to determine the arrangement position of the target monomer in the current arrangement straight line based on the minimum arrangement distance.
[0160] The next arrangement straight line determining subunit is used to determine the next arrangement straight line along the second dimension and whose distance from the current arrangement straight line is the minimum arrangement distance.
[0161] The next arrangement position determination subunit is used to determine the arrangement position of the target monomer in the next arrangement straight line based on the minimum arrangement distance.
[0162] In some optional embodiments, the device comprises:
[0163] The adjustment instruction acquisition module is used to acquire the adjustment instruction of the geometric figure, and the adjustment instruction is used to adjust the geometric figure to obtain the adjusted geometric figure.
[0164] The quantity acquisition module is used to obtain the quantity of the target monomers that have been arranged before adjustment.
[0165] The minimum arrangement distance determination module is used to determine the adjusted minimum arrangement distance based on the adjusted geometric figure and the number of arranged target monomers.
[0166] The arrangement display module is used to arrange the target monomers based on the adjusted geometric figures and the adjusted minimum arrangement distance, and determine and display the adjusted arrangement results.
[0167] The arrangement device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and a memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0168] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0169] The embodiment of the present invention also provides a computer device having the above Figure 6 The arrangement shown.
[0170] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 7As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.
[0171] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0172] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0173] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0174] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0175] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means, and FIG. X takes the bus connection as an example.
[0176] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0177] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0178] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A layout method, It is characterized in that The method comprises: Obtaining an arrangement instruction and a minimum arrangement distance of a target monomer, wherein the arrangement instruction is used to generate a geometric figure representing an arrangement style, and the minimum arrangement distance is an arrangement distance of adjacent target monomers along the geometric figure, and the minimum arrangement distance is determined based on a specification description document; Displaying the geometric figure on the interface; The target monomer is arranged based on the minimum arrangement distance and the geometric figure, and an arrangement result is determined and displayed.
2. The method according to claim 1, It is characterized in that Obtaining the minimum arrangement distance includes: Obtaining a minimum distance input instruction, wherein the minimum distance input instruction is used to determine a preset minimum distance; Parsing the specification description document to determine the minimum distance in a preset direction; Based on the minimum distance in the preset direction and the geometric figure, determining a minimum distance along the geometric figure; The minimum arrangement distance is determined based on the size relationship between the preset minimum distance and the minimum distance along the geometric figure.
3. The method according to claim 2, It is characterized in that The determining the minimum arrangement distance based on the size relationship between the preset minimum distance and the minimum distance along the geometric figure includes: If the minimum distance along the geometric figure is greater than the preset minimum distance, determining the preset minimum distance as the minimum arrangement distance; If the minimum distance along the geometric figure is less than the preset minimum distance, the minimum distance along the geometric figure is determined to be the minimum arrangement distance.
4. The method according to claim 1, It is characterized in that If the geometric figure is a line or a two-dimensional figure, arranging the target monomer based on the minimum arrangement distance and the geometric figure, and determining and displaying the arrangement result, includes: Get the center point of the target monomer; Based on the minimum arrangement distance, determining the position of the center point of the adjacent target monomer in the geometric figure; The target monomers are arranged based on the determined positions, and the arrangement results are displayed.
5. The method according to claim 4, It is characterized in that If the geometric figure is a curve, determining the positions of the center points of adjacent target monomers in the geometric figure based on the minimum arrangement distance includes: Obtaining the length of a unit line segment in the curve, where the unit line segment is obtained by dividing the curve into preset equal parts; Get the position of the center point of the current target monomer in the curve; Based on the length of the unit line segment, the minimum arrangement distance, and the position of the center point of the current target monomer in the curve, the position of the center point of the next target monomer in the curve is determined.
6. The method according to claim 4, It is characterized in that If the geometric figure is a two-dimensional figure, determining the positions of the center points of adjacent target monomers in the geometric figure based on the minimum arrangement distance includes: Obtaining a first dimension direction and a second dimension direction of the two-dimensional graph; Taking the minimum point of the second dimension as the starting point and the intersection of the first dimension and the two-dimensional figure as the end point, a current arrangement straight line is generated; Based on the minimum arrangement distance, determining the arrangement position of the target monomer in the current arrangement straight line; The distance along the second dimension from the current arrangement straight line is the minimum arrangement distance, and the next arrangement straight line is determined; Based on the minimum arrangement distance, the arrangement position of the target monomer in the next arrangement straight line is determined.
7. The method according to claim 1, It is characterized in that The method further comprises: Obtaining an adjustment instruction for the geometric figure, wherein the adjustment instruction is used to adjust the geometric figure to obtain an adjusted geometric figure; Get the number of target monomers that have been arranged before adjustment; Based on the adjusted geometric figure and the number of arranged target monomers, determining an adjusted minimum arrangement distance; Based on the adjusted geometric figure and the adjusted minimum arrangement distance, the target monomer is arranged, and the adjusted arrangement result is determined and displayed.
8. An arrangement device, It is characterized in that The device comprises: An arrangement instruction acquisition module, used to acquire an arrangement instruction and a minimum arrangement distance of a target monomer, wherein the arrangement instruction is used to generate a geometric figure representing an arrangement style, and the minimum arrangement distance is an arrangement distance of adjacent target monomers along the geometric figure, and the minimum arrangement distance is determined based on a specification description document; A first display module, used for displaying the geometric figure on an interface; The second display module is used to arrange the target monomer based on the minimum arrangement distance and the geometric figure, and determine and display the arrangement result.
9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the arrangement method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the arrangement method according to any one of claims 1 to 7.
