Structure generation method, device, computer equipment and storage medium
Generating structures through the Rhino and Grasshopper platforms solves the problems of high design threshold and low modification efficiency in traditional design models, and realizes low-threshold and efficient structure generation.
Patent Information
- Application Number
- CN202210775876.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-03
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2042-07-03
AI Technical Summary
The traditional design model of interior structures requires mastering both 2D and 3D software, which has a high design threshold and low modification efficiency.
By obtaining the building size data input by the user, the building is generated using Rhino software and Grasshopper platform, lowering the design threshold and improving generation efficiency.
Without having to master Rhino and Grasshopper operations, users can batch input dimensional data to generate structures, significantly improving generation and modification efficiency.
Smart Images

Figure CN115033971B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of architectural interior design, and in particular to a method, apparatus, computer equipment, and storage medium for generating a structure. Background Art
[0002] In the past, when designing interior structures, the traditional design model generally involved first using two-dimensional software (such as Autodesk's CAD software) for 2D drawing, and then using three-dimensional software (such as Google's Sketchup software) for 3D modeling.
[0003] However, the inventors have noticed that the above-mentioned design pattern has some problems in its actual application. Specifically, when applying the above-mentioned design pattern, it is necessary to first use 2D software for drawing and then use 3D software for modeling. It is not easy for the same designer to master the use of both 2D and 3D software. If the operations of 2D drawing and 3D modeling are handled by different designers, it is difficult to achieve coordination between the software and problems are likely to occur. Therefore, the design threshold of the above-mentioned design pattern is relatively high. In addition, if the structure needs to be modified after it is designed, all drawings need to be modified separately. Obviously, the modification efficiency of the above-mentioned modification method is low.
[0004] Therefore, how to lower the design threshold of buildings and improve the modification efficiency of buildings has become an urgent problem to be solved. Summary of the Invention
[0005] In response to the above-mentioned deficiencies or shortcomings, the present application provides a structure generation method, apparatus, computer equipment and storage medium. The embodiments of the present application can lower the design threshold of the structure and improve the drawing efficiency and modification efficiency of the structure.
[0006] According to a first aspect, the present application provides a method for generating a structure. In one embodiment, the method includes:
[0007] Obtain multiple sets of structure size data input by the user in the interactive interface, as well as the structure identifiers associated with each set of structure size data;
[0008] Obtaining the editable program corresponding to each structure identifier from a preset editable program library;
[0009] Based on Rhino software and Grasshopper platform, each editable program is loaded, and the parameter values of the target adjustable parameters of the corresponding editable program are set according to the size data of each group of structures, so as to obtain a new editable program corresponding to each structure identifier;
[0010] The structures corresponding to the structure size data of each group are generated according to the new editable program corresponding to each structure identifier.
[0011] In one embodiment, after generating structures corresponding to each set of structure dimension data according to the new editable program corresponding to each structure identifier, the method further includes:
[0012] In response to the structure export instruction, calculating the modeling area of each structure;
[0013] Export each structure and its shape area into an electronic file in a specified format.
[0014] In one embodiment, after generating structures corresponding to each set of structure dimension data according to the new editable program corresponding to each structure identifier, the method further includes:
[0015] Obtain the Rhino display of each structure in various specific display states. The Rhino display refers to the display of the structure in the Rhino software;
[0016] The Rhino display images of each structure are transmitted to the user terminal, so that the user terminal displays the Rhino display images of each structure on the interactive interface.
[0017] In one embodiment, before obtaining the Rhino display images of each structure in a plurality of specific display states, the method further includes:
[0018] For any structure, a corresponding set of display state control instructions is executed in the Rhino software to switch the display state of the structure in the Rhino software.
[0019] In one embodiment, the method further includes:
[0020] When receiving a display operation instruction for a target structure among the structures, adjusting the display state of the target structure in the Rhino software according to the display operation instruction; the display operation instruction is sent by the user end when it detects in real time that the user is performing a display operation on the target structure; the display state includes a display angle and / or a display size;
[0021] Acquire the Rhino display of the target structure in real time and encode it into a video stream;
[0022] The encoded video stream is transmitted to the user end, so that the user end renders the real-time display state adjustment process of the target structure on the interactive interface according to the video stream.
[0023] In one embodiment, the method further includes:
[0024] Real-time acquisition of new dimension data input by the user for a target structure in each structure in the interactive interface;
[0025] Determine the target editable program corresponding to the target structure;
[0026] The parameter values of the target adjustable parameters of the target editable program are adjusted according to the new size data of the target structure, and a new target structure is generated according to the target editable program after the parameter values are adjusted.
[0027] In one embodiment, after generating a new target structure according to the target editable program after adjusting the parameter value, the method further includes:
[0028] Get the Rhino display of the new target structure in real time;
[0029] The acquired Rhino display image is transmitted to the user terminal, so that the user terminal displays the Rhino display image of the new target structure in real time on the interactive interface.
[0030] In one embodiment, the method further includes:
[0031] Obtain any editable program designed by a developer through the Grasshopper platform as the target detection program to be detected, where the target detection program contains multiple commands;
[0032] Identify the execution order and command type corresponding to each command;
[0033] According to the execution order and command type corresponding to each command, determine whether the execution logic of the target detection program conforms to the preset point, line, surface and body execution logic;
[0034] If the judgment result is no, it is determined that the target detection program has failed the test, and the developer is prompted to adjust the execution logic of the target detection program;
[0035] If the judgment result is yes, it is determined that the target detection program has passed the detection, and the target detection program is stored in a preset editable program library.
[0036] According to a second aspect, the present application provides a structure generation device. In one embodiment, the device includes:
[0037] The first acquisition module is used to acquire multiple sets of structure size data input by the user in the interactive interface, as well as the structure identifier associated with each set of structure size data;
[0038] A second acquisition module is used to acquire the editable program corresponding to each structure identifier from a preset editable program library;
[0039] The program editing module is used to load each editable program based on the Rhino software and Grasshopper platform, and set the parameter values of the target adjustable parameters of the corresponding editable program according to the size data of each group of structures, so as to obtain a new editable program corresponding to each structure identifier;
[0040] The generating module is used to generate structures corresponding to each set of structure size data according to the new editable program corresponding to each structure identifier.
[0041] According to a third aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the above-mentioned method embodiments when executing the computer program.
[0042] According to a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of any of the above-mentioned method embodiments when the computer program is executed by a processor.
[0043] In the above-described embodiment of the present application, the server obtains multiple sets of structure dimension data entered by the user in an interactive interface, as well as the structure identifiers associated with each set of structure dimension data. The server then retrieves the editable program corresponding to each structure identifier from a pre-set editable program library. Each editable program is then loaded based on the Rhino software and Grasshopper platform. The parameter values of the target adjustable parameters of the corresponding editable program are set according to the structure dimension data of each set, thereby obtaining a new editable program corresponding to each structure identifier. Finally, the structure corresponding to each set of structure dimension data is generated based on the new editable program corresponding to each structure identifier. By applying the above-described embodiment, the user does not need to understand the operation of the Rhino software and Grasshopper platform, nor does they need to install the Rhino software and Grasshopper platform in advance on the user's terminal. Instead, the user only needs to enter the dimension information of the structure they want to generate through the user's interactive interface, and the server will generate the corresponding structure for them, thereby lowering the threshold for structure design. Furthermore, since the user can batch-enter multiple sets of structure dimension information, multiple structures can be generated at once, significantly improving the efficiency of structure generation compared to existing technologies. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 is a flow chart of a method for generating a structure in one embodiment;
[0045] Figure 2-1 is a schematic diagram of the shape of a single arch in one embodiment;
[0046] Figure 2-2 A schematic diagram of the shape of a single arch in another embodiment;
[0047] Figure 2-3 is a schematic diagram of the shape of a single arch in another embodiment;
[0048] Figure 3-1A schematic diagram of a combined shape of multiple arches in one embodiment;
[0049] Figure 3-2 A schematic diagram of a combined shape of multiple arches in another embodiment;
[0050] Figure 3-3 A schematic diagram of a combined shape of multiple arches in another embodiment;
[0051] Figure 4-1 This is a schematic diagram of the object that needs to be generated in an example;
[0052] Figure 4-2 A schematic diagram of an editable program in an example displayed in the Grasshopper platform;
[0053] Figure 5 is a structural block diagram of a structure generating device in one embodiment;
[0054] Figure 6 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0055] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0056] The present application provides a method for generating a structure. In one embodiment, the method for generating a structure includes: Figure 1 The steps shown are described below.
[0057] S110: Acquire multiple sets of structure size data input by the user in the interactive interface, and structure identifiers associated with each set of structure size data.
[0058] The structure generation method provided in this embodiment can be applied to a server, where the server and client interact to provide services to the user. The server is installed with server software, Rhino software, and the Grasshopper platform. The user only needs to install client software (which can be a browser) that can interact with the server software to implement the structure generation method. This client software provides an interactive interface for users, allowing them to batch-enter multiple sets of structure dimension data. The client software then sends this data to the server.
[0059] The Grasshopper platform, based on Rhino software, uses visual programming to allow designers to perform design work. It is also one of the mainstream software in the field of architectural design. Through visual programming and preset adjustable parameters, the design process can be transformed from traditional manual drawing to rapid program-generated graphics. By adjusting different parameters, different design results can be obtained. This method is also known as "parametric design." Parametric design differs from traditional design in that designers can creatively combine the commands provided by Grasshopper to generate automated solutions that meet their needs. It can be said that Grasshopper provides the raw materials, and designers process and create these raw materials to form new programs. By adjusting the relevant parameters of the program, solutions can be quickly modified and generated, which greatly facilitates interactive and adjustable designs.
[0060] Furthermore, the service end can be a server, a personal computer, a laptop or other device, and the user end can be various smart mobile devices, such as a smart phone, a tablet, etc., or can also be a personal computer, a laptop or other device.
[0061] S120: Obtaining the editable program corresponding to each structure identifier from a preset editable program library.
[0062] The preset editable program library can be stored in a server or cloud server. The library includes multiple editable programs. Each editable program can be used to generate a type of structure. In order to facilitate identification, a unique structure identifier can be set for each editable program. Furthermore, multiple editable programs can be written for each type as needed. Taking an arch as an example, different shapes of a single arch (such as Figures 2-1 to 2-3 As shown in the figure), you can also write corresponding editable programs for different combinations of multiple arches (such as Figures 3-1 to 3-3 It should be noted that this embodiment does not specifically limit the specific form of the structure. For example, the structure can be an arch structure, a train element structure, or other structures that can be logically sorted out.
[0063] The editable programs in this library can be pre-written on the Grasshopper platform by designers with Rhino and Grasshopper experience. These programs can be packaged, with only a few parameters (called adjustable parameters) reserved for user adjustment. These adjustable parameters can also have default values.
[0064] S130: Loading each editable program based on the Rhino software and the Grasshopper platform, and setting parameter values of target adjustable parameters of the corresponding editable program according to the size data of each group of structures, to obtain a new editable program corresponding to each structure identifier.
[0065] The target adjustable parameters of the editable program refer to the parameters that the user actually wants to adjust, and may be all or part of the adjustable parameters of the editable program.
[0066] The server can automatically set parameter values of target adjustable parameters of the editable program according to the size data of the structure in the Grasshopper platform. The editable program with the set parameter values can be called a new editable program.
[0067] S140: Generate structures corresponding to each set of structure size data according to the new editable program corresponding to each structure identifier.
[0068] The server can automatically run a new editable program corresponding to each structure identifier in the Grasshopper platform to generate a structure corresponding to each set of structure size data.
[0069] Taking a single arch as an example, the developer has pre-designed an editable program for the single arch. The reserved parameters for user adjustment may be the arch's height and width. After obtaining the arch's height and width input by the user, the processing flow may be:
[0070] 1. Based on the user-defined arch height and width, as well as the required distance on both sides of the arch (indicating the required distance on both sides of the arch), the server generates four corresponding points.
[0071] 2. Create a rectangular shape with the four points and draw a circle at the center of the shape. The server will calculate the circle's diameter based on the distance between the arches entered by the user and automatically calculate the circle's size.
[0072] 3. The server automatically moves the circle to the specified position based on the distance between the arch and the top surface preset by the user.
[0073] 4. The server uses a circle to cut the rectangular line to obtain an arch.
[0074] 5. Extrude the arch to obtain a volumetric arch.
[0075] In this embodiment, users do not need to understand how to operate Rhino or the Grasshopper platform, nor do they need to install them on their client. Instead, they simply input the desired structure's dimensions through the client's interactive interface, and the server generates the corresponding structure for them, thus lowering the barrier to entry for structure design. Furthermore, because users can batch-enter multiple sets of structure dimensions, multiple structures can be generated simultaneously, significantly improving the efficiency of structure creation and modification compared to existing technologies.
[0076] Taking an arch as an example, manually drawing each arch using traditional methods would take at least tens of minutes. However, if the method provided in this embodiment is adopted, the user only needs to input parameters such as the length, height, distance from the sides of the columns, distance from the top, and column thickness of the arch in the interactive interface, and the server can automatically generate an arch of corresponding size. The time it takes for the server to generate a single new arch each time generally does not exceed 1 second, which is significantly improved compared to the traditional design process.
[0077] In one embodiment, after generating structures corresponding to each set of structure dimension data according to the new editable program corresponding to each structure identifier, the method further includes:
[0078] Obtain the Rhino display of each structure in various specific display states. The Rhino display refers to the display of the structure in the Rhino software;
[0079] The Rhino display images of each structure are transmitted to the user terminal, so that the user terminal displays the Rhino display images of each structure on the interactive interface.
[0080] In this embodiment, in order to facilitate the user end to see the status of the structure generated by the server end, the server end can transmit the display screen of the structure in the Rhino software (referred to as the Rhino display screen for short) to the user end, and the user end will display the Rhino display screen of each structure it receives on the interactive interface.
[0081] The server can transmit Rhino displays of the structure in various specific display states to the user, allowing the user to better understand the structure's status. A specific display state can refer to a specific display angle of the structure in Rhino. For example, a front view, top view, side view, etc. of the structure can be obtained and transmitted to the user.
[0082] Accordingly, before obtaining the Rhino display images of each structure in multiple specific display states, the method further includes: executing a corresponding set of display state control instructions in the Rhino software for any structure to switch the display state of the structure in the Rhino software.
[0083] In one embodiment, the method further includes:
[0084] When receiving a display operation instruction for a target structure among the structures, adjusting the display state of the target structure in the Rhino software according to the display operation instruction; the display operation instruction is sent by the user end when it detects in real time that the user is performing a display operation on the target structure; the display state includes a display angle and / or a display size;
[0085] Acquire the Rhino display of the target structure in real time and encode it into a video stream;
[0086] The encoded video stream is transmitted to the user end, so that the user end renders the real-time display state adjustment process of the target structure on the interactive interface according to the video stream.
[0087] This embodiment can support users in viewing structures in a more personalized and specific manner. Specifically, users can perform display operations on a target structure (which can be any of the various structures) through the interactive interface. The display operation is used to trigger a display operation instruction, and the user terminal will send the display operation instruction triggered by the user to the server terminal. The display operation instruction may include, but is not limited to, instructions for zooming in, zooming out, and flipping a structure. After receiving the display operation instruction, the server terminal will automatically execute the instruction in the Rhino software, thereby simultaneously obtaining the Rhino display screen of the structure and encoding it into a video stream. The server terminal will transmit the encoded video stream to the user terminal. After receiving the video stream, the user terminal will decode it and then render the screen in the interactive interface based on the decoded video stream data, so that the user can see the real-time display status adjustment process of the target structure.
[0088] In one embodiment, the method further includes:
[0089] Real-time acquisition of new dimension data input by the user for a target structure in each structure in the interactive interface;
[0090] Determine the target editable program corresponding to the target structure;
[0091] The parameter values of the target adjustable parameters of the target editable program are adjusted according to the new size data of the target structure, and a new target structure is generated according to the target editable program after the parameter values are adjusted.
[0092] In this embodiment, the user can adjust the size data of the structure in real time through the user terminal. Specifically, the user only needs to re-enter the new size data of the target structure in the interactive interface, and the user terminal will send the new size data of the target structure entered by the user to the server, so that the server can generate a new target structure based on the new size data of the target structure.
[0093] Accordingly, in one embodiment, after generating a new target construct according to the target editable program after adjusting the parameter value, the method further includes:
[0094] Get the Rhino display of the new target structure in real time;
[0095] The acquired Rhino display image is transmitted to the user terminal, so that the user terminal displays the Rhino display image of the new target structure in real time on the interactive interface.
[0096] In this embodiment, the server side will obtain the Rhino display image of the new target structure in real time and transmit it to the user side, so that the user can timely observe the specific status of the target structure after the size data is adjusted.
[0097] In one embodiment, after generating structures corresponding to each set of structure dimension data according to the new editable program corresponding to each structure identifier, the method further includes:
[0098] In response to the structure export instruction, calculating the modeling area of each structure;
[0099] Export each structure and its shape area into an electronic file in a specified format.
[0100] Furthermore, users can input material costs, and the server will automatically calculate them. These material prices can be directly quoted by manufacturers or obtained by users through online quotations. When designing a structure, users can enter the corresponding material prices on the client interface.
[0101] In this embodiment, once the user confirms that the structure generated by the server meets the requirements, the user can send a structure export instruction to the server through the user terminal. In response to this instruction, the server automatically calculates the shape area and then exports an electronic file containing the shape area and the specific shape. This electronic file can then be delivered to the factory for digital processing. The electronic file can be in DWG format (a proprietary file format used by computer-aided design software AutoCAD and AutoCAD-based software to save design data).
[0102] In the above embodiment, users do not need to draw all the construction drawings one by one in traditional drawing software as in traditional drawing methods. Instead, users can conveniently send the dimensional data of the structure they want to create to the server through the user terminal. The server then generates the corresponding structure based on the received dimensional data and sends a real-time display of the structure to the user terminal for display. The user can observe and modify the relevant dimensional data of the structure in real time until the structure meets the requirements. The user can also instruct the server to export the generated structure as an electronic file containing the modeling area. Subsequently, the electronic file only needs to be handed over to the factory, and the factory can conveniently carry out digital production. In addition, users do not need to have professional design knowledge, which allows users to have a low technical threshold to use the method, thereby greatly reducing the barriers to users' use, increasing the actual utilization rate of the method, and facilitating the popularization of the method. Furthermore, users can operate in real time on their own laptops at the construction site, and the results are displayed in real time. This allows for rapid coordination between the needs of the owner and the construction party on site, achieving improved communication efficiency.
[0103] Furthermore, in one embodiment, the above method further comprises the following steps:
[0104] (1) Obtain any editable program designed by the developer through the Grasshopper platform as the target detection program to be detected, and the target detection program contains multiple commands;
[0105] (2) Identify the execution order and command type corresponding to each command;
[0106] (3) Based on the execution order and command type corresponding to each command, determine whether the execution logic of the target detection program conforms to the preset point, line, surface and body execution logic;
[0107] (4) If the judgment result is no, the target detection program is determined to have failed the test, and the developer is prompted to adjust the execution logic of the target detection program;
[0108] (5) If the judgment result is yes, it is determined that the target detection program has passed the detection, and the target detection program is stored in the preset editable program library.
[0109] The inventors discovered that different commands in the Grasshopper platform utilize different computer resources, such as CPU and memory, when executed. Furthermore, the platform executes commands in series, meaning the next command is executed only after the previous one has completed. Based on these characteristics of the Grasshopper platform, the inventors conducted multiple experiments and found that, because subsequent commands require additional processing based on the previous one, placing memory-intensive commands first can significantly reduce the computer's performance when executing the entire editable program.
[0110] To further optimize computing performance, improve computer operating efficiency, and thereby increase the efficiency of structure generation, this embodiment proposes a Grasshopper-based "point-line-surface-solid" execution logic (i.e., the aforementioned point-line-surface-solid execution logic) and utilizes this execution logic to address the aforementioned technical issues. The aforementioned "point-line-surface-solid" execution logic means that when executing the commands contained in the editable program, the operations and calculations of points, which require less computation, are first completed, followed by the calculations of line operations, and finally the generation of surfaces and corresponding solids. This significantly improves the computer's computing performance, thereby ensuring faster generation of the user's desired structures. For example, an arch structure can be generated in under one second.
[0111] The following explains the above execution logic
[0112] This application pre-verifies the usage of computer resources such as computer memory and computing performance by each command in the Grasshopper platform.
[0113] Taking a single arch as an example, the commands that may be used in the editable program for designing a single arch include:
[0114] Move and copy operator, point enclosure line operator, extract object point, line and surface operator, calculate distance between two points operator, draw circle operator, list data selection operator, extract a point on a line segment operator, addition, subtraction, multiplication and division operator, cover operator, cutting operator, extrusion operator, area calculation operator.
[0115] After executing, the editable program will display the specific calculation time taken by the operator in real time. Based on this, after experimenting, the commands can be divided into three categories according to the time taken: the first category does not display the calculation time or the displayed calculation time is white; the second category is the calculation time taken within 1 second or the displayed calculation time is yellow; the third category is the calculation time taken over 1 second or the displayed calculation time is red. To more significantly optimize performance, operators belonging to the first category can be used at the beginning of the execution logic, operators belonging to the second category can be used in the early and middle parts of the execution logic, and operators belonging to the third category can be used at the end of the execution logic as much as possible. The program will also try to find other operators to replace the operators in order to maximize performance optimization.
[0116] Based on the verification results, we then categorized each command in the Grasshopper platform into the three aforementioned categories. Point module commands generally fall into the first category, line module commands generally fall into the second category, and surface and volume module commands generally fall into the third category.
[0117] Among them, the point module can include commands such as "copy point" and "move related points", and the commands belonging to the point module basically do not occupy memory; the line module can include commands such as "generate line from point", "determine the position distance between the main body of the arch circle and the frame" and "move the circle body to the position set by the user parameters", and the commands belonging to the line module basically do not occupy memory; the surface module can include commands such as "cover and cut the line"; the body module can include commands such as "user-set thickness for the cut surface"; the commands belonging to the surface module and the body module both need to occupy a certain amount of memory and CPU resources when executed. For example, an operation on only one object will take 0.1 seconds.
[0118] In order to more intuitively demonstrate the difference between an editable program that uses the "point-line-surface-body" execution logic and one that does not, this embodiment also provides an example. Figure 4-1 , Figure 4-1 The objects to be generated in this example are shown. Figure 4-2 The figure shows a schematic diagram of an editable program designed using the "point-line-surface-body" execution logic.
[0119] from Figure 4-2It can be seen that when generating the same object, the time taken for the editable program using the "point-line-surface-body" execution logic is only "0.1 second + 1 second + 0.1 second". In other words, using the "point-line-surface-body" execution logic to design editable programs can significantly improve computing performance and increase the speed of generating structures. It can also be understood that as the number of objects that need to be generated increases, the positive effects brought about by using the "point-line-surface-body" execution logic to design editable programs will be further expanded.
[0120] This embodiment optimizes the application methods of various native commands in Grasshopper, and after the developer edits the editable program, checks whether the execution logic of the editable program conforms to the above-mentioned "point-line-surface-solid" execution logic. If the detection fails, the developer is prompted to adjust the execution logic of the editable program to the "point-line-surface-solid" execution logic, thereby ensuring that the computer can execute each editable program stored in the editable program library with higher efficiency, and thus can generate the structures required by the user more quickly.
[0121] Figure 1 FIG. 1 is a flow chart of a method for generating a structure in one embodiment. It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0122] Based on the same inventive concept, the present application also provides a structure generating device. In this embodiment, Figure 5 As shown, the structure generation device includes the following modules:
[0123] The first acquisition module 110 is used to acquire multiple sets of structure size data input by the user in the interactive interface, as well as the structure identifier associated with each set of structure size data;
[0124] The second acquisition module 120 is used to acquire the editable program corresponding to each structure identifier from a preset editable program library;
[0125] The program editing module 130 is used to load each editable program based on the Rhino software and the Grasshopper platform, and set the parameter values of the target adjustable parameters of the corresponding editable program according to the size data of each structure, so as to obtain a new editable program corresponding to each structure identifier;
[0126] The generating module 140 is used to generate structures corresponding to each set of structure dimension data according to the new editable program corresponding to each structure identifier.
[0127] In one embodiment, the apparatus further comprises:
[0128] A calculation module, configured to calculate the shaping area of each structure in response to the structure export instruction;
[0129] The export module is used to export each structure and its modeling area into an electronic file in a specified format.
[0130] In one embodiment, the apparatus further comprises:
[0131] The third acquisition module is used to obtain the Rhino display screen of each structure in multiple specific display states. The Rhino display screen refers to the display screen of the structure in the Rhino software;
[0132] The first transmission module is used to transmit the Rhino display images of each structure to the user terminal, so that the user terminal displays the Rhino display images of each structure on the interactive interface.
[0133] In one embodiment, the apparatus further comprises:
[0134] The display state switching module is used to execute a corresponding set of display state control instructions in the Rhino software for any structure to switch the display state of the structure in the Rhino software.
[0135] In one embodiment, the device further includes a display state real-time adjustment module. The display state real-time adjustment module includes:
[0136] The adjustment submodule is configured to adjust the display state of a target structure in the Rhino software according to the display operation instruction received for the target structure among the structures; the display operation instruction is sent by the user end when the user performs a display operation on the target structure in real time; the display state includes a display angle and / or a display size;
[0137] The acquisition submodule is used to acquire the Rhino display screen of the target structure in real time and encode it into a video stream;
[0138] The transmission submodule is used to transmit the encoded video stream to the user end, so that the user end can render the real-time display state adjustment process of the target structure on the interactive interface according to the video stream.
[0139] In one embodiment, the device further includes a real-time size adjustment module. The real-time size adjustment module includes:
[0140] The size acquisition submodule is used to obtain in real time the new size data input by the user for the target structure in each structure in the interactive interface;
[0141] A determination submodule, used for determining a target editable program corresponding to a target structure;
[0142] The generating submodule is used to adjust the parameter values of the target adjustable parameters of the target editable program according to the new size data of the target structure, and generate a new target structure according to the target editable program after the parameter values are adjusted.
[0143] In one embodiment, the apparatus further comprises:
[0144] The fourth acquisition module is used to acquire the Rhino display image of the new target structure in real time;
[0145] The second transmission module is used to transmit the acquired Rhino display image to the user terminal, so that the user terminal can display the Rhino display image of the new target structure in real time on the interactive interface.
[0146] The specific definitions of the structure generation device can be found in the definitions of the structure generation method above and will not be repeated here. Each module in the structure generation device described above can be implemented in whole or in part through software, hardware, or a combination thereof. Each of these modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a computer device memory in software form, so that the processor can call and execute the corresponding operations of each module.
[0147] In one embodiment, a computer device is provided, whose internal structure diagram can be as follows: Figure 6As shown. The computer device includes a processor, a memory, a network interface and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as editable programs. The specific stored data can also be found in the definitions in the above method embodiments. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for generating a structure is implemented.
[0148] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0149] This embodiment also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of the method provided in any of the above method embodiments are implemented.
[0150] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the method provided in any of the above method embodiments are implemented.
[0151] Those skilled in the art will appreciate that all or part of the processes in the above-described method embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the above-described method embodiments. Any reference to memory, storage, database, or other media used in the embodiments provided herein may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM).
[0152] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0153] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for generating a structure, characterized in that: The method comprises: Obtain multiple sets of structure size data input by the user in the interactive interface, as well as the structure identifiers associated with each set of structure size data; Obtaining the editable program corresponding to each of the structure identifiers from a preset editable program library; Loading each of the editable programs based on Rhino software and Grasshopper platform, and setting parameter values of target adjustable parameters of the corresponding editable programs according to the size data of each group of structures, to obtain new editable programs corresponding to each of the structure identifiers; Generate structures corresponding to each set of structure size data according to a new editable program corresponding to each structure identifier; The method further comprises: Obtain any editable program designed by a developer through the Grasshopper platform as a target detection program to be detected, wherein the target detection program includes multiple commands; Identify the execution order and command type corresponding to each of the commands; According to the execution order and command type corresponding to each of the commands, it is determined whether the execution logic of the target detection program conforms to the preset point-line-surface-solid execution logic; the point-line-surface-solid execution logic means that when each command contained in the editable program is executed, the operations and calculations of points with smaller computational complexity are completed first, then the calculations of line operations are completed, and finally the surfaces and corresponding entities are generated; If the judgment result is no, it is determined that the target detection program has failed the detection, and the developer is prompted to adjust the execution logic of the target detection program; If the judgment result is yes, it is determined that the target detection program passes the detection, and the target detection program is stored in the preset editable program library.
2. The method according to claim 1, wherein After generating the structures corresponding to the structure size data of each set according to the new editable program corresponding to each structure identifier, the method further includes: In response to the structure export instruction, calculating the modeling area of each structure; Export each of the structures and their modeling areas into electronic files in a specified format.
3. The method according to claim 1, wherein After generating the structures corresponding to the structure size data of each set according to the new editable program corresponding to each structure identifier, the method further includes: Obtaining Rhino display images of each of the structures in a plurality of specific display states, wherein the Rhino display images refer to display images of the structures in the Rhino software; The Rhino display images of the structures are transmitted to the user terminal, so that the user terminal displays the Rhino display images of the structures on the interactive interface.
4. The method according to claim 3, wherein Before obtaining the Rhino display images of each of the structures in a plurality of specific display states, the process further includes: For any of the structures, a corresponding set of display state control instructions is executed in the Rhino software to switch the display state of the structure in the Rhino software.
5. The method according to claim 3 or 4, wherein: The method further comprises: When receiving a display operation instruction for a target structure among the structures, adjusting the display state of the target structure in the Rhino software according to the display operation instruction; the display operation instruction is sent by the user end when the user performs a display operation for the target structure in real time; the display state includes a display angle and / or a display size; Acquire the Rhino display image of the target structure in real time and encode it into a video stream; The encoded video stream is transmitted to the user terminal, so that the user terminal renders the real-time display state adjustment process of the target structure on the interactive interface according to the video stream.
6. The method according to claim 1, wherein The method further comprises: Real-time acquisition of new dimension data input by the user for a target structure in each of the structures in the interactive interface; Determining a target editable program corresponding to the target structure; The parameter values of the target adjustable parameters of the target editable program are adjusted according to the new size data of the target structure, and a new target structure is generated according to the target editable program with the adjusted parameter values.
7. The method according to claim 6, wherein After generating a new target structure according to the target editable program after adjusting the parameter value, the method further includes: Acquire a Rhino display image of the new target structure in real time; and transmit the acquired Rhino display image to a user terminal, so that the user terminal displays the Rhino display image of the new target structure on the interactive interface in real time.
8. A structure generating device for implementing the method according to claim 1, characterized in that: The device comprises: The first acquisition module is used to acquire multiple sets of structure size data input by the user in the interactive interface, as well as the structure identifier associated with each set of structure size data; A second acquisition module is used to acquire the editable program corresponding to each of the structure identifiers from a preset editable program library; A program editing module is used to load each of the editable programs based on Rhino software and Grasshopper platform, and set the parameter values of the target adjustable parameters of the corresponding editable programs according to the size data of each group of structures, so as to obtain a new editable program corresponding to each of the structure identifiers; The generating module is used to generate structures corresponding to each set of structure size data according to the new editable program corresponding to each structure identifier.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Digital asset making method and device, computer equipment and storage medium
CN113989423A