Wall generation method and device
By dividing the initial wall curve into the wall curve to be processed and the intersection curve, and creating and splicing wall objects, the problems of cumbersome and inefficient wall editing are solved, and automated generation and visual effect are improved.
Patent Information
- Application Number
- CN202210642522.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-08
- Publication Date
- 2025-07-04
- Estimated Expiration
- 2042-06-08
AI Technical Summary
In the prior art, there is a lot of repetitive work in the editing and production of walls, which leads to inefficiency and manual editing of model vertices when frequently modified, resulting in cumbersome and troublesome.
By dividing the initial wall curve into the wall curve and the intersection curve according to the curve intersection, a wall foundation object and associated object are created, and splicing it according to the intersection attribute information, the target wall is finally generated.
It realizes automatic generation of walls, improves generation efficiency, is suitable for frequent modification, improves the visual effect of the model, and reduces manual intervention.
Smart Images

Figure CN114998498B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer vision technology, and particularly to two methods for generating walls. This application also relates to two wall generation devices, a computing device, and a computer-readable storage medium. Background Art
[0002] With the development of Internet technology, virtual scenes are being applied more and more widely. Users have higher and higher requirements for the picture details and image quality involved in scenes such as games and movies, and the content that content creators need to create is also increasing accordingly. In the creation of virtual scenes, walls are a relatively common element in the scene. Since walls often represent the boundaries of each unit in the scene, during the process of editing the scene, it is a common situation to repeatedly modify the walls. In the prior art, polygons are created for walls according to the original design. When modification is required, it is necessary to re-edit the vertex positions and other structures of the model, and during the editing process, a large amount of manual editing is used, resulting in a huge workload. However, regardless of whether the design of the wall itself is complex or delicate, it is always a relatively standardized resource. Using the prior art to edit and produce walls will cause a large amount of repetitive work. Therefore, there is an urgent need for a wall generation method to solve the above problems. Summary of the Invention
[0003] In view of this, embodiments of this application provide two methods for generating walls to solve the technical defects existing in the prior art. Embodiments of this application also provide two wall generation devices, a computing device, and a computer-readable storage medium.
[0004] According to the first aspect of the embodiments of this application, a method for generating a wall is provided, including:
[0005] Dividing the initial wall curve into at least two wall curves to be processed and at least one intersection curve according to the curve intersection points in the initial wall curve;
[0006] Creating a wall base object based on the initial wall curve and the at least one intersection curve, and creating a wall associated object based on the at least two wall curves to be processed;
[0007] Performing splicing processing on the wall associated object according to the attribute information of the curve intersection points to obtain a target wall associated object;
[0008] Combining the target wall associated object with the wall base object to obtain a target wall.
[0009] Optionally, before dividing the initial wall curve into at least two wall curves to be processed and at least one intersection curve according to the curve intersection points in the initial wall curve, the method further includes:
[0010] Receiving a wall generation instruction submitted for the initial wall curve;
[0011] Selecting an intersection rule corresponding to the wall generation instruction from an intersection rule library;
[0012] Calculating curve intersection points in the initial wall curve based on the intersection rule.
[0013] Optionally, dividing the initial wall curve into at least two wall curves to be processed according to the curve intersection points in the initial wall curve includes:
[0014] Determining sub-initial wall curves connected by the curve intersection points in the initial wall curve;
[0015] Calculating the wall angle between adjacent sub-initial wall curves;
[0016] Selecting sub-initial wall curves that do not meet the angle selection condition as sub-target wall curves according to each wall angle;
[0017] Determining a splitting position in the initial wall curve according to the curve intersection points and the sub-target wall curves;
[0018] Splitting the initial wall curve according to the splitting position to obtain at least two wall curves to be processed.
[0019] Optionally, dividing the initial wall curve into at least one intersection curve according to the curve intersection points in the initial wall curve includes:
[0020] Taking the curve intersection points as starting points, dividing the sub-initial wall curves according to a preset intercept length to obtain at least one intersection curve.
[0021] Optionally, when the initial wall curve includes multiple curve intersection points, the method further includes:
[0022] Calculating the intersection point distance between any two adjacent curve intersection points among the multiple curve intersection points;
[0023] Selecting curve intersection points with an intersection point distance less than the preset intercept length and no inflection points between the two curve intersection points to construct associated curve intersection point pairs;
[0024] Taking each curve intersection point in the pair of associated curve intersection points as the center point respectively, and dividing according to a preset intercept length, to obtain the intersection point curves corresponding to each curve intersection point in the pair of associated curve intersection points.
[0025] Optionally, the creating the wall foundation object based on the initial wall curve and the at least one intersection point curve includes:
[0026] Calculating the normal directions corresponding to the initial wall curve and the intersection point curves respectively;
[0027] Based on the normal direction corresponding to the initial wall curve, widening the initial wall curve to a preset width to obtain a widened wall curve;
[0028] Based on the normal direction corresponding to the intersection point curve, widening the intersection point curve to a preset width to obtain a widened intersection curve;
[0029] Extracting the initial wall contour curve from the widened wall curve, and extracting the intersection point contour curve from the widened intersection curve;
[0030] Creating a wall foundation object based on the initial wall contour curve and the intersection point contour curve.
[0031] Optionally, the creating the wall foundation object based on the initial wall contour curve and the intersection point contour curve includes:
[0032] Calculating the tangent directions of each vertex on the initial wall contour curve, wherein the selection of the tangent directions between each vertex is related to the tangent direction of the previous vertex;
[0033] Sorting each vertex on the initial wall contour curve according to the tangent directions of each vertex on the initial wall contour curve;
[0034] Performing texture mapping processing on the initial wall contour curve and the intersection point contour curve respectively based on the sorting result to obtain a wall foundation object.
[0035] Optionally, the performing texture mapping processing on the initial wall contour curve and the intersection point contour curve respectively based on the sorting result to obtain a wall foundation object includes:
[0036] Creating a wall foundation object cross-section curve according to the preset wall foundation object cross-section information;
[0037] Generating an initial wall sub-object based on the wall foundation object cross-section curve and the initial wall contour curve, and generating an intersection point sub-object based on the wall foundation object cross-section curve and the intersection point contour curve;
[0038] Perform UV processing on the initial wall sub-objects and the intersection point sub-objects based on the sorting results;
[0039] Determine the sub-object position relationship between the initial wall sub-objects and the intersection point sub-objects in the initial wall curve;
[0040] Stitch the UV-processed initial wall sub-objects and the intersection point sub-objects according to the sub-object position relationship to obtain a wall base object.
[0041] Optionally, the creating of a wall association object based on the at least two walls to be processed curves includes:
[0042] Create a cross-section curve of the wall association object according to the preset cross-section information of the wall association object;
[0043] Sort the vertices on the cross-section curve of the wall association object;
[0044] Generate an initial wall association object based on the sorted cross-section curve of the wall association object and the walls to be processed curves;
[0045] Perform UV processing on the initial wall association object to obtain a wall association object corresponding to each wall to be processed curve.
[0046] Optionally, the splicing process of the wall association object according to the attribute information of the curve intersection point to obtain a target wall association object includes:
[0047] Determine the position to be modified in the wall association object according to the position of the curve intersection point in the initial wall curve;
[0048] Process the position to be modified in the wall association object based on the attribute information of the curve intersection point, and obtain a wall association object to be spliced according to the processing result;
[0049] Determine the association object position relationship of the wall association object to be spliced in the initial wall curve;
[0050] Splice the wall association object to be spliced according to the association object position relationship to obtain the target wall association object.
[0051] Optionally, the processing of the position to be modified associated according to the attribute information of each curve intersection point includes:
[0052] Determine at least two wall association objects to be processed connected to the curve intersection point;
[0053] Based on the attribute information of the curve intersection points, determine the first to-be-modified position and the second to-be-modified position among the to-be-modified positions of the at least two to-be-processed wall association objects;
[0054] Cut the to-be-processed wall association object corresponding to the first to-be-modified position at the first to-be-modified position with a preset first cutting shape;
[0055] Cut the to-be-processed wall association object corresponding to the second to-be-modified position at the second to-be-modified position with a preset second cutting shape, where the first cutting shape is complementary to the second cutting shape.
[0056] According to the second aspect of the embodiments of the present application, another method for generating a fence is provided, including
[0057] Receive a wall creation instruction submitted for the wall editing interface, and draw an initial wall curve according to the wall creation instruction;
[0058] According to the curve intersection points in the initial wall curve, divide the initial wall curve into at least two to-be-processed wall curves and at least one intersection point curve;
[0059] Create a wall foundation object based on the initial wall curve and the at least one intersection point curve, and create a wall association object based on the at least two to-be-processed wall curves;
[0060] Perform splicing processing on the wall association object according to the attribute information of the curve intersection points to obtain a target wall association object;
[0061] Combine the target wall association object with the wall foundation object to obtain a target wall, and display it through the wall editing interface.
[0062] According to the third aspect of the embodiments of the present application, a fence generation device is provided, including:
[0063] A division module configured to divide the initial wall curve into at least two to-be-processed wall curves and at least one intersection point curve according to the curve intersection points in the initial wall curve;
[0064] A creation module configured to create a wall foundation object based on the initial wall curve and the at least one intersection point curve, and create a wall association object based on the at least two to-be-processed wall curves;
[0065] A splicing module configured to perform splicing processing on the wall association object according to the attribute information of the curve intersection points to obtain a target wall association object;
[0066] Combination module, configured to combine the target wall associated object with the wall foundation object to obtain a target wall.
[0067] According to a fourth aspect of the embodiments of the present application, another fence generation device is provided, including:
[0068] Receiving module, configured to receive a wall creation instruction submitted for the wall editing interface and draw an initial wall curve according to the wall creation instruction;
[0069] Intersection point division module, configured to divide the initial wall curve into at least two to-be-processed wall curves and at least one intersection point curve according to the curve intersection points in the initial wall curve;
[0070] Wall object creation module, configured to create a wall foundation object based on the initial wall curve and the at least one intersection point curve, and create a wall associated object based on the at least two to-be-processed wall curves;
[0071] Wall object splicing module, configured to perform splicing processing on the wall associated object according to the attribute information of the curve intersection point to obtain a target wall associated object;
[0072] Display module, configured to combine the target wall associated object with the wall foundation object to obtain a target wall and display it through the wall editing interface.
[0073] According to a fifth aspect of the embodiments of the present application, a computing device is provided, including:
[0074] A memory and a processor;
[0075] The memory is used to store computer-executable instructions, and when the processor executes the computer-executable instructions, the steps of the fence generation method are implemented.
[0076] According to a sixth aspect of the embodiments of the present application, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the fence generation method are implemented.
[0077] According to a seventh aspect of the embodiments of the present application, a chip is provided, which stores a computer program, and when the computer program is executed by the chip, the steps of the fence generation method are implemented.
[0078] The wall generation method provided by this application divides the initial wall curve according to its curve intersection points to obtain the wall curve to be processed and the intersection point curve. A wall foundation object is created based on the initial wall curve and the wall curve to be processed, and a wall associated object is created according to the wall curve to be processed. Then, the wall associated objects are spliced to obtain the target wall associated object. Finally, the target wall associated object and the wall associated object are combined to obtain the target wall, realizing the automatic generation of the wall, solving the problems of cumbersome wall production and troublesome modification, accelerating the wall generation efficiency, being suitable for frequent modification of the wall during the wall production process, and improving the visual effect of the wall model. Description of the Drawings
[0079] Figure 1 is a flowchart of a wall generation method provided by an embodiment of this application;
[0080] Figure 2 is a schematic diagram of the initial wall curve of a wall generation method provided by an embodiment of this application;
[0081] Figure 3 is a schematic diagram of the widened wall curve and the widened intersection curve of a wall generation method provided by an embodiment of this application;
[0082] Figure 4 is a schematic diagram of the initial wall contour curve and the intersection point contour curve of a wall generation method provided by an embodiment of this application;
[0083] Figure 5 is a schematic diagram of the cross-section of the wall foundation object and the cross-section of the wall associated object of a wall generation method provided by an embodiment of this application;
[0084] Figure 6 is a schematic diagram of the wall associated object of a wall generation method provided by an embodiment of this application;
[0085] Figure 7 is a flowchart of another wall generation method provided by an embodiment of this application;
[0086] Figure 8 is a processing flowchart of a wall generation method applied to a movie scene provided by an embodiment of this application;
[0087] Figure 9 is a schematic diagram of the structure of a wall generation device provided by an embodiment of this application;
[0088] Figure 10 is a schematic diagram of the structure of another wall generation device provided by an embodiment of this application;
[0089] Figure 11It is a structural block diagram of a computing device provided by an embodiment of the present application. Detailed implementation manners
[0090] In the following description, many specific details are set forth in order to provide a thorough understanding of the present application. However, the present application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the connotation of the present application. Therefore, the present application is not limited by the specific implementations disclosed below.
[0091] The terms used in one or more embodiments of the present application are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of the present application. The singular forms "a", "the", and "said" used in one or more embodiments of the present application and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of the present application refers to and includes any or all possible combinations of one or more of the associated listed items.
[0092] It should be understood that although the terms first, second, etc. may be used in one or more embodiments of the present application to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of the present application, the first may also be referred to as the second, and similarly, the second may also be referred to as the first.
[0093] First, the noun terms related to one or more embodiments of the present invention are explained.
[0094] UV: The abbreviation of u, v texture mapping coordinates, which is similar to the X, Y, Z axes of the spatial model. It defines the information of the position of each point on the picture. UV is to accurately correspond each point on the image to the surface of the model object. The software performs image smoothing interpolation processing at the gap positions between points.
[0095] In the present application, two methods for generating walls are provided. The present application is also related to two wall generating devices, a computing device, and a computer-readable storage medium, which will be described in detail one by one in the following embodiments.
[0096] In practical applications, in the creation of virtual scenes, for the establishment of the fence model, polygons are often created according to a preset style, and the outline of the fence is generated by stacking polygons. When editing the fence in this way, manual intervention is required during texturing to ensure the consistency of the fence model texture. Especially when there is more than one fence, the texturing operation at the intersection points between two fences needs to be manually adjusted to ensure the coherence of the texture and make the created fence more realistic.
[0097] However, as a relatively standardized resource, the process of setting up the enclosure wall involves a large amount of repetitive work. Although manual intervention can ensure the quality of the enclosure wall generation, the repetitive work will greatly reduce the efficiency of the enclosure wall creation. Especially since the wall body resource is a resource that often needs to be modified, using conventional means, during each modification of the wall body resource, it is necessary to re-edit the vertices of the entire wall body model. Also, because the intersection points between the walls do not disappear during the re-editing process, in order to ensure the coherence of the texture mapping, manual intervention becomes inevitable, and the efficiency of the enclosure wall generation cannot be guaranteed.
[0098] In view of this, this specification provides a method for generating a wall body. During the process of generating the wall body, the entire enclosure wall curve will be cut based on the intersection points of the enclosure wall body, and then the wall body will be created separately in terms of the wall body foundation object and the wall body associated object, ensuring the feasibility of the solution when facing a complex wall body structure. Creating the wall body in this way realizes the automatic generation of the wall body without manual intervention, solves the problems of cumbersome wall body production and troublesome modification, speeds up the wall body generation efficiency, is suitable for the frequent modification of the wall body during the wall body production process, and such a method for automatically generating the wall body can also ensure the visual effect of the generated wall body model.
[0099] Figure 1 The flowchart of a method for generating a wall body provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0100] Step S102: Divide the initial wall body curve into at least two wall body curves to be processed and at least one intersection point curve according to the curve intersection points in the initial wall body curve.
[0101] Among them, the initial wall body curve can be understood as the curve that has been set to indicate the position where the created wall body is located. It should be noted that the initial wall body curve can be drawn manually by the user, can also be automatically generated based on the existing buildings or objects in the scene, or can also be the curve that has been set and selected from the database as the initial wall body curve. That is to say, the determination process of the initial wall body curve is diverse, and its specific determination method is determined by the actual usage scenario, which is not limited in this embodiment. The curve intersection point can be understood as the point formed by the intersection of line segments in the initial wall body curve; the wall body curve to be processed can be understood as the segment obtained after dividing the initial wall body curve. It should be noted that there are no longer intersection points in the wall body curve to be processed; the intersection point curve can be understood as the segment obtained after dividing the initial wall body curve. It should be noted that each intersection point curve contains a curve intersection point.
[0102] Based on this, taking the curve intersection points in the initial wall curve as a reference, the initial wall curve is segmented to obtain a to-be-processed wall curve that does not contain curve intersection points and an intersection point curve that contains curve intersection points. In this way, the curve intersection point part in the initial wall curve is separated, ensuring the separate processing of curve intersection points. The generation of the wall model in this way does not require real-time monitoring of the texture processing of the wall intersection point part, that is to say, manual intervention is avoided during the generation process of the wall model, which speeds up the generation efficiency. It should be noted that when processing the initial wall curve, if there are no curve intersection points in it, the initial wall curve does not need to be divided, but the initial wall curve can be directly used as a to-be-processed wall curve for subsequent processing.
[0103] Further, regarding the processing of the initial enclosure curve by the relevant computing device, the device cannot directly know the curve intersection points in it and needs to first calculate the curve intersection points based on the initial enclosure curve area. In this embodiment, the specific implementation method is as follows:
[0104] Receive a wall generation instruction submitted for the initial wall curve; select the intersection point rule corresponding to the wall generation instruction in the intersection point rule library; calculate the curve intersection points in the initial wall curve based on the intersection point rule.
[0105] Among them, the wall generation instruction can be understood as an instruction to create a corresponding wall based on the initial wall curve. It should be noted that the relevant parameters in the wall generation instruction can be set by the user or automatically generated based on the initial wall curve, and the specific determination method of its parameters is determined by the actual usage scenario and is not limited in this embodiment. The intersection point rule library can be understood as a database storing the rules for calculating the curve intersection points in the initial wall curve; the intersection point rule can be understood as a rule for calculating the curve intersection points in the initial wall curve. It should be noted that the methods for calculating the curve intersection points in the initial wall curve included in the intersection point rule can include establishing relevant line segment equations based on the position relationships of the points in the initial wall curve, and determining its domain and range through the endpoints of the relevant line segments in the initial wall, and calculating the curve intersection points through the obtained line segment equations; or performing limit calculations on the points in the initial wall curve to obtain the curve intersection points; or identifying the number of adjacent points of each point in the initial wall curve, and when the number of adjacent points is greater than 2, determining this point as the curve intersection point. Therefore, the types of intersection point rules for calculating the curve intersection points in the initial wall curve are diverse, and which specific intersection point rules are included in the intersection point rule library is determined by the actual usage scenario and is not limited in this embodiment.
[0106] Based on this, a wall generation instruction for creating a corresponding wall based on the initial wall curve is received. Then, a crossing point rule suitable for the current scenario is selected from the crossing point rule library. If the current scenario is not restricted, a crossing point rule can also be selected based on a preset selection strategy. It should be noted that the preset strategy for selecting crossing point rules can be random selection, or a certain crossing point rule can be used as the default rule, and this rule is preferentially selected when there is no restriction. This embodiment does not limit the preset selection strategy. Then, the curve crossing points in the initial wall curve are calculated according to the selected crossing point rule.
[0107] For example, in the development of a certain game, developers need to build a wall around a certain house scene. Based on their own needs, developers plan an initial wall curve on the ground layer of the scene editing software, such as Figure 2 the schematic diagram of the initial wall curve of the wall generation method shown. After the developers plan the initial wall curve, they click the "Confirm" button on the editing interface of the scene editing software. Then, the scene editing software generates a wall generation instruction based on the initial wall curve. Then, the default crossing point rule is selected from the crossing point rule library. This default crossing point rule will construct a function regarding the initial wall curve and calculate the curve crossing points in the initial wall curve based on the obtained function, obtaining curve crossing points a1, a2, and a3.
[0108] In summary, through the crossing point rule selected from the crossing point rule library, the curve crossing points of the initial wall curve are calculated, ensuring the accuracy of the determination process of the curve crossing points in the initial wall curve, which is helpful for subsequent division of the initial wall curve based on the curve crossing points.
[0109] Furthermore, during the process of constructing a corresponding wall based on the initial wall curve, problems such as model penetration or texture errors are likely to occur at the parts of the curve crossing points. To solve this problem, the intersecting parts of the initial wall curve need to be separated. In this embodiment, the specific implementation method is as follows:
[0110] Determine the sub-initial wall curves connected by the curve crossing points in the initial wall curve; calculate the wall angles between adjacent sub-initial wall curves; select the sub-initial wall curves that do not meet the angle selection conditions as sub-target wall curves according to each wall angle; determine the splitting positions in the initial wall curve according to the curve crossing points and the sub-target wall curves; split the initial wall curve according to the splitting positions to obtain at least two wall curves to be processed.
[0111] Among them, the sub-initial wall curve can be understood as a curve starting from the curve crossing point or the end point of the initial wall curve, such as Figure 2In the initial wall curve schematic diagram of the wall generation method shown, the curve L1 has a starting point that is a curve intersection point a1 and an end point b1 of an initial wall curve; the angle selection condition can be understood as a preset selection condition to achieve the determination of the parts that need to be segmented in each sub-initial wall curve in the initial wall curve.
[0112] Based on this, in the initial wall curve, determine each sub-initial wall curve connected to the curve intersection point, calculate the angle between two adjacent sub-initial wall curves, and select the sub-initial wall curve whose angle does not meet the preset requirements as the sub-target wall curve; then, according to the sub-target wall curve and the curve intersection point, determine the position in the initial wall curve that needs to be segmented to facilitate separating the sub-target wall curve from the initial wall curve. The several parts obtained after separation are the wall curves to be processed.
[0113] Continuing with the above example, in the initial wall curve, taking the curve intersection point a1 as an example, determine that the sub-initial wall curves connected to a1 are L1, L2, and L3; calculate the angle ∠12 between L1 and L2, the angle ∠13 between L1 and L3, and the angle ∠23 between L2 and L3, where ∠12 = 90°, ∠13 = 90°, and ∠23 = 180°; the preset angle selection condition is that one of the two relevant wall angles of the sub-initial wall curve contains an angle of 180°. At this time, it can be determined that L1 does not meet the angle selection condition, that is, the sub-target wall curve is L1. Then, determine the segmentation position to ensure that L1 can be cut off from the initial wall curve. Process a2 and a3 in a similar manner. Finally, the wall curves to be processed are L1, L23, L4, L5, L6, and L7, where L23 is the combination of L2 and L3.
[0114] In summary, segmenting the initial wall curve so that each part is processed separately avoids the occurrence of model penetration during the generation of the relevant wall model at the curve intersection point and also avoids the appearance of splicing gaps during the texturing process.
[0115] Furthermore, when segmenting the initial wall curve, it is also necessary to process the curve at the intersection point as a separate part to ensure that no errors occur during the generation of the relevant wall model. In this embodiment, the specific implementation method is as follows:
[0116] Taking the curve intersection point as the starting point, divide the sub-initial wall curve according to a preset intercept length to obtain at least one intersection point curve.
[0117] Among them, taking the curve intersection point as the starting point, then determining the direction of the sub-initial wall curve, and then along the determined direction, intercepting the preset length of the sub-initial wall curve, the intercepted lower part is the curve intersection point; in addition, a circle can also be drawn with the curve intersection point as the center and the preset intercepting length as the radius, and the part of the initial wall curve included in this circle is used as the curve intersection point. It should be noted that there is more than one way to determine the intersection point curve, and the specific choice of which method is determined by the actual application scenario, which is not limited in this embodiment.
[0118] Continuing with the above example, taking point a1 as an example, determine the directions of L1, L2, and L3 connected to a1, and intercept 1 cm along these directions to obtain a "T"-shaped curve with the intersection point being a1. This curve is the intersection point curve; similarly, in a similar way, a "cross"-shaped intersection point curve with two intersection points being a2 and a3 respectively is obtained.
[0119] In summary, by intercepting the curves at the curve intersection points, the walls at the intersection points can be processed separately, ensuring that no errors occur during the generation process of the wall model.
[0120] Furthermore, if the distance between two curve intersection points is too small, one intersection point curve will include two curve intersection points, which is not conducive to subsequent related processing. To solve this problem, in this embodiment, the specific implementation method is as follows:
[0121] Calculate the intersection point distance between any two adjacent curve intersection points among multiple curve intersection points; select the curve intersection points where the curve intersection point distance is less than the preset intercepting length and there is no inflection point between the two curve intersection points to construct associated curve intersection point pairs; take each curve intersection point in the associated curve intersection point pairs as the center point respectively, and divide them according to the preset intercepting length to obtain the intersection point curves corresponding to each curve intersection point in the associated curve intersection point pairs.
[0122] Among them, the intersection point distance can be understood as the distance between two curve intersection points. It should be noted that in order to reduce the calculation amount, when calculating the distance between two curve intersection points, it can be first judged whether the two curve intersection points are connected by the same sub-initial wall curve. If not, the distance between them can be not calculated; the inflection point can be understood as the point where the direction of the curve in the initial wall curve changes; the associated curve intersection point pair can be understood as consisting of two curve intersection points that meet two restrictive conditions.
[0123] Based on this, the distance between the initial two curve intersections connected by the same sub-initial wall curve is calculated, and the two curve intersections whose distance is less than the interception length and there is no inflection point in the middle are taken as an associated curve intersection pair; then one of the curve intersections in the associated intersection pair is selected as the center point, and then the other curve intersection is ignored. It should be noted that the sub-initial wall curve connected to another curve intersection but not connected to the center point can also be ignored, wherein the ignored sub-initial wall curve does not include the sub-initial wall curve with the same direction as the sub-initial wall curve between the two curve intersections, and after ignoring, the intersection curve is intercepted in a preset manner.
[0124] Using the above example, determine the distance between the intersection points of the curves connected by the same sub-initial wall curve, and judge that the distance between the two intersection points of the curves is less than the preset interception length of 1cm, and there is no inflection point in the sub-initial wall curve between the two intersection points of the curves. Figure 2 In the schematic diagram of the initial wall curve of the wall generation method shown, if the length of L5 is 0.9 cm, then a2 and a3 meet the above requirements, and a2 and a3 are determined as the intersection point pair of the associated curve; then a2 is taken as the center point, a3, L4, and L6 are ignored, 1 cm is intercepted from the top, bottom, and right directions of point a2, and then L5 and L7 are regarded as one, 0.1 cm is intercepted from the left side of point a3, and 0.9 cm of L5 is combined to obtain the "cross" intersection curve corresponding to a2 by combining the parts intercepted in the above four directions. Similarly, a2 is ignored, and a similar method is used for a3 to obtain the "cross" intersection curve corresponding to a3.
[0125] In summary, by ignoring the intersection points of curves that affect each other and intercepting the intersection curves, the influence between the intersection points of the curves is solved. It should be noted that the intersection points of two curves can also be intercepted into the same intersection curve at the same time to obtain a "卄"-shaped intersection curve, but this approach requires the construction of corresponding model construction and mapping processing methods. Whether to choose to intercept the two curve intersections separately into two intersection curves or to intercept the two curve intersections into the same intersection curve needs to be determined according to the actual usage scenario, and this embodiment does not limit it.
[0126] Step S104: creating a wall basic object based on the initial wall curve and the at least one intersection curve, and creating a wall associated object based on the at least two wall curves to be processed.
[0127] Specifically, after the initial wall curve is divided, the wall is constructed based on the division result. Here, due to the different characteristics between different parts of the wall, a method of dividing the wall into two parts, namely, a wall basic object and a wall associated object, is adopted.
[0128] Among them, the wall foundation object can be understood as the combination of the main body and the base of the wall, that is, the "wall surface" and the "wall root", or it can be understood as a structural object similar to the combination of the "wall body" and the "skirting board"; the wall-related object can be understood as the wall edge of the wall, including the "top pressure" and "drip edge" of the wall, the "gun head" and "bayonet net" of the fence, the "ridge beast" and "eaves" of the Chinese-style wall, and so on.
[0129] Based on this, the "wall surface" and "wall root" of the wall are constructed according to the initial wall curve and the intersection curve, and the top of the wall is created according to the wall curve to be processed. It should be noted that the wall basic object is often more regular than the wall-related object. When processing, you only need to pay attention to the intersection to ensure the quality of the wall. Therefore, here, most of the wall basic object is constructed based on the initial wall curve, and the intersection of the wall basic object is processed in a targeted manner in combination with the intersection curve, so that the wall basic object that meets the user's needs can be obtained; different from the wall basic object, the style of the wall-related object is more diverse, and its size cannot be guaranteed to be completely consistent with the wall basic object. It is also necessary to cut and splice at the intersection, so the corresponding wall-related object is created based on each wall curve to be processed.
[0130] Furthermore, the wall itself has thickness, while the line has no thickness. In order to create a wall basic object based on the initial wall curve and the intersection curve, it is necessary to assign width to the initial wall curve and the intersection curve. In this embodiment, the specific implementation is as follows:
[0131] Calculate the normal directions corresponding to the initial wall curve and the intersection curve respectively; based on the normal direction corresponding to the initial wall curve, widen the initial wall curve to a preset width to obtain a widened wall curve; based on the normal direction corresponding to the intersection curve, widen the intersection curve to a preset width to obtain a widened wall curve; extract the initial wall contour curve from the widened wall curve, and extract the intersection contour curve from the widened intersection curve; create a wall basic object based on the initial wall contour curve and the intersection contour curve.
[0132] Among them, the widened wall curve can be understood as a surface whose center line is consistent with the initial wall curve; the widened intersection curve can be understood as a surface whose center line is consistent with the intersection curve; the initial wall contour curve can be understood as the contour line (outer edge boundary) of the widened wall curve, and the intersection contour curve can be understood as the contour line (outer edge boundary) of the widened intersection curve.
[0133] Based on this, calculate the normal vectors of each part of the initial wall curve and the normal vectors of each part of the intersection point curve. The method of calculating the normal vectors can be based on the function expressions of each part of the initial wall curve or the intersection point curve. Then, obtain the slopes of the tangents at each point in the function expressions, and based on the slopes and coordinate values of each point, determine the equations of the normal vectors passing through these points. It should be noted that there is more than one method for calculating the normal vectors, and the specific method to be selected for normal vector calculation is not limited in this embodiment. After calculating the normal vector directions of each point on the initial wall curve and the intersection point curve, starting from each point, draw line segments with a preset width along the corresponding normal vector directions. Process all the points on the initial wall curve and the intersection point curve in this way to obtain the widened wall curve and the widened intersection curve. Then, extract the contour lines of the widened wall curve and the widened intersection curve to obtain the initial wall contour curve and the intersection point contour curve. Finally, construct the wall foundation object based on the initial wall contour curve and the intersection point contour curve.
[0134] Continuing with the above example, calculate the normal vectors passing through each point on the initial wall curve. Widen the initial wall curve to the preset width according to the normal vector directions to obtain the widened wall curve, as shown on the left side of the schematic diagram of the widened wall curve and the widened intersection curve of the wall generation method Figure 3 shown. Then, process the intersection point curve in a similar manner to obtain the widened intersection curve, as shown on the right side of the schematic diagram of the widened wall curve and the widened intersection curve of the wall generation method Figure 3 shown. Then, extract the contour line of the widened wall curve to obtain the initial wall contour curve, as shown on the left side of the schematic diagram of the initial wall contour curve and the intersection point contour curve of the wall generation method Figure 4 shown. Obtain the intersection point contour curve in a similar manner, as shown on the right side of the schematic diagram of the initial wall contour curve and the intersection point contour curve of the wall generation method Figure 4 shown. Finally, construct the wall foundation object based on the initial wall contour curve and the intersection point contour curve.
[0135] In summary, by widening the initial wall curve and the intersection point curve and then extracting the corresponding contour lines, the outer contour of the wall foundation object can be quickly determined.
[0136] Furthermore, after obtaining the initial wall contour curve and the intersection point contour curve, texture mapping can be performed to obtain the wall foundation object. In this embodiment, the specific implementation method is as follows:
[0137] Calculate the tangent directions of each vertex on the initial wall contour curve, where the selection of the tangent directions between each vertex is related to the tangent direction of the previous vertex; sort each vertex on the initial wall contour curve according to the tangent directions of each vertex on the initial wall contour curve; perform texture mapping on the initial wall contour curve and the intersection point contour curve respectively based on the sorting result to obtain the wall base object.
[0138] Among them, a vertex can be understood as a point on the initial wall contour curve where the direction changes.
[0139] Based on this, calculate the tangent directions of each vertex on the initial wall contour curve. Since the vertex is a point where the direction changes on the initial wall contour curve, that is to say, the curve including the vertex part is not a smooth curve and it is impossible to calculate the slope of the vertex position according to the function. At this time, the derivatives of the left limit and the right limit of the vertex can be calculated, and then the average value of the two derivatives is calculated. The slope direction corresponding to this average value is used as the tangential direction of the vertex.
[0140] Continuing with the above example, calculate the tangent directions of each vertex on the initial wall contour curve, and then use any one of the endpoints b1, b2, b3 as the starting point to sort the vertices. It should be noted that for the curve inside the closed space formed by L4, L5 and L5, L6, any vertex can be selected as the starting point, and the vertices can be sorted in a clockwise or counterclockwise direction; it should be noted that during the sorting process, the tangent direction of the current vertex points to the tangent direction of the next vertex. Then use the method of UV texture mapping to perform texture mapping on the initial wall contour curve. According to the user's needs, determine the cross-sectional curve of the wall base object. Among them, the cross-sectional curve of the wall base object is as Figure 5 shown in Figure (a) of the schematic diagram of the cross-section of the wall base object and the cross-section of the wall associated object of the wall generation method. Sort each vertex on the cross-sectional curve. Based on the sorting result, use the sorting result of the vertices on the cross-section as one direction of the UV texture mapping, and use the sorting result of each vertex on the initial wall contour curve as the other direction of the UV texture mapping, and then perform texture mapping; similarly, similar processing is also performed on the vertices on the intersection point contour curve to complete the texture mapping; construct the wall base object based on the initial wall contour curve and the intersection point contour curve after the texture mapping is completed.
[0141] In summary, by sorting the vertices on the initial wall contour curve and the intersection point contour curve, the texture mapping direction can be determined to realize texture mapping on the initial wall contour curve and the intersection point contour curve.
[0142] Furthermore, for the initial wall contour curve and the intersection point contour curve subjected to texture mapping, the wall base object cannot be directly obtained and needs to be spliced. In this embodiment, the specific implementation method is as follows:
[0143] Create a cross-sectional curve of the wall foundation object according to the preset cross-sectional information of the wall foundation object; generate an initial wall sub-object based on the cross-sectional curve of the wall foundation object and the initial wall contour curve, and generate an intersection point sub-object based on the cross-sectional curve of the wall foundation object and the intersection point contour curve; perform UV processing on the initial wall sub-object and the intersection point sub-object based on the sorting result; determine the sub-object position relationship between the initial wall sub-object and the intersection point sub-object in the initial wall curve; splice the UV-processed initial wall sub-object and the intersection point sub-object according to the sub-object position relationship to obtain the wall foundation object.
[0144] Among them, the cross-sectional information of the wall foundation object can be understood as the information recording the cross-section of the wall foundation object; the cross-sectional curve of the wall foundation object can be understood as the cross-section corresponding to the wall foundation object, showing the shape, size, etc. of the cross-section corresponding to the wall foundation object; the initial wall sub-object can be understood as a solid model obtained by scanning the initial wall contour curve and the cross-sectional curve of the wall foundation object; the intersection point sub-object can be understood as a solid model obtained by scanning the intersection point contour curve and the cross-sectional curve of the wall foundation object.
[0145] Based on this, determine the cross-sectional curve corresponding to the wall foundation object according to the cross-sectional information of the wall foundation object, and then scan with the cross-sectional curve of the wall as one scanning direction and the initial wall contour curve as the other scanning direction to obtain the initial wall sub-object; similarly, scan based on the cross-sectional curve of the wall and the intersection point contour curve to obtain the intersection point sub-object; perform UV processing on the initial wall sub-object and the intersection point sub-object according to the sorting result of the determined vertices; determine the position relationship between the initial wall sub-object and the intersection point sub-object, and splice according to this position relationship to obtain the wall foundation object. It should be noted that during the splicing process, the faces corresponding to the end points of the intersection point curve in each face of the intersection point sub-object are inside the wall and are useless parts that can be removed; in addition, when the texturing form is a cyclic texture in a certain minimum unit, such as the brick joints of a brick wall, in order to ensure that the textures on the initial wall sub-object and the intersection point sub-object can be perfectly docked, it is necessary to determine the specific texture of a docking point on the initial wall sub-object and the intersection point sub-object, and then use this point as an anchor point to determine the textures of each docking point. Finally, after the initial wall sub-object and the intersection point sub-object are spliced, the wall foundation object is obtained.
[0146] Continuing with the above example, determine the cross-sectional curve corresponding to the wall foundation object according to the cross-sectional information of the initial wall object, such as Figure 5As shown in Figure (a) of the schematic diagram of the cross-section of the wall foundation object and the cross-section of the wall associated object in the wall generation method, an initial wall sub-object is then constructed based on the cross-section curve and the initial wall contour, and an intersection point sub-object is constructed based on the cross-section curve and the intersection point contour; then, texture mapping is performed on the initial wall sub-object based on the sorting result of the vertices, starting from point b3 for texture mapping. After reaching the left docking position of the intersection point sub-object corresponding to a3, the texture mapping information at this position is determined. Based on the obtained texture mapping information, the left endpoint of the intersection point sub-object corresponding to a3 is textured. After the texture mapping is completed, the texture mapping information at the positions of the upper endpoint, lower endpoint, and right endpoint is obtained. Based on the obtained texture mapping information, the docking positions of the intersection point sub-object corresponding to a3 on the initial wall sub-objects corresponding to L4, L5, and L6 are textured. After all the texture mapping is completed, the obtained initial wall sub-object and the intersection point sub-object are spliced to obtain the wall foundation object.
[0147] In summary, through the above positioning method, the quality of the wall foundation object obtained by splicing the generated initial wall sub-object and the intersection point sub-object can be guaranteed. It should be noted that after the above texture mapping process, the UV needs to be scaled so that the V direction is within the range of 0-1 to ensure that the texture mapping does not exceed the preset range of the wall foundation object.
[0148] Furthermore, in the process of constructing the target wall, in addition to the wall foundation object, a wall associated object is also required. Regarding the creation of the wall associated object, in this embodiment, the specific implementation method is as follows:
[0149] According to the preset cross-section information of the wall associated object, a cross-section curve of the wall associated object is created; the vertices on the cross-section curve of the wall associated object are sorted; an initial wall associated object is generated based on the sorted cross-section curve of the wall associated object and the wall curve to be processed; the initial wall associated object is subjected to UV processing to obtain a wall associated object corresponding to each wall curve to be processed.
[0150] Among them, the cross-section information of the wall associated object can be understood as the information including the cross-section of the associated object, including but not limited to the size and shape of the cross-section.
[0151] Based on this, according to the preset cross-section information of the wall associated object, the cross-section curve corresponding to the wall associated object is determined. Since the cross-section curve is composed of multiple line segments, in practical applications, the head-to-tail arrangement order of these line segments may have the wrong situation of being reversed. Therefore, the vertices on the cross-section curve are re-sorted. Taking the sorted cross-section curve as one scanning direction and the wall curve to be processed as the other scanning direction, the initial wall associated object is obtained after scanning. Then, UV processing is performed on the obtained initial wall associated object. The direction of UV processing is determined by the sorting result of the cross-section curve. After texturing, the wall associated object is obtained.
[0152] Continuing with the above example, according to the cross-section information of the wall associated object, the cross-section curve corresponding to the wall associated object is determined, as shown in Figure (b) of the schematic diagram of the cross-section of the wall base object and the cross-section of the wall associated object in the wall generation method. Then, the vertices on the cross-section curve are sorted. Based on the sorting result, one direction is determined, and based on the wall curve to be processed, another direction is determined. These two directions are used as the scanning directions. After scanning, the initial wall associated object is obtained. Then, these two directions are used as the U direction and V direction of texturing. After texturing is completed, the wall associated object is obtained. Taking L23 as an example, its corresponding wall associated object is shown in Figure (a) of the schematic diagram of the wall associated object in a wall generation method. Figure 5 Continuing with the above example, according to the cross-section information of the wall associated object, the cross-section curve corresponding to the wall associated object is determined, as shown in Figure (b) of the schematic diagram of the cross-section of the wall base object and the cross-section of the wall associated object in the wall generation method. Then, the vertices on the cross-section curve are sorted. Based on the sorting result, one direction is determined, and based on the wall curve to be processed, another direction is determined. These two directions are used as the scanning directions. After scanning, the initial wall associated object is obtained. Then, these two directions are used as the U direction and V direction of texturing. After texturing is completed, the wall associated object is obtained. Taking L23 as an example, its corresponding wall associated object is shown in Figure (a) of the schematic diagram of the wall associated object in a wall generation method. Figure 6 Continuing with the above example, according to the cross-section information of the wall associated object, the cross-section curve corresponding to the wall associated object is determined, as shown in Figure (b) of the schematic diagram of the cross-section of the wall base object and the cross-section of the wall associated object in the wall generation method. Then, the vertices on the cross-section curve are sorted. Based on the sorting result, one direction is determined, and based on the wall curve to be processed, another direction is determined. These two directions are used as the scanning directions. After scanning, the initial wall associated object is obtained. Then, these two directions are used as the U direction and V direction of texturing. After texturing is completed, the wall associated object is obtained. Taking L23 as an example, its corresponding wall associated object is shown in Figure (a) of the schematic diagram of the wall associated object in a wall generation method.
[0153] In summary, by sorting the vertices on the cross-section curve, it is ensured that there will be no wrong direction situation during texturing. Then, combined with the wall curve to be processed, the creation of the wall associated object is realized. This way of creating the wall associated object has strong applicability and can meet the needs of users in various scenarios.
[0154] Step S106: Perform splicing processing on the wall associated object according to the attribute information of the curve intersection point to obtain the target wall associated object.
[0155] Among them, the target wall associated object can be understood as the model object obtained after splicing each wall associated object according to the corresponding positional relationship; the attribute information of the curve intersection point can be understood as including the position information of the curve intersection point.
[0156] Based on this, according to the position information of the curve intersection point, the positional relationship between the wall associated objects is determined, and splicing processing is performed based on these positional relationships to obtain the target wall associated object.
[0157] Furthermore, there is a correlation between the position information of the curve intersection point and the positional relationship between each wall associated object. Therefore, the positional relationship between each wall associated object can be determined according to the attribute information of the curve intersection point. In this embodiment, the specific implementation method is as follows:
[0158] Determine the position to be modified in the wall-related object according to the position of the curve intersection point in the initial wall curve; process the position to be modified in the wall-related object based on the attribute information of the curve intersection point, and obtain the wall-related object to be spliced according to the processing result; determine the relative position relationship of the associated objects of the wall-related object to be spliced in the initial wall curve; splice the wall-related object to be spliced according to the relative position relationship of the associated objects to obtain the target wall-related object.
[0159] It should be noted that the dimensions between the wall-related object and the wall foundation object are often inconsistent. For example, in a Chinese-style building, the eaves of a wall are much larger than the wall itself. Correspondingly, if the wall foundation object is spliced according to the splicing method of the wall foundation object, the situation of "model penetration" often occurs. Under this premise, it is necessary to cut the wall-related object: the position to be modified can be understood as the position on the wall-related object that needs to be cut; the wall-related object to be spliced can be understood as the wall-related object after cutting; the relative position relationship of the associated objects can be understood as the position relationship between each wall-related object to be spliced; the target wall-related object is the wall-related object corresponding to the initial wall curve.
[0160] Based on this, determine the positions where all wall-related objects need to be spliced according to the position of the curve intersection point in the initial wall curve, that is, the positions to be modified; then, according to whether the wall-related object at the position to be modified indicated by the attribute information of the curve intersection point corresponds to the end point of the sub-target wall curve, process the wall-related object accordingly according to the judgment result to obtain the wall-related object to be spliced; then, determine the position relationship between each wall-related object to be spliced according to the initial wall curve; finally, splice the wall-related objects to be spliced based on this position relationship to obtain the target wall-related object.
[0161] Continuing with the above example, taking the wall-related object corresponding to L23 as an example, first determine the position to be modified in the wall-related object corresponding to L23 according to the position of the curve intersection point in the initial wall curve, then determine the specific cutting method of the position to be modified according to whether the wall-related object at the position to be modified indicated by the attribute information of the curve intersection point corresponds to the end point of the sub-target wall curve, then cut the wall-related object corresponding to L23 to obtain the wall-related object to be spliced corresponding to L23. By a similar method, construct the wall-related objects to be spliced corresponding to L1, L4, L5, L6, and L7 respectively. Then, determine the corresponding position relationship of the obtained wall-related objects to be spliced according to the initial wall curve, and finally splice them according to the corresponding position relationship to obtain the target wall-related object.
[0162] In summary, by processing the wall-associated objects and finally splicing the wall-associated objects, the problem of model penetration that occurs during direct splicing is solved.
[0163] Furthermore, before splicing the wall-associated objects, the wall-associated objects need to be cut. The specific cutting method is as follows in this embodiment:
[0164] Determine at least two wall-associated objects to be processed connected to the curve intersection point; based on the attribute information of the curve intersection point, determine the first modification position and the second modification position in the positions to be modified of the at least two wall-associated objects to be processed; cut the wall-associated object to be processed corresponding to the first modification position at the first modification position with a preset first cutting shape; cut the wall-associated object to be processed corresponding to the second modification position at the second modification position with a preset second cutting shape, where the first cutting shape and the second cutting shape are complementary.
[0165] Among them, the first modification position can be understood as the position corresponding to the end point position of the sub-target wall curve on the wall-associated object to be processed; the second modification position can be understood as the position corresponding to the position that is not the end point position of the sub-target wall curve on the wall-associated object to be processed; the first cutting shape and the second cutting shape can be understood as different cutting shapes performed according to different types of positions to be modified.
[0166] Based on this, determine at least two wall-associated objects to be processed connected to a curve intersection point, determine the first modification position and the second modification position in the positions to be modified of the wall-associated objects to be processed according to the indication of the attribute information of the curve intersection point, and perform cutting with different shapes according to different types of positions to be modified.
[0167] Continuing with the above example, for the wall-associated object corresponding to L23, determine the type of the corresponding position to be modified, and perform cutting with different shapes based on different types of positions to be modified. After cutting, as shown in Figure 6 Figure (b) in the schematic diagram of the wall-associated object of a wall generation method, where the position to be modified in the left ellipse is the second modification position and is cut with a preset second cutting shape; the position to be modified in the right ellipse is the first modification position and is cut with a preset first cutting shape.
[0168] In summary, by cutting the wall-related objects, each wall-related object can be spliced "perfectly" without the phenomenon of penetration. It should be noted that the preset cutting shape should ensure that the wall-related objects after cutting can fit with the wall foundation object after splicing, ensuring that the two can also be spliced. In addition, in addition to this cutting method, each wall-related object can also be directly combined on the wall foundation object, and then the penetrated part is judged and the penetrated part is cut off.
[0169] Step S108: Combine the target wall-related object with the wall foundation object to obtain a target wall.
[0170] Among them, the target wall can be understood as a wall model constructed based on the initial wall curve.
[0171] Based on this, determine the positional relationship between the target wall-related object and the wall foundation object according to the initial wall curve, and then based on this positional relationship, combine the two to obtain a target wall.
[0172] The wall generation method provided by this application divides the initial wall curve according to its own curve intersection points to obtain a to-be-processed wall curve and an intersection point curve, creates a wall foundation object according to the initial wall curve and the to-be-processed wall curve, creates a wall-related object according to the to-be-processed wall curve, then splices the wall-related objects to obtain a target wall-related object, and finally combines the target wall-related object with the wall-related object to obtain a target wall, realizing the automatic generation of the wall, solving the problems of cumbersome wall production and troublesome modification, accelerating the wall generation efficiency, being suitable for frequent modification of the wall during the wall production process, and improving the visual effect of the wall model.
[0173] Figure 7 The flowchart of a wall generation method provided by an embodiment of the present application is shown, which specifically includes the following steps:
[0174] Step S702: Receive a wall creation instruction submitted for the wall editing interface and draw an initial wall curve according to the wall creation instruction.
[0175] Step S704: Divide the initial wall curve into at least two to-be-processed wall curves and at least one intersection point curve according to the curve intersection points in the initial wall curve.
[0176] Step S706: Create a wall foundation object based on the initial wall curve and the at least one intersection point curve, and create a wall-related object based on the at least two to-be-processed wall curves.
[0177] Step S708: Perform splicing processing on the wall associated object according to the attribute information of the curve intersection point to obtain a target wall associated object.
[0178] Step S710: Combine the target wall associated object with the wall foundation object to obtain a target wall, and display it through the wall editing interface.
[0179] Specifically, the other wall generation method is applied to a client terminal. Through the operation of the user on the wall editing interface of the client terminal, a target wall is automatically generated, and then the target wall is displayed in the wall editing interface for the user to view and export.
[0180] Among them, the wall editing interface can be understood as an interface displayed on the client terminal for the user to operate based on their own needs to generate an expected target wall and display the target wall for the user to view; the wall creation instruction can be understood as an instruction to indicate the creation of a target wall, which may include curves entered by the user in the wall editing interface. The input method can be touch screen input or drawing based on a preset line segment plugin. Since there is more than one input method, the specific input method is determined by the actual usage scenario and is not limited in this embodiment.
[0181] Based on this, the user enters relevant initial wall curves through the wall editing interface on the client terminal to generate a wall creation instruction, and then draws the initial wall curves in the wall editing interface according to the wall creation instruction. Subsequently, the initial wall curves are processed to obtain a target wall, and the target wall is displayed through the wall editing interface for the user to view, and the relevant resource package of the target wall can be exported from the client terminal for subsequent processing and application by other devices or programs; it should be noted that the process of processing the initial wall curves to obtain a target wall has been explained in detail in a wall generation method provided in an embodiment of this specification and will not be elaborated in this embodiment.
[0182] In an optional embodiment, before dividing the initial wall curve into at least two wall curves to be processed and at least one intersection point curve according to the curve intersection points in the initial wall curve, it further includes:
[0183] Receive a wall generation instruction submitted for the initial wall curve; select an intersection point rule corresponding to the wall generation instruction in the intersection point rule library; calculate the curve intersection points in the initial wall curve based on the intersection point rule.
[0184] In an optional embodiment, dividing the initial wall curve into at least two wall curves to be processed according to the curve intersection points in the initial wall curve includes:
[0185] Determine the sub-initial wall curves connected by the curve intersection points in the initial wall curve; calculate the wall angles between adjacent sub-initial wall curves; select the sub-initial wall curves that do not meet the angle selection conditions as sub-target wall curves according to each wall angle; determine the splitting positions in the initial wall curve according to the curve intersection points and the sub-target wall curves; split the initial wall curve according to the splitting positions to obtain at least two to-be-processed wall curves.
[0186] In an alternative embodiment, the dividing the initial wall curve into at least one intersection point curve according to the curve intersection points in the initial wall curve includes:
[0187] Taking the curve intersection point as the starting point, divide the sub-initial wall curve according to a preset intercept length to obtain at least one intersection point curve.
[0188] In an alternative embodiment, when the initial wall curve includes multiple curve intersection points, it further includes:
[0189] Calculate the intersection point distances between any two adjacent curve intersection points among the multiple curve intersection points; select the curve intersection points with the intersection point distance less than the preset intercept length and no inflection points between the two curve intersection points to construct associated curve intersection point pairs; take each curve intersection point in the associated curve intersection point pair as the center point and divide according to the preset intercept length to obtain the intersection point curves corresponding to each curve intersection point in the associated curve intersection point pair.
[0190] In an alternative embodiment, the creating a wall base object based on the initial wall curve and the at least one intersection point curve includes:
[0191] Calculate the normal directions corresponding to the initial wall curve and the intersection point curve respectively; based on the normal direction corresponding to the initial wall curve, widen the initial wall curve to a preset width to obtain a widened wall curve; based on the normal direction corresponding to the intersection point curve, widen the intersection point curve to a preset width to obtain a widened intersection curve; extract the initial wall contour curve from the widened wall curve and extract the intersection point contour curve from the widened intersection curve; create a wall base object based on the initial wall contour curve and the intersection point contour curve.
[0192] In an alternative embodiment, the creating a wall base object based on the initial wall contour curve and the intersection point contour curve includes:
[0193] Calculate the tangent directions of each vertex on the initial wall contour curve, where the selection of the tangent directions between each vertex is related to the tangent direction of the previous vertex; sort each vertex on the initial wall contour curve according to the tangent directions of each vertex on the initial wall contour curve; perform texture mapping on the initial wall contour curve and the intersection point contour curve respectively based on the sorting result to obtain a wall base object.
[0194] In an alternative embodiment, the performing texture mapping on the initial wall contour curve and the intersection point contour curve respectively based on the sorting result to obtain a wall base object includes:
[0195] Create a wall base object cross-section curve according to the preset wall base object cross-section information; generate an initial wall sub-object based on the wall base object cross-section curve and the initial wall contour curve, and generate an intersection point sub-object based on the wall base object cross-section curve and the intersection point contour curve; perform UV processing on the initial wall sub-object and the intersection point sub-object based on the sorting result; determine the sub-object position relationship between the initial wall sub-object and the intersection point sub-object in the initial wall curve; splice the UV-processed initial wall sub-object and the intersection point sub-object according to the sub-object position relationship to obtain a wall base object.
[0196] In an alternative embodiment, the creating a wall association object based on the at least two walls to be processed curves includes:
[0197] Create a wall association object cross-section curve according to the preset wall association object cross-section information; sort the vertices on the wall association object cross-section curve; generate an initial wall association object based on the sorted wall association object cross-section curve and the walls to be processed curves; perform UV processing on the initial wall association object to obtain a wall association object corresponding to each wall to be processed curve.
[0198] In an alternative embodiment, the splicing process the wall association object according to the attribute information of the curve intersection point to obtain a target wall association object includes:
[0199] Determine the position to be modified in the wall association object according to the position of the curve intersection point in the initial wall curve; process the position to be modified in the wall association object based on the attribute information of the curve intersection point, and obtain a wall association object to be spliced according to the processing result; determine the association object position relationship of the wall association object to be spliced in the initial wall curve; splice the wall association object to be spliced according to the association object position relationship to obtain the target wall association object.
[0200] In an optional embodiment, processing the associated position to be decorated according to the attribute information of each curve intersection point includes:
[0201] Determine at least two wall-related objects to be processed connected to the curve intersection point; based on the attribute information of the curve intersection point, determine a first position to be decorated and a second position to be decorated among the positions to be decorated of the at least two wall-related objects to be processed; cut the wall-related object corresponding to the first position to be decorated at the first position to be decorated in a preset first cutting shape; cut the wall-related object corresponding to the second position to be decorated at the second position to be decorated in a preset second cutting shape, where the first cutting shape is complementary to the second cutting shape.
[0202] Another method for generating a wall provided by this application not only realizes the automatic generation of walls, solves the problems of cumbersome wall production and troublesome modification, speeds up the wall generation efficiency, is suitable for frequent modification of walls during the wall production process, and improves the visual effect of the wall model; it also provides a means of human-computer interaction, enabling users to easily obtain the expected target wall.
[0203] The above is a schematic solution of another method for generating a wall in this embodiment. It should be noted that the technical solution of another method for generating a wall belongs to the same concept as the technical solution of the above method for generating a wall. For the details not described in the technical solution of another method for generating a wall, reference can be made to the description of the technical solution of the above method for generating a wall.
[0204] The following combines the attached Figure 8 , taking the application of the wall processing method provided by this application to a movie scene as an example, to further illustrate the movie scene method. Among them, Figure 8 FIG. shows a processing flow chart of a method for generating a wall applied to a movie scene provided by an embodiment of this application, specifically including the following steps:
[0205] Step S802: Receive a wall generation instruction submitted for an initial wall curve.
[0206] Specifically, a movie art director issues a wall generation instruction for a certain movie scene where a wall needs to be generated, and the movie scene drawing program receives this wall generation instruction.
[0207] Step S804: Select an intersection point rule corresponding to the wall generation instruction in the intersection point rule library.
[0208] Specifically, the movie scene drawing program receives this wall generation instruction and starts to execute the wall generation task. First, it selects an intersection point rule in the intersection point rule library.
[0209] Step S806: Calculate the curve intersection points in the initial wall curve based on the intersection point rule.
[0210] Specifically, according to the intersection point rule, calculate the curve intersection point x1 in the initial wall curve of the "plus" shape preset by the user.
[0211] Step S808: Determine the sub-initial wall curves connected by the curve intersection points in the initial wall curve.
[0212] Specifically, determine the sub-initial wall curves m1, m2, m3, and m4 connected to x1.
[0213] Step S810: Calculate the wall angles between adjacent sub-initial wall curves.
[0214] Specifically, determine that the angles between m1, m2, m3, and m4 are all 90°.
[0215] Step S812: Select the sub-initial wall curves that do not meet the angle selection condition as the sub-target wall curves according to each wall angle.
[0216] Specifically, the angle selection condition is that at least one of the angles between a sub-initial wall curve and its two adjacent sub-initial wall curves is 180°. According to the angle selection condition, determine that m1, m2, m3, and m4 are all sub-target wall curves.
[0217] Step S814: Determine the splitting positions in the initial wall curve according to the curve intersection points and the sub-target wall curves.
[0218] Specifically, determine the splitting positions according to m1, m2, m3, m4 and x1.
[0219] Step S816: Split the initial wall curve according to the splitting positions to obtain at least two wall curves to be processed.
[0220] Specifically, starting from x1, cut off m1, m2, m3, and m4. The cut-off m1, m2, m3, and m4 are used as the wall curves to be processed.
[0221] Step S818: Starting from the curve intersection point, divide the sub-initial wall curve according to the preset truncation length to obtain at least one intersection point curve.
[0222] Specifically, starting from x1 and with a preset truncation length of 1 m, intercept in the directions of m1, m2, m3, and m4 to obtain a "plus"-shaped intersection point curve.
[0223] Step S820: Calculate the normal directions corresponding to the initial wall curve and the intersection point curve respectively.
[0224] Step S822: Based on the normal direction corresponding to the initial wall curve, widen the initial wall curve to a preset width to obtain a widened wall curve.
[0225] Step S824: Based on the normal direction corresponding to the intersection curve, widen the intersection curve to a preset width to obtain a widened intersection curve.
[0226] Step S826: Extract the initial wall contour curve from the widened wall curve, and extract the intersection point contour curve from the widened intersection curve.
[0227] Specifically, the initial wall contour curve n1 is extracted from the widened wall curve, and the intersection point contour curve n2 is extracted from the widened intersection curve.
[0228] Step S828: Create a wall base object based on the initial wall contour curve and the intersection point contour curve.
[0229] Specifically, calculate the tangent directions of each vertex on n1 and n2. According to the obtained tangent directions, sort each vertex on n1 and n2. Then, according to the preset cross-section information of the wall base object, create a cross-section curve n3 of the wall base object. Generate the initial wall sub-object corresponding to n1 according to n1 and n3, and generate the intersection point sub-object corresponding to n2 according to n2 and n3. Then, determine the U direction and V direction of the corresponding UV map according to the sorting results of each vertex on n1 and n2, perform texture mapping processing, determine the sub-object position relationship between the initial wall sub-object and the intersection point sub-object in the initial wall curve, and combine the initial wall sub-object and the intersection point sub-object with the completed UV map according to the sub-object position relationship to obtain the wall base object.
[0230] Step S830: Create a cross-section curve of the wall associated object according to the preset cross-section information of the wall associated object.
[0231] Step S832: Sort the vertices on the cross-section curve of the wall associated object.
[0232] Step S834: Obtain the wall associated object according to the sorting result and the cross-section curve of the wall associated object.
[0233] Specifically, according to the cross-section information of the preset wall associated object, create a cross-section curve of the wall associated object. Then, generate the corresponding initial wall associated objects m1a, m2a, m3a, m4a according to the wall object expiration curve and m1, m2, m3, m4, and perform texture mapping on m1a, m2a, m3a, m4a according to the vertex sorting on the cross-section curve of the wall associated object to obtain the wall associated objects M1, M2, M3, M4.
[0234] Step S836: Perform splicing processing on the wall associated object according to the attribute information of the curve intersection point to obtain the target wall associated object.
[0235] Specifically, according to the position of x1, determine the positions to be processed among M1, M2, M3, and M4 that need to be processed, and based on the attribute information of x1, determine the specific processing methods to be used for the positions to be processed of M1, M2, M3, and M4. Process based on this processing method, and splice the processed M1, M2, M3, and M4 according to their corresponding positions on the initial wall curve to obtain the target wall associated object.
[0236] Step S838: Combine the target wall associated object with the wall foundation object to obtain the target wall.
[0237] Specifically, combine the target wall associated object with the wall foundation object to obtain the target wall corresponding to the initial wall curve.
[0238] The fence generation method provided by this application divides the initial wall curve according to its own curve intersection points to obtain the wall curve to be processed and the intersection point curve, creates a wall foundation object according to the initial wall curve and the wall curve to be processed, creates a wall associated object according to the wall curve to be processed, then splices the wall associated objects to obtain the target wall associated object, and finally combines the target wall associated object with the wall associated object to obtain the target wall, realizing the automatic generation of the wall, solving the problems of cumbersome wall production and troublesome modification, accelerating the wall generation efficiency, being suitable for frequent modification of the wall during the wall production process, and improving the visual effect of the wall model.
[0239] Corresponding to the above method embodiment, this application also provides a wall generation device embodiment. Figure 9 The structural schematic diagram of a wall generation device provided by an embodiment of this application is shown. As Figure 9 shown, the device includes:
[0240] A division module 902, configured to divide the initial wall curve into at least two walls to be processed curves and at least one intersection point curve according to the curve intersection points in the initial wall curve.
[0241] A creation module 904, configured to create a wall foundation object based on the initial wall curve and the at least one intersection point curve, and create a wall associated object based on the at least two walls to be processed curves.
[0242] A splicing module 906, configured to perform splicing processing on the wall associated object according to the attribute information of the curve intersection point to obtain the target wall associated object.
[0243] The combined module 908 is configured to combine the target wall associated object with the wall foundation object to obtain a target wall.
[0244] In an optional embodiment, the wall generating device further includes:
[0245] A rule selection module, configured to receive a wall generation instruction submitted for the initial wall curve; select an intersection rule corresponding to the wall generation instruction from an intersection rule library; calculate curve intersection points in the initial wall curve based on the intersection rule.
[0246] In an optional embodiment, the partitioning module 902 is further configured to:
[0247] Determine sub-initial wall curves connected by the curve intersection points in the initial wall curve; calculate wall angles between adjacent sub-initial wall curves; select sub-initial wall curves that do not meet the angle selection condition as sub-target wall curves according to each wall angle; determine a splitting position in the initial wall curve according to the curve intersection points and the sub-target wall curves; split the initial wall curve according to the splitting position to obtain at least two wall curves to be processed.
[0248] In an optional embodiment, the partitioning module 902 is further configured to:
[0249] Starting from the curve intersection point, divide the sub-initial wall curve according to a preset intercept length to obtain at least one intersection point curve.
[0250] In an optional embodiment, the partitioning module 902 is further configured to:
[0251] Calculate the intersection point distance between any two adjacent curve intersection points among multiple curve intersection points; select curve intersection points with an intersection point distance less than the preset intercept length and no inflection points between the two curve intersection points to construct associated curve intersection point pairs; use each curve intersection point in the associated curve intersection point pairs as a center point and divide according to the preset intercept length to obtain intersection point curves corresponding to each curve intersection point in the associated curve intersection point pairs.
[0252] In an optional embodiment, the creating module 904 is further configured to:
[0253] Calculate the normal directions corresponding to the initial wall curve and the intersection point curve respectively; based on the normal direction corresponding to the initial wall curve, widen the initial wall curve to a preset width to obtain a widened wall curve; based on the normal direction corresponding to the intersection point curve, widen the intersection point curve to a preset width to obtain a widened intersection curve; extract the initial wall contour curve from the widened wall curve, and extract the intersection point contour curve from the widened intersection curve; create a wall foundation object based on the initial wall contour curve and the intersection point contour curve.
[0254] In an alternative embodiment, the creating module 904 is further configured to:
[0255] Calculate the tangent directions of each vertex on the initial wall contour curve, where the selection of the tangent directions between each vertex is related to the tangent direction of the previous vertex; sort each vertex on the initial wall contour curve according to the tangent directions of each vertex on the initial wall contour curve; perform texture mapping processing on the initial wall contour curve and the intersection point contour curve respectively based on the sorting result to obtain a wall foundation object.
[0256] In an alternative embodiment, the creating module 904 is further configured to:
[0257] Create a wall foundation object cross-section curve according to the preset wall foundation object cross-section information; generate an initial wall sub-object based on the wall foundation object cross-section curve and the initial wall contour curve, and generate an intersection point sub-object based on the wall foundation object cross-section curve and the intersection point contour curve; perform UV processing on the initial wall sub-object and the intersection point sub-object based on the sorting result; determine the sub-object position relationship between the initial wall sub-object and the intersection point sub-object in the initial wall curve; splice the UV-processed initial wall sub-object and the intersection point sub-object according to the sub-object position relationship to obtain a wall foundation object.
[0258] In an alternative embodiment, the creating module 904 is further configured to:
[0259] Create a wall associated object cross-section curve according to the preset wall associated object cross-section information; sort the vertices on the wall associated object cross-section curve; generate an initial wall associated object based on the sorted wall associated object cross-section curve and the wall curve to be processed; perform UV processing on the initial wall associated object to obtain a wall associated object corresponding to each wall curve to be processed.
[0260] In an alternative embodiment, the splicing module 906 is further configured to:
[0261] Determine the position to be modified in the wall-related object according to the position of the curve intersection point in the initial wall curve; process the position to be modified in the wall-related object based on the attribute information of the curve intersection point, and obtain the wall-related object to be spliced according to the processing result; determine the relative position relationship of the associated object of the wall-related object to be spliced in the initial wall curve; splice the wall-related object to be spliced according to the relative position relationship of the associated object to obtain the target wall-related object.
[0262] In an optional embodiment, the splicing module 906 is further configured to:
[0263] Determine at least two wall-related objects to be processed connected to the curve intersection point; based on the attribute information of the curve intersection point, determine a first position to be modified and a second position to be modified in the positions to be modified of the at least two wall-related objects to be processed; cut the wall-related object to be processed corresponding to the first position to be modified in the first position to be modified in a preset first cutting shape; cut the wall-related object to be processed corresponding to the second position to be modified in the second position to be modified in a preset second cutting shape, where the first cutting shape is complementary to the second cutting shape.
[0264] The fence generation device provided in this application realizes the automatic generation of the wall, solves the problems of cumbersome wall production and troublesome modification, improves the wall generation efficiency, is suitable for frequent modification of the wall during the wall production process, and enhances the visual effect of the wall model.
[0265] The above is a schematic solution of a fence generation device in this embodiment. It should be noted that the technical solution of this fence generation device and the technical solution of the above fence generation method belong to the same concept. For the details not described in detail in the technical solution of the fence generation device, reference can be made to the description of the technical solution of the above fence generation method. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method. The device claims defined by such a set of functional modules should be understood as mainly realizing the functional module framework of the solution through the computer program recorded in the specification, rather than mainly realizing the physical device of the solution through hardware means.
[0266] Corresponding to the above method embodiment, this application also provides another embodiment of the wall generation device. Figure 10 The structure diagram of another wall generation device provided in an embodiment of this application is shown. As Figure 10 shown, the device includes:
[0267] A receiving module 1002, configured to receive a wall creation instruction submitted for a wall editing interface and draw an initial wall curve according to the wall creation instruction;
[0268] An intersection point division module 1004, configured to divide the initial wall curve into at least two to-be-processed wall curves and at least one intersection point curve according to curve intersection points in the initial wall curve;
[0269] A wall object creation module 1006, configured to create a wall base object based on the initial wall curve and the at least one intersection point curve, and create a wall associated object based on the at least two to-be-processed wall curves;
[0270] A wall object splicing module 1008, configured to perform a splicing process on the wall associated object according to attribute information of the curve intersection point to obtain a target wall associated object;
[0271] A display module 1010, configured to combine the target wall associated object with the wall base object to obtain a target wall and display it through the wall editing interface.
[0272] Another fence generation device provided by the present application not only realizes the automatic generation of walls, solves the problems of cumbersome wall production and troublesome modification, speeds up the wall generation efficiency, is suitable for frequent modification of walls during the wall production process, and improves the visual effect of the wall model; it also provides a human-computer interaction means, enabling users to simply and conveniently obtain the expected target wall.
[0273] The above is a schematic solution of another fence generation device of this embodiment. It should be noted that the technical solution of this fence generation device and the technical solution of the above-mentioned another fence generation method belong to the same concept. For the details not described in detail in the technical solution of this fence generation device, reference can be made to the description of the technical solution of the above-mentioned another fence generation method. In addition, each component in the device embodiment should be understood as a functional module that must be established to implement each step of the program flow or each step of the method. Each functional module is not an actual functional division or separation limitation. The device claim defined by such a group of functional modules should be understood as mainly implementing the functional module framework of the solution through the computer program recorded in the specification, rather than mainly implementing the entity device of the solution through hardware means.
[0274] Figure 11FIG. 0 shows a structural block diagram of a computing device 1100 provided according to an embodiment of the present application. The components of the computing device 1100 include, but are not limited to, a memory 1110 and a processor 1120. The processor 1120 is connected to the memory 1110 via a bus 1130, and a database 1150 is used to store data.
[0275] The computing device 1100 further includes an access device 1140, which enables the computing device 1100 to communicate via one or more networks 1160. Examples of these networks include the Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 1140 may include one or more of any type of wired or wireless network interface (e.g., Network Interface Card (NIC)), 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 on.
[0276] In an embodiment of the present application, the above components of the computing device 1100 and Figure 11 other components not shown in FIG. may also be connected to each other, for example, via a bus. It should be understood that Figure 11 the shown structural block diagram of the computing device is for illustrative purposes only and is not a limitation on the scope of the present application. Those skilled in the art can add or replace other components as needed.
[0277] The computing device 1100 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 1100 can also be a mobile or stationary server.
[0278] Among them, the processor 1120 is used to execute the following computer-executable instructions:
[0279] Dividing the initial wall curve into at least two to-be-processed wall curves and at least one intersection curve according to the curve intersection points in the initial wall curve;
[0280] Creating a wall base object based on the initial wall curve and the at least one intersection curve, and creating a wall association object based on the at least two to-be-processed wall curves;
[0281] Perform splicing processing on the wall - related object according to the attribute information of the curve intersection point to obtain a target wall - related object;
[0282] Combine the target wall - related object with the wall foundation object to obtain a target wall.
[0283] The above is a schematic solution of a computing device in this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above - mentioned wall generation method belong to the same concept. For the details not described in detail in the technical solution of the computing device, reference can be made to the description of the technical solution of the above - mentioned wall generation method.
[0284] An embodiment of the present application also provides a computer - readable storage medium, which stores computer instructions. When the instructions are executed by a processor, they are used for:
[0285] Divide the initial wall curve into at least two to - be - processed wall curves and at least one intersection - point curve according to the curve intersection points in the initial wall curve;
[0286] Create a wall foundation object based on the initial wall curve and the at least one intersection - point curve, and create a wall - related object based on the at least two to - be - processed wall curves;
[0287] Perform splicing processing on the wall - related object according to the attribute information of the curve intersection point to obtain a target wall - related object;
[0288] Combine the target wall - related object with the wall foundation object to obtain a target wall.
[0289] The above is a schematic solution of a computer - readable storage medium in this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above - mentioned wall generation method belong to the same concept. For the details not described in detail in the technical solution of the storage medium, reference can be made to the description of the technical solution of the above - mentioned wall generation method.
[0290] An embodiment of the present application also provides a chip, which stores a computer program. When the computer program is executed by the chip, it implements the steps of the wall generation method.
[0291] The above - mentioned specific embodiments of the present application are described. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be executed in a different order from that in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired result. In certain embodiments, multi - tasking and parallel processing are also possible or may be advantageous.
[0292] The computer instructions include computer program code, which may be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, mobile hard disks, magnetic disks, optical disks, computer memories, read-only memories (ROMs), random access memories (RAMs), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice within the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electrical carrier signals and telecommunication signals.
[0293] It should be noted that for the foregoing method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that this application is not limited by the described action sequence, because according to this application, certain steps may be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0294] In the above embodiments, the descriptions of the respective embodiments have their own focuses. For parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.
[0295] The preferred embodiments of this application disclosed above are only used to help explain this application. The alternative embodiments do not elaborate on all details and do not limit the invention to the specific embodiments described. Obviously, many modifications and variations can be made according to the content of this application. This application selects and specifically describes these embodiments to better explain the principle and practical application of this application, so that those skilled in the art can understand and utilize this application well. This application is only limited by the claims and their full scope and equivalents.
Claims
1. A method for generating a wall, characterized in that, Including: Dividing the initial wall curve into at least two to-be-processed wall curves and at least one intersection curve according to the curve intersection points in the initial wall curve, wherein dividing the initial wall curve into at least two to-be-processed wall curves and at least one intersection curve according to the curve intersection points in the initial wall curve includes: taking the curve intersection points as a reference, splitting the initial wall curve to split out at least two to-be-processed wall curves that do not include the curve intersection points and at least one intersection curve that includes the curve intersection points; Creating a wall base object based on the initial wall curve and the at least one intersection curve, and creating a wall associated object based on the at least two to-be-processed wall curves; Performing splicing processing on the wall associated object according to the attribute information of the curve intersection points to obtain a target wall associated object; Combining the target wall associated object with the wall base object to obtain a target wall.
2. The method according to claim 1, characterized in that, Before dividing the initial wall curve into at least two to-be-processed wall curves and at least one intersection curve according to the curve intersection points in the initial wall curve, it further includes: Receiving a wall generation instruction submitted for the initial wall curve; Selecting an intersection rule corresponding to the wall generation instruction in an intersection rule library; Calculating the curve intersection points in the initial wall curve based on the intersection rule.
3. The method according to claim 1, wherein The splitting the initial wall curve to split out at least two to-be-processed wall curves that do not include the curve intersection points by taking the curve intersection points as a reference includes: Determining sub-initial wall curves connected by the curve intersection points in the initial wall curve; Calculating the wall angle between adjacent sub-initial wall curves; Selecting sub-initial wall curves that do not meet the angle selection condition as sub-target wall curves according to each wall angle; Determining a splitting position in the initial wall curve according to the curve intersection points and the sub-target wall curves; Splitting the initial wall curve according to the splitting position to obtain at least two to-be-processed wall curves.
4. The method according to claim 3, wherein The splitting the initial wall curve to split out at least one intersection curve that includes the curve intersection points by taking the curve intersection points as a reference includes: Taking the curve intersection points as starting points, dividing the sub-initial wall curves according to a preset intercept length to obtain at least one intersection curve.
5. The method according to claim 4, characterized in that In the case where the initial wall curve includes multiple curve intersection points, it further includes: Calculating the intersection distance between any two adjacent curve intersection points among the multiple curve intersection points; Selecting curve intersection points with an intersection distance less than the preset intercept length and no inflection points between the two curve intersection points to construct associated curve intersection point pairs; Taking each curve intersection point in the associated curve intersection point pairs as a center point and dividing according to the preset intercept length to obtain intersection curves corresponding to each curve intersection point in the associated curve intersection point pairs.
6. The method according to claim 1, characterized in that, The creating a wall base object based on the initial wall curve and the at least one intersection curve includes: Calculate the normal directions corresponding to the initial wall curve and the intersection point curve respectively; Based on the normal direction corresponding to the initial wall curve, widen the initial wall curve to a preset width to obtain a widened wall curve; Based on the normal direction corresponding to the intersection point curve, widen the intersection point curve to a preset width to obtain a widened intersection curve; Extract the initial wall contour curve from the widened wall curve, and extract the intersection point contour curve from the widened intersection curve; Create a wall base object based on the initial wall contour curve and the intersection point contour curve.
7. The method according to claim 6, wherein The creating a wall base object based on the initial wall contour curve and the intersection point contour curve includes: Calculate the tangent directions of each vertex on the initial wall contour curve, where the selection of the tangent directions between each vertex is related to the tangent direction of the previous vertex; Sort each vertex on the initial wall contour curve according to the tangent directions of each vertex on the initial wall contour curve; Perform texture mapping processing on the initial wall contour curve and the intersection point contour curve respectively based on the sorting result to obtain a wall base object.
8. The method according to claim 7, wherein The performing texture mapping processing on the initial wall contour curve and the intersection point contour curve respectively based on the sorting result to obtain a wall base object includes: Create a wall base object cross-section curve according to the preset wall base object cross-section information; Generate an initial wall sub-object based on the wall base object cross-section curve and the initial wall contour curve, and generate an intersection point sub-object based on the wall base object cross-section curve and the intersection point contour curve; Perform UV processing on the initial wall sub-object and the intersection point sub-object based on the sorting result; Determine the sub-object position relationship between the initial wall sub-object and the intersection point sub-object in the initial wall curve; Splice the UV-processed initial wall sub-object and the intersection point sub-object according to the sub-object position relationship to obtain a wall base object.
9. The method according to claim 1, wherein The creating a wall associated object based on the at least two walls to be processed includes: Create a wall associated object cross-section curve according to the preset wall associated object cross-section information; Sort the vertices on the wall associated object cross-section curve; Generate an initial wall associated object based on the sorted wall associated object cross-section curve and the walls to be processed; Perform UV processing on the initial wall associated object to obtain a wall associated object corresponding to each wall to be processed.
10. The method according to claim 9, characterized in that, The splicing process the wall associated object according to the attribute information of the curve intersection point to obtain a target wall associated object includes: Determine the position to be modified in the wall associated object according to the position of the curve intersection point in the initial wall curve; Process the position to be modified in the wall associated object based on the attribute information of the curve intersection point, and obtain a wall associated object to be spliced according to the processing result; Determine the associated object position relationship of the wall associated object to be spliced in the initial wall curve; Splice the wall object to be spliced according to the positional relationship of the associated objects to obtain the target wall object.
11. The method according to claim 10, wherein Processing the associated position to be decorated according to the attribute information of each curve intersection point includes: Determine at least two wall objects to be processed connected to the curve intersection point; Based on the attribute information of the curve intersection point, determine a first position to be decorated and a second position to be decorated among the positions to be decorated of the at least two wall objects to be processed; Cut the wall object to be processed corresponding to the first position to be decorated at the first position to be decorated in a preset first cutting shape; Cut the wall object to be processed corresponding to the second position to be decorated at the second position to be decorated in a preset second cutting shape, where the first cutting shape is complementary to the second cutting shape.
12. A wall generating device, characterized in that, Including: A dividing module configured to divide the initial wall curve into at least two wall curves to be processed and at least one wall curve to be processed according to the curve intersection points in the initial wall curve; The dividing module is further configured to divide the initial wall curve with the curve intersection point as a reference, cutting out at least two wall curves to be processed that do not include the curve intersection point and at least one intersection curve that includes the curve intersection point; A creating module configured to create a wall basic object based on the initial wall curve and the at least one intersection curve, and create a wall associated object based on the at least two wall curves to be processed; A splicing module configured to splice the wall associated objects according to the attribute information of the curve intersection point to obtain a target wall associated object; A combining module configured to combine the target wall associated object with the wall basic object to obtain a target wall.
13. A method for generating a wall, characterized in that, Applied to a client terminal, it includes: Receive a wall creation instruction submitted for the wall editing interface, and draw an initial wall curve according to the wall creation instruction; Divide the initial wall curve into at least two wall curves to be processed and at least one intersection curve according to the curve intersection points in the initial wall curve, where dividing the initial wall curve into at least two wall curves to be processed and at least one intersection curve according to the curve intersection points in the initial wall curve includes: dividing the initial wall curve with the curve intersection point as a reference, cutting out at least two wall curves to be processed that do not include the curve intersection point and at least one intersection curve that includes the curve intersection point; Create a wall basic object based on the initial wall curve and the at least one intersection curve, and create a wall associated object based on the at least two wall curves to be processed; Splice the wall associated objects according to the attribute information of the curve intersection point to obtain a target wall associated object; Combine the target wall associated object with the wall basic object to obtain a target wall, and display it through the wall editing interface.
14. A computing device, characterized in that, Including: A memory and a processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the wall generation method according to any one of claims 1 to 11 or 13.
15. A computer-readable storage medium stores computer instructions, characterized in that, When the instructions are executed by the processor, the steps of the wall generation method according to any one of claims 1 to 11 or 13 are implemented.
16. A computer program product, characterized in that, It includes computer instructions, and when the computer instructions are executed by the processor, the steps of the wall generation method according to any one of claims 1 to 11 or 13 are implemented.
Citation Information
Patent Citations
Wall surface generation method of crossed wall body, computer equipment and readable storage medium
CN112966330A