Method and electronic device for drawing segmentation used in architectural design
By using hash value and binary search tree technology in architectural design, the problem of slow segmentation speed and deformation of large drawings is solved, efficient and accurate drawing segmentation is achieved, and the segmentation speed and efficiency are improved.
Patent Information
- Application Number
- CN202011441940.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-08
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2040-12-08
AI Technical Summary
In architectural design, existing technology is difficult to efficiently segment large drawings, resulting in slow loading and browsing speeds. In addition, existing software easily causes distortion of drawing effects during the segmentation process and lacks correlation between segmented drawings.
By determining the hash values of multiple space and component elements in the drawing, construct a binary search tree, associate the drawing frame with the space and component elements, and use the binary search tree to segment the drawing to quickly find the frame set to which the component element belongs.
It improves the speed of segmenting large drawings, reduces the scope of the frame to which elements are found, ensures the accuracy and efficiency of the segmentation effect, and avoids drawing deformation.
Smart Images

Figure CN112581476B
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the computer field, and more particularly, to a drawing segmentation method, an electronic device, a computer-readable storage medium, and a computer program product used in architectural design. Background Art
[0002] With the popularity of automatic computer-aided drafting design software, it plays a pivotal role in computer-aided design in various industries with its popular DWG file format, perfect graphics drawing function and powerful graphics editing and processing function. In order to improve the loading and browsing speed of large drawings, it is necessary to divide the drawings into multiple sub-drawings according to the drawing frames. In the process of segmentation, it is necessary to determine the drawing frame for each geometric element, which usually requires traversing all the drawing frames in the drawing. When there are a large number of drawing frames, the process is relatively slow. Therefore, a solution for segmenting drawings is needed. Summary of the invention
[0003] An embodiment of the present disclosure provides a solution for a drawing segmentation method used in architectural design.
[0004] In a first aspect of the present disclosure, a drawing segmentation method used in architectural design is provided, comprising: determining multiple spaces in a drawing based on multiple drawing frames and multiple component elements in the drawing; determining a unique first hash value of each of the multiple spaces and a unique second hash value of each of the multiple component elements; constructing a binary search tree based on the respective first hash values of the multiple spaces, wherein multiple nodes of the binary search tree correspond to the multiple first hash values respectively; determining the associated drawing frame of each space based on the positional relationship between the multiple spaces and the multiple drawing frames; using the binary search tree, based on the first hash value and the second hash value, associating the multiple component elements with the associated drawing frame to update the attribute value of the corresponding node in the binary search tree; storing the updated binary search tree in association with the drawing so as to perform drawing segmentation based on the binary search tree in response to user input. Thus, the drawing can be segmented efficiently.
[0005] In the second aspect of the present disclosure, an electronic device is provided, characterized in that it includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect of the present disclosure.
[0006] In a third aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute the method according to the first aspect of the present disclosure.
[0007] In a fourth aspect of the present disclosure, a computer program product is provided, comprising computer program instructions, wherein when the computer program instructions are executed by a processor, the method according to the first aspect of the present disclosure is implemented.
[0008] This Summary is provided to introduce a selection of concepts in a simplified form that are further described in the Detailed Description below. This Summary is not intended to identify key features or essential features of the disclosure, nor is it intended to limit the scope of the disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] The above and other purposes, features and advantages of the present disclosure will become more apparent by describing the exemplary embodiments of the present disclosure in more detail in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present disclosure. In the accompanying drawings:
[0010] Figure 1 A schematic diagram showing an exemplary environment according to an embodiment of the present disclosure is shown;
[0011] Figure 2 A flowchart showing a process of a drawing segmentation method used in architectural design according to an embodiment of the present disclosure;
[0012] Figure 3 A schematic diagram showing a process for determining a binary search tree of a space according to an embodiment of the present disclosure is shown;
[0013] Figure 4 A flowchart showing a process of determining a component element in a binary search tree according to an embodiment of the present disclosure; and
[0014] Figure 5 A block diagram of an example device that may be used to implement embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0015] The principles of the present disclosure will be described below with reference to several example embodiments shown in the accompanying drawings.
[0016] As used herein, the term "including" and its variations mean open inclusion, i.e., "including but not limited to". Unless otherwise stated, the term "or" means "and / or". The term "based on" means "based at least in part on". The terms "an example embodiment" and "an embodiment" mean "a set of example embodiments". The term "another embodiment" means "a set of additional embodiments". The terms "first", "second", etc. may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0017] As discussed above, it is necessary to split a drawing into multiple sub-drawings to speed up the loading and browsing speed of the drawings.
[0018] Traditionally, there are the following drawing segmentation methods:
[0019] (1) Manually split the design drawings, that is, split the large drawings into multiple small drawings. Since it is a huge workload for designers to manually split the drawings, and the drawings are prone to deformation, this method is costly and ineffective.
[0020] (2) Use design drawing splitting software to split drawings. However, most existing design drawing splitting software can only meet part of the requirements of the design institute. Since the principle of implementation is to explode the blocks, it is easy to cause the effect of the drawing to be deformed and fail to achieve the effect expected by the designer. In addition, there is no connection between the split drawings. If you want to find a component element, you often need to traverse all the component elements in the original drawing.
[0021] In order to at least partially solve some of the above shortcomings, an embodiment of the present disclosure provides a drawing segmentation method used in architectural design. First, multiple spaces in the drawing are determined through multiple drawing frames and multiple component elements in the drawing. Then the hash value of each space and the hash value of each component element are determined. Then, a binary search tree is established based on the hash value of each space. Thereafter, the relationship between the drawing frame and each space is determined. Using the binary search tree, the component elements are associated with the spaces, and then the relationship between the component elements and the drawing frames is established, and the relationship is stored in the binary search tree. Finally, the drawing segmentation can be performed through the binary search tree.
[0022] Based on such a drawing segmentation scheme, by automatically constructing drawing frames and spaces, the frame set around the component elements can be quickly determined, thereby reducing the scope of searching for the frame to which the element belongs, which can effectively improve the segmentation speed on large drawings.
[0023] Figure 1 FIG. 1 is a schematic diagram of an exemplary environment 100 according to an embodiment of the present disclosure, in which the device and / or method according to an embodiment of the present disclosure may be implemented. Figure 1 As shown, various methods according to embodiments of the present disclosure are implemented at a computing device 102 .
[0024] The computing device 102 may be installed with computer-aided drafting design software, for example, software for prefabricated building design. In some embodiments, the software may be an aluminum mold (aluminum mold matching design system. http: / / pkpm-wh.cn / ProductManage / Product / MainProduct). The user may complete the segmentation of multiple drawings 106 on the above software. Drawings 106 may be template drawings, reinforcement drawings, section drawings, accessory drawings, component positioning drawings, large-scale drawings, axial side views, component lists, reinforcement lists, accessory lists, etc., including multiple component elements. Drawings 106 may be one or more formats such as CAD, DWG, DXF, and PDF. In the text, drawings in DWG format are used as examples, but the present disclosure is not intended to be limiting. Drawings may be drawings in any suitable format as required.
[0025] Before segmenting the drawing 106, the computing device 102 may predetermine several drawing frames in the drawing 106 through interaction with the user. There are also several component elements 108 in the drawing 106, which may also be referred to as geometric elements or entity elements. In some embodiments, the component elements 108 may be objects such as lines, circles, fonts, etc. in the drawing 106 in DWG format. The component elements 108 may also be various architectural elements in an architectural drawing.
[0026] In some embodiments, a frame has a unique identification value. A frame may be composed of a plurality of component elements 108 , and the attributes of a corresponding component element 108 must include the identification value of the frame to which it belongs.
[0027] Although only a single drawing 108 and a component element 108 are shown in the figure, it can be understood that a plurality of component elements 108 may exist in one drawing 108, and a plurality of drawings 108 may be divided. The present disclosure is not limited to this.
[0028] It is understood that examples of computing device 102 include, but are not limited to, computers, tablet computers, and smart phones. Interaction with the user includes, but is not limited to, user input including the following items: keyboard input, mouse input, touch input, voice input, gesture input, eye tracking input, digital drawing board input, etc. The present disclosure is not limited to this.
[0029] The computing device 102 can read or traverse the positions of each component element and frame in the drawing 108 to further establish a space. And establish the relationship between the space, the component element and the frame. The computing device 102 can segment the drawing 106 according to the above relationship. The computing device 102 can also further store the above relationship, such as the binary search tree 104, in the database 110 to facilitate the subsequent rapid loading of the component elements in the drawing and segmentation of the drawing according to the user input. The detailed process will be described below.
[0030] In some embodiments, the binary search tree 104 may be saved as a file (eg, XML format) for use in subsequent designs.
[0031] The following will combine Figure 1 The example environment, and Figures 2 to 4 The process of generating a component diagram according to an embodiment of the present disclosure is described in detail with a flowchart or schematic diagram. For ease of understanding, the specific data mentioned in the following description are exemplary and are not intended to limit the scope of protection of the present disclosure. It should be understood that the described method may include additional actions not shown and / or may omit the actions shown, and the scope of the present disclosure is not limited in this respect.
[0032] Figure 2 A flowchart of a process 200 of a drawing segmentation method used in architectural design according to an embodiment of the present disclosure is shown.
[0033] At 210, the computing device 102 determines a plurality of spaces in the drawing 106 based on the plurality of drawing frames and the plurality of component elements 108 in the drawing 106. For example, the computing device 102 first determines a range to be segmented in the drawing, and then further segments the range to be segmented into a plurality of spaces. The plurality of spaces may refer to each space after the drawing 106 is meshed.
[0034] In one example, the computing device 102 may determine the minimum bounding box of the plurality of frames based on the minimum bounding boxes of the plurality of component elements 108 .
[0035] In one embodiment, the computing device 102 reads all the component elements 108 in the DWG drawing, obtains whether the attribute of each component element 108 contains the identification value of the drawing frame, and classifies the component elements 108 containing the drawing frame identification value according to the identification value, thereby obtaining the drawing frame composed of the corresponding component elements 108. The computing device 102 then calculates the bounding box and intersection of each component element 108 in a single drawing frame to obtain the bounding box of each drawing frame. In one example, the bounding box is the minimum rectangle that encloses the component element 108 and the drawing frame, and the length and width of the rectangle are parallel to the X and Y directions of the coordinate axes of the drawing. The computing device 102 can calculate the bounding box of each component element 108.
[0036] The computing device 102 may determine the range to be segmented of the drawing based on the minimum bounding boxes of the multiple drawing frames. For example, the computing device 102 may determine all bounding boxes in the drawing 106 according to the above method, and obtain a union of all bounding boxes on the drawing range, and determine the bounding box of the union to determine the range to be segmented of the drawing 106. The computing device 106 may then determine multiple spaces in the drawing 106 based on the range to be segmented.
[0037] In one embodiment, the computing device 102 may determine the length and width of the to-be-divided range of the drawing 106, and then determine the multiple spaces in the drawing 106 based on the number of the multiple drawing frames and the length and width of the to-be-divided range. For example, the computing device 102 may determine the length and width of each space on the drawing, and then determine the multiple spaces by dividing the horizontal axis X and the vertical axis Y according to the length and width through multiple dividing lines.
[0038] The computing device 102 can determine the length L and width W of the range to be segmented, and can obtain the number N of frames by reading the drawing 106. The computing device 102 can determine the increase in the space segmentation line in each direction. Assuming that the number of grids in the X direction is x and the number of grids in the Y direction is y, x and y can be calculated by the following equations (1) and (2):
[0039]
[0040] x+y=N (2)
[0041] Thus, the computing device 102 may determine a plurality of spaces in the drawing 106. The above formula and space segmentation method are merely exemplary, and the segmentation of the space may also be determined based on other algorithms or models.
[0042] At 220 , computing device 102 determines a unique first hash value for each of the plurality of spaces and a unique second hash value for each of the plurality of component elements 108 .
[0043] After determining the above multiple spaces, the computing device 102 can establish the relationship between the multiple spaces and the multiple component elements 108. The computing device 102 determines the relationship between them through a hash value, where a hash value refers to an output value of a fixed length converted from an input of any length through a hash algorithm.
[0044] For the hash value of the space, the computing device 104 may traverse each space to obtain the distance of each space from the border of the drawing; and determine a unique first hash value for each space based on the distance.
[0045] In one embodiment, the computing device 102 can obtain the bounding box of each divided space, and calculate its hash value based on the sequence value of the space on the X-axis and Y-axis (the sequence value is the row and column of the subspace). The computing device 102 can also use the distance from the geometric center of each space to the origin of the coordinate system of the drawing as input to calculate the hash value. The above hash values are merely exemplary. As long as it is ensured that each space corresponds to only a unique hash value, each space can also be determined by other unique identifiers, and the present disclosure is not limited here.
[0046] For the hash values of component elements 108 , computing device 102 may determine the positions of multiple component elements 108 based on the distance between the center of the minimum bounding box of component element 108 and the border of the drawing, and determine a second hash value of at least one component element based on the positions of component elements 108 .
[0047] In one embodiment, the computing device 102 obtains the bounding box information of each component element 108, and then the computing device 102 can subtract the origin coordinates of the drawing space from the coordinates of the center point of the bounding box, and then obtain the difference in the X and Y directions, and divide the difference in each direction by the length and width of the subspace to obtain the grid number in which the bounding box is located in this direction, that is, the sequence value of the subspace where the element is located, and then use the sequence value as input to determine the hash value of each component element 108.
[0048] At 230, the computing device 102 constructs a binary search tree based on the first hash values of the plurality of spaces. For example, the computing device 102 may use the unique first hash value of the space calculated in 220 as a tree node to construct a binary search tree of the space. For example, if the hash values of the 10 spaces are 1-10, then the single node of the first layer of the binary search tree is the middle value 6, the value of the left node of the second layer is less than 6, and the value of the right node is greater than 6, and so on for the third layer.
[0049] At 240 , the computing device 102 determines the associated drawing frame of each space based on the positional relationship between the multiple spaces and the multiple drawing frames. For example, the computing device 102 may determine one or more drawing frames associated with each space on the paper space.
[0050] In one embodiment, the computing device 102 determines whether each space overlaps with the minimum bounding box of at least one frame, and if so, associates each space with at least one frame. For example, the computing device 102 may determine the bounding box of the frame and the bounding box of the space, i.e., two rectangles, and compare whether there is overlap.
[0051] At 250 , the computing device 102 uses a binary search tree to associate the plurality of component elements 108 with associated frames based on the first hash value and the second hash value to update the property values of corresponding nodes in the binary search tree.
[0052] In one embodiment, the computing device 102 can determine a first hash value that is the same as a second hash value from the binary search tree 104, then associate the component element having the second hash value with the space having the first hash value, then associate the component element with the associated frame of the space and finally update the attribute value of the corresponding node in the binary search tree 104 to reflect the above-mentioned association relationship.
[0053] The computing device 102 can use the second hash value of the component element 108 to quickly determine the first hash value equal to it in the above-mentioned binary search tree 104, thereby associating each component element 108 with the corresponding space. Since each space has its associated frame, the computing device 102 can obtain the association relationship and determine the frame where each component element 108 is located.
[0054] In one embodiment, the computing device 102 stores the determined (component element-space-frame) ternary relationship group in the binary search tree 104, or stores it in association with the binary search tree 104, to facilitate subsequent segmentation and search.
[0055] At 260 , the computing device 102 stores the updated binary search tree 104 in association with the drawing sheet 106 , so as to perform drawing sheet partitioning based on the binary search tree in response to the user input.
[0056] In one embodiment, the computing device 102 may store the binary search tree in association with the drawing 106 in the database 110. When the computing device 102 receives the hash value of the component element 108 input by the user, the computing device 102 may quickly determine the frame where the component element is located, thereby only loading or splitting the component elements required by the user.
[0057] Based on such a drawing segmentation scheme, by automatically constructing drawing frames and spaces, the frame set around the component elements can be quickly determined, thereby reducing the scope of searching for the frame to which the element belongs, which can effectively improve the segmentation speed on large drawings.
[0058] Figure 3A schematic diagram of a process for determining a binary search tree of a space according to an embodiment of the present disclosure is shown. The computing device 102 reads the drawing 106 at 310. The space of the drawing 106 is determined at 320. At 330, the computing device 102 enumerates each space to establish a binary search tree 104 of the space 106. At 340, the computing device 102 associates the frame with the space. At 350, the computing device 102 determines whether all spaces have been enumerated. If not, it returns to 330 and repeats the above steps. Otherwise, the computing device determines that all spaces have been enumerated and all frames and spaces have been associated. For the specific implementation of each step, see Figure 2 , I will not go into details here.
[0059] Figure 4 A flowchart of a process for determining component elements in a binary search tree according to an embodiment of the present disclosure is shown. The computing device 102 reads the drawing 108 at 410. The component elements 108 are enumerated at 420 to determine the hash value of the component elements 108. At 430, the computing device 102 enumerates each space to determine the space associated with the component element 108 in the binary search tree 104. At 440, the computing device 102 determines the frame to which the component element 108 belongs. At 450, the computing device 102 determines whether all component elements 108 have been enumerated. If not, it returns to 420 and repeats the above steps. Otherwise, the computing device determines that all component elements have been enumerated and all frames and component elements have been associated. For the specific implementation of each step, see Figure 2 , I will not go into details here.
[0060] Figure 5 1 is a schematic block diagram of an example electronic device 500 that can be used to implement an embodiment of the present disclosure. For example, the electronic device 500 can be used to implement Figure 1 500 is a computer system 102. As shown in the figure, the device 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 502 or loaded from a storage unit 508 to a random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the device 500 can also be stored. The CPU 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0061] A number of components in the device 500 are connected to the I / O interface 505, including: an input unit 506, such as a keyboard, a mouse, etc.; an output unit 507, such as various types of displays, speakers, etc.; a storage unit 508, such as a disk, an optical disk, etc.; and a communication unit 509, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 509 allows the device 500 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0062] The processing unit 501 performs the various methods and processes described above, such as the process 200. For example, in some embodiments, the process 200 may be implemented as a computer software program or a computer program product, which is tangibly contained in a machine-readable medium, such as a storage unit 508. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 500 via the ROM 502 and / or the communication unit 509. When the computer program is loaded into the RAM 503 and executed by the CPU 501, one or more steps in the process 200 described above may be performed. Alternatively, in other embodiments, the CPU 501 may be configured to perform the process 200 in any other suitable manner (e.g., by means of firmware).
[0063] The present disclosure may be a method, an apparatus, a system and / or a computer program product. The computer program product may include a computer-readable storage medium on which are loaded computer-readable program instructions for executing various aspects of the present disclosure. In some embodiments, the method described in the present disclosure may be used in prefabricated building design. In some embodiments, the method described in the present disclosure may be implemented in an aluminum mold matching design system (aluminum mold).
[0064] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, any non-temporary storage device, or any suitable combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the above. The computer-readable storage medium used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.
[0065] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0066] The computer program instructions for performing the operation of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be customized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the present disclosure.
[0067] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to the embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0068] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0069] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0070] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0071] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A drawing segmentation method used in architectural design, the method comprising: Determine a plurality of spaces in the drawing based on a plurality of drawing frames and a plurality of component elements in the drawing; Determining a unique first hash value for each of the plurality of spaces and a unique second hash value for each of the plurality of component elements; Based on the first hash values of the multiple spaces, respectively, a binary search tree is constructed, wherein the multiple nodes of the binary search tree respectively correspond to the multiple first hash values; Determining an associated frame of each space based on a positional relationship between the plurality of spaces and the plurality of frames; Using the binary search tree, based on the first hash value and the second hash value, a plurality of component elements are associated with the association frame to update the attribute values of corresponding nodes in the binary search tree, including: determining from the binary search tree the first hash value that is identical to the second hash value; associating the component element having the second hash value with the space having the first hash value; Associating the component element with an associated frame of the space; and Updating the attribute values of the corresponding nodes in the binary search tree to reflect the above association relationship; The updated binary search tree is associated with the drawing and stored so as to perform drawing segmentation based on the binary search tree in response to user input.
2. The method according to claim 1, wherein determining a plurality of spaces in the drawing based on a plurality of drawing frames and a plurality of component elements in the drawing comprises: Determining the minimum bounding box of the plurality of drawing frames based on the minimum bounding boxes of the plurality of component elements; Determining a range of the drawing to be segmented based on the smallest bounding box of the multiple drawing frames; as well as Based on the range to be divided, the multiple spaces in the drawing are determined.
3. The method according to claim 2, wherein determining the plurality of spaces in the drawing based on the range to be segmented comprises: Determine the length and width of the to-be-divided range of the drawing; as well as The multiple spaces in the drawing are determined based on the number of the multiple drawing frames and the length and width of the range to be divided.
4. The method of claim 1 , wherein determining a unique first hash value for each of the plurality of spaces comprises: Traversing each of the spaces to obtain the distance between each of the spaces and the border of the drawing; as well as Based on the distance, a unique first hash value is determined for each of the spaces.
5. The method of claim 1, wherein the unique second hash value of each component element in the plurality of component elements comprises: Determining the positions of the plurality of component elements based on the distance between the center of the minimum bounding box of the component element and the border of the drawing; as well as Based on the positions of the component elements, a second hash value of at least one component element is determined.
6. The method according to claim 1, wherein determining the associated frame of each space based on the positional relationship between the plurality of spaces and the plurality of frames comprises: If it is determined that each of the spaces overlaps with the minimum bounding box of at least one frame, each of the spaces is associated with the at least one frame. The method according to claim 1 , wherein the component element is at least one of a geometric element and a text element. The method according to claim 1 , wherein the drawing is in DWG format.
9. An electronic device, characterized in that include: at least one processor; as well as a memory communicatively connected to the at least one processor; 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 perform the method according to any one of claims 1 to 8.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 8.
11. A computer program product comprising computer program instructions, characterized in that When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
METHOD, APPARATUS, AND COMPUTER PROGRAM PRODUCT FOR MANAGING Hash TABLES
CN110109915A
Sub-graph extraction method and device of electronic engineering drawing, storage medium and terminal
CN111460204A
Determination method and device for relevance between drawings, storage medium and terminal
CN111460556A
Drawing review result display method and related equipment
CN111783392A
System, method and computer program product for electronic document display
US20180082448A1
