Gesture-based quick drawing and automatic finishing method for simple house type image
Through gesture drawing and automatic trimming technology, the floor plan drawing process is simplified, the complex operation and inefficiency problems in the existing technology are solved, and the rapid and accurate floor plan drawing is achieved, reducing the difficulty of delivery for installation and maintenance personnel.
Patent Information
- Application Number
- CN202411863156.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-16
- Publication Date
- 2025-03-25
AI Technical Summary
The existing floor plan drawing process is complicated, the operation is not simple, and the drawing efficiency is not high, which makes it more difficult to deliver installation and maintenance personnel.
Through gestures, multiple rooms are drawn one by one in the grid grid matrix pre-constructed in the graphical display interface. The room with the largest area is used as the basis point to automatically adjust the room gap, and automatically trim it based on the path distance of the center point. Finally, a simple floor plan is obtained through gesture sliding and fine adjustment.
It reduces the difficulty and time of drawing floor plans, improves the drawing efficiency, and allows the installation and maintenance personnel to quickly and accurately draw a complete simple floor plan, which is consistent with the actual floor plan.
Smart Images

Figure CN119690318A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer software technology, and in particular to a method for quickly drawing and automatically trimming a simple floor plan based on gestures, a device for quickly drawing and automatically trimming a simple floor plan based on gestures, an electronic device and a storage medium. Background Art
[0002] In the communications-related industry, when installing broadband or installing WiFi terminals throughout the house, installation personnel may fail to install the equipment in the most appropriate location due to differences in experience, which may result in insufficient WiFi signal coverage. If a relatively accurate floor plan can be obtained during the current construction process, combined with a specific algorithm, the system can calculate the equipment installation area with the best coverage range to guide installation personnel.
[0003] The existing floor plan drawing mainly relies on computer-aided design or other online drawing methods. Most of them are concentrated in the application fields of home decoration, construction, fire protection, etc. Although this kind of drawing method has high drawing effect and accuracy, it generally has problems such as relatively complicated process, high entry threshold, and long drawing time, which makes the delivery difficulty of installation and maintenance personnel increase exponentially. Summary of the invention
[0004] The present invention provides a method for quickly drawing and automatically trimming a simple floor plan based on gestures, a device for quickly drawing and automatically trimming a simple floor plan based on gestures, an electronic device and a storage medium, which are used to solve or partially solve the technical problems that the existing floor plan drawing process is relatively complicated, the operation is not simple enough, and the drawing efficiency is not high enough.
[0005] The present invention provides a method for quickly drawing and automatically modifying a simple floor plan based on gestures, the method comprising:
[0006] Use gestures to draw multiple rooms one by one in the pre-built grid matrix of the graphical display interface;
[0007] The room with the largest area is taken as the base room, and the gaps in each room are automatically adjusted based on the cross-direction gaps.
[0008] Based on the center point of the base point room and in combination with the center point path distance calculation, each of the rooms is automatically trimmed;
[0009] According to the gesture sliding, the room whose wall intersects with the base point room is fine-tuned to obtain the final simplified floor plan.
[0010] Optionally, the painting process for each room includes:
[0011] Taking the first touch point in the grid matrix as the origin, calculating the continuous x-axis coordinate data and y-axis coordinate data of the touch point as the gesture slides;
[0012] According to the x-axis coordinate data and the y-axis coordinate data, calculate the x-axis minimum value min(x), the x-axis maximum value max(x), the y-axis minimum value min(y), and the y-axis maximum value max(y);
[0013] A room is drawn in the grid matrix according to the x-axis minimum value min(x), the x-axis maximum value max(x), the y-axis minimum value min(y), and the y-axis maximum value max(y).
[0014] Optionally, the method further comprises:
[0015] In the process of drawing multiple rooms, if the current drawing room overlaps with the historical drawing room, and the cross-overlap matrix has been marked by the historical drawing room, the cross-overlap matrix is directly used as a part of the current drawing room by overwriting marking;
[0016] The current drawing room refers to the room currently being drawn, and the historical drawing room refers to the room drawn before the current drawing room.
[0017] Optionally, the step of taking the room with the largest area as the base room, merging the gaps in the cross direction, and automatically adjusting the room gaps of the rooms includes:
[0018] The room with the largest area is regarded as the base room, and the rooms other than the base room are regarded as common rooms;
[0019] Calculate the gaps between each common room and the base point room in each direction in the four directions of east, south, west and north of the base point room respectively;
[0020] For any single direction of east, south, west, or north centered on the base room:
[0021] Taking the maximum gap calculated in the single direction as the moving distance, all the common rooms in the single direction are translated toward the base point room to connect with the base point room;
[0022] Determine the target common room with the smallest distance difference from the base point room in the cross direction in the single direction; the distance difference in the cross direction represents the distance difference between the length of the same side of the single common room in the single direction and the base point room in the cross direction; the single direction and the cross direction are perpendicular to each other;
[0023] Taking the target common room as a base point for movement in the cross direction, the common rooms other than the target common room in the single direction are translated toward the target common room to merge the gaps in the cross direction, and the gaps between two adjacent common rooms in the single direction are automatically eliminated;
[0024] If the minimum distance difference between the target ordinary room and the base point room in the intersection direction is less than 1 / 10 of the length of the side of the base point room connected to the target ordinary room, the target ordinary room is translated in the direction of shortening the minimum distance difference to align the target ordinary room with the base point room.
[0025] Optionally, the automatically trimming each of the rooms based on the center point of the base point room and in combination with the center point path distance calculation includes:
[0026] Calculate the center point of the base point room;
[0027] For the base point room, a door opening operation is performed on any wall with the longest path from the center point;
[0028] For each common room adjacent to the base point room, a door opening operation is performed on the wall with the shortest path from the center point, and a window opening operation is performed on the wall with the longest path from the center point.
[0029] Optionally, the step of fine-tuning the room whose wall intersects with the base point room according to the gesture sliding to obtain the final simplified floor plan includes:
[0030] Within the range of the base room, the rooms whose walls intersect with the base room are adjusted according to the finger sliding range in the gesture sliding, so as to adjust the wall position of the room with the intersecting walls to coincide with the wall position of the base room, and obtain the final simple floor plan.
[0031] Optionally, the graphic display interface is an H5 page, and the method further includes:
[0032] Draw a grid matrix of a preset size on the H5 page, and set the grid squares in the grid matrix to be dragged, enlarged or reduced according to gestures;
[0033] Default attributes are filled in for each grid square; the default attributes include square ID, edge type and direction identifier; the edge type includes non-edge, wall, door, and window; the direction identifier includes four directions: east, south, west, and north.
[0034] The present invention also provides a gesture-based simple floor plan fast drawing and automatic trimming device, comprising:
[0035] A room drawing module is used to draw multiple rooms one by one in a pre-built grid matrix on a graphical display interface through gestures;
[0036] The room gap adjustment module is used to take the room with the largest area as the base room, merge the gaps in the cross direction, and automatically adjust the room gaps of each room;
[0037] A room automatic trimming module, used to automatically trim each of the rooms based on the center point of the base point room and in combination with the center point path distance calculation;
[0038] The room fine-tuning module is used to fine-tune the room whose wall intersects with the base point room according to gesture sliding to obtain the final simplified floor plan.
[0039] The present invention also provides an electronic device, the device comprising a processor and a memory:
[0040] The memory is used to store program code and transmit the program code to the processor;
[0041] The processor is used to execute the gesture-based simple floor plan quick drawing and automatic trimming method as described in any of the above items according to the instructions in the program code.
[0042] The present invention also provides a computer-readable storage medium, which is used to store program code, and the program code is used to execute the gesture-based simple floor plan rapid drawing and automatic trimming method as described in any of the above items.
[0043] It can be seen from the above technical solutions that the present invention has the following advantages:
[0044] A method for fast drawing and automatic trimming of a simple floor plan based on gestures is provided. First, multiple rooms are drawn one by one in a pre-constructed grid matrix on a graphic display interface through gestures; then, the room with the largest area is used as the base room, and the gaps of each room are automatically adjusted based on the gaps in the cross direction; then, based on the center point of the base room and the center point path distance calculation, each room is automatically trimmed; finally, according to the gesture sliding, the room with the wall intersecting with the base room is fine-tuned to obtain the final simple floor plan. Thus, by providing an efficient and simple solution for fast drawing and automatic trimming of simple floor plans, the difficulty of drawing floor plans is reduced and the drawing efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A flowchart of the steps of a method for fast drawing and automatic trimming of a simple floor plan based on gestures;
[0047] Figure 2 A schematic diagram of an interface for drawing a single room;
[0048] Figure 3 A schematic diagram of an interface for drawing multiple rooms;
[0049] Figure 4 A schematic diagram of an interface for automatically adjusting room gaps in multiple rooms;
[0050] FIG5 (a) is a schematic diagram of an interface for opening doors of multiple rooms;
[0051] FIG5( b ) is a schematic diagram of an interface for performing window opening processing on multiple rooms;
[0052] Figure 6 A schematic diagram of a room interface obtained after drawing;
[0053] Figure 7 The overall process diagram of a method for fast drawing and automatic trimming of a simple floor plan based on gestures is shown;
[0054] Figure 8 The present invention is a structural block diagram of a device for quickly drawing and automatically modifying a simple floor plan based on gestures. DETAILED DESCRIPTION
[0055] The embodiments of the present invention provide a method for quickly drawing and automatically trimming a simple floor plan based on gestures, a device for quickly drawing and automatically trimming a simple floor plan based on gestures, an electronic device and a storage medium, which are used to solve or partially solve the technical problems that the existing floor plan drawing process is relatively complicated, the operation is not simple enough, and the drawing efficiency is not high enough.
[0056] In order to make the purpose, features and advantages of the present invention more obvious and easy to understand, the technical solutions 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 embodiments described below are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] As an example, existing floor plans are mainly drawn with the help of computer-aided design or other online drawing methods. Most of them are concentrated in application fields such as home decoration, construction, and fire protection. Although such drawing methods have high drawing effects and accuracy, they generally have problems such as relatively complex processes, high entry barriers, and long drawing time, which makes the delivery difficulty of installation and maintenance personnel increase exponentially.
[0058] Based on this, the present invention believes that there is an urgent need for an online floor plan drawing solution that is simple to operate, has high drawing efficiency, and can basically present the layout of a house.
[0059] Therefore, one of the core invention points of the embodiment of the present invention is: in order to help installation and maintenance personnel to efficiently and simply draw the user's house floor plan, a method for fast drawing and automatic trimming of a simple floor plan based on gestures is proposed. First, multiple rooms are drawn one by one in the grid square matrix pre-constructed in the graphic display interface through gestures, so that when drawing the floor plan, there is no need to draw walls, but the outline of a single or multiple rooms is drawn according to the trajectory of the finger sliding on the screen and the rectangular area occupied by the screen; then the room with the largest area is taken as the base point room, and the room gaps of each room are automatically adjusted based on the gaps in the cross direction, so that multiple rooms are automatically adjusted according to the base point room, and the room gaps can be automatically eliminated; then based on the center point of the base point room, combined with the center point path distance calculation, each room is automatically trimmed to open doors and windows, so that doors and windows are automatically opened based on the path distance between the base point room and other rooms, and the door and window positions can be automatically calculated according to the layout of the floor plan and presented on the floor plan; finally, according to the gesture sliding, the room with a wall intersecting with the base point room is fine-tuned to obtain the final simple floor plan.
[0060] The technical solution of the present invention reduces the difficulty of drawing house plans and improves the drawing efficiency by providing an efficient and simple solution for rapid drawing and automatic trimming of simple house plans. By adopting the technical solution of the present invention, in actual applications, installation and maintenance personnel can master the drawing of house plans through simple training. Based on gestures and trajectories, combined with the logic of automatic trimming of the house structure, the outlines of common house types such as one bedroom and one living room, two bedrooms and one living room, and three bedrooms and two living rooms can be drawn within 3 minutes, thereby efficiently and accurately drawing a complete simple house plan that roughly matches the actual house type. Compared with existing drawing methods, the technical solution adopted by the present invention can greatly reduce the threshold for use.
[0061] Reference Figure 1 , shows a flowchart of a method for quickly drawing and automatically trimming a simple floor plan based on gestures provided by an embodiment of the present invention, which may specifically include the following steps:
[0062] Step 101, drawing a plurality of rooms one by one in a pre-constructed grid matrix on a graphic display interface through gestures;
[0063] Gesture refers to sliding your finger on a screen with a touch screen function such as a mobile phone or tablet. In a specific implementation, the graphical display interface can be an H5 page. Before drawing a room, you can draw a grid matrix of a preset size (such as 400*400) on the H5 page, and set the grid squares in the grid matrix to be dragged, enlarged or reduced according to the gesture. That is, the grid squares have the ability to be dragged, enlarged and reduced according to the screen gesture.
[0064] At the same time, default attributes can also be filled in for each grid square. Among them, the default attributes include square ID, edge type and direction identifier. Furthermore, edge types can mainly include non-edges, walls, doors, and windows. Direction identifiers can mainly include four directions: east, south, west, and north. For the screen, from the user's perspective, it can also be seen as the four directions of up (north), down (south), left (west), and right (east). In the specific example, the default attributes filled in each grid square are:
[0065] {Square ID, edge type: {0: non-edge 1: wall 2: door 3: window}, direction identifier: east, south, west, north}
[0066] Specifically, the drawing process of each room can be as follows: first, taking the first touch point in the grid matrix through a gesture as the origin, calculate the continuous x-axis coordinate data and y-axis coordinate data of the touch point as the gesture slides; secondly, according to the x-axis coordinate data and the y-axis coordinate data, calculate the x-axis minimum value min(x), x-axis maximum value max(x), y-axis minimum value min(y), and y-axis maximum value max(y) in the coordinates; finally, according to the x-axis minimum value min(x), x-axis maximum value max(x), y-axis minimum value min(y), and y-axis maximum value max(y), draw a room in the grid matrix.
[0067] For example, Figure 2 A schematic diagram of an interface for drawing a single room provided by an embodiment of the present invention is shown.
[0068] Figure 2 It can be regarded as the first step in drawing a simple floor plan, that is, drawing a single room. Figure 2 , when drawing a single room:
[0069] Take the first touch point as the origin and calculate the continuous x and y coordinate data when the touch point slides;
[0070] Calculate the four values of the coordinates: min(x), max(x), min(y), and max(y);
[0071] Draw a rectangular room based on the above four values.
[0072] It is understandable that in actual situations, the drawn room is not necessarily a rectangle, but may just be a square. Since a square is a special case of a rectangle, for ease of description, the drawn rooms are all regarded as rectangular rooms.
[0073] For example, Figure 3 A schematic diagram of an interface for drawing multiple rooms provided by an embodiment of the present invention is shown.
[0074] Figure 3 This can be regarded as the second step of drawing a simple floor plan, that is, drawing multiple rooms. When drawing each room, just refer to the single room drawing method. I will not go into details here.
[0075] Assumption Figure 3 After a quick drawing of Figure 3 The first picture from left to right above), bathroom (corresponding to Figure 3 The second picture from the left above), kitchen (corresponding to Figure 3 The third picture from the left above) and the living room (corresponding to Figure 3The rooms with the largest area are shown below.
[0076] Among them, when drawing multiple rooms, if the intersection of the currently drawn room and other rooms will "invade" these rooms, and the midpoints of the matrix of the overlapping part have been marked by these rooms, you can adopt the direct overwriting marking method to complete the drawing.
[0077] Specifically, during the process of drawing multiple rooms, if the current drawing room overlaps with the historical drawing room, and the overlap matrix has been marked by the historical drawing room, the overlap matrix is directly covered and marked as part of the current drawing room. The current drawing room refers to the room currently being drawn. The historical drawing room refers to the room drawn before the current drawing room.
[0078] Step 102, taking the room with the largest area as the base room, merging the gaps in the cross direction, and automatically adjusting the room gaps of each room;
[0079] In a specific implementation, the room with the largest area is taken as the base room, and the gaps in the cross direction are merged to automatically adjust the gaps between the rooms. The process can be as follows:
[0080] The room with the largest area is regarded as the base room, and the rooms other than the base room are regarded as common rooms;
[0081] Calculate the gaps between each common room and the base point room in each direction in the four directions of east, south, west and north of the base point room;
[0082] For any single direction of the east, south, west, or north (or any single direction of the four directions of up, down, left, or right in a more popular sense) centered on the base room:
[0083] Taking the maximum gap calculated in a single direction as the moving distance, all common rooms in a single direction are translated toward the base point room to connect with the base point room;
[0084] Determine the target common room with the smallest distance difference from the base point room in the cross direction in a single direction; the distance difference in the cross direction indicates the distance difference between the length of the same side of a single common room in a single direction and the base point room in the cross direction; the single direction and the cross direction are perpendicular to each other;
[0085] Taking the target common room as the base point for movement in the cross direction, the common rooms other than the target common room in a single direction are translated toward the target common room to merge the gaps in the cross direction, and the gaps between two adjacent common rooms in a single direction are automatically eliminated;
[0086] If the minimum distance difference between the target ordinary room and the base point room in the intersection direction is less than 1 / 10 of the length of the side of the base point room connected to the target ordinary room, the target ordinary room will be translated in the direction of shortening the minimum distance difference to align the target ordinary room with the base point room.
[0087] In order to enable those skilled in the art to better understand this step, following the above example, Figure 4 A schematic diagram of an interface for automatically adjusting the room gaps between multiple rooms provided by an embodiment of the present invention is shown.
[0088] Figure 4 It can be seen as the third step of drawing a simple floor plan, that is, the process of merging rooms in automatic trimming, and it can also be seen as the process of automatically adjusting the gaps between rooms.
[0089] Combination Figure 3 , take the living room, the largest room, as the base room. Calculate the gaps between other rooms and the living room in four directions: up, down, left, and right. For example Figure 3 , taking the living room as the base room, the bedroom, bathroom and kitchen are just above the living room. Assume that after calculation, the bedroom is 2 away from the living room, the bathroom is 3 away from the living room, and the kitchen is 5 away from the living room. Then the maximum gap between the living room and other rooms in the "upward" direction is 5. Figure 4 In the example, the three rooms (bedroom, bathroom, kitchen) in the "upward" direction are moved downward as a whole to connect with the living room with a maximum gap of 5. To better match the design of a real house, after the three rooms are moved downward as a whole to connect with the living room and embedded, the edges of the bedroom, kitchen and living room that are tangent to each other can be adjusted to be on the same straight line (that is, the bottom edge of the four sides of the bedroom is flush with the bottom edge of the four sides of the kitchen).
[0090] In addition to the base room, other ordinary rooms in a single direction are merged in the cross direction. First, calculate the room with the smallest cross direction distance difference from the base room in a single direction, and use this room as the base point for the cross direction movement. Other rooms in the same direction are moved closer to this room. For example Figure 3 Assuming that the left distance between the bedroom and the living room is 1, and the right distance between the kitchen and the living room is 3, then take the bedroom as the base point for horizontal movement (i.e. the cross direction at this time), and move the bathroom and kitchen to the left to align and eliminate the gap between the rooms.
[0091] Step 103, based on the center point of the base point room and in combination with the center point path distance calculation, automatically trim each of the rooms;
[0092] In a specific implementation, each room is automatically trimmed based on the center point of the base room and combined with the center point path distance calculation, which can be as follows: first calculate the center point of the base room; for the base room, open the door on any wall with the longest path from the center point; for each ordinary room adjacent to the base room, open the door on the wall with the shortest path from the center point, and open the window on the wall with the longest path from the center point.
[0093] Fig. 5 (a) shows a schematic diagram of an interface for opening doors of multiple rooms. Fig. 5 (b) shows a schematic diagram of an interface for opening windows of multiple rooms.
[0094] Figure 5 (a) and Figure 5 (b) can be regarded as the fourth step of drawing a simple floor plan, that is, the process of opening windows and doors in automatic trimming. This process actually automatically opens doors and windows based on the distance between the base room and the wall path of other rooms. Combined with Figure 5 (a) and Figure 5 (b), when opening doors and windows in a room:
[0095] First calculate the center point of the living room;
[0096] For rooms adjacent to the living room (bedroom, bathroom, kitchen), open the door on the shortest path to the center of the living room;
[0097] For rooms adjacent to the living room (bedroom, bathroom, kitchen), windows should be opened on the wall farthest from the center point of the living room.
[0098] In addition, for the living room, the door opening operation can also be performed on any wall with the longest path from the center point, such as on the left side of the longer short side.
[0099] In another case, the door opening operation can also be performed on the wall with the shortest path from the center point. As shown in FIG5(b), the door opening operation is performed on the wall with the opposite long side length between the living room and each room (i.e., the lower side among the four sides of the living room).
[0100] Based on the previous steps, Figure 6 FIG. 1 shows a schematic diagram of a room interface obtained after drawing. Figure 6 It can be seen that after opening the doors and windows, the width of the windows in the bedroom and kitchen is 600mm (millimeters). Since the bathroom has a smaller area, its window width can be set to 300mm for a more realistic house design. The door widths of the bedroom, bathroom, and kitchen are all 390mm. Since the door of the living room is the main door of the entire house, it can be set wider, such as 1280mm.
[0101] It should be noted that Figure 5(b) and Figure 6The relevant dimension values of the doors and windows of the house are only used as an example. For the specific dimension values of the doors and windows of each room, those skilled in the art can reasonably set them according to the actual situation. It is understood that the present invention is not limited to this.
[0102] Step 104, according to the gesture sliding, fine-tune the room whose wall intersects with the base point room to obtain the final simplified floor plan.
[0103] Furthermore, according to the gesture sliding, the rooms where the walls intersect with the base room are fine-tuned to obtain the final simple floor plan. The final simple floor plan can be as follows: within the range of the base room, according to the finger sliding range in the gesture sliding, the rooms where the walls intersect with the base room are adjusted to adjust the wall position of the wall intersection room to coincide with the wall position of the base room, to obtain the final simple floor plan.
[0104] by Figure 6 For example, combined with the previous related drawing process, the edge where the bathroom and the living room meet is used as the reference calibration edge. In fact, the bedroom and kitchen both have walls intersecting with the living room. At this time, you can slide your finger in the living room, place your finger below the bedroom (when adjusting the bedroom) or the kitchen (when adjusting the kitchen), and slide your finger upward. At this time, the wall positions of the bedroom and kitchen will be adjusted according to the finger sliding range, so that they coincide with the wall position of the living room (that is, it is equivalent to manually adjusting the walls of the bedroom and kitchen to align with the walls of the living room), and obtain the final simple floor plan.
[0105] For another example, suppose that after the drawing steps, the bathroom and the living room finally have walls that intersect. At this time, you can slide your finger under the bathroom in the living room and slide it upward. At this time, the bathroom wall position will be adjusted according to the finger sliding range to make it coincide with the living room wall position (that is, it is equivalent to manually adjusting the bathroom wall to align the living room wall), and the final simple floor plan will be obtained.
[0106] In an embodiment of the present invention, a method for fast drawing and automatic trimming of a simple floor plan based on gestures is proposed. First, multiple rooms are drawn one by one in a grid matrix pre-constructed in a graphic display interface through gestures, so that when drawing a floor plan, there is no need to draw walls, but the outlines of a single or multiple rooms are drawn according to the trajectory of the finger sliding on the screen and the rectangular area occupied by the screen; then the room with the largest area is taken as the base point room, and the room gaps of each room are automatically adjusted based on the gaps in the cross direction, so that multiple rooms are automatically adjusted according to the base point room, and the room gaps can be automatically eliminated; then based on the center point of the base point room, combined with the center point path distance calculation, each room is automatically trimmed to open doors and windows, so that doors and windows are automatically opened based on the path distance between the base point room and other rooms, and the positions of doors and windows can be automatically calculated according to the floor plan layout and presented on the floor plan; finally, according to the gesture sliding, the room with a wall intersecting with the base point room is fine-tuned to obtain the final simple floor plan.
[0107] The technical solution of the present invention reduces the difficulty of drawing house plans and improves the drawing efficiency by providing an efficient and simple solution for rapid drawing and automatic trimming of simple house plans. By adopting the technical solution of the present invention, in actual applications, installation and maintenance personnel can master the drawing of house plans through simple training. Based on gestures and trajectories, combined with the logic of automatic trimming of the house structure, the outlines of common house types such as one bedroom and one living room, two bedrooms and one living room, and three bedrooms and two living rooms can be drawn within 3 minutes, thereby efficiently and accurately drawing a complete simple house plan that roughly matches the actual house type. Compared with existing drawing methods, the technical solution adopted by the present invention can greatly reduce the threshold for use.
[0108] For better explanation, refer to Figure 7 , showing a schematic diagram of the overall process of a method for quick drawing and automatic trimming of a simple floor plan based on gestures provided by an embodiment of the present invention. It should be pointed out that this embodiment only briefly describes the general process of quick drawing and automatic trimming of a simple floor plan based on gestures. The specific implementation process of each step can be understood by referring to the relevant content in the aforementioned embodiment, which will not be described here. It can be understood that the present invention does not limit this.
[0109] Step 701: Draw a 400*400 grid matrix on the H5 page, set the grid squares in the grid matrix to be draggable, enlarged or reduced according to gestures, and fill in default attributes for each grid square;
[0110] Step 702: Draw multiple rooms one by one in the grid matrix through gestures;
[0111] Step 703: The room with the largest area is taken as the base room, merged based on the gap in the cross direction, and the room gaps of each room are automatically adjusted;
[0112] Step 704: Based on the center point of the base point room and in combination with the center point path distance calculation, automatically trim the doors and windows of each room;
[0113] Step 705: Within the range of the base room, adjust the rooms whose walls intersect with the base room according to the finger sliding range in the gesture sliding, so as to adjust the wall positions of the rooms whose walls intersect with the base room to coincide with the wall positions of the base room, and obtain the final simplified floor plan.
[0114] Reference Figure 8 , shows a structural block diagram of a device for quickly drawing and automatically modifying a simple floor plan based on gestures provided by an embodiment of the present invention, which may specifically include:
[0115] The room drawing module 801 is used to draw multiple rooms one by one in a grid matrix pre-constructed in the graphic display interface through gestures;
[0116] The room gap adjustment module 802 is used to take the room with the largest area as the base room, merge the gaps in the cross direction, and automatically adjust the room gaps of each room;
[0117] The room automatic trimming module 803 is used to automatically trim each of the rooms based on the center point of the base point room and in combination with the center point path distance calculation;
[0118] The room fine-tuning module 804 is used to fine-tune the room whose wall intersects with the base point room according to the gesture sliding to obtain the final simplified floor plan.
[0119] In an optional embodiment, the room drawing module 801 includes:
[0120] A coordinate data calculation module, used to calculate the continuous x-axis coordinate data and y-axis coordinate data of the touch point when the touch point slides with the gesture, taking the first touch point in the grid matrix as the origin;
[0121] A coordinate maximum point calculation module is used to calculate the x-axis minimum value min(x), the x-axis maximum value max(x), the y-axis minimum value min(y), and the y-axis maximum value max(y) in the coordinates according to the x-axis coordinate data and the y-axis coordinate data;
[0122] The room drawing submodule is used to draw a room in the grid matrix according to the x-axis minimum value min(x), the x-axis maximum value max(x), the y-axis minimum value min(y), and the y-axis maximum value max(y).
[0123] In an optional embodiment, the room drawing module 801 further includes:
[0124] A marking and covering module is used for, in the process of drawing multiple rooms, if the current drawing room overlaps with the historical drawing room, and the overlapping matrix has been marked by the historical drawing room, directly using the covering marking method to take the overlapping matrix as part of the current drawing room;
[0125] The current drawing room refers to the room currently being drawn, and the historical drawing room refers to the room drawn before the current drawing room.
[0126] In an optional embodiment, the room gap adjustment module 802 includes:
[0127] A room definition module, used for taking the room with the largest area as the base room, and taking the rooms other than the base room as common rooms;
[0128] A room gap calculation module, used to calculate the gap between each common room and the base point room in each direction in the four directions of east, south, west and north of the base point room respectively;
[0129] A translation connection module, used to translate all common rooms in the single direction toward the base point room using the maximum gap calculated in the single direction as a moving distance, so as to connect with the base point room;
[0130] a target common room determination module, used to determine a target common room having the smallest distance difference from the base point room in the single direction in the cross direction; the distance difference in the cross direction represents the distance difference between the length of the same side of the single common room in the single direction and the base point room in the cross direction; the single direction and the cross direction are perpendicular to each other;
[0131] A cross direction gap merging module, used to use the target common room as a base point for cross direction movement, and to translate the common rooms other than the target common room in the single direction toward the target common room, so as to merge the cross direction gaps, and automatically eliminate the gaps between two adjacent common rooms in the single direction;
[0132] The base point room alignment module is used to translate the target ordinary room in a direction that shortens the minimum distance difference between the target ordinary room and the base point room in the intersection direction, so as to align the target ordinary room with the base point room, when the minimum distance difference between the target ordinary room and the base point room in the intersection direction is less than 1 / 10 of the length of the side of the base point room connected to the target ordinary room.
[0133] In an optional embodiment, the room automatic trimming module 803 includes:
[0134] A center point calculation module, used to calculate the center point of the base point room;
[0135] A base point room trimming module, for performing a door opening operation on any wall of the base point room that has the longest path from the center point;
[0136] The common room trimming module is used to, for each common room adjacent to the base point room, perform a door opening operation on the wall with the shortest path from the center point, and perform a window opening operation on the wall with the longest path from the center point.
[0137] In an optional embodiment, the room fine-tuning module 804 is specifically used to:
[0138] Within the range of the base room, the rooms whose walls intersect with the base room are adjusted according to the finger sliding range in the gesture sliding, so as to adjust the wall position of the room with the intersecting walls to coincide with the wall position of the base room, and obtain the final simple floor plan.
[0139] In an optional embodiment, the graphic display interface is an H5 page, and the device further includes:
[0140] A grid matrix drawing module, used to draw a grid matrix of a preset size on the H5 page, and set the grid squares in the grid matrix to be dragged, enlarged or reduced according to gestures;
[0141] The default attribute filling module is used to fill default attributes for each grid square; the default attributes include square ID, edge type and direction identification; the edge type includes non-edge, wall, door, window; the direction identification includes four directions: east, south, west and north.
[0142] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the aforementioned method embodiment.
[0143] An embodiment of the present invention further provides an electronic device, the device comprising a processor and a memory:
[0144] The memory is used to store the program code and transmit the program code to the processor;
[0145] The processor is used to execute the gesture-based simple floor plan fast drawing and automatic trimming method of any embodiment of the present invention according to the instructions in the program code.
[0146] An embodiment of the present invention further provides a computer-readable storage medium, which is used to store program code, and the program code is used to execute the gesture-based simple floor plan fast drawing and automatic trimming method of any embodiment of the present invention.
[0147] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0148] In the several embodiments provided by the present invention, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0149] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0150] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0151] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0152] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features thereof may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for quickly drawing and automatically modifying a simple floor plan based on gestures, characterized in that: include: Use gestures to draw multiple rooms one by one in the pre-built grid matrix of the graphical display interface; The room with the largest area is taken as the base room, and the gaps in each room are automatically adjusted based on the cross-direction gaps. Based on the center point of the base point room and in combination with the center point path distance calculation, each of the rooms is automatically trimmed; According to the gesture sliding, the room whose wall intersects with the base point room is fine-tuned to obtain the final simplified floor plan.
2. The method for quickly drawing and automatically modifying a simple floor plan based on gestures according to claim 1, characterized in that: The painting process for each room includes: Taking the first touch point in the grid matrix as the origin, calculating the continuous x-axis coordinate data and y-axis coordinate data of the touch point as the gesture slides; According to the x-axis coordinate data and the y-axis coordinate data, calculate the x-axis minimum value min(x), the x-axis maximum value max(x), the y-axis minimum value min(y), and the y-axis maximum value max(y); A room is drawn in the grid matrix according to the x-axis minimum value min(x), the x-axis maximum value max(x), the y-axis minimum value min(y), and the y-axis maximum value max(y).
3. The method for quickly drawing and automatically modifying a simple floor plan based on gestures according to claim 2, characterized in that: Also includes: In the process of drawing multiple rooms, if the current drawing room overlaps with the historical drawing room, and the cross-overlap matrix has been marked by the historical drawing room, the cross-overlap matrix is directly used as a part of the current drawing room by overwriting marking; The current drawing room refers to the room currently being drawn, and the historical drawing room refers to the room drawn before the current drawing room.
4. The method for quickly drawing and automatically modifying a simple floor plan based on gestures according to claim 1, characterized in that: The room with the largest area is taken as the base room, and the gaps in the cross directions are merged to automatically adjust the gaps in each room, including: The room with the largest area is regarded as the base room, and the rooms other than the base room are regarded as common rooms; Calculate the gaps between each common room and the base point room in each direction in the four directions of east, south, west and north of the base point room respectively; For any single direction of east, south, west, or north centered on the base room: Taking the maximum gap calculated in the single direction as the moving distance, all the common rooms in the single direction are translated toward the base point room to connect with the base point room; Determine the target common room with the smallest distance difference from the base point room in the cross direction in the single direction; the distance difference in the cross direction represents the distance difference between the length of the same side of the single common room in the single direction and the base point room in the cross direction; the single direction and the cross direction are perpendicular to each other; Taking the target common room as a base point for movement in the cross direction, the common rooms other than the target common room in the single direction are translated toward the target common room to merge the gaps in the cross direction, and the gaps between two adjacent common rooms in the single direction are automatically eliminated; If the minimum distance difference between the target ordinary room and the base point room in the intersection direction is less than 1 / 10 of the length of the side of the base point room connected to the target ordinary room, the target ordinary room is translated in the direction of shortening the minimum distance difference to align the target ordinary room with the base point room.
5. The method for quickly drawing and automatically modifying a simple floor plan based on gestures according to claim 4, characterized in that: The automatic trimming of each room based on the center point of the base point room and the center point path distance calculation includes: Calculate the center point of the base point room; For the base point room, a door opening operation is performed on any wall with the longest path from the center point; For each common room adjacent to the base point room, a door opening operation is performed on the wall with the shortest path from the center point, and a window opening operation is performed on the wall with the longest path from the center point.
6. The method for quickly drawing and automatically modifying a simple floor plan based on gestures according to claim 1, characterized in that: According to the gesture sliding, fine-tuning the room whose wall intersects with the base point room to obtain the final simplified floor plan includes: Within the range of the base room, the rooms whose walls intersect with the base room are adjusted according to the finger sliding range in the gesture sliding, so as to adjust the wall position of the room with the intersecting walls to coincide with the wall position of the base room, and obtain the final simple floor plan.
7. The method for quickly drawing and automatically modifying a simple floor plan based on gestures according to any one of claims 1 to 6, characterized in that: The graphic display interface is an H5 page, and the method further includes: Draw a grid matrix of a preset size on the H5 page, and set the grid squares in the grid matrix to be dragged, enlarged or reduced according to gestures; Default attributes are filled in for each grid square; the default attributes include square ID, edge type and direction identifier; the edge type includes non-edge, wall, door, and window; the direction identifier includes four directions: east, south, west, and north.
8. A gesture-based device for rapid drawing and automatic trimming of a simple floor plan, characterized in that: include: A room drawing module is used to draw multiple rooms one by one in a pre-built grid matrix on a graphical display interface through gestures; The room gap adjustment module is used to take the room with the largest area as the base room, merge the gaps in the cross direction, and automatically adjust the room gaps of each room; A room automatic trimming module, used to automatically trim each of the rooms based on the center point of the base point room and in combination with the center point path distance calculation; The room fine-tuning module is used to fine-tune the room whose wall intersects with the base point room according to gesture sliding to obtain the final simplified floor plan.
9. An electronic device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the gesture-based simple floor plan rapid drawing and automatic trimming method described in any one of claims 1-7 according to the instructions in the program code.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store program codes, and the program codes are used to execute the gesture-based simple floor plan rapid drawing and automatic trimming method described in any one of claims 1-7.