Spline data processing method and device, equipment and storage medium

By adjusting the angle of the spline segment to conform to the preset target angle array, the problem of inconsistent segment angles in the virtual scene is solved. The generated scene elements are more standardized and unified, reducing the difficulty of subsequent modification and optimization.

CN120707791APending Publication Date: 2025-09-26GUANGZHOU BOGUAN TELECOMM TECH LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510856359.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-24
Publication Date
2025-09-26

AI Technical Summary

Technical Problem

In virtual scene development, scene elements generated based on arbitrary splines have inconsistent line segment angles, resulting in inconsistent use of art resources and increasing the difficulty of subsequent modification and optimization.

Method used

By obtaining the normal direction of the spline segment on the original spline, calculating the current angle, and determining the target angle from the preset target angle array, the angle of the spline segment is adjusted to make it conform to the preset target angle array to generate the target spline.

Benefits of technology

The generated scene elements are more standardized and unified, reducing the difficulty of later modification and optimization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120707791A_ABST
    Figure CN120707791A_ABST
Patent Text Reader

Abstract

The invention provides a spline line data processing method and device, equipment and a storage medium, and relates to the technical field of data processing. The method comprises the following steps: acquiring normal directions of starting points and normal directions of end points of a plurality of spline segments on an original spline line, and calculating a current included angle of a current spline segment according to the normal directions of the starting points and the normal directions of the end points of the current spline segment in the plurality of spline segments, determining a target included angle corresponding to the current spline line segment from a preset target included angle array, and adjusting the current included angle of the current spline line segment into the corresponding target included angle; and recalculating and adjusting the included angle of the next spline line segment into the corresponding included angle in the preset target included angle array, and determining the spline line when the included angles of the plurality of spline line segments are adjusted as a target spline line for generating the scene elements in the line form in the virtual scene, so that the scene elements are more unified visually.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a spline data processing method, apparatus, device and storage medium. Background Art

[0002] In the development of some virtual scenes, each requires the creation of line-based elements, such as roads and rivers. The underlying data for these elements is often defined using arbitrary splines. These generated splines, due to the keypoint coordinates of the original data, can realistically reflect the line's shape. However, the angles between line segments can be arbitrary. These irregular angles can lead to inconsistencies in the use of art assets, increasing the difficulty of later modification and optimization. Summary of the Invention

[0003] The object of the present invention is to address the deficiencies in the above-mentioned prior art and provide a spline data processing method, apparatus, device and storage medium so that the target angles of each spline segment on the target spline are all preset angles in a preset target angle array, and the scene elements generated based on the target spline are more standardized and visually more unified.

[0004] To achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows: In a first aspect, an embodiment of the present application provides a method for processing spline data, the method comprising: Get the normal direction of the starting point and the normal direction of the end point of multiple spline segments on the original spline; Calculating a current angle of the current spline segment according to a normal direction of a starting point and a normal direction of an end point of the current spline segment among the multiple spline segments; According to the current angle of the current spline segment, determine the target angle corresponding to the current spline segment from a preset target angle array, and adjust the current angle of the current spline segment to the corresponding target angle, wherein the preset target angle array includes: a plurality of preset angles; recalculating and adjusting the angle of the next spline segment to a corresponding angle in the preset target angle array according to the normal direction of the starting point and the normal direction of the end point of the next spline segment among the multiple spline segments; A spline obtained when the angles of the plurality of spline segments are adjusted is determined as a target spline, wherein the target spline is used to generate a line-shaped scene element in a virtual scene.

[0005] In an optional embodiment, obtaining the normal directions of the start points and the normal directions of the end points of the plurality of spline segments on the original spline includes: Obtaining normal directions of multiple control points on the original spline; The normal direction of the first control point at the starting point and the normal direction of the second control point at the end point of each spline segment are read from the normal directions of the multiple control points and used as the normal direction of the starting point and the normal direction of the end point of each spline segment respectively.

[0006] In an optional embodiment, obtaining the normal directions of the plurality of control points on the original spline includes: Sampling the original spline according to a preset interval to obtain the multiple control points on the original spline; Segmenting the original spline according to the multiple control points to obtain the multiple spline segments; The normal directions of the multiple control points are acquired and stored, wherein the normal direction of each control point is the vector direction of the spline segment preceding each control point.

[0007] In an optional embodiment, the calculating the current angle of the current spline segment according to the normal direction of the starting point and the normal direction of the end point of the current spline segment among the multiple spline segments includes: Performing a dot product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a first dot product operation result; An inverse trigonometric operation is performed on the first dot product operation result to obtain a current angle of the current spline segment.

[0008] In an optional embodiment, before determining the target angle corresponding to the current spline segment from a preset target angle array based on the current angle of the current spline segment, the method further includes: determining whether the angle of the current spline segment satisfies a preset angle correction condition according to the normal direction of the starting point and the normal direction of the end point of the current spline segment and a preset reference direction; If the preset angle correction condition is met, the difference between 360 degrees and the current angle of the current spline segment is determined as the corrected angle of the current spline segment.

[0009] In an optional embodiment, determining whether the angle of the current spline segment satisfies a preset angle correction condition based on the normal direction of the starting point and the normal direction of the end point of the current spline segment and a preset reference direction includes: Performing a cross product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a cross product operation result; Performing a dot product operation on the cross product operation result and a preset reference direction to obtain a second dot product operation result; If the second dot product operation result is less than 0, determining that the current angle of the current spline segment meets the preset angle correction condition; If the second dot product operation result is greater than 0, it is determined that the current angle of the current spline segment does not meet the preset angle correction condition.

[0010] In an optional embodiment, determining the target angle corresponding to the current spline segment from a preset target angle array based on the current angle of the current spline segment includes: According to the current angle of the current spline segment, a preset angle closest to the current angle of the current spline segment is determined from the preset target angle array as the target angle.

[0011] In an optional implementation, adjusting the angle of the current spline segment to the corresponding target angle includes: The position of the end point of the current spline segment is adjusted so that the angle of the current spline segment after adjustment is the corresponding target angle.

[0012] In an optional embodiment, adjusting the position of the end point of the current spline segment includes: Determine the angle difference between the target angle corresponding to the current spline segment and the current angle; determining a target rotation parameter at an end point of the current spline segment according to the angle difference; According to the target rotation parameter, the current spline segment is rotated around the starting point to obtain a target vector; Determining a target end point position of the current spline segment according to the target vector, the starting point of the current spline segment, and the length of the current spline segment; Adjust the endpoint of the current spline segment to the target endpoint position.

[0013] In an optional embodiment, before determining the target angle corresponding to the current spline segment from a preset target angle array based on the angle of the current spline segment, the method further includes: According to the preset angle deviation, a plurality of angles in an angle arithmetic progression are obtained as the plurality of preset angles, wherein the angle difference between adjacent angles in the angle arithmetic progression is the preset angle deviation.

[0014] In a second aspect, an embodiment of the present application further provides a spline data processing device, the device comprising: An acquisition module, used for acquiring the normal directions of the starting points and the normal directions of the end points of multiple spline segments on the original spline; a calculation module, configured to calculate a current angle of the current spline segment according to a normal direction of a starting point and a normal direction of an end point of the current spline segment among the multiple spline segments; an adjustment module, configured to determine, based on the current angle of the current spline segment, a target angle corresponding to the current spline segment from a preset target angle array, and adjust the current angle of the current spline segment to the corresponding target angle, wherein the preset target angle array includes: a plurality of preset angles; The adjustment module is further configured to recalculate and adjust the current angle of the next spline segment to a corresponding angle in the preset target angle array based on the normal direction of the starting point and the normal direction of the end point of the next spline segment among the multiple spline segments; The determination module is configured to determine a spline line obtained when the angles of the plurality of spline segments are adjusted as a target spline line, wherein the target spline line is used to generate a line-shaped scene element in a virtual scene.

[0015] In a third aspect, an embodiment of the present application further provides an electronic device comprising: a processor, a storage medium and a bus, wherein the storage medium stores program instructions executable by the processor. When the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the program instructions to perform the steps of the spline data processing method as described in any one of the first aspects.

[0016] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the spline data processing method as described in any one of the first aspects are executed.

[0017] The beneficial effects of this application are: Embodiments of the present application provide a spline data processing method, apparatus, device, and storage medium. The method includes: obtaining normal directions of the start points and the end points of multiple spline segments on an original spline; calculating a current angle of the current spline segment based on the normal directions of the start point and the end point of a current spline segment among the multiple spline segments; determining a target angle corresponding to the current spline segment from a preset target angle array based on the current angle of the current spline segment; and adjusting the current angle of the current spline segment to the corresponding target angle, wherein the preset target angle array includes: multiple preset angles; recalculating and adjusting the angle of a next spline segment to a corresponding angle in the preset target angle array based on the normal directions of the start point and the end point of a next spline segment among the multiple spline segments; and finally determining a spline when the angles of the multiple spline segments are all adjusted as a target spline. The target spline is used to generate line-shaped scene elements in a virtual scene. The method of the present application determines the target angle corresponding to the current spline segment based on a preset target angle array. After the angle adjustment of the current spline segment is completed, the angle of the next spline segment is continued to be processed to finally obtain the target spline, so that the target angles of each spline segment on the target spline are all preset angles in the preset target angle array. Based on the target spline, which truly reflects the line shape, the generated scene elements are more standardized and visually more unified, which reduces the difficulty of later modification and optimization. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 One of the flow charts of a spline data processing method provided in an embodiment of the present application; Figure 2 A schematic diagram of an original spline provided in an embodiment of the present application; Figure 3 A second flow chart of a spline data processing method provided in an embodiment of the present application; Figure 4 The third flowchart of a spline data processing method provided in an embodiment of the present application; Figure 5 A schematic diagram of the normal directions of multiple control points provided in an embodiment of the present application; Figure 6 A fourth flow chart of a spline data processing method provided in an embodiment of the present application; Figure 7 A fifth flow chart of a spline data processing method provided in an embodiment of the present application; Figure 8 Flowchart 6 of a spline data processing method provided in an embodiment of the present application; Figure 9 Flowchart 7 of a spline data processing method provided in an embodiment of the present application; Figure 10 A schematic diagram of a target spline provided in an embodiment of the present application; Figure 11 A schematic diagram of multiple target splines provided in an embodiment of the present application; Figure 12 A schematic diagram of the functional modules of a spline data processing device provided in an embodiment of the present application; Figure 13 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments.

[0021] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments in the present application without creative work are within the scope of protection of the present application.

[0022] In the description of this application, it should be noted that if the terms "upper", "lower", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the accompanying drawings, or is the orientation or position relationship in which the product of the application is usually placed when in use. It is only for the convenience of describing this application and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation on this application.

[0023] In addition, the terms "first," "second," and the like in the description and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product, or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to these processes, methods, products, or apparatus.

[0024] It should be noted that, in the absence of conflict, the features in the embodiments of this application can be combined with each other.

[0025] In order to make the angles between the segments on the original spline more standardized and facilitate the management of the effects of scene elements generated based on splines in the virtual scene, an embodiment of the present application provides a spline data processing method, which calculates the current angle of the current spline segment through the normal directions of the starting points and the normal directions of the end points of multiple spline segments on the original spline, and then determines the corresponding target angle from the preset target angle array, and adjusts the current angle to the corresponding target angle, and continues to adjust the current angle of the next spline segment until the angle adjustment of all spline segments is completed to obtain the target spline, so that the scene elements generated based on the target spline on the basis of truly reflecting the line shape are more standardized and visually more unified, reducing the difficulty of later modification and optimization.

[0026] The following is a detailed explanation of a spline data processing method provided in an embodiment of the present application through specific examples in conjunction with the accompanying drawings. Figure 1 One of the flow charts of a spline data processing method provided in an embodiment of the present application; Figure 2 A schematic diagram of an original spline provided in an embodiment of the present application; Figure 1 As shown, the method includes: S101: Obtain the normal directions of the start points and the normal directions of the end points of multiple spline segments on an original spline.

[0027] In this embodiment, during the virtual scene development process, the underlying data of scene elements in the virtual scene are defined by primitive splines. The scene elements may be roads, rivers, mountains, glaciers, and the like.

[0028] For example, the geographic coordinates of multiple points on the road in the virtual scene are obtained and stored as a position file. The position file is read using the three-dimensional computer graphics software Houdini, and the multiple points are connected in the order of the geographic coordinates to obtain the original spline. Figure 2 As shown, the original spline includes multiple points, among which the blue points are points.

[0029] The original spline has multiple spline segments, and the start point and end point of each spline segment both store normal directions, so that the normal directions of the start point and the end point of each spline segment can be obtained.

[0030] S102: Calculate a current angle of the current spline segment according to the normal direction of the starting point and the normal direction of the end point of the current spline segment among the multiple spline segments.

[0031] S103 : Determine a target angle corresponding to the current spline segment from a preset target angle array according to the current angle of the current spline segment, and adjust the current angle of the current spline segment to the corresponding target angle.

[0032] The preset target angle array includes: multiple preset angles.

[0033] Specifically, a for loop is performed on each spline segment on the original spline, and the number of loops is the number of spline segments. It can be understood that the first loop process is to process the first spline segment among the multiple spline segments, and the current angle of the first spline segment is calculated and adjusted. Then, a second loop process is performed to continue processing the second spline segment among the multiple spline segments, until the last loop process is performed, that is, the last spline segment among the multiple spline segments is processed.

[0034] Therefore, the current spline segment is any one of the multiple spline segments. First, the current angle of the current spline segment is calculated, and then the target angle corresponding to the current spline segment is determined from the preset target angle array, and the current angle of the current spline segment is adjusted to the corresponding target angle.

[0035] Optionally, before determining the target angle corresponding to the current spline segment from a preset target angle array based on the angle of the current spline segment, the method further includes: According to the preset angle deviation, a plurality of angles in the angle arithmetic progression are obtained as a plurality of preset angles, wherein the angle difference between adjacent angles in the angle arithmetic progression is the preset angle deviation.

[0036] Specifically, the angle deviation is predetermined and an angle arithmetic progression is generated. The multiple angles in the angle arithmetic progression are used as multiple preset angles to obtain a preset target angle array.

[0037] For example, if the preset angle deviation is 15, the range of the generated angle arithmetic sequence target_angles is {0-360}, which is specifically expressed as: target_angles={15,30,45,60,75,90,105,120,135,150,165,180,195,210,225,240,255,270,285,300,315,330,345,360}.

[0038] Based on the multiple angles in the angle arithmetic progression target_angles, multiple preset angles in the preset target angle array are determined, resulting in a preset target angle array. Thus, based on the current angle of the current spline segment, the target angle corresponding to the current spline segment can be determined from the preset target angle array. It should be noted that the preset angle deviation can be set to a multiple of 15, such as 30 or 45, without limitation. The corresponding angle arithmetic progression is then generated, resulting in a corresponding preset target angle array.

[0039] Optionally, according to the current angle of the current spline segment, a preset angle closest to the current angle of the current spline segment is determined from an array of preset target angles as the target angle.

[0040] Specifically, if the preset angles in the preset target angle array are {15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 210, 225, 240, 255, 270, 285, 300, 315, 330, 345, 360}, and if the current angle of the current spline segment is 199, then the target angle of the current spline segment is determined to be 195, and the current angle 199 of the current spline segment is adjusted to the corresponding target angle 195. Similarly, if the current angle of the current spline segment is 169, then the target angle of the current spline segment is determined to be 165, and the current angle 169 of the current spline segment is adjusted to the corresponding target angle 165.

[0041] S104 , recalculating and adjusting the angle of the next spline segment to a corresponding angle in the preset target angle array according to the normal direction of the starting point and the normal direction of the end point of the next spline segment among the multiple spline segments.

[0042] S105: Determine a spline when the angles of the plurality of spline segments are adjusted as a target spline.

[0043] The target spline is used to generate line-shaped scene elements in the virtual scene.

[0044] Specifically, since the current angle of the current spline segment is adjusted to the corresponding target angle, the end point of the current spline segment changes. Since the end point of the current spline segment is the starting point of the next spline segment, this also affects the normal direction of the starting point and the normal direction of the end point of the next spline segment. Therefore, in the next loop, it is necessary to determine the normal direction of the starting point and the normal direction of the end point of the next spline segment and calculate the angle of the next spline segment in the next loop.

[0045] Similarly, according to the angle of the next spline segment, the target angle corresponding to the next spline segment is determined from the preset target angle array, and the current angle of the next spline segment is adjusted to the corresponding target angle.

[0046] This loop continues until all the spline segments have been adjusted, resulting in a target spline. The target angles of each spline segment on the target spline are all preset angles in the preset target angle array. This creates a more visually unified virtual scene based on the target spline, with the line-shaped scene elements being more uniform.

[0047] In summary, an embodiment of the present application provides a spline data processing method, the method comprising: obtaining the normal directions of the start points and the normal directions of the end points of multiple spline segments on an original spline, calculating the current angle of the current spline segment based on the normal directions of the start point and the end point of the current spline segment among the multiple spline segments, determining the target angle corresponding to the current spline segment from a preset target angle array based on the current angle of the current spline segment, and adjusting the current angle of the current spline segment to the corresponding target angle, wherein the preset target angle array includes: multiple preset angles, recalculating and adjusting the angle of the next spline segment to the corresponding angle in the preset target angle array based on the normal directions of the start point and the end point of the next spline segment among the multiple spline segments, and finally determining the spline when the angles of the multiple spline segments are all adjusted as the target spline, wherein the target spline is used to generate line-shaped scene elements in a virtual scene. The method of the present application determines the target angle corresponding to the current spline segment based on a preset target angle array. After the angle adjustment of the current spline segment is completed, the angle of the next spline segment is continued to be processed to finally obtain the target spline, so that the target angles of each spline segment on the target spline are all preset angles in the preset target angle array. Based on the target spline, which truly reflects the line shape, the generated scene elements are more standardized and visually more unified, which reduces the difficulty of later modification and optimization.

[0048] The embodiment of the present application also provides another possible implementation of the spline data processing method by obtaining the normal direction of the starting point and the normal direction of the end point. Figure 3 The second flow chart of a spline data processing method provided in the embodiment of the present application is as follows: Figure 3 As shown, the normal directions of the start points and end points of multiple spline segments on the original spline are obtained, including: S201: Obtain normal directions of multiple control points on the original spline.

[0049] S202. Read the normal direction of the first control point at the starting point and the normal direction of the second control point at the end point of each spline segment from the normal directions of the multiple control points, and use them as the normal direction of the starting point and the normal direction of the end point of each spline segment, respectively.

[0050] In this embodiment, there are multiple control points on the original spline, and each control point stores a corresponding normal direction. Since the starting point and end point of each spline segment are both control points, the normal direction of the first control point at the starting point of each spline segment and the normal direction of the second control point at the end point of each spline segment are used as the normal direction of the starting point and the normal direction of the end point of each spline segment, respectively.

[0051] In this embodiment, the normal directions of the start point and the end point of each spline segment are determined by reading the normal directions of the multiple control points, so as to process each spline segment.

[0052] The embodiment of the present application also provides another possible implementation of the spline data processing method by obtaining the normal directions of multiple control points. Figure 4 The third flow chart of a spline data processing method provided in an embodiment of the present application is as follows: Figure 5 This is a schematic diagram of the normal direction of multiple control points provided in an embodiment of the present application. Figure 4 As shown, get the normal direction of multiple control points on the original spline, including: S301 : Sampling an original spline according to a preset spacing to obtain a plurality of control points on the original spline.

[0053] In this example, the Resample node in Houdini software is used to sample the original spline at a preset spacing, obtaining multiple control points on the original spline. The preset spacing can be set to 20, 25, or 35 units (meters), but this is not a limitation. It should be noted that the start and end points of the original spline are also control points.

[0054] S302: Segment the original spline according to the multiple control points to obtain multiple spline segments.

[0055] Specifically, the ConvertLine node in Houdini software is used to segment the original spline according to multiple control points to obtain multiple spline segments.

[0056] It should be noted that the length of each spline segment is less than or equal to the preset spacing. For example, the end point of the last spline segment of the original spline is the last control point, and the starting point is the previous control point adjacent to the last control point. If the interval between the end point and the starting point of the last spline segment is the preset spacing, the length of the last spline segment is equal to the preset spacing. If the interval between the end point and the starting point of the last spline segment is less than the preset spacing, the length of the last spline segment is less than the preset spacing.

[0057] S303: Acquire and store the normal directions of multiple control points.

[0058] The normal direction of each control point is the vector direction of the spline segment before each control point.

[0059] Specifically, the OrientAlongCurve node in Houdini software is used to take the vector direction of the spline segment before each control point as the normal direction of the control point, such as Figure 5 As shown, four spline segments are shown, including control point A, control point B, control point C and control point D. The dotted lines are the vector directions of each spline segment and also the normal directions of each control point. It should be noted that since control point A is the starting point of the original spline, the normal direction of control point A is the vector direction of the first spline segment, and the normal direction of control point B is also the vector direction of the first spline segment.

[0060] In the method provided in the embodiment of the present application, the original spline is sampled according to a preset spacing to obtain multiple control points on the original spline; the original spline is segmented according to the multiple control points to obtain multiple spline segments; the normal directions of the multiple control points are obtained and stored, wherein the normal direction of each control point is the vector direction of the spline segment before each control point, thereby obtaining the normal directions of the multiple control points on the original spline and obtaining multiple spline segments.

[0061] The embodiment of the present application also provides another possible implementation of the spline data processing method by calculating the current angle of the current spline segment. Figure 6 The fourth flow chart of a spline data processing method provided in the embodiment of the present application is as follows: Figure 6 As shown, the current angle of the current spline segment is calculated according to the normal direction of the starting point and the normal direction of the end point of the current spline segment among multiple spline segments, including: S401 : Perform a dot product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a first dot product operation result.

[0062] S402: Perform an inverse trigonometric operation on the result of the first dot product operation to obtain a current angle of the current spline segment.

[0063] In this embodiment, the normal direction of the starting point of the current spline segment is the vector direction last_N of the previous spline segment adjacent to the current spline segment, and the normal direction of the end point of the current spline segment is the vector direction next_N of the current spline segment.

[0064] Then, a dot product operation is performed on the normal direction of the starting point of the current spline segment and the normal direction of the end point to obtain the first dot product operation result. Then, an arccos (inverse cosine trigonometric function) operation is performed on the first dot product operation result to obtain the current angle of the current spline segment, which is recorded as angle.

[0065] It should be noted that if the current spline segment is the first spline segment, the normal direction of the starting point and the normal direction of the end point of the first spline segment are the same, both being the vector direction next_N of the first spline segment, and the angle of the first spline segment is 180 degrees.

[0066] In the method provided in an embodiment of the present application, a first dot product operation result is obtained by performing a dot product operation on the normal direction of the starting point of the current spline segment and the normal direction of the end point; then an inverse trigonometric operation is performed on the first dot product operation result to obtain the current angle of the current spline segment, which is used to adjust the current spline segment according to the current angle.

[0067] The present application embodiment also provides another possible implementation of the spline data processing method. Figure 7 The fifth flow chart of a spline data processing method provided in the embodiment of the present application is as follows: Figure 7 As shown, before determining the target angle corresponding to the current spline segment from the preset target angle array according to the current angle of the current spline segment, the method further includes: S501: Determine whether the angle of the current spline segment meets a preset angle correction condition based on the normal direction of the starting point and the normal direction of the end point of the current spline segment and a preset reference direction.

[0068] S502: If a preset angle correction condition is met, determine the difference between 360 degrees and the current angle of the current spline segment as the corrected angle of the current spline segment.

[0069] In this embodiment, based on the normal direction of the starting point and the normal direction of the end point of the current spline segment and a preset reference direction, it is determined whether the angle of the current spline segment meets the preset angle correction condition, that is, whether the actual angle of the current spline segment is greater than 180 degrees.

[0070] Since inverse trigonometric operations are used in the process of calculating the current angle of the current spline segment, the calculated current angles are all less than 180 degrees, while the actual angle of the current spline segment may be greater than 180 degrees. If, based on the normal direction of the starting point and the normal direction of the end point of the current spline segment, as well as the preset reference direction, it is determined that the actual angle of the current spline segment is greater than 180 degrees, but the calculated current angle of the current spline segment is less than 180 degrees, it is determined that the current angle of the current spline segment meets the preset angle correction condition, and the current angle of the current spline segment needs to be corrected. In this case, the corrected angle of the current spline segment is 360-angle.

[0071] If the actual angle of the current spline segment is less than 180 degrees, it is determined that the current angle of the current spline segment does not meet the preset angle correction condition, and in this case, the current angle of the current spline segment does not need to be corrected.

[0072] In the method provided in an embodiment of the present application, whether the angle of the current spline segment meets a preset angle correction condition is determined based on the normal direction of the starting point and the normal direction of the end point of the current spline segment, as well as a preset reference direction. If the preset angle correction condition is met, the difference between 360 degrees and the current angle of the current spline segment is determined as the corrected angle of the current spline segment, thereby ensuring the accuracy of the current angle of the current spline segment.

[0073] The present application embodiment also provides another possible implementation of the spline data processing method. Figure 8 The sixth flow chart of a spline data processing method provided in the embodiment of the present application is as follows: Figure 8 As shown, according to the normal direction of the starting point and the normal direction of the end point of the current spline segment and the preset reference direction, determining whether the angle of the current spline segment meets the preset angle correction condition includes: S601: Perform a cross product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a cross product operation result.

[0074] S602: Perform a dot product operation on the cross product operation result and a preset reference direction to obtain a second dot product operation result.

[0075] S603: If the result of the second dot product operation is less than 0, determine whether the current angle of the current spline segment meets a preset angle correction condition.

[0076] S604: If the result of the second dot product operation is greater than 0, determine that the current angle of the current spline segment does not meet a preset angle correction condition.

[0077] In this embodiment, the preset reference direction may be the positive Y-axis direction in Houdini software, i.e., {0, 1, 0}, where the axis perpendicular to the default plane in Houdini software is the Y-axis. A cross product operation is then performed on the normal direction of the starting point of the current spline segment and the normal direction of the end point to obtain a cross product result. A dot product operation is then performed on the cross product result and the preset reference direction to obtain a second dot product result. Based on the second dot product result, it is determined whether the actual angle formed by the normal direction of the starting point and the normal direction of the end point is less than 180 degrees or greater than 180 degrees.

[0078] If the result of the second dot product operation is less than 0, it means that the actual angle of the current spline segment is greater than 180 degrees, while the calculated current angle of the current spline segment is less than 180 degrees. Therefore, it is determined that the current angle of the current spline segment meets the preset angle correction condition, and the corrected angle of the current spline segment is 360-current angle.

[0079] If the result of the second dot product operation is greater than 0, it means that the actual angle of the current spline segment is less than 180 degrees, and the calculated current angle of the current spline segment is also less than 180 degrees. Therefore, it is determined that the current angle of the current spline segment does not meet the preset angle correction condition, and the current angle of the current spline segment is not corrected, thereby ensuring the accuracy of the current angle of the current spline segment.

[0080] The embodiment of the present application further provides another possible implementation of a spline data processing method, which adjusts the angle of a current spline segment to a corresponding target angle, including: Adjust the position of the end point of the current spline segment so that the angle of the current spline segment after adjustment is the corresponding target angle.

[0081] In this embodiment, when processing the current spline segment, the angles of the spline segments before the current spline segment have all been processed into standard angles, that is, the angles contained in the target_angles array. In this loop, only the position of the end point of the current spline segment is adjusted so that the angle of the current spline segment after adjustment is the corresponding target angle.

[0082] Based on the above example, the embodiment of the present application also provides another possible implementation of the spline data processing method: Figure 9 The seventh flow chart of a spline data processing method provided in an embodiment of the present application is as follows: Figure 10 A schematic diagram of a target spline provided in an embodiment of the present application, Figure 11 This is a schematic diagram of multiple target splines provided in an embodiment of the present application. Figure 9 As shown, adjust the position of the end point of the current spline segment, including: S701: Determine the angle difference between the target angle corresponding to the current spline segment and the current angle.

[0083] S702: Determine a target rotation parameter at the end point of the current spline segment according to the angle difference.

[0084] S703: Rotate the current spline segment around the starting point according to the target rotation parameter to obtain a target vector.

[0085] S704: Determine the target end point position of the current spline segment according to the target vector, the start point of the current spline segment, and the length of the current spline segment.

[0086] S705: Adjust the end point of the current spline segment to the target end point position.

[0087] In this embodiment, the angle difference delta_degree between the target angle corresponding to the current spline segment and the current angle is calculated, and the target rotation parameter at the end point of the current spline segment is determined based on the angle difference. Then, based on the target rotation parameter, the current spline segment is rotated around the starting point to obtain the target vector.

[0088] Among them, the target rotation parameter determines the direction in which the current spline segment rotates around the starting point. For example, if the angle difference is positive, the target rotation parameter at the end point of the current spline segment is positive, and the current spline segment is rotated right around the starting point by delta_degree to obtain the target vector; if the angle difference is negative, the target rotation parameter at the end point of the current spline segment is negative, and the current spline segment is rotated left around the starting point by delta_degree to obtain the target vector.

[0089] Then, according to the target vector, the starting point of the current spline segment and the length of the current spline segment, the target end point position of the current spline segment is determined. Specifically, the target end point position = the starting point position of the current spline segment + the target vector × the length of the current spline segment, thereby obtaining the target end point position of the current spline segment, and adjusting the end point of the current spline segment to the target end point position to complete the adjustment of the angle of the current spline segment, so that the angle of the current spline segment after adjustment is the corresponding target angle.

[0090] like Figure 10 As shown, the dotted line is the original spline, and the solid line is the spline after all the angles of the spline segments on the original spline are adjusted, i.e., the target spline. It can be seen that the basic trends of the original spline and the target spline are consistent, but the regularized target spline only has the angles in the preset target angle array target_angles.

[0091] If there are multiple original splines in the virtual scene, the above steps are applied to each original spline to obtain the target spline corresponding to each original spline, such as Figure 11 As shown, each target spline only has the angles in the preset target angle array target_angles.

[0092] The following continues to explain the spline data processing device and electronic device provided by any of the above embodiments of the present application. The specific implementation process and the technical effects produced are the same as those of the corresponding method embodiments mentioned above. For the sake of brief description, the parts not mentioned in this embodiment can be referred to the corresponding content in the method embodiment.

[0093] Figure 12 This is a functional module diagram of a spline data processing device provided in an embodiment of the present application. Figure 12 As shown, the spline data processing device 100 includes: An acquisition module 110 is used to acquire the normal directions of the start points and the end points of multiple spline segments on the original spline; a calculation module 120 for calculating a current angle of the current spline segment according to a normal direction of a starting point and a normal direction of an end point of the current spline segment among the plurality of spline segments; an adjustment module 130 for determining a target angle corresponding to the current spline segment from a preset target angle array based on the current angle of the current spline segment, and adjusting the current angle of the current spline segment to the corresponding target angle, wherein the preset target angle array includes: a plurality of preset angles; The adjustment module 130 is further configured to recalculate and adjust the current angle of the next spline segment to a corresponding angle in the preset target angle array based on the normal direction of the starting point and the normal direction of the end point of the next spline segment among the multiple spline segments; The determination module 140 is configured to determine a spline obtained when the angles of the plurality of spline segments are adjusted as a target spline, wherein the target spline is used to generate a line-shaped scene element in the virtual scene.

[0094] Optionally, the acquisition module 110 is further used to obtain the normal directions of multiple control points on the original spline; from the normal directions of the multiple control points, the normal direction of the first control point at the starting point of each spline segment and the normal direction of the second control point at the end point are read respectively and used as the normal direction of the starting point and the normal direction of the end point of each spline segment respectively.

[0095] Optionally, the acquisition module 110 is further used to sample the original spline according to a preset spacing to obtain multiple control points on the original spline; segment the original spline according to the multiple control points to obtain multiple spline segments; obtain and store the normal directions of the multiple control points, wherein the normal direction of each control point is the vector direction of the spline segment before each control point.

[0096] Optionally, the calculation module 120 is further configured to perform a dot product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a first dot product operation result; and perform an inverse trigonometric operation on the first dot product operation result to obtain a current angle of the current spline segment.

[0097] Optionally, the determination module 140 is further configured to determine whether the angle of the current spline segment satisfies a preset angle correction condition based on the normal direction of the starting point and the normal direction of the end point of the current spline segment, as well as a preset reference direction; if the preset angle correction condition is satisfied, determine the difference between 360 degrees and the current angle of the current spline segment as the corrected angle of the current spline segment.

[0098] Optionally, the determination module 140 is further used to perform a cross product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a cross product operation result; perform a dot product operation on the cross product operation result and a preset reference direction to obtain a second dot product operation result; if the second dot product operation result is less than 0, it is determined that the current angle of the current spline segment meets the preset angle correction condition; if the second dot product operation result is greater than 0, it is determined that the current angle of the current spline segment does not meet the preset angle correction condition.

[0099] Optionally, the determination module 140 is further configured to determine, based on the current angle of the current spline segment, from the preset target angle array a preset angle closest to the current angle of the current spline segment as the target angle.

[0100] Optionally, the adjustment module 130 is further configured to adjust the position of the end point of the current spline segment so that the angle of the current spline segment after adjustment is the corresponding target angle.

[0101] Optionally, the adjustment module 130 is further configured to determine an angle difference between a target angle corresponding to the current spline segment and the current angle; determine a target rotation parameter at the end point of the current spline segment based on the angle difference; rotate the current spline segment around the starting point based on the target rotation parameter to obtain a target vector; determine a target end point position of the current spline segment based on the target vector, the starting point of the current spline segment, and the length of the current spline segment; and adjust the end point of the current spline segment to the target end point position.

[0102] Optionally, the acquisition module 110 is further configured to acquire multiple angles in an angle arithmetic progression as multiple preset angles according to a preset angle deviation, wherein the angle difference between adjacent angles in the angle arithmetic progression is the preset angle deviation.

[0103] The above-mentioned device is used to execute the method provided in the above-mentioned embodiment. Its implementation principle and technical effect are similar and will not be repeated here.

[0104] The above modules can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more microprocessors, or one or more field programmable gate arrays (FPGAs). For example, when a module is implemented by scheduling program code through a processing element, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor that can call program code. For another example, these modules can be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0105] Figure 13 This is a schematic diagram of an electronic device provided in an embodiment of the present application, which can be used for spline data processing. Figure 13 As shown, the electronic device includes: a processor 210 , a storage medium 220 , and a bus 230 .

[0106] The storage medium 220 stores machine-readable instructions executable by the processor 210. When the electronic device is running, the processor 210 communicates with the storage medium 220 via the bus 230, and the processor 210 executes the machine-readable instructions. The execution method includes: Get the normal direction of the starting point and the normal direction of the end point of multiple spline segments on the original spline; Calculating a current angle of the current spline segment according to a normal direction of a starting point and a normal direction of an end point of the current spline segment among the multiple spline segments; According to the current angle of the current spline segment, determine the target angle corresponding to the current spline segment from a preset target angle array, and adjust the current angle of the current spline segment to the corresponding target angle, wherein the preset target angle array includes: a plurality of preset angles; Recalculate and adjust the angle of the next spline segment to a corresponding angle in the preset target angle array according to the normal direction of the starting point and the normal direction of the end point of the next spline segment among the multiple spline segments; A spline obtained when the angles of the plurality of spline segments are adjusted is determined as a target spline, wherein the target spline is used to generate a line-shaped scene element in a virtual scene.

[0107] Optionally, obtaining the normal directions of the start points and end points of multiple spline segments on the original spline includes: Get the normal direction of multiple control points on the original spline; From the normal directions of the multiple control points, the normal direction of the first control point at the start point of each spline segment and the normal direction of the second control point at the end point are read respectively and used as the normal direction of the start point and the normal direction of the end point of each spline segment respectively.

[0108] Optionally, obtain the normal directions of multiple control points on the original spline, including: According to the preset spacing, the original spline is sampled to obtain multiple control points on the original spline; According to multiple control points, the original spline is segmented to obtain multiple spline segments; Get and store the normal directions of multiple control points, where the normal direction of each control point is the vector direction of the spline segment before each control point.

[0109] Optionally, calculating the current angle of the current spline segment according to the normal direction of the starting point and the normal direction of the end point of the current spline segment among the multiple spline segments includes: Perform a dot product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a first dot product operation result; Perform an inverse trigonometric operation on the result of the first dot product operation to obtain the current angle of the current spline segment.

[0110] Optionally, before determining the target angle corresponding to the current spline segment from a preset target angle array based on the current angle of the current spline segment, the method further includes: Determining whether the angle of the current spline segment meets a preset angle correction condition according to the normal direction of the starting point and the normal direction of the end point of the current spline segment and a preset reference direction; If the preset angle correction condition is met, the difference between 360 degrees and the current angle of the current spline segment is determined as the corrected angle of the current spline segment.

[0111] Optionally, determining whether the angle of the current spline segment satisfies a preset angle correction condition based on the normal direction of the starting point and the normal direction of the end point of the current spline segment and a preset reference direction includes: Perform a cross product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a cross product operation result; Performing a dot product operation on the cross product operation result and the preset reference direction to obtain a second dot product operation result; If the result of the second dot product operation is less than 0, it is determined that the current angle of the current spline segment meets the preset angle correction condition; If the result of the second dot product operation is greater than 0, it is determined that the current angle of the current spline segment does not meet the preset angle correction condition.

[0112] Optionally, according to the current angle of the current spline segment, determining the target angle corresponding to the current spline segment from a preset target angle array includes: According to the current angle of the current spline segment, a preset angle closest to the current angle of the current spline segment is determined from the preset target angle array as the target angle.

[0113] Optionally, adjusting the angle of the current spline segment to a corresponding target angle includes: Adjust the position of the end point of the current spline segment so that the angle of the current spline segment after adjustment is the corresponding target angle.

[0114] Optionally, adjust the position of the end point of the current spline segment, including: Determine the angle difference between the target angle and the current angle corresponding to the current spline segment; According to the angle difference, the target rotation parameter at the end point of the current spline segment is determined; According to the target rotation parameter, the current spline segment is rotated around the starting point to obtain the target vector; Determine the target end point of the current spline segment based on the target vector, the start point of the current spline segment, and the length of the current spline segment; Adjust the endpoint of the current spline segment to the target endpoint position.

[0115] Optionally, before determining the target angle corresponding to the current spline segment from a preset target angle array based on the angle of the current spline segment, the method further includes: According to the preset angle deviation, a plurality of angles in the angle arithmetic progression are obtained as a plurality of preset angles, wherein the angle difference between adjacent angles in the angle arithmetic progression is the preset angle deviation.

[0116] Optionally, the present application further provides a storage medium 220 on which a computer program is stored. When the computer program is executed by a processor, the steps of the above method embodiment are executed.

[0117] When the program is executed by the processor, the execution method may include: Get the normal direction of the starting point and the normal direction of the end point of multiple spline segments on the original spline; Calculating a current angle of the current spline segment according to a normal direction of a starting point and a normal direction of an end point of the current spline segment among the multiple spline segments; According to the current angle of the current spline segment, determine the target angle corresponding to the current spline segment from a preset target angle array, and adjust the current angle of the current spline segment to the corresponding target angle, wherein the preset target angle array includes: a plurality of preset angles; Recalculate and adjust the angle of the next spline segment to a corresponding angle in the preset target angle array according to the normal direction of the starting point and the normal direction of the end point of the next spline segment among the multiple spline segments; A spline obtained when the angles of the plurality of spline segments are adjusted is determined as a target spline, wherein the target spline is used to generate a line-shaped scene element in a virtual scene.

[0118] Optionally, obtaining the normal directions of the start points and end points of multiple spline segments on the original spline includes: Get the normal direction of multiple control points on the original spline; From the normal directions of the multiple control points, the normal direction of the first control point at the start point of each spline segment and the normal direction of the second control point at the end point are read respectively and used as the normal direction of the start point and the normal direction of the end point of each spline segment respectively.

[0119] Optionally, obtain the normal directions of multiple control points on the original spline, including: According to the preset spacing, the original spline is sampled to obtain multiple control points on the original spline; According to multiple control points, the original spline is segmented to obtain multiple spline segments; Get and store the normal directions of multiple control points, where the normal direction of each control point is the vector direction of the spline segment before each control point.

[0120] Optionally, calculating the current angle of the current spline segment according to the normal direction of the starting point and the normal direction of the end point of the current spline segment among the multiple spline segments includes: Perform a dot product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a first dot product operation result; Perform an inverse trigonometric operation on the result of the first dot product operation to obtain the current angle of the current spline segment.

[0121] Optionally, before determining the target angle corresponding to the current spline segment from a preset target angle array based on the current angle of the current spline segment, the method further includes: Determining whether the angle of the current spline segment meets a preset angle correction condition according to the normal direction of the starting point and the normal direction of the end point of the current spline segment and a preset reference direction; If the preset angle correction condition is met, the difference between 360 degrees and the current angle of the current spline segment is determined as the corrected angle of the current spline segment.

[0122] Optionally, determining whether the angle of the current spline segment satisfies a preset angle correction condition based on the normal direction of the starting point and the normal direction of the end point of the current spline segment and a preset reference direction includes: Perform a cross product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a cross product operation result; Performing a dot product operation on the cross product operation result and the preset reference direction to obtain a second dot product operation result; If the result of the second dot product operation is less than 0, it is determined that the current angle of the current spline segment meets the preset angle correction condition; If the result of the second dot product operation is greater than 0, it is determined that the current angle of the current spline segment does not meet the preset angle correction condition.

[0123] Optionally, according to the current angle of the current spline segment, determining the target angle corresponding to the current spline segment from a preset target angle array includes: According to the current angle of the current spline segment, a preset angle closest to the current angle of the current spline segment is determined from the preset target angle array as the target angle.

[0124] Optionally, adjusting the angle of the current spline segment to a corresponding target angle includes: Adjust the position of the end point of the current spline segment so that the angle of the current spline segment after adjustment is the corresponding target angle.

[0125] Optionally, adjust the position of the end point of the current spline segment, including: Determine the angle difference between the target angle and the current angle corresponding to the current spline segment; According to the angle difference, the target rotation parameter at the end point of the current spline segment is determined; According to the target rotation parameter, the current spline segment is rotated around the starting point to obtain the target vector; Determine the target end point of the current spline segment based on the target vector, the start point of the current spline segment, and the length of the current spline segment; Adjust the endpoint of the current spline segment to the target endpoint position.

[0126] Optionally, before determining the target angle corresponding to the current spline segment from a preset target angle array based on the angle of the current spline segment, the method further includes: According to the preset angle deviation, a plurality of angles in the angle arithmetic progression are obtained as a plurality of preset angles, wherein the angle difference between adjacent angles in the angle arithmetic progression is the preset angle deviation.

[0127] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0128] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0129] In addition, the functional units in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional units.

[0130] The aforementioned integrated unit implemented as a software functional unit can be stored in a computer-readable storage medium. The software functional unit, stored in a storage medium, includes instructions for causing a computer device (which may be a personal computer, server, or network device, etc.) or a processor to execute portions of the method steps described in various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, a removable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0131] The above are only specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this invention should be included in the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be based on the scope of protection of the claims.

Claims

1. A spline data processing method, characterized in that: The method comprises: Get the normal direction of the starting point and the normal direction of the end point of multiple spline segments on the original spline; Calculating a current angle of the current spline segment according to a normal direction of a starting point and a normal direction of an end point of the current spline segment among the multiple spline segments; According to the current angle of the current spline segment, determine the target angle corresponding to the current spline segment from a preset target angle array, and adjust the current angle of the current spline segment to the corresponding target angle, wherein the preset target angle array includes: a plurality of preset angles; recalculating and adjusting the angle of the next spline segment to a corresponding angle in the preset target angle array according to the normal direction of the starting point and the normal direction of the end point of the next spline segment among the multiple spline segments; A spline obtained when the angles of the plurality of spline segments are adjusted is determined as a target spline, wherein the target spline is used to generate a line-shaped scene element in a virtual scene.

2. The method according to claim 1, characterized in that The step of obtaining the normal directions of the start points and the end points of the plurality of spline segments on the original spline includes: Obtaining normal directions of multiple control points on the original spline; The normal direction of the first control point at the starting point and the normal direction of the second control point at the end point of each spline segment are read from the normal directions of the multiple control points and used as the normal direction of the starting point and the normal direction of the end point of each spline segment respectively.

3. The method according to claim 2, characterized in that The obtaining of normal directions of a plurality of control points on the original spline includes: Sampling the original spline according to a preset interval to obtain the multiple control points on the original spline; Segmenting the original spline according to the multiple control points to obtain the multiple spline segments; The normal directions of the multiple control points are acquired and stored, wherein the normal direction of each control point is the vector direction of the spline segment preceding each control point.

4. The method according to claim 1, wherein Calculating the current angle of the current spline segment according to the normal direction of the starting point and the normal direction of the end point of the current spline segment among the multiple spline segments includes: Performing a dot product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a first dot product operation result; An inverse trigonometric operation is performed on the first dot product operation result to obtain a current angle of the current spline segment.

5. The method according to claim 1, wherein Before determining the target angle corresponding to the current spline segment from a preset target angle array based on the current angle of the current spline segment, the method further includes: determining whether the angle of the current spline segment satisfies a preset angle correction condition according to the normal direction of the starting point and the normal direction of the end point of the current spline segment and a preset reference direction; If the preset angle correction condition is met, the difference between 360 degrees and the current angle of the current spline segment is determined as the corrected angle of the current spline segment.

6. The method according to claim 5, characterized in that The determining, based on the normal direction of the starting point and the normal direction of the end point of the current spline segment and a preset reference direction, whether the angle of the current spline segment satisfies a preset angle correction condition includes: Performing a cross product operation on the normal direction of the starting point and the normal direction of the end point of the current spline segment to obtain a cross product operation result; Performing a dot product operation on the cross product operation result and a preset reference direction to obtain a second dot product operation result; If the second dot product operation result is less than 0, determining that the current angle of the current spline segment meets the preset angle correction condition; If the second dot product operation result is greater than 0, it is determined that the current angle of the current spline segment does not meet the preset angle correction condition.

7. The method according to claim 1, characterized in that The step of determining a target angle corresponding to the current spline segment from a preset target angle array according to the current angle of the current spline segment includes: According to the current angle of the current spline segment, a preset angle closest to the current angle of the current spline segment is determined from the preset target angle array as the target angle.

8. The method according to claim 1, characterized in that The adjusting the angle of the current spline segment to the corresponding target angle includes: The position of the end point of the current spline segment is adjusted so that the angle of the current spline segment after adjustment is the corresponding target angle.

9. The method according to claim 8, characterized in that The adjusting the position of the end point of the current spline segment includes: Determine the angle difference between the target angle corresponding to the current spline segment and the current angle; determining a target rotation parameter at an end point of the current spline segment according to the angle difference; According to the target rotation parameter, the current spline segment is rotated around the starting point to obtain a target vector; Determining a target end point position of the current spline segment according to the target vector, the starting point of the current spline segment, and the length of the current spline segment; Adjust the endpoint of the current spline segment to the target endpoint position.

10. The method according to claim 1, characterized in that Before determining the target angle corresponding to the current spline segment from a preset target angle array based on the angle of the current spline segment, the method further includes: According to the preset angle deviation, a plurality of angles in an angle arithmetic progression are obtained as the plurality of preset angles, wherein the angle difference between adjacent angles in the angle arithmetic progression is the preset angle deviation.

11. A spline data processing device, characterized in that: The device comprises: An acquisition module, used for acquiring the normal directions of the starting points and the normal directions of the end points of multiple spline segments on the original spline; a calculation module, configured to calculate a current angle of the current spline segment according to a normal direction of a starting point and a normal direction of an end point of the current spline segment among the multiple spline segments; an adjustment module, configured to determine, based on the current angle of the current spline segment, a target angle corresponding to the current spline segment from a preset target angle array, and adjust the current angle of the current spline segment to the corresponding target angle, wherein the preset target angle array includes: a plurality of preset angles; The adjustment module is further configured to recalculate and adjust the current angle of the next spline segment to a corresponding angle in the preset target angle array based on the normal direction of the starting point and the normal direction of the end point of the next spline segment among the multiple spline segments; The determination module is configured to determine a spline line obtained when the angles of the plurality of spline segments are adjusted as a target spline line, wherein the target spline line is used to generate a line-shaped scene element in a virtual scene.

12. An electronic device, characterized in that: include: A processor, a storage medium, and a bus, wherein the storage medium stores program instructions executable by the processor. When the electronic device is running, the processor and the storage medium communicate via the bus, and the processor executes the program instructions to perform the steps of the spline data processing method according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the spline data processing method according to any one of claims 1 to 10 are executed.