Disclosure of Invention
In view of this, embodiments of the present application provide a model construction method and system, a computing device, and a storage medium, so as to solve technical defects existing in the prior art.
The embodiment of the application discloses a model construction method, which comprises the following steps:
determining the number of fragment points and the positions of the fragment points of a model to be constructed, and obtaining a construction connection diagram of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed;
cutting the model to be constructed according to the construction communicating graph to obtain fragments of the model to be constructed;
determining the binding force among fragments, and obtaining a weighted communication diagram of the model to be constructed according to the construction communication diagram and the binding force among the fragments;
and splicing the fragments of the model to be constructed according to the authorized connected graph to generate a target model.
Optionally, the determining the number of the fragment points and the position of the fragment point of the model to be constructed, and obtaining the construction connectivity graph of the model to be constructed according to the number of the fragment points and the position of the fragment point of the model to be constructed includes:
acquiring the body type proportion information of a model to be constructed, and determining the number of fragment points and the positions of the fragment points of the model to be constructed according to the body type proportion information of the model to be constructed;
and obtaining an initial communicating graph of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed, and taking the initial communicating graph as the construction communicating graph of the model to be constructed.
Optionally, the determining the number of fragment points and the position of the fragment point of the model to be constructed, and obtaining the construction connectivity graph of the model to be constructed according to the number of fragment points and the position of the fragment point of the model to be constructed, includes:
obtaining body type proportion information and an offset random number of a model to be constructed;
determining the number of fragment points and the positions of the fragment points of the model to be constructed according to the body type proportion information of the model to be constructed; obtaining an initial connection diagram of the model to be constructed according to the number of fragment points and the positions of the fragment points of the model to be constructed;
and obtaining a construction connected graph of the model to be constructed according to the offset random number and the initial connected graph.
Optionally, the method further comprises: determining an anchor point of a model to be constructed according to the connection relation between the model to be constructed and other construction models in a 3D scene;
the obtaining of the initial connection diagram of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed comprises the following steps:
and obtaining an initial connection diagram of the model to be constructed according to the number of the fragment points of the model to be constructed, the positions of the fragment points and the anchor points.
Optionally, the determining the bonding force between the fragments, and obtaining the authorized communication map of the model to be constructed according to the bonding force between the construction communication map and the fragments includes:
determining the binding force between the fragments according to the area of the connection surface of the fragments;
determining a bonding weight between the fragments according to the bonding force,
and obtaining the weighted connected graph of the model to be constructed according to the bonding weight between the constructed connected graph and the fragments.
Optionally, the cutting the model to be constructed according to the construction connectivity graph includes:
and based on the Thiessen polygon algorithm, cutting the model to be constructed according to the construction connected graph.
In another aspect, the present application further discloses a model construction system, including:
the first generation module is configured to determine the number of fragment points and the positions of the fragment points of the model to be constructed, and obtain a construction connection diagram of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed;
the cutting module is configured to cut the model to be constructed according to the construction communication diagram to obtain fragments of the model to be constructed;
the second generation module is configured to determine the adhesive force between the fragments, and obtain a weighted communication graph of the model to be constructed according to the constructed communication graph and the adhesive force between the fragments;
and the third generation module is configured to splice the fragments of the model to be constructed according to the weighted connected graph to generate a target model.
Optionally, the first generating module includes:
the first acquisition submodule is configured to acquire body type proportion information of a model to be constructed, and the number of fragment points and the position of the fragment points of the model to be constructed are determined according to the body type proportion information of the model to be constructed;
and the first generation submodule is configured to obtain an initial connection diagram of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed, and the initial connection diagram is used as a construction connection diagram of the model to be constructed.
Optionally, the first generating module includes:
the second acquisition submodule is configured to acquire body type proportion information and an offset random number of the model to be constructed;
the second generation submodule is configured to determine the number of fragment points and the positions of the fragment points of the model to be constructed according to the body type proportion information of the model to be constructed; obtaining an initial connection diagram of the model to be constructed according to the number of fragment points and the positions of the fragment points of the model to be constructed;
and the third generation submodule is configured to obtain a construction connected graph of the model to be constructed according to the offset random number and the initial connected graph.
Optionally, the method further comprises: the determination module is configured to determine an anchor point of the model to be constructed according to the connection relation between the model to be constructed and other construction models in the 3D scene;
the obtaining of the initial connection diagram of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed comprises the following steps:
and obtaining an initial connection diagram of the model to be constructed according to the number of the fragment points of the model to be constructed, the positions of the fragment points and the anchor points.
Optionally, the second generating module includes:
a first determination submodule configured to determine an adhesive force between the fragments according to an area of a joint face of the fragments;
a second determination submodule configured to determine a bonding weight between the fragments according to the bonding force,
and the fourth generation submodule is configured to obtain a weighted connected graph of the model to be constructed according to the adhesion weight between the construction connected graph and the fragment.
Optionally, the cutting module is further configured to cut the model to be constructed according to the construction connectivity graph based on a thieson polygon algorithm.
In another aspect, the present application also discloses a computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the model construction method when executing the instructions.
In another aspect, the present application also discloses a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the model construction method.
The application provides a model construction method and system, computing device and storage medium, through the target model that waits to construct the model correspondence in the area right communicating graph generation 3D scene, target model can confirm according to the area right communicating graph the target model mode of rupture to can need not the fine arts personnel and make a large amount of art resources, can make target model, and then can save target model's preparation time.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is capable of implementation in many different ways than those herein set forth and of similar import by those skilled in the art without departing from the spirit of this application and is therefore not limited to the specific implementations disclosed below.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can be termed a second and, similarly, a second can be termed a first without departing from the scope of one or more embodiments of the present description. The word "if," as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination," depending on the context.
In the present application, a model construction method and system, a computing device, and a storage medium are provided, which are described in detail one by one in the following embodiments.
Fig. 1 is a block diagram illustrating a configuration of a computing device 100 according to an embodiment of the present specification. The components of the computing device 100 include, but are not limited to, a memory 110 and a processor 120. The processor 120 is coupled to the memory 110 via a bus 130 and a database 150 is used to store data.
Computing device 100 also includes access device 140, access device 140 enabling computing device 100 to communicate via one or more networks 160. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. Access device 140 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present description, the above-described components of computing device 100 and other components not shown in FIG. 1 may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 1 is for purposes of example only and is not limiting as to the scope of the description. Those skilled in the art may add or replace other components as desired.
Computing device 100 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), a mobile phone (e.g., smartphone), a wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 100 may also be a mobile or stationary server.
Wherein the processor 120 may perform the steps of the method shown in fig. 2. Fig. 2 shows a schematic flow chart of a model construction method according to an embodiment of the present application, comprising step 202 to step 208.
Step 202: determining the number of fragment points and the positions of the fragment points of the model to be constructed, and obtaining a construction communicating graph of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed.
Step 204: and cutting the model to be constructed according to the construction communicating graph to obtain fragments of the model to be constructed.
Step 206: and determining the binding force among fragments, and obtaining the authorized communication diagram of the model to be constructed according to the constructed communication diagram and the binding force among the fragments.
Step 208: and splicing fragments of the model to be constructed according to the authorized connected graph to generate a target model.
The target model corresponding to the model to be constructed in the 3D scene is generated through the authorized communicating graph, the target model can be determined according to the authorized communicating graph in the rupture process of the target model, so that a large amount of art resources can be manufactured without art workers, the target model can be manufactured, and the manufacturing time of the target model can be saved.
On the other hand, the present application also proposes a model construction method, and referring to fig. 3, fig. 3 shows a schematic flowchart of a model construction method according to an embodiment of the present application, including steps 302 to 310:
step 302: obtaining the body type proportion information of the model to be constructed, and determining the number of fragment points and the position of the fragment points of the model to be constructed according to the body type proportion information of the model to be constructed.
Step 304: and obtaining an initial communicating graph of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed, and taking the initial communicating graph as the construction communicating graph of the model to be constructed.
Referring to fig. 4, fig. 4 shows an initial connection diagram according to an embodiment of the present application, which determines that the number of fragment points of a building model to be constructed is sixteen and the positions of the fragment points according to body type proportion information of the building model to be constructed, so as to obtain an initial connection diagram of the building model to be constructed, where the initial connection diagram of the building model to be constructed includes the number of connection points, the positions of the connection points, and connection relationships between the connection points in the initial connection diagram, and takes the initial connection diagram of the building model to be constructed as a construction connection diagram.
Step 306: and cutting the model to be constructed according to the construction communicating graph to obtain fragments of the model to be constructed.
Referring to fig. 5, fig. 5 is a schematic structural diagram illustrating a fracture mode of a to-be-constructed model determined according to an initial connectivity graph, according to an embodiment of the present application, the to-be-constructed building model can be segmented according to the construction connectivity graph of the to-be-constructed building model by using a corresponding spatial segmentation algorithm, so as to generate sixteen fragments with flush joint faces.
According to the method, the initial communicating graph is used as the construction communicating graph of the model to be constructed, and the fragment generation speed can be improved by cutting the model to be constructed.
Step 308: and determining the binding force among fragments, and obtaining the authorized communication diagram of the model to be constructed according to the constructed communication diagram and the binding force among the fragments.
Step 310: and splicing the fragments of the model to be constructed according to the authorized connected graph to generate a target model.
Referring to fig. 6, fig. 6 is a schematic diagram illustrating a construction state of a target model according to an embodiment of the present application, and in the case of determining a weighted connectivity map, sixteen fragments are spliced according to the weighted connectivity map of a building model to be constructed, wherein the position of each fragment point corresponds to a connection point of the weighted connectivity map.
The fragments can be spliced according to the authorized connected graph to generate a target model which can be broken, and the operation is simple. When the target model is cracked, the target model can be cracked according to the adhesive force among fragments and the stress condition of the target model.
In another aspect, the present application further provides a model construction method, and fig. 7 shows a schematic flowchart of the model construction method according to an embodiment of the present application, including steps 702 to 712:
step 702: and obtaining body type proportion information and an offset random number of the model to be constructed.
Step 704: determining the number of fragment points and the positions of the fragment points of the model to be constructed according to the body type proportion information of the model to be constructed; and obtaining an initial communicating graph of the model to be constructed according to the number of the fragment points of the model to be constructed and the positions of the fragment points.
Step 706: and obtaining a construction connected graph of the model to be constructed according to the offset random number and the initial connected graph.
Referring to fig. 8, fig. 8 shows a configuration connectivity graph according to an embodiment of the present application, where the positions of the connection points in the configuration connectivity graph obtained according to the offset random number are more prone to fracture of the building model to be constructed than the positions of the connection points in the initial connectivity graph.
Step 708: and cutting the model to be constructed according to the construction communicating graph to obtain fragments of the model to be constructed.
Referring to fig. 9, fig. 9 is a schematic structural diagram illustrating a fracture mode of a model to be constructed determined according to an initial connectivity graph according to an embodiment of the present application,
and cutting the building model to be constructed according to the structure communicating graph obtained by the offset random number to obtain sixteen fragments, wherein the connecting surfaces of the fragments are uneven, so that the fragments are more in accordance with the characteristic of fragmentation.
Step 710: and determining the binding force among fragments, and obtaining the authorized communication diagram of the model to be constructed according to the constructed communication diagram and the binding force among the fragments.
Step 712: and splicing fragments of the model to be constructed according to the authorized connected graph to generate a target model.
Referring to fig. 10, fig. 10 is a schematic diagram illustrating a construction state of a target model according to an embodiment of the present application, and in the case of determining a weighted connectivity map, sixteen fragments are spliced according to the weighted connectivity map of a building model to be constructed, wherein the position of each fragment point corresponds to a connection point of the weighted connectivity map.
Optionally, the method further comprises: determining an anchor point of a model to be constructed according to the connection relation between the model to be constructed and other construction models in a 3D scene;
the obtaining of the initial connection diagram of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed comprises the following steps:
and obtaining an initial communication diagram of the model to be constructed according to the number of the fragment points, the positions of the fragment points and the anchor points of the model to be constructed.
By determining anchor points in the initial connectivity graph, the generated target model can be fixed with other construction models in the 3D scene. For example, the wall lamp is fixed with the wall through anchor points, the bridge is fixed with the ground through a plurality of anchor points (piers), and each anchor point has the adsorption and aggregation effect on fragments within a certain range.
Optionally, the determining the bonding force between the fragments, and obtaining the authorized communication map of the model to be constructed according to the bonding force between the construction communication map and the fragments includes:
determining the binding force among the fragments according to the areas of the joint surfaces of the fragments;
determining a bonding weight between the fragments according to the bonding force,
and obtaining the weighted connected graph of the model to be constructed according to the bonding weight between the constructed connected graph and the fragments.
In one embodiment, the larger the surface area of the connection surface of the fragments, the greater the binding force between the fragments. The bonding force between the fragments is marked through the bonding weight, splicing of the fragments can be facilitated, and therefore the target model can be broken more vividly in the process of breaking the target model.
Optionally, the cutting the model to be constructed according to the construction connectivity graph includes:
and cutting the model to be constructed according to the construction connected graph based on a Thiessen polygon (Voronoi) algorithm.
The Thiessen polygon algorithm divides the space by selecting a proper data structure, a motion point replacement rule and an iteration method, and compresses a point set mark in a block area, so that a plane or an n-dimensional space is divided into blocks with periodicity or quasi-periodicity.
On the other hand, the present application also discloses a model construction system 1100, and referring to fig. 11, fig. 11 is a schematic structural diagram illustrating the model construction system 1100 according to an embodiment of the present application, including:
the first generation module 1102 is configured to determine the number of the fragment points and the positions of the fragment points of the model to be constructed, and obtain a construction connection diagram of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed;
a cutting module 1104 configured to cut the model to be constructed according to the construction connectivity graph to obtain fragments of the model to be constructed;
a second generation module 1106 configured to determine binding forces between fragments, and obtain a weighted connectivity graph of the model to be constructed according to the configuration connectivity graph and the binding forces between the fragments;
a third generating module 1108 configured to splice the fragments of the model to be constructed according to the weighted connectivity graph to generate a target model.
The model construction system generates the target model corresponding to the model to be constructed in the 3D scene through the authorized communicating graph, and the target model can determine the rupture mode of the target model according to the authorized communicating graph in the rupture process, so that the target model can be manufactured without manufacturing a large amount of art resources by art workers, and the manufacturing time of the target model can be saved.
Optionally, the first generating module includes:
the first acquisition submodule is configured to acquire body type proportion information of a model to be constructed, and the number of fragment points and the position of the fragment points of the model to be constructed are determined according to the body type proportion information of the model to be constructed;
and the first generation submodule is configured to obtain an initial connection diagram of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed, and the initial connection diagram is used as a construction connection diagram of the model to be constructed.
The first generation submodule takes the initial communicating graph as a construction communicating graph of the model to be constructed and obtains a weighted communicating graph of the model to be constructed, and the generation speed of the weighted communicating graph can be improved. The cutting module 1104 can improve the fragment generation speed by cutting the model to be constructed according to the initial communication diagram as the construction communication diagram of the model to be constructed.
Optionally, the first generating module includes:
the second acquisition submodule is configured to acquire body type proportion information and an offset random number of the model to be constructed;
the second generation submodule is configured to determine the number of fragment points and the positions of the fragment points of the model to be constructed according to the body type proportion information of the model to be constructed; obtaining an initial connection diagram of the model to be constructed according to the number of fragment points and the positions of the fragment points of the model to be constructed;
and the third generation submodule is configured to obtain a construction connected graph of the model to be constructed according to the offset random number and the initial connected graph.
And the third generation submodule can enable fragments to be more vivid according to the constructed connected graph obtained by the offset random number and the initial connected graph, so that the display effect of the animation is improved.
Optionally, the method further comprises: the determination module is configured to determine an anchor point of a model to be constructed according to the connection relation between the model to be constructed and other construction models in a 3D scene;
the obtaining of the initial connection diagram of the model to be constructed according to the number of the fragment points and the positions of the fragment points of the model to be constructed comprises the following steps:
and obtaining an initial connection diagram of the model to be constructed according to the number of the fragment points of the model to be constructed, the positions of the fragment points and the anchor points.
The determination module is capable of fixing the generated target model to other construction models in the 3D scene by determining an anchor point in the initial connectivity graph. For example, the wall lamp is fixed with the wall through anchor points, the bridge is fixed with the ground through a plurality of anchor points (piers), and each anchor point has the adsorption and aggregation effect on fragments within a certain range.
Optionally, the second generating module includes:
a first determination submodule configured to determine an adhesive force between the fragments according to an area of a joint face of the fragments;
a second determination submodule configured to determine a bonding weight between the fragments according to the bonding force,
and the fourth generation submodule is configured to obtain a weighted connected graph of the model to be constructed according to the adhesion weight between the construction connected graph and the fragment.
The bonding force between the fragments is marked through the bonding weight, splicing of the fragments can be facilitated, and therefore the target model can be broken more vividly in the process of breaking the target model.
Optionally, the cutting module is further configured to cut the model to be constructed according to the construction connectivity graph based on a thieson polygon algorithm.
The Thiessen polygon algorithm divides the space by selecting a proper data structure, a motion point replacement rule and an iteration method, and compresses a point set mark in a block area, so that a plane or an n-dimensional space is divided into blocks with periodicity or quasi-periodicity.
An embodiment of the present application also provides a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor performing the steps of the model construction method as described above.
An embodiment of the present application also provides a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the model construction method as described above.
The above is an illustrative scheme of a computer-readable storage medium of the present embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the model construction method described above, and for details that are not described in detail in the technical solution of the storage medium, reference may be made to the description of the technical solution of the model construction method described above.
The computer instructions comprise computer program code which may be in source code form, object code form, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The preferred embodiments of the present application disclosed above are intended only to aid in the explanation of the application. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles of the application and its practical application, to thereby enable others skilled in the art to best understand and utilize the application. The application is limited only by the claims and their full scope and equivalents.