Model processing methods, devices, electronic equipment, and storage media
By using a first thread and a second thread to process editing data and rendering data respectively in the model processing, the main thread lag problem caused by model display in the prior art is solved, and a smooth rendering effect is achieved.
Patent Information
- Application Number
- CN202111657081.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-30
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-12-30
AI Technical Summary
In existing technologies, the display of 2D and 3D models is rendered on the current screen by the main thread, which can easily lead to the main thread lag.
By using a first thread to obtain the edit data from the user's editing operations and rendering it based on the initial model data, and a second thread to render it based on the initial and edit data, the data calculation and rendering of different threads can be synchronized, avoiding lag.
During model editing, smooth rendering was achieved, avoiding lag caused by editing operations and improving the user experience.
Smart Images

Figure CN114445537B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a model processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] With the rapid development of urban construction and computer technology, using computers to complete building design has become a common practice, and the design has gradually shifted from two-dimensional architectural drawings to three-dimensional architectural models.
[0003] Currently, to facilitate modeling for developers, 2D and 3D renderings of Building Information Models (BIMs) are often displayed simultaneously. When editing 2D model data, a corresponding 3D model rendering can be displayed in another area of the interface. Similarly, when editing 3D model data, a corresponding 2D model rendering can be displayed in another area of the interface.
[0004] In related technologies, when rendering model data, the display of 2D and 3D models is rendered by the main thread on the current screen, which can easily cause the main thread to lag. Summary of the Invention
[0005] This application provides a model processing method, apparatus, electronic device, and storage medium to solve the problem in the prior art where the display of 2D and 3D models is rendered by the main thread on the current screen when rendering model data, which can easily cause lag in the main thread.
[0006] In a first aspect, embodiments of this application provide a model processing method, including:
[0007] Obtain the initial model data for the model to be edited;
[0008] The first thread is invoked to obtain the user's editing operation on the model to be edited, determine the editing data corresponding to the editing operation, determine the first rendering model data based on the initial model data and the editing data, and render the first rendering model based on the first rendering model data;
[0009] The second thread is invoked to determine the second rendering model data based on the initial model data and the edit data, and then renders the second rendering model based on the second rendering model data.
[0010] Optionally, the step of calling the first thread to determine the edit data corresponding to the edit operation includes:
[0011] The first thread is invoked to determine the target component in the model to be edited by the user based on the editing operation;
[0012] Obtain adjustment data for the target component;
[0013] The edit data is determined based on the adjustment data and the initial component data of the target component.
[0014] Optionally, after the first thread is invoked to determine the edit data corresponding to the edit operation, the method further includes:
[0015] The edited data is stored in a preset data sharing area;
[0016] The process of calling the second thread to determine the second rendering model data based on the initial model data and the edited data includes:
[0017] The second thread is invoked to obtain the edit data from the data sharing area, and the second rendering model data is determined based on the initial model data and the edit data.
[0018] Optionally, the step of calling the second thread to determine the second rendering model data based on the initial model data and the edit data includes:
[0019] The second thread is invoked to update the initial model data based on the edited data to obtain updated model data;
[0020] Determine the rendering dimension corresponding to the second thread, wherein the rendering dimension indicates the dimension presented after the model to be edited is rendered;
[0021] The updated model data is converted into second rendering model data for the rendering dimension.
[0022] Optionally, when the rendering dimension is three-dimensional, converting the updated model data into second rendering model data of the rendering dimension includes:
[0023] Obtain the elevation data of the model to be edited;
[0024] The second rendering model data is determined based on the elevation data and the updated model data.
[0025] Optionally, when the rendering dimension is two-dimensional, converting the updated model data into second rendering model data of the rendering dimension includes:
[0026] Determine the elevation data in the updated model data;
[0027] The data in the updated model data, excluding the elevation data, is determined to be the second rendering model data.
[0028] Optionally, the rendering based on the second rendering model data includes:
[0029] The second rendering model data is rendered in a preset buffer to obtain the rendering result;
[0030] The rendering result is displayed on the screen.
[0031] Secondly, embodiments of this application provide a model processing apparatus, including:
[0032] The acquisition module is used to acquire the initial model data of the model to be edited;
[0033] The first rendering module is used to call the first thread to obtain the user's editing operation on the model to be edited, determine the editing data corresponding to the editing operation, determine the first rendering model data based on the initial model data and the editing data, and render the first rendering model based on the first rendering model data.
[0034] The second rendering module is used to call the second thread to determine the second rendering model data based on the initial model data and the edit data, and to render the second rendering model based on the second rendering model data.
[0035] Thirdly, embodiments of this application provide an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;
[0036] The memory is used to store computer programs;
[0037] The processor is used to execute the program stored in the memory to implement the model processing method described in the first aspect.
[0038] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the model processing method described in the first aspect.
[0039] Compared with the prior art, the technical solution provided in this application has the following advantages: The method provided in this application obtains the initial model data of the model to be edited; calls a first thread to obtain the user's editing operation on the model to be edited, determines the editing data corresponding to the editing operation, determines the first rendering model data based on the initial model data and the editing data, and renders the first rendering model based on the first rendering model data; calls a second thread to determine the second rendering model data based on the initial model data and the editing data, and renders the second rendering model based on the second rendering model data. Thus, when the model to be edited is rendered, different threads calculate the editing data and perform rendering, thereby achieving the effect of simultaneous rendering while calculating the editing data. This ensures that the rendered screen does not lag due to editing when the user performs the editing operation, making the rendered screen smoother. Attached Figure Description
[0040] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, those skilled in the art can obtain other drawings based on these drawings without creative effort.
[0042] Figure 1 This is an application scenario diagram of the model processing method provided in an embodiment of this application;
[0043] Figure 2 A flowchart illustrating a model processing method provided in an embodiment of this application;
[0044] Figure 3 This is a structural diagram of a model processing apparatus provided in an embodiment of this application;
[0045] Figure 4 This is a structural diagram of an electronic device provided in an embodiment of this application. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0047] Before providing a further detailed description of the embodiments of the present invention, the nouns and terms involved in the embodiments of the present invention will be explained, and the nouns and terms involved in the embodiments of the present invention shall be subject to the following interpretations.
[0048] A thread is the smallest unit of computation that an operating system can schedule. It is contained within a process and is the actual unit of operation within that process. A thread refers to a single, sequential flow of control within a process; multiple threads can run concurrently within a process, each executing different tasks in parallel.
[0049] Building Information Modeling (BIM) is a holistic process for creating and managing information about building assets. Based on intelligent models supported by cloud platforms, BIM integrates structured, multi-domain data to generate digital representations of assets throughout their entire lifecycle, from planning and design to construction and operation.
[0050] Offscreen rendering refers to the GPU creating a new buffer outside the current screen buffer to perform rendering operations. In other words, the rendered result is not directly presented on the current screen, but is displayed at an appropriate time.
[0051] Postmessage is a commonly used function in the Windows API (Application Programming Interface) used to put a message into a message queue.
[0052] According to an embodiment of this application, a model processing method is provided. Optionally, in an embodiment of this application, the above-described model processing method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal 101 and server 102. For example... Figure 1 As shown, server 102 is connected to terminal 101 via a network and can be used to provide services (such as video services, application services, etc.) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 102. The network mentioned above includes, but is not limited to, wide area network, metropolitan area network or local area network. Terminal 101 is not limited to PC, mobile phone, tablet computer, etc.
[0053] The model processing method of this application embodiment can be executed by server 102, terminal 101, or jointly by server 102 and terminal 101. The terminal 101 can execute the model processing method of this application embodiment, or it can be executed by a client installed on it.
[0054] Taking the model processing method of this application embodiment executed by the server as an example, Figure 2 This is a flowchart illustrating an optional model processing method according to an embodiment of this application, such as... Figure 2 As shown, the process of this method may include the following steps:
[0055] Step 201: Obtain the initial model data of the model to be edited.
[0056] In some embodiments, the model to be edited can be a building information model that the user has already drawn, or a building information model that the user is currently drawing.
[0057] The initial model data can be the model data corresponding to the model currently being rendered on the server's display end.
[0058] Building information models can include architectural drawings for projects such as airports, train stations, bus stations, office buildings, residential buildings, hospitals, museums, tourist attractions, churches, schools, parks, etc.
[0059] Step 202: Call the first thread to obtain the user's editing operation on the model to be edited, determine the editing data corresponding to the editing operation, determine the first rendering model data based on the initial model data and the editing data, and render the first rendering model based on the first rendering model data.
[0060] In some embodiments, the user's editing operation on the model to be edited may be that the user adds or deletes some components in the model to be edited, or modifies the parameter information of some components in the model to be edited.
[0061] For example, taking the building information model being drawn by the user as the model to be edited, the user can select the component to be drawn from the preset component library during the drawing process, drag the component to the editing area of the model to be edited, and complete the editing operation of the component by translating, rotating and modifying the component parameters.
[0062] In some embodiments, after the user completes the editing operation on the model to be edited on the display interface, the server can call the first thread to determine the editing data corresponding to the editing operation.
[0063] When the server begins processing the model, it initializes the threads on the server, enabling them to load the corresponding processing logic. The number of threads can be set according to actual needs, and during initialization, the corresponding processing logic is loaded for each process. Furthermore, after thread initialization, the first thread loads the initial model data.
[0064] Specifically, the first thread is a pre-configured thread in the server, whose main function is to calculate and edit data.
[0065] During the model editing process, after editing a certain component, there may be other components that are positionally related to it. Therefore, editing the component may affect the component parameters of the components that are positionally related to it. Thus, the editing data determined by the first thread includes not only the editing data of the target component being edited, but also the editing data of the components that are related to the target component.
[0066] In one optional embodiment, the first thread is invoked to determine the edit data corresponding to the edit operation, including:
[0067] The first thread is invoked to determine the target component to be edited in the model by the user based on the editing operation; the adjustment data for the target component is obtained; and the editing data is determined based on the adjustment data and the initial component data of the target component.
[0068] Specifically, users can drag and drop components to be added using the mouse. By moving and rotating the component, they can determine its position within the model to be edited. The first thread can then obtain the corresponding editing data—the component's position and orientation—based on the user's mouse actions. Furthermore, users may adjust the parameters of the component, such as its size or color. The first thread can then determine the corresponding editing data—the edited parameter information—based on these modifications.
[0069] Furthermore, after obtaining the edit data, the first thread will determine the first rendering model data based on the initial model data and the edit data, and then perform rendering based on the first rendering model data to obtain the first rendering model.
[0070] Specifically, after calculating the edit data, the first thread first determines the first rendering model data based on the edit data and the initial model data. Then, based on the first rendering model data, it renders the first rendering model data in the first display area according to the rendering dimension corresponding to the first thread.
[0071] Step 203: Call the second thread to determine the second rendering model data based on the initial model data and the edit data, and render the second rendering model based on the second rendering model data.
[0072] In some embodiments, after the editing data is determined by the first thread, the server calls the second thread to determine the second rendering model data based on the initial model data and the editing data, and then performs rendering based on the second rendering model data.
[0073] In this way, by using different threads to calculate and render the editing data separately, it is possible to achieve the effect of rendering simultaneously while calculating the editing data. This ensures that the rendered screen will not lag when the user is performing editing operations, making the rendered screen smoother.
[0074] In one optional embodiment, invoking a second thread to determine second rendering model data based on initial model data and edit data includes:
[0075] The second thread is invoked to update the initial model data based on the edit data to obtain updated model data; the rendering dimension of the model to be edited is determined, which indicates the dimension that the model to be edited will be rendered in; the updated model data is converted into second rendering model data with the rendering dimension.
[0076] In some embodiments, after the first thread determines the edit data, the second thread obtains the edit data and updates the initial model data based on the edit data to obtain updated model data. Since it is often necessary to display both 2D and 3D effects simultaneously when rendering the model, after obtaining the updated model data, if the updated model data is 2D model data, the rendering dimension of the model to be edited is determined to be 3D; if the updated model data is 3D model data, the rendering dimension of the model to be edited is determined to be 2D.
[0077] Once the rendering dimension of the model to be edited is determined, the updated model data can be converted into second rendering model data, so that the rendering effect of the rendering dimension can be obtained during rendering.
[0078] Furthermore, when the rendering dimension is three-dimensional, the updated model data is converted into second-dimensional rendering model data, including:
[0079] Obtain the elevation data of the model to be edited; determine the second rendering model data based on the elevation data and the updated model data.
[0080] Furthermore, when the rendering dimension is two-dimensional, the updated model data is converted into second-dimensional rendering model data, including:
[0081] Determine the elevation data in the updated model data; determine that the data in the updated model data other than the elevation data is the second rendering model data.
[0082] In some embodiments, the two-dimensional model data has an additional dimension compared to the three-dimensional model data. By defining basic two-dimensional data (including points, lines, surfaces, etc.), and then assigning height information to the two-dimensional points, lines, and surfaces based on the elevation, it is possible to simultaneously draw 3D points, lines, and surfaces. A class of basic extruded body structures is defined based on a surface and an extrusion direction, thus expressing a three-dimensional component structure. More complex shapes are also composed of the above basic data, including more complex excavations, which belong to Boolean operations between two extruded bodies in the construction of the shape, and can perform intersection, union, complement, etc.
[0083] In this way, elevation data is used to convert between two-dimensional and three-dimensional model data.
[0084] In an optional embodiment, after calling the first thread to determine the edit data corresponding to the edit operation, the method further includes:
[0085] Store edited data in a preset data sharing area;
[0086] Furthermore, the second thread is invoked to determine the second rendering model data based on the initial model data and the edited data, including:
[0087] The second thread is invoked to retrieve edit data from the data sharing area, and the second rendering model data is determined based on the initial model data and the edit data.
[0088] In some embodiments, edit data is stored in a data sharing area. After the first thread calculates the edit data, it is stored in the data sharing area, so that the second thread can directly obtain the edit data from the data sharing area when rendering, so as to further render the model.
[0089] In one alternative embodiment, rendering is performed based on the second rendering model data, including:
[0090] The second rendering model data is rendered in a preset buffer; the rendering result is displayed on the screen.
[0091] In some embodiments, off-screen rendering is achieved by rendering the second rendering model data in a preset data cache, thus avoiding visual stuttering for the user. The rendering result of the second rendering model data can be displayed at a preset position on the screen. After updating the initial model data based on editing data, the updated model data is also rendered and displayed at different positions on the screen, thereby achieving the effect of simultaneously displaying two-dimensional and three-dimensional model data.
[0092] In one specific embodiment, taking two-dimensional data as the initial model data as an example, the model processing method of this application specifically includes:
[0093] Step 1: Set up a drawing data sharing area in memory beforehand and create a new buffer (for off-screen rendering). This data sharing area is used to store 2D editing data and 3D editing data.
[0094] In model editing software, there are two windows: one is the editing window, and the other is the display window for the corresponding 2D or 3D model. To prevent editing from lagging, different processes are set for these two windows. The model editing data is calculated and rendered separately through different processes, which can prevent lag.
[0095] The editing window is the window for displaying the updated model data, and the display window is the window for displaying the rendered model data.
[0096] Step 2: If the currently edited data is 2D data, the main thread (i.e. the first thread mentioned above) renders the 2D model based on the 2D edited data and stores the 2D edited data in the data sharing area.
[0097] The editing process can involve the user selecting a component from the component library, dragging the component to the corresponding position in the editing area, and adjusting certain parameters of the component in the corresponding component parameter information editing area.
[0098] 2D editing data includes: selected component driving parameter information and / or mouse operation information. Step 3: The Worker thread (i.e. the second thread mentioned above) obtains 2D editing data from the data sharing area and calculates the 2D editing data to obtain the 3D model data.
[0099] Step 4: The Worker thread renders the 3D model data in a new buffer and displays the rendering result in the corresponding position on the screen.
[0100] The main process displays the rendered model in the editing window, while the worker process displays the rendered model in the display window.
[0101] It should be noted that this embodiment can enable multi-threading on computers with multi-core CPUs to improve processing efficiency. Therefore, before processing the model, it can be determined in advance whether the server has a multi-core CPU.
[0102] Specifically, this invention employs a cloud modeling tool, allowing developers to operate the software for modeling within a browser. The browser can determine if it has a multi-core CPU, and then open a worker using the browser's WebWorker interface. The scene is then rendered in the main thread, and the rendering data in the main thread is shared using the browser's off-screen rendering interface. This avoids the time overhead of copying and transferring data from the main thread to the worker thread.
[0103] In the interaction part, since the worker thread does not manipulate UI (User Interface) related information, to avoid errors caused by multiple threads operating the UI simultaneously, a communication event is needed to pass interaction commands from the main thread to the worker thread. This is done by obtaining the mouse click position and movement distance in the main thread and passing it to the worker (postmessage). Then, the worker calculates the appearance of the model before and after the movement and renders it based on the results. Because this step is performed in the off-screen buffer, it will not cause time-consuming or stuttering rendering in the main thread. This achieves smooth interaction with the 3D model in the worker thread.
[0104] Edit 2D model data in the main thread, and then transfer rendering data to the worker thread for 3D rendering. This avoids 3D rendering from being stuck due to 2D editing in the main thread. Furthermore, by simulating mouse events in the worker thread, the 3D model can be interacted with in the worker thread.
[0105] The main thread and worker threads are triggered by starting the server. The triggering condition is data sharing between the two sides; changing the data on one side will synchronously change the data on the other. Off-screen rendering is essentially data-sharing rendering, which takes place within a virtual screen.
[0106] Since mouse information cannot be obtained in the worker thread, this embodiment transmits the mouse coordinates to the worker thread through event publishing, thereby transferring the editing data to the 3D environment for interaction. The worker itself has a mechanism for sending messages carrying data.
[0107] Based on the same concept, this application provides a model processing device in its embodiments. Specific implementation of this device can be found in the description of the method embodiments section; repeated details will not be repeated. Figure 3 As shown, the device mainly includes:
[0108] The acquisition module 301 is used as the first acquisition module to acquire the initial model data of the model to be edited;
[0109] The first rendering module 302 is used to call the first thread to obtain the user's editing operation on the model to be edited, determine the editing data corresponding to the editing operation, determine the first rendering model data based on the initial model data and the editing data, and render the first rendering model based on the first rendering model data.
[0110] The second rendering module 303 is used to call the second thread to determine the second rendering model data based on the initial model data and the edit data, and to render the second rendering model based on the second rendering model data.
[0111] Based on the same concept, this application also provides an electronic device, such as... Figure 4 As shown, the electronic device mainly includes a processor 401, a memory 402, and a communication bus 403. The processor 401 and the memory 402 communicate with each other via the communication bus 403. The memory 402 stores programs that can be executed by the processor 401. The processor 401 executes the programs stored in the memory 402 to achieve the following steps:
[0112] Obtain the initial model data for the model to be edited;
[0113] The first thread is invoked to obtain the user's editing operation on the model to be edited, determine the editing data corresponding to the editing operation, determine the first rendering model data based on the initial model data and the editing data, and render the first rendering model based on the first rendering model data.
[0114] The second thread is invoked to determine the second rendering model data based on the initial model data and the edit data, and then renders the second rendering model based on the second rendering model data.
[0115] The communication bus 403 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus 403 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0116] The memory 402 may include random access memory (RAM) or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor 401.
[0117] The processor 401 mentioned above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc., or a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0118] In another embodiment of this application, a computer-readable storage medium is provided, which stores a computer program that, when run on a computer, causes the computer to perform the model processing method described in the above embodiments.
[0119] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. This computer program product includes one or more computer instructions. When these computer instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape, etc.), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive), etc.
[0120] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0121] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A model processing method, characterized in that, include: Obtain the initial model data for the model to be edited; The first thread is invoked to obtain the user's editing operation on the model to be edited, determine the editing data corresponding to the editing operation, determine the first rendering model data based on the initial model data and the editing data, and render the first rendering model based on the first rendering model data; The second thread is invoked to determine the second rendering model data based on the initial model data and the edit data, and the second rendering model is obtained by rendering based on the second rendering model data; The step of calling the first thread to determine the edit data corresponding to the edit operation includes: The first thread is invoked to determine the target component in the model to be edited by the user based on the editing operation; Obtain adjustment data for the target component; Based on the adjustment data and the initial component data of the target component, the edit data is determined; The process of calling the second thread to determine the second rendering model data based on the initial model data and the edited data includes: The second thread is invoked to update the initial model data based on the edited data to obtain updated model data; Determine the rendering dimension corresponding to the second thread, wherein the rendering dimension indicates the dimension presented after the model to be edited is rendered; The updated model data is converted into second rendering model data for the rendering dimension; When the rendering dimension is three-dimensional, the step of converting the updated model data into second rendering model data of the rendering dimension includes: Obtain the elevation data of the model to be edited; The second rendering model data is determined based on the elevation data and the updated model data; When the rendering dimension is two-dimensional, the step of converting the updated model data into second rendering model data of the rendering dimension includes: Determine the elevation data in the updated model data; The data in the updated model data, excluding the elevation data, is determined to be the second rendered model data; The rendering based on the second rendering model data includes: The second rendering model data is rendered in a preset buffer to obtain the rendering result; The rendering result is displayed on the screen.
2. The model processing method according to claim 1, characterized in that, After the first thread is invoked to determine the edit data corresponding to the edit operation, the process further includes: The edited data is stored in a preset data sharing area; The process of calling the second thread to determine the second rendering model data based on the initial model data and the edited data includes: The second thread is invoked to obtain the edit data from the data sharing area, and the second rendering model data is determined based on the initial model data and the edit data.
3. A model processing device, characterized in that, include: The acquisition module is used to acquire the initial model data of the model to be edited; The first rendering module is used to call the first thread to obtain the user's editing operation on the model to be edited, determine the editing data corresponding to the editing operation, determine the first rendering model data based on the initial model data and the editing data, and render the first rendering model based on the first rendering model data. The second rendering module is used to call the second thread to determine the second rendering model data based on the initial model data and the edit data, and to render the second rendering model based on the second rendering model data. The step of calling the first thread to determine the edit data corresponding to the edit operation includes: The first thread is invoked to determine the target component in the model to be edited by the user based on the editing operation; Obtain adjustment data for the target component; Based on the adjustment data and the initial component data of the target component, the edit data is determined; The process of calling the second thread to determine the second rendering model data based on the initial model data and the edited data includes: The second thread is invoked to update the initial model data based on the edited data to obtain updated model data; Determine the rendering dimension corresponding to the second thread, wherein the rendering dimension indicates the dimension presented after the model to be edited is rendered; The updated model data is converted into second rendering model data for the rendering dimension; When the rendering dimension is three-dimensional, the step of converting the updated model data into second rendering model data of the rendering dimension includes: Obtain the elevation data of the model to be edited; The second rendering model data is determined based on the elevation data and the updated model data; When the rendering dimension is two-dimensional, the step of converting the updated model data into second rendering model data of the rendering dimension includes: Determine the elevation data in the updated model data; The data in the updated model data, excluding the elevation data, is determined to be the second rendered model data; The rendering based on the second rendering model data includes: The second rendering model data is rendered in a preset buffer to obtain the rendering result; The rendering result is displayed on the screen.
4. An electronic device, characterized in that, include: The processor, communication interface, memory, and communication bus are connected, with the processor, communication interface, and memory communicating with each other via the communication bus. The memory is used to store computer programs; The processor is used to execute the program stored in the memory to implement the model processing method according to any one of claims 1-2.
5. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the model processing method according to any one of claims 1-2.
Citation Information
Patent Citations
To-be-rendered object processing method and device and terminal
CN111459591A