Design surface data processing method, device, equipment and computer readable medium
By generating an offset curve matching the boundary of the target area in the design surface data processing and adding offset control points, the problem of surface extension in the prior art increases in computational complexity is solved, and more efficient design surface data processing is achieved.
Patent Information
- Application Number
- CN202411349640.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-09-26
AI Technical Summary
In design surface data processing, the prior art realizes surface extension by adjusting and optimizing the control points of the design surface, resulting in an increase in computational complexity and reducing processing efficiency.
By detecting the user-selected design surface target area, an offset curve matching the boundary of the area is generated, and an offset control point is added to the control point matrix to generate an updated design surface to achieve surface extension.
This method does not need to adjust the original control points, but directly adds offset control points, which reduces the computational complexity, improves the generation efficiency of extended surfaces, and thus improves the overall efficiency of design surface data processing.
Smart Images

Figure CN118864773B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and computer-readable medium for processing design surface data. Background Art
[0002] Surface extension usually refers to the process of using computer-aided design to generate new surface areas based on existing surfaces, so that the original surface can be extended to a new area to meet the user's design needs.
[0003] In the related art, when extending a design surface, it is achieved by adjusting and optimizing the control points of the design surface, which may change the overall shape of the original design surface, increase the calculation complexity of the computer, and reduce the efficiency of design surface data processing.
[0004] Therefore, how to improve the efficiency of design surface data processing is an urgent problem to be solved. Summary of the invention
[0005] To solve the above technical problems, the embodiments of the present application provide a method, apparatus, device and computer-readable storage medium for processing design surface data.
[0006] Among them, the technical solutions adopted in this application are as follows.
[0007] A design surface data processing method comprises: detecting a design surface target area selected by a user on a design surface to be extended; wherein the design surface is generated based on a control point matrix composed of a plurality of control points; generating an offset curve matching the boundary of the design surface target area based on the target point position input by the user; wherein the offset curve comprises a plurality of offset control points; adding the plurality of offset control points corresponding to the offset curve to the control point matrix based on the direction of the boundary of the design surface target area in the design surface to obtain an updated control point matrix; generating an updated design surface based on the updated control point matrix, wherein the updated design surface comprises an extended surface matching the design surface target area.
[0008] A design surface data processing device comprises: a detection unit, used to detect a design surface target area selected by a user on a design surface to be extended; wherein the design surface is generated based on a control point matrix composed of multiple control points; a processing unit, used to generate an offset curve matching the boundary of the design surface target area based on the target point position input by the user; wherein the offset curve includes multiple offset control points; the processing unit is also used to add the multiple offset control points corresponding to the offset curve to the control point matrix based on the direction of the boundary of the design surface target area in the design surface to obtain an updated control point matrix; the processing unit is also used to generate an updated design surface based on the updated control point matrix, wherein the updated design surface includes an extended surface matching the design surface target area.
[0009] In one embodiment of the present application, based on the aforementioned scheme, the processing unit is further used to generate a target ray in a preset direction with the target point as the starting point; the device also includes a calculation unit, which is used to calculate the point on the boundary of the designed surface target area that is closest to the target ray, and the target distance between the point with the closest distance and the target ray; the processing unit is also used to generate an offset curve that matches the boundary of the designed surface target area based on multiple sampling points on the boundary of the designed surface target area, the point with the closest distance and the target distance.
[0010] In one embodiment of the present application, based on the aforementioned scheme, the processing unit is further used to perform sampling on the boundary of the target area of the designed surface to obtain the multiple sampling points; based on the target distance, the offset of the multiple sampling points and the points closest to the distance is calculated to obtain multiple offset points; wherein the multiple offset points include an offset sampling point corresponding to each sampling point, and an offset point corresponding to the point closest to the distance; based on the multiple offset points, an offset curve matching the boundary of the target area of the designed surface is calculated.
[0011] In one embodiment of the present application, based on the aforementioned scheme, the device also includes an acquisition unit, which is used to acquire the multiple offset control points corresponding to the offset curve, wherein the multiple offset control points are generated based on the target point position and the boundary of the target area of the design surface; the processing unit is also used to add a reserved space in the control point matrix to accommodate the multiple offset control points based on the direction of the boundary of the target area of the design surface in the design surface; and add the multiple offset control points to the reserved space in the control point matrix to obtain an updated control point matrix.
[0012] In one embodiment of the present application, based on the aforementioned scheme, the acquisition unit is also used to acquire the selection points input by the user for multiple areas in the design surface; the processing unit is also used to generate a selection ray in a preset direction with the selection point as the starting point; and determine the target area of the design surface based on the intersection of the selection ray and the design surface.
[0013] In one embodiment of the present application, based on the aforementioned scheme, the processing unit is also used to, if the design surface is uniformly mapped to a preset coordinate system, uniformly divide the design surface into regions under the preset coordinate system to obtain the multiple regions; calculate the region where the intersection is located based on the coordinates of the intersection; and use the region where the intersection is located as the target region of the design surface.
[0014] In one embodiment of the present application, based on the aforementioned scheme, the processing unit is also used to, if the design surface is non-uniformly mapped to a preset coordinate system, perform non-uniform division on the design surface in the preset coordinate system to obtain the multiple regions; wherein, among the multiple regions, the difference between the sum of the areas of the regions in the first direction and the sum of the areas of the regions in the second direction is greater than the preset difference; the first direction and the second direction are perpendicular to each other; the coordinates of the non-uniform division points inside the design surface are calculated, and the non-uniform division points are used to perform the non-uniform division on the design surface; based on the boundary of each region and the non-uniform division points, the area where the intersection is located is calculated; and the area where the intersection is located is used as the target area of the design surface.
[0015] A design surface data processing device comprises a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the above-mentioned design surface data processing method is implemented.
[0016] A computer-readable storage medium stores computer-readable instructions, which, when executed by a processor of a computer, enable the computer to execute the above-mentioned design surface data processing method.
[0017] A computer program product includes computer-readable instructions, which implement the above-mentioned design surface data processing method when executed by a processor.
[0018] In the above technical solution, the target area of the design surface selected by the user can be detected first, and then based on the target point position input by the user, an offset curve matching the boundary of the target area of the design surface is generated, and the offset curve corresponds to multiple offset control points. Therefore, the multiple offset control points can be added to the control point matrix corresponding to the design surface according to the direction of the boundary of the target area of the design surface in the design surface. In this way, an updated design surface can be generated based on the updated control point matrix, and the updated design surface includes an extended surface. This method does not need to adjust the original multiple control points of the design surface, but can directly add multiple offset control points corresponding to the offset curve, which reduces the computational complexity of the computer, improves the generation efficiency of the extended surface, and thus improves the efficiency of the design surface data processing.
[0019] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings.
[0021] Figure 1 It is a schematic diagram of a NURBS surface formed by multiple control points involved in the present application.
[0022] Figure 2 The figure is a flow chart of a method for processing design surface data according to an exemplary embodiment.
[0023] Figure 3 It is a schematic diagram of multiple areas of a designed curved surface involved in this application.
[0024] Figure 4a The figure is a flow chart of a method for processing design surface data according to another exemplary embodiment.
[0025] Figure 4b The figure is a flow chart of a method for processing design surface data according to another exemplary embodiment.
[0026] Figure 5a This is a schematic diagram of evenly dividing a design surface involved in the present application.
[0027] Figure 5b This is a schematic diagram of non-uniform division of a design surface involved in the present application.
[0028] Figure 6 The figure is a flow chart of a method for processing design surface data according to another exemplary embodiment.
[0029] Figure 7 It is a schematic diagram of a boundary and offset curve involved in this application.
[0030] Figure 8 The figure is a flow chart of a method for processing design surface data according to another exemplary embodiment.
[0031] Fig. 9 It is a schematic diagram of a surface extension result involved in this application.
[0032] Fig.10 The figure is a flow chart of a method for processing design surface data according to another exemplary embodiment.
[0033] Fig.11 The figure is a block diagram of a design surface data processing device according to an exemplary embodiment.
[0034] Fig.12 The diagram is a structural diagram of a computer system of a design surface data processing device according to an exemplary embodiment. DETAILED DESCRIPTION
[0035] Here, exemplary embodiments will be described in detail, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments that are the same as the present application. Instead, they are only examples of devices and methods that are the same as some aspects of the present application as detailed in the attached claims.
[0036] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0037] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, while some operations / steps can be integrated or partially integrated, so the actual execution order may change according to actual conditions.
[0038] It should be noted that the "multiple" mentioned in this application refers to two or more than two. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship.
[0039] It should be noted that in the specific implementation of the present application, when the user-related data is involved, when the embodiment of the present application is applied to a specific product or technology, the user's permission or consent is required, and the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions. At the same time, the formulas involved in the embodiments of the present application can be flexibly adjusted, such as increasing or decreasing the corresponding parameters.
[0040] Before introducing the technical solutions of the embodiments of the present application, the technical terms involved in the embodiments of the present application are first introduced here.
[0041] Non-Uniform Rational B-Splines (NURBS) surface is a mathematical model widely used in computer-aided design (CAD), computer graphics and modeling to represent and generate complex surfaces and curves. NURBS surface can be named as surface S , and the corresponding formula is as follows.
[0042]
[0043] in, is a point on the NURBS surface; u and v is a parameter in the parameter domain, and its interval can be in [0,1]; and is a B-spline basis function defined on the parameter domain, which is composed of parameters u and v Decide; is the first ( i , j ) control points, It is the first i , j ) control point weights.
[0044] Among them, B-spline basis function is defined recursively as follows.
[0045] when p= 0 o'clock, .
[0046] when p >0 o'clock, .
[0047] in, is the B-spline basis function, u is the parameter value, is the first node in the vector i elements; the node vector (Knot Vector) is , is a non-decreasing sequence, and ; p is the degree of the basis function.
[0048] like Figure 1 FIG. 1 is a schematic diagram of a NURBS surface formed by multiple control points involved in the present application. Figure 1 In the figure, the irregular shapes on the left are formed by a control point matrix, which contains multiple control points. Figure 1 In the example, the control point matrix is a matrix with 4 rows and 5 columns. When the user inputs the control point matrix into the computer, the computer can generate the corresponding Figure 1 The NURBS surface on the right can be called a design surface. The user can change the shape of the design surface by moving each control point.
[0049] In the related art, when extending a design surface, it is achieved by adjusting and optimizing the control points of the design surface, which may change the overall shape of the original design surface, increase the calculation complexity of the computer, and reduce the efficiency of design surface data processing.
[0050] Based on this, the embodiments of the present application respectively propose a design surface data processing method, a design surface data processing device, a design surface data processing equipment, a computer-readable storage medium and a computer program product. In these embodiments, the design surface target area selected by the user can be detected first, and then based on the target point position input by the user, an offset curve matching its boundary is generated for the design surface target area, and the offset curve corresponds to a plurality of offset control points. Therefore, the plurality of offset control points can be added to the control point matrix corresponding to the design surface according to the direction of the boundary of the design surface target area in the design surface. In this way, an updated design surface can be generated based on the updated control point matrix, and the updated design surface includes an extended surface. This method does not need to adjust the original plurality of control points of the design surface, but can directly add a plurality of offset control points corresponding to the offset curve, which reduces the computational complexity of the computer, improves the generation efficiency of the extended surface, and thus improves the efficiency of the design surface data processing.
[0051] It should be noted that the design surface data processing method in this application can be applied to multiple usage scenarios, such as automobile design, architectural design, product design, aerospace design, subway transportation design, 3D printing design, etc., and the embodiments of this application are not limited. In these application scenarios, the computer can output corresponding three-dimensional models according to the designer's design for different application scenarios.
[0052] It should be noted that the design surface data processing method in the present application can be applied in a computer, such as a terminal device, which may be a mobile phone, a tablet computer, a laptop computer, a PDA, a mobile Internet device (MID), a vehicle-mounted device, an aircraft, a wearable device (smart devices such as smart watches, smart bracelets, pedometers, etc.), a virtual reality device (such as a virtual reality (VR) device, an augmented reality (AR) device), and the like.
[0053] See also Figure 2 , Figure 2 This is a flow chart of a design surface data processing method according to an exemplary embodiment. The method can be specifically executed by a computer. Of course, the method can also be applied to other implementation environments, and the execution subject of the method is not limited here.
[0054] The following will use a computer as an exemplary execution subject to describe the design surface data processing method in detail. Figure 2 As shown, in an exemplary embodiment, the method includes at least the following steps.
[0055] S210, detecting a design surface target area selected by a user on the design surface to be extended; wherein the design surface is generated based on a control point matrix composed of a plurality of control points.
[0056] The design surface can be a NURBS surface drawn by the user on the design software. The user can first add multiple control points in the design software to form a control point matrix, and the control point matrix can be converted into a design surface by the design software accordingly. The user can change the shape of the design surface by moving the spatial coordinates of the multiple control points. Among them, the user can move each control point in the two-dimensional space or three-dimensional space in the design software to generate different design surfaces. The user can move the perspective moving tool provided in the design software to observe the design surface from different perspectives. Under different perspectives, the design surface may present different shapes.
[0057] It should be noted that in addition to users who can perform operations in the design software, computer programs, robots and other entities that can execute specific instructions can also perform operations in the design software.
[0058] In the embodiment of the present application, each design surface can be mapped to a preset coordinate system, which can be a standard coordinate system with two mutually perpendicular directions, namely, the U direction and the V direction. The definition domain of each design surface mapped to the preset coordinate system can be the same, for example, it can be [0,1]. This is because, from the NURBS surface From the parametric equation, we can see that its domain is rectangular space.
[0059] Since the design surface is generated based on the control point matrix, the design surface contains four boundaries, and the design surface can be divided into four regions according to the four boundaries, which are respectively recorded as U0, U1, V0 and V1. Figure 3 In , the design surface contains 4 vertices, namely, vertex 1, vertex 2, vertex 3 and vertex 4. By connecting vertex 1 and vertex 4, and connecting vertex 2 and vertex 3, the design surface can be divided into 4 regions, namely, U0, U1, V0 and V1. Moreover, each region corresponds to a boundary, for example, in Figure 3 In the example, the boundary of the U0 region is , the boundary of the U1 region is , the boundary of the V0 region is , the boundary of the V1 region is .
[0060] The way to map the design surface to the preset coordinate system may include uniform mapping and non-uniform mapping. Uniform mapping refers to mapping the design surface to the preset coordinate system with the same probability, and the same probability refers to the probability of each boundary being selected, that is, in the case of uniform mapping, the probability of each boundary of the design surface being selected is the same. Non-uniform mapping refers to mapping the design surface to the preset coordinate system according to the probability of the four boundaries of the design surface being selected, that is, the probabilities of different boundaries being selected may be different. In the case of non-uniform mapping, the probability of each boundary of the design surface being selected may be different. The mapped design surfaces obtained by the two mapping methods are both distributed in the domain of within the rectangular space.
[0061] After the design surface is mapped to the preset coordinate system, the multiple areas contained in it will also be mapped accordingly, namely the four areas U0, U1, V0 and V1. Subsequent operations on these four areas are based on the preset coordinate system.
[0062] When the user needs to extend the design surface, the user can select the target area of the design surface in the screen of the currently displayed design surface.
[0063] Specifically, the user can use the mouse to click on the screen, and the click point of the mouse can be called the selection point. The computer can obtain the selection points for multiple areas in the design surface input by the user, and use the selection points as the starting point to generate selection rays in a preset direction. The preset direction can be the normal direction from the camera in the three-dimensional space to the selection point, which can be understood as the direction perpendicular to the screen outward, that is, the user's current viewing direction.
[0064] Next, the computer determines the target area of the design surface based on the intersection of the selected ray and multiple areas. In other words, the ray out of the screen starting from the user's mouse click point may intersect with the design surface, and an intersection will be generated. Based on the intersection, it can be determined which area of the design surface the user has selected, and then the target area of the design surface can be obtained.
[0065] S220, generating an offset curve that matches the boundary of the target area of the design surface based on the target point position input by the user; wherein the offset curve includes a plurality of offset control points.
[0066] The target point may be the point clicked by the user for the second time. It should be noted that the selection point clicked by the user is used to select the target area in the design surface, and the target point clicked by the user is the position to which the user expects the design surface to extend.
[0067] After the user inputs the target point, the computer can generate an offset curve that matches the boundary of the target area of the design surface based on the boundary of the target area of the design surface.
[0068] Specifically, the computer uses the target point as the starting point, generates a target ray in a preset direction, and calculates the point on the boundary of the target area of the design surface that is closest to the target ray, as well as the target distance between the closest point and the target ray. Finally, based on multiple sampling points on the boundary of the target area of the design surface, the closest point, and the target distance, the computer generates corresponding offset sampling points for the multiple sampling points, and generates corresponding offset points for the closest point, so that an offset point set can be obtained. Next, based on the offset point set, the computer can solve the multiple offset control points corresponding to the offset curve, and thus generate an offset curve that matches the boundary of the target area of the design surface based on the multiple offset control points.
[0069] S230 , based on the direction of the boundary of the design surface target area in the design surface, adding a plurality of offset control points corresponding to the offset curve to the control point matrix to obtain an updated control point matrix.
[0070] Specifically, the computer first determines the direction of the boundary of the target area of the design surface in the design surface, and then based on the direction, adds multiple offset control points to the multiple control points to obtain multiple updated control points.
[0071] For example, Figure 3 In the example, if the user selects the design surface target area U1, the boundary of U1 is , which is located in the upper direction of the design surface, therefore, the computer will add another row above the first row of the control point matrix, and add multiple offset control points of the offset curve to the newly added row, and then the updated multiple control points can be obtained, that is, the updated control point matrix.
[0072] For another example, if the user selects the design surface target area V1, the boundary of V1 is , which is located to the right of the design surface. Therefore, the computer will add a new column to the right of the rightmost column of the control point matrix, and add multiple offset control points of the offset curve to the newly added column, and then the updated multiple control points can be obtained, that is, the updated control point matrix.
[0073] S240: Generate an updated design curved surface based on the updated control point matrix, where the updated design curved surface includes an extended curved surface that matches the design curved surface target area.
[0074] Since the computer has calculated the updated control point matrix including the updated multiple control points, an updated design surface can be generated based on the updated control point matrix. The updated design surface includes an extended surface that matches the target area of the design surface.
[0075] By extending the surface, new surface areas can be added to the existing design surface, which can help designers make better use of space and create more complex or wider design forms. Designers can flexibly adjust the shape and range of the surface without redesigning the entire surface structure, which helps to quickly respond to changes and make local optimizations or adjustments during the design process.
[0076] For example, in subway scenes, the architectural design of subway stations usually needs to consider a large number of curved structures, such as the curved surface design of ceilings, walls, columns, stairs, etc. By using the extended surface technology, new curved surface areas can be extended without changing the original design surface, so as to more flexibly adjust the layout of the internal space of the subway station to meet functional and aesthetic requirements.
[0077] In addition, the extended surface method can also be applied in the design of subway trains. The design of the subway train appearance often adopts a streamlined surface structure to reduce air resistance and improve energy efficiency. The extended surface can be used to make local adjustments or expansions on the existing body design, optimize aerodynamic performance or leave space for new functional components. The extended surface method of this application improves the generation efficiency of the extended surface, allowing designers to obtain a faster surface extension experience and improve design efficiency.
[0078] Finally, the computer will output the corresponding 3D modeling model based on the extended surface that matches the target area of the design surface after the surface extension operation. In this way, in practical applications, the corresponding solid model can be constructed based on the 3D modeling model output by the computer. For example, when designing a subway train, the designer uses the surface extension method to design a 3D model of a train, then the computer can output the 3D model of the train, and based on the 3D model, a physical train matching the 3D model can be manufactured during product manufacturing.
[0079] Through this method, the computer can first detect the target area of the design surface selected by the user, and then generate an offset curve matching the boundary of the target area of the design surface based on the target point position input by the user. The offset curve corresponds to multiple offset control points. Therefore, the multiple offset control points can be added to the control point matrix corresponding to the design surface according to the direction of the boundary of the target area of the design surface in the design surface. In this way, an updated design surface can be generated based on the updated control point matrix, and the updated design surface includes an extended surface. This method does not need to adjust the original multiple control points of the design surface, but can directly add multiple offset control points corresponding to the offset curve, which reduces the computational complexity of the computer, improves the generation efficiency of the extended surface, and thus improves the efficiency of the design surface data processing.
[0080] In one embodiment of the present application, another design surface data processing method is provided, and the design surface data processing method can be executed by a computer. Figure 4a and Figure 4b As shown, the design surface data processing method may include S410 to S430 and S220 to S240. That is, S410 to S430 are Figure 2 The specific implementation method of S210 is shown.
[0081] S410 to S430 are described below.
[0082] S410: Obtain selected points for multiple areas in the design surface input by the user.
[0083] When a user clicks on a computer screen, a click point is generated, which can be called a selection point. That is, the function of the selection point is to select a target area in the design surface. The click point can be generated when the user clicks with a mouse; if the computer supports screen touch, it can also be a click point generated when the user clicks on the screen; if the computer supports eye recognition, it can also be a click point obtained by recognizing the user's eyes.
[0084] The user may use the perspective moving tool to input the selected point at different perspectives, and the coordinates of the selected point at different perspectives may be different.
[0085] S420: Taking the selected point as the starting point, generating a selected ray in a preset direction.
[0086] Specifically, the computer can record the selected point as ,Should is a three-dimensional point. Next, the computer obtains the normal vector from the camera in three-dimensional space to the selected point. , get the selection ray , where t is a parameter.
[0087] S430: Determine a target area of the design surface based on the intersection of the selected ray and the design surface.
[0088] The equation of the design surface is , so the computer can calculate and The intersection of The solution to the intersection point parameter set can be obtained That is, if a point can make the error between its value on the selected ray and its value on the design surface less than , we can consider this point as the intersection of the selected ray and the design surface. There may be multiple intersections between the selected ray and the design surface. The coordinates of the i-th intersection on the design surface are , the coordinates on the selected ray are .
[0089] Optionally, the computer may use Newton's method or bisection method when calculating the intersection point.
[0090] In order to clarify which area of the design surface the user has selected, the computer needs to calculate the selection ray. t The first intersection point with the design surface in the direction of >0 is used to determine the target area of the design surface.
[0091] Specifically, the computer needs to obtain the intersection parameter set Select the elements that meet the following two conditions and record them as .
[0092] 1. Recorded as a set .
[0093] 2. .
[0094] Will Substitution and The intersection of the two parametric equations can be obtained from .
[0095] Therefore, when selecting the ray Points and on the design surface The point can be used as the target intersection of the two , the computer can use the target intersection To determine which area of the design surface the user has selected.
[0096] In one embodiment of the present application, after mapping the design surface to the preset coordinate system, the computer also needs to divide the design surface into regions in the preset coordinate system to obtain multiple regions of the design surface in the preset coordinate system. The coordinates of the unmapped design surface are The coordinates of are corresponding, for example, if determined in the preset coordinate system Located in the U1 region, then in the unmapped design surface It is also located in the U1 area.
[0097] Specifically, the region division of the designed surface in the preset coordinate system may include uniform division and non-uniform division.
[0098] For the uniform division of the design surface, see Figure 4a ,exist Figure 4a In the embodiment, S430 may specifically include S431 to S433, as follows.
[0099] S431. If the designed curved surface is uniformly mapped to a preset coordinate system, the designed curved surface is uniformly divided into regions in the preset coordinate system to obtain a plurality of regions.
[0100] Among them, uniform mapping means mapping the design surface to the preset coordinate system with the same probability, wherein the same probability refers to the probability of each boundary being selected, that is, in the case of uniform mapping, the probability of each boundary of the design surface being selected is the same.
[0101] If the computer maps the design surface to a preset coordinate system by uniform mapping, the computer also needs to divide the design surface into regions uniformly in the preset coordinate system to obtain a plurality of regions.
[0102] In one embodiment of the present application, the uniform division method may be to connect the control points on the four vertices in the control point matrix corresponding to the design surface through diagonal lines in a preset coordinate system. Figure 5a In the figure, the design surface contains 4 vertices, which are connected by diagonal lines to obtain 4 regions: U0, U1, V0 and V1. Moreover, each region has a corresponding boundary. For example, Figure 5a In the example, the boundary of the U0 region is , the boundary of the U1 region is , the boundary of the V0 region is , the boundary of the V1 region is .
[0103] The boundary of each region can be the corresponding isoparm. For example, U1 represents the extraction The isoparms , which can be used as the boundary of U1; U0 represents the extraction The isoparms , which can be used as the boundary of U0; V1 represents the extraction The isoparms , which can be used as the boundary of V1; V0 represents the extraction The isoparms , which can be used as the boundary of V0.
[0104] In addition, U0, U1, V0 and V1 can also represent the extension directions of the surface boundaries respectively.
[0105] Optionally, in addition to using the diagonal method for uniform mapping, those skilled in the art may also use other methods for uniform mapping. The embodiment of the present application uses the diagonal method as an example for description and is not intended to be limiting.
[0106] S432. Calculate the area where the intersection point is located based on the coordinates of the intersection point.
[0107] The intersection point may refer to the target intersection point. The computer can calculate the coordinates of the intersection point by the following formula to determine the area where the intersection point is located.
[0108] 。
[0109] .
[0110] If ab = 11, the intersection point is in the U0 interval; if ab = 10, the intersection point is in the V1 interval; if ab = 01, the intersection point is in the V0 interval; if ab = 00, the intersection point is in the U1 interval.
[0111] S433. The area where the intersection point is located is used as the design surface target area.
[0112] In this way, the computer can use the intersection point (i.e., the target intersection point) ) is used as the target area of the design surface.
[0113] Through the methods from S431 to S433, when the design surface is uniformly mapped to the preset coordinate system, the computer can quickly calculate the area where the intersection is located based on the coordinate values of the intersection, thereby improving the efficiency and accuracy of determining the target area of the design surface, thereby improving the efficiency of design surface data processing.
[0114] For the case of non-uniform partitioning of the design surface, see Figure 4b ,exist Figure 4b In the embodiment, S430 may specifically include S435 to S438, as follows.
[0115] S435. If the design surface is non-uniformly mapped to a preset coordinate system, the design surface is non-uniformly divided in the preset coordinate system to obtain multiple regions; wherein, among the multiple regions, the difference between the sum of the areas of the regions in the first direction and the sum of the areas of the regions in the second direction is greater than the preset difference; and the first direction and the second direction are perpendicular to each other.
[0116] Non-uniform mapping maps the four boundaries of the design surface to the preset coordinate system according to the probability of selection. That is, the probabilities of different boundaries being selected may be different. In the case of non-uniform mapping, the probability of each boundary of the design surface being selected may be different.
[0117] If the computer maps the design surface to a preset coordinate system through non-uniform mapping, the computer also needs to perform non-uniform division of regions on the design surface in the preset coordinate system to obtain multiple regions.
[0118] The non-uniform partitioning is mapped to the preset coordinate system according to the probability of the four boundaries of the design surface being selected, and the domain is Rectangular space. Since the control point matrix of the design surface contains four vertices, the design surface contains four boundaries. In this case, the area of the design surface is not evenly distributed according to the definition domain, so the difference between the sum of the areas in the first direction and the sum of the areas in the second direction may be greater than the preset difference, and the first direction and the second direction are perpendicular to each other, that is, the first direction may be the U direction, and the second direction may be the V direction. The preset difference may be preset by computer personnel in this field, for example, it may be 5%, 20%, etc. of the area of the design surface.
[0119] That is to say, there may be a design surface where the surface area of the design surface in the V domain is significantly different from the surface area of the design surface in the U domain. For example:
[0120] in Representation Surface exist u , v The partial derivative in the direction, × represents the cross product, Represents the bi-norm of a vector.
[0121] In this case, it is necessary to divide the design surface non-uniformly. When the surface is divided non-uniformly, the area in the direction with a larger surface area is divided into a trapezoidal shape, and the area in the direction with a smaller surface area is divided into a triangle shape.
[0122] For example, Figure 5b Schematic diagram of multiple regions obtained by non-uniform division involved in this application. Figure 5b It shows the multiple regions divided when the surface area of the design surface of the U definition domain is larger than the surface area of the design surface of the V definition domain. It can be seen that the surface areas of the U1 and U0 regions are the same and are both larger than the surface area of the V1 or V0 regions.
[0123] Moreover, each region has a corresponding boundary, for example Figure 5b In the example, the boundary of the U0 region is , the boundary of the U1 region is , the boundary of the V0 region is , the boundary of the V1 region is .
[0124] S436, calculating the coordinates of the non-uniform division points inside the design curved surface, where the non-uniform division points are used to perform non-uniform division on the design curved surface.
[0125] Since the design surface is divided non-uniformly, there are non-uniform division points inside the design surface. Figure 5b In the example, there are two non-uniform division points, point A and point B. With the non-uniform division points, the difference in surface area between the regions corresponding to U and V can be made larger. Moreover, the line between the non-uniform division points is parallel to the U axis of the preset coordinate system.
[0126] When calculating the coordinates of unevenly divided points, the computer needs to calculate The length is calculated as , and get the length of the curve .in, yes The first derivative of yes The corresponding curve functions respectively.
[0127] In addition, it is necessary to calculate Figure 5b As shown in The angle of yes The corresponding angle, .
[0128] when , that is, the length of the representative of the domain of U1+U0 is greater than the length of V1+V0, that is, when the user clicks, the user has a greater tendency to extend the visually closer boundary curve, that is, . Figure 5b Shown situation, Then Figure 5b Rotate 90 degrees.
[0129] Assumptions Established, of which The angle between the components is , denoted as ,point , points A and B need to pass through The calculation steps are as follows.
[0130] ; .
[0131] In this way, it is possible to calculate the non-uniform partitioning points (e.g. Figure 5b The coordinates of point A and point B in the image.
[0132] S437. Based on the boundary of each area and the non-uniform division points, calculate the area where the intersection point is located.
[0133] Determine the target intersection The distribution in the parameter range is as follows.
[0134] For any convex polygon (such as Figure 5b The triangles corresponding to V0 and V1, and the trapezoids corresponding to U0 and U1 are all convex polygons). For each side of the polygon, calculate the cross product of the vectors from the target intersection point to the two endpoints of this side. If all the cross products have the same sign (both positive or both negative), then the target intersection point is inside the polygon; otherwise, the target intersection point is outside the polygon.
[0135] Let convex polygon be the set of first connected edges. The computer can remember the set , in , is the starting point of the edge. E End point .
[0136] For convex polygons , any point There are the following collections.
[0137]
[0138] If all the values are greater than 0 or less than 0, click P exist If there is a value equal to 0, then the point P exist in the borders.
[0139] Therefore, the computer can Substituting it into the calculation, we can calculate the area where it is located.
[0140] S438. The area where the intersection point is located is used as the design surface target area.
[0141] In this way, the computer can use the intersection point (i.e., the target intersection point) ) is used as the target area of the design surface.
[0142] Through the methods of S435 to S438, when the design surface is non-uniformly mapped to the preset coordinate system, the computer performs non-uniform division on the design surface in the preset coordinate system, calculates the coordinates of the non-uniform division points, and calculates the cross product of the vectors from the target intersection to the two endpoints of each edge of the convex polygon. The area where the intersection is located can be quickly calculated based on the coordinate value of the intersection, thereby improving the efficiency and accuracy of determining the target area of the design surface, thereby improving the efficiency of design surface data processing.
[0143] Through the methods from S410 to S430, the computer can uniformly map the design surface and divide the area uniformly, and can also non-uniformly map the design surface and divide the area non-uniformly, so that when calculating the intersection of the selected ray and the design surface, different types of design surfaces can be adapted, which is more flexible, thereby improving the accuracy of determining the target area of the design surface.
[0144] In one embodiment of the present application, another design surface data processing method is provided, and the design surface data processing method can be executed by a computer. Figure 6 As shown, the design surface data processing method may include S210, S610 to S630 and S230 to S240. That is, S610 to S630 are Figure 2 The specific implementation method of S220 is shown.
[0145] S610 to S630 are described below.
[0146] S610: Taking the target point as the starting point, generate a target ray in a preset direction.
[0147] Specifically, the computer can record the target point as ,Should is a three-dimensional point. Next, the computer obtains the normal vector from the camera in three-dimensional space to the selected point. , get the selection ray ,in, t is a parameter.
[0148] S620, calculating the point on the boundary of the target area of the design surface that is closest to the target ray, and the target distance between the closest point and the target ray.
[0149] The computer can calculate the closest point based on the function corresponding to the boundary of the target area of the designed surface and the function corresponding to the target ray. The closest point can be recorded as .
[0150] For example, if the target area of the design surface is U1, the function of the boundary corresponding to U1 is , the computer can calculate and The point with the closest distance between them (denoted as ), which is in The closest point on , and the target distance between the nearest point and the target ray can be recorded as d.
[0151] It should be noted that the isoparametric line can be a NURBS curve, for example, The improvement is defined by the following formula.
[0152]
[0153] Since NURBS surfaces can be interpolated through the node insertion algorithm, it is easy to obtain a NURBS surface with UV boundaries as the interpolation curve, that is, for the basis function The following definitions are added.
[0154] 1. Convert the knot vector to a clamped knot vector, that is , where the first p+1 nodes are 0 and the last p+1 nodes are 1.
[0155] 2. Surface , which has two node vectors U and V which are clamped node vectors.
[0156] 3. Among them The node vector in is defined as , .
[0157] S630: Generate an offset curve matching the boundary of the design surface target area based on multiple sampling points on the boundary of the design surface target area, the nearest point position and the target distance.
[0158] The computer can perform sampling on the boundary of the target area of the design surface, and can obtain multiple sampling points. Next, an offset curve matching the boundary of the target area of the design surface can be generated based on the multiple sampling points, the nearest point and the target distance.
[0159] Specifically, S630 may include S631 to S633.
[0160] S631 to S633 are described below.
[0161] S631. Sampling is performed on the boundary of the target area of the design surface to obtain a plurality of sampling points.
[0162] The computer will obtain the corresponding node vector based on the curve function corresponding to the boundary of the target area of the designed surface, and then sample all the nodes in the node vector and the point closest to the target ray to obtain the multiple sampling points.
[0163] For example, for the curve , whose node vector is , for all nodes in the node vector U and The sampling point set is obtained by sampling .
[0164] S632. Based on the target distance, calculate the offset of multiple sampling points and the nearest point to obtain multiple offset points; wherein the multiple offset points include an offset sampling point corresponding to each sampling point and an offset point corresponding to the nearest point.
[0165] The computer will calculate the offset sampling point corresponding to each sampling point based on the target distance, and also calculate the corresponding offset point for the point closest to the target ray. In this way, an offset point set can be obtained, and the offset point set includes multiple offset points. It can be understood that the multiple offset points include the offset sampling point corresponding to each sampling point, and the offset point corresponding to the point closest to the target ray.
[0166] Specifically, For example, the computer will collect the sampling points Each sampling point in is denoted as point p ,for have , need to Any point in p Calculate the offset. All sampling points in are transformed as follows.
[0167] 1.
[0168] 2. Calculate the offset direction
[0169] in," " is the cross product, " .normal " is the normalization of the vector.
[0170] 3.
[0171] 4. according to p exist By sorting in the order in , we can get the offset point set corresponding to the offset curve That is to say, Contains multiple offset points, but the order of arrangement may be different from that of multiple sampling points. The order of arrangement in is inconsistent, so it is necessary to rearrange it to obtain .
[0172] S633. Calculate an offset curve that matches the boundary of the target area of the design surface based on the multiple offset points.
[0173] The computer will offset the point set based on the offset point set The multiple offset points included in the design are fitted to obtain an offset curve that matches the boundary of the target area of the design surface.
[0174] During the fitting process, the computer needs to establish constraints, which are to minimize the amount of modification to the original control point matrix of the design surface.
[0175] Specifically, taking the design surface target area U1 as an example, the computer ensures that the node vectors and weights W of U and V are consistent with the original curve. Under the same circumstances, a curve to be fitted that requires calculation of control points is constructed, and the formula for canceling the curve to be fitted is as follows.
[0176]
[0177] Set the offset points Substitute the point corresponding to u in Obtained in The number of equations is calculated to calculate the number of differences from the unique solution, that is, we need to obtain other sampling points, multiple sampling ensures that there are n+1 equations.
[0178] The sampling method is as follows: points are evenly distributed into the m intervals (spans) divided by the U node vector to obtain a new node vector ,Will Substituting into the four calculation steps in S632, we obtain for The corresponding offset point in the offset curve.
[0179] Next, the computer calculates At the corresponding offset point in the offset curve, calculate and The element and its corresponding u Substitution , thus constructing n+1 unknown quantities The following linear equations.
[0180] t :
[0181] in, for and The i-th element in the union, for The corresponding parameter values on the curve equation.
[0182] Pair Matrix , , and solve it to obtain The computer can then calculate multiple offset control points of the offset curve and substitute the multiple offset control points into In the above example, the offset curve corresponding to the boundary of the target area of the design surface can be solved.
[0183] It should be noted that the computer first calculates a plurality of offset control points, and then solves the offset curve based on the plurality of offset control points.
[0184] like Figure 7 The figure shows a schematic diagram of a boundary and offset curve involved in the present application. Figure 7 It can be seen that the computer generates an offset curve for the boundary that has the same shape as the boundary but is longer. The offset curve can represent the new boundary corresponding to the extended surface.
[0185] Through this method, the computer can more accurately calculate the offset curve corresponding to the boundary of the target area of the designed surface based on the target ray corresponding to the boundary and target point of the target area of the designed surface, thereby improving the accuracy of surface extension.
[0186] In one embodiment of the present application, another design surface data processing method is provided, and the design surface data processing method can be executed by a computer. Figure 8As shown, the design surface data processing method may include S210 to S230 and S810 to S830. That is, S810 to S830 are Figure 2 The specific implementation method of S230 is shown.
[0187] S810 to S830 are described below.
[0188] S810: Acquire a plurality of offset control points corresponding to the offset curve, wherein the plurality of offset control points are generated based on a target point position and a boundary of a target area of a design surface.
[0189] The multiple offset control points are Figure 7 The figure shows what is generated in S633, that is, the computer first calculates a plurality of offset control points, and then solves the offset curve according to the plurality of offset control points.
[0190] S820: Based on the direction of the boundary of the design surface target area in the design surface, add a reserved space in the control point matrix for accommodating the multiple offset control points.
[0191] The multiple control points are located in the original control point matrix of the design surface, and based on the multiple control points, the computer can generate the design surface.
[0192] At this time, the computer can add multiple offset control points corresponding to the offset curve to the control point matrix. Specifically, the computer will identify the direction of the boundary of the target area of the design surface in the design surface, and then add a reserved space in the control point matrix for accommodating multiple offset control points according to the direction, so that the multiple offset control points can be added to multiple control points (control point matrix). The reserved space can be a newly added row or a newly added column.
[0193] S830: Add multiple offset control points to the reserved space in the control point matrix to obtain an updated control point matrix.
[0194] For example, if Figure 5a or Figure 5b As shown, if the target area of the design surface is U1, then it is necessary to add a row at the top of the control point matrix, and then add the multiple offset control points to the newly added row.
[0195] If the target area of the design surface is V0, then it is necessary to add a column to the leftmost side of the control point matrix, and then add the multiple offset control points to the newly added column.
[0196] If the target area of the design surface is U0, then it is necessary to add a row at the bottom of the control point matrix, and then add the multiple offset control points to the newly added row.
[0197] If the target area of the design surface is V1, then it is necessary to add a column to the rightmost side of the control point matrix, and then add the multiple offset control points to the newly added column.
[0198] In this way, multiple updated control points can be obtained, and the multiple updated control points can constitute an updated control point matrix. Based on the updated control point matrix, the computer can generate the extended surface for the boundary of the target area of the designed surface.
[0199] like Fig. 9 FIG. 1 is a schematic diagram of a curved surface extension result involved in the present application. Fig. 9 is based on Figure 7 The surface extension result graph generated by the boundary and offset curves shown is from Fig. 9 Obviously, the computer will Figure 7 The area between the boundary and the offset curve in is generated to obtain an extended surface, and there is a smooth transition between the extended surface and the original design surface, that is, Figure 7 There is no sudden change at the two endpoints of the middle boundary, but it extends naturally and smoothly to the offset curve. As mentioned above, the user inputs the target point on the offset curve, so the extended surface can just use the offset curve corresponding to the target point as the boundary, so that the designed surface can also remain smooth after the surface extension.
[0200] In this process, the computer does not change the original control points of the control point matrix, but adds multiple offset control points to the matrix without affecting other control points. The number of control points is only increased by one row or one column, thereby reducing the computer's calculation complexity and improving the efficiency of generating extended surfaces, thereby improving the efficiency of design surface data processing.
[0201] In one embodiment of the present application, another design surface data processing method is provided, and the design surface data processing method can be executed by a computer. Fig.10 As shown, the design surface data processing method may include S1001 to S1008.
[0202] S1001 to S1008 are described below.
[0203] S1001. Obtain a design surface.
[0204] S1002: Obtain the selection point input by the user.
[0205] The computer will map the designed surface to a preset coordinate system. If it is mapped uniformly, S1003 will be executed; if it is mapped non-uniformly, S1004 will be executed.
[0206] S1003. In a preset coordinate system, the designed surface is evenly divided into regions to obtain a plurality of regions, and a target region of the designed surface is determined.
[0207] After executing S1003, S1005 may be executed.
[0208] S1004. In a preset coordinate system, the designed surface is non-uniformly divided into regions to obtain a plurality of regions, and a target region of the designed surface is determined.
[0209] After executing S1004, S1005 may be executed.
[0210] S1005. Obtain the boundary corresponding to the target area of the design surface.
[0211] The boundary is the boundary that the user wants to extend.
[0212] S1006: Calculate the offset desired by the user.
[0213] The offset is the shortest distance between the target ray corresponding to the target point input by the user and the boundary, that is, the target distance between the point on the boundary closest to the target ray and the target ray.
[0214] S1007. Generate an offset curve based on the offset amount and the boundary of the target area of the design surface.
[0215] S1008. Generate an extended surface based on the offset curve.
[0216] Through this method, on the one hand, two methods can be used to determine the target area of the design surface, which improves the flexibility and accuracy of the target area determination. On the other hand, there is no need to adjust the original multiple control points of the design surface, but multiple offset control points corresponding to the offset curve can be directly added, and the number of control points is only increased by one row or one column, which reduces the calculation complexity of the computer, improves the generation efficiency of the extended surface, and thus improves the efficiency of the design surface data processing.
[0217] Fig.11 FIG. 1 is a block diagram of a design surface data processing device according to an embodiment of the present application. Fig.11 As shown, the design surface data processing device can be applied to a computer, and the device includes the following equipment.
[0218] A design surface data processing device includes: a detection unit 1110, used to detect a design surface target area selected by a user on the design surface to be extended; wherein the design surface contains multiple control points; a processing unit 1120, used to generate an offset curve matching the boundary of the design surface target area based on the target point position input by the user; wherein the offset curve is generated based on a control point matrix composed of multiple control points; the processing unit 1120 is also used to add multiple offset control points corresponding to the offset curve to the control point matrix based on the direction of the boundary of the design surface target area in the design surface to obtain an updated control point matrix; the processing unit 1120 is also used to generate an updated design surface based on the updated control point matrix, and the updated design surface includes an extended surface matching the design surface target area.
[0219] In one embodiment of the present application, based on the aforementioned scheme, the processing unit 1120 is also used to generate a target ray in a preset direction with the target point as the starting point; the device also includes a calculation unit 1130, and the calculation unit 1130 is used to calculate the point on the boundary of the target area of the designed surface that is closest to the target ray, and the target distance between the closest point and the target ray; the processing unit 1120 is also used to generate an offset curve that matches the boundary of the target area of the designed surface based on multiple sampling points on the boundary of the target area of the designed surface, the closest point and the target distance.
[0220] In one embodiment of the present application, based on the aforementioned scheme, the processing unit 1120 is further used to perform sampling on the boundary of the target area of the design surface to obtain multiple sampling points; based on the target distance, the offset of the multiple sampling points and the nearest points is calculated to obtain multiple offset points; wherein the multiple offset points include an offset sampling point corresponding to each sampling point, and an offset point corresponding to the nearest point; based on the multiple offset points, an offset curve matching the boundary of the target area of the design surface is calculated.
[0221] In one embodiment of the present application, based on the aforementioned scheme, the device also includes an acquisition unit 1140, which is used to acquire multiple offset control points corresponding to the offset curve, wherein the multiple offset control points are generated based on the target point position and the boundary of the target area of the design surface; the processing unit 1120 is also used to add a reserved space in the control point matrix for accommodating multiple offset control points based on the direction of the boundary of the target area of the design surface in the design surface; and add the multiple offset control points to the reserved space in the control point matrix to obtain an updated control point matrix.
[0222] In one embodiment of the present application, based on the aforementioned scheme, the acquisition unit 1140 is also used to obtain the selection points for multiple areas in the design surface input by the user; the processing unit 1120 is also used to generate a selection ray in a preset direction with the selection point as the starting point; and determine the target area of the design surface based on the intersection of the selection ray and the design surface.
[0223] In one embodiment of the present application, based on the aforementioned scheme, the processing unit 1120 is also used to, if the design surface is uniformly mapped to a preset coordinate system, evenly divide the design surface into regions under the preset coordinate system to obtain multiple regions; calculate the region where the intersection is located based on the coordinates of the intersection; and use the region where the intersection is located as the target region of the design surface.
[0224] In one embodiment of the present application, based on the aforementioned scheme, the processing unit 1120 is also used to, if the design surface is non-uniformly mapped to a preset coordinate system, perform non-uniform division on the design surface in the preset coordinate system to obtain multiple regions; wherein, in the multiple regions, the difference between the sum of the areas of the regions in the first direction and the sum of the areas of the regions in the second direction is greater than the preset difference; the first direction and the second direction are perpendicular to each other; the coordinates of the non-uniform division points inside the design surface are calculated, and the non-uniform division points are used to perform non-uniform division on the design surface; based on the boundaries of each region and the non-uniform division points, the area where the intersection is located is calculated; and the area where the intersection is located is used as the target area of the design surface.
[0225] It should be noted that the apparatus provided in the aforementioned embodiment and the method provided in the aforementioned embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment.
[0226] An embodiment of the present application also provides a design surface data processing device, including: one or more processors; a memory for storing one or more programs, when the one or more programs are executed by one or more processors, the electronic device implements the above-mentioned design surface data processing method.
[0227] Fig.12 It is a structural diagram of a computer system suitable for implementing the design surface data processing device of the embodiment of the present application.
[0228] It should be noted that Fig.12 The computer system 1200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0229] like Fig.12As shown, the computer system 1200 includes a central processing unit (CPU) 1201, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 1202 or the program loaded from the storage part 1208 to the random access memory (RAM) 1203, such as executing the method in the above embodiment. In the RAM 1203, various programs and data required for system operation are also stored. The CPU 1201, the ROM 1202 and the RAM 1203 are connected to each other through the bus 1204. The input / output (I / O) interface 1205 is also connected to the bus 1204.
[0230] The following components are connected to the I / O interface 1205: an input section 1206 including a keyboard, a mouse, etc.; an output section 1207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to the I / O interface 1205 as needed. A removable medium 1211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1210 as needed so that a computer program read therefrom is installed into the storage section 1208 as needed.
[0231] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication part 1209, and / or installed from a removable medium 1211. When the computer program is executed by the central processing unit (CPU) 1201, various functions defined in the system of the present application are executed.
[0232] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier, in which a computer-readable computer program is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0233] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0234] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0235] Another aspect of the present application also provides a computer readable medium having a computer program stored thereon, which implements the above-mentioned design surface data processing method when executed by a processor. The computer readable medium may be included in the electronic device described in the above embodiment, or may exist independently without being assembled into the electronic device.
[0236] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable medium. A processor of a computer device reads the computer instruction from the computer-readable medium, and the processor executes the computer instruction, so that the computer device executes the design surface data processing method provided in each of the above embodiments.
[0237] The above content is only a preferred exemplary embodiment of the present application and is not intended to limit the implementation scheme of the present application. A person skilled in the art can easily make corresponding changes or modifications based on the main concept and spirit of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection required by the claims.
Claims
1. A design surface data processing method, characterized in that: include: Detecting a target area of a design surface to be extended, selected by a user on the design surface; wherein the design surface is generated based on a control point matrix composed of a plurality of control points; Taking the target point as the starting point, generating a target ray in a preset direction; Calculating the point on the boundary of the target area of the designed curved surface that is closest to the target ray, and the target distance between the point that is closest to the target ray; Sampling is performed on the boundary of the target area of the designed curved surface to obtain the plurality of sampling points; Based on the target distance, the offset of the multiple sampling points and the point with the closest distance is calculated to obtain multiple offset points; wherein the multiple offset points include an offset sampling point corresponding to each sampling point and an offset point corresponding to the point with the closest distance; Calculating an offset curve matching the boundary of the target area of the designed curved surface based on the multiple offset points; Based on the direction of the boundary of the design curved surface target area in the design curved surface, adding the plurality of offset control points corresponding to the offset curve to the control point matrix to obtain an updated control point matrix; An updated design curved surface is generated based on the updated control point matrix, wherein the updated design curved surface includes an extended curved surface matching the design curved surface target area.
2. The method according to claim 1, characterized in that The adding the plurality of offset control points corresponding to the offset curve to the control point matrix based on the direction of the boundary of the design curved surface target area in the design curved surface to obtain an updated control point matrix includes: Acquire the multiple offset control points corresponding to the offset curve; wherein the multiple offset control points are generated based on the target point and the boundary of the target area of the designed curved surface; Based on the direction of the boundary of the design curved surface target area in the design curved surface, adding a reserved space for accommodating the plurality of offset control points in the control point matrix; The multiple offset control points are added to the reserved space in the control point matrix to obtain an updated control point matrix.
3. The method according to claim 1, characterized in that The step of detecting a target area of the designed curved surface to be extended, selected by a user on the designed curved surface, comprises: Acquire the selected points for multiple areas in the designed curved surface input by the user; Taking the selected point as the starting point, generating a selected ray in a preset direction; The design curved surface target area is determined based on the intersection point between the selected ray and the design curved surface.
4. The method according to claim 3, characterized in that The step of determining the target area of the design curved surface based on the intersection of the selected ray and the design curved surface comprises: If the designed curved surface is uniformly mapped to a preset coordinate system, the designed curved surface is uniformly divided into regions in the preset coordinate system to obtain the multiple regions; Calculating the area where the intersection point is located based on the coordinates of the intersection point; The area where the intersection point is located is used as the design curved surface target area.
5. The method according to claim 3, characterized in that: The step of determining the target area of the design curved surface based on the intersection of the selected ray and the design curved surface comprises: If the designed curved surface is non-uniformly mapped to a preset coordinate system, the designed curved surface is non-uniformly divided in the preset coordinate system to obtain the multiple regions; wherein, among the multiple regions, a difference between a sum of an area of a region in a first direction and a sum of an area of a region in a second direction is greater than a preset difference, and the first direction and the second direction are perpendicular to each other; Calculating coordinates of non-uniform division points within the designed curved surface, wherein the non-uniform division points are used to perform the non-uniform division on the designed curved surface; Based on the boundary of each area and the non-uniform division point, calculating the area where the intersection point is located; The area where the intersection point is located is used as the design curved surface target area.
6. A design surface data processing device, characterized in that: include: A detection unit, used to detect a design curved surface target area selected by a user on a design curved surface for curved surface extension; wherein the design curved surface is generated based on a control point matrix composed of a plurality of control points; A processing unit is used to generate a target ray in a preset direction with the target point as a starting point; calculate the point on the boundary of the target area of the design surface that is closest to the target ray, and the target distance between the point with the closest distance and the target ray; perform sampling on the boundary of the target area of the design surface to obtain the multiple sampling points; based on the target distance, perform offset calculation on the multiple sampling points and the point with the closest distance to obtain multiple offset points; wherein the multiple offset points include an offset sampling point corresponding to each sampling point, and an offset point corresponding to the point with the closest distance; and calculate an offset curve matching the boundary of the target area of the design surface based on the multiple offset points; The processing unit is further configured to add the plurality of offset control points corresponding to the offset curve to the control point matrix based on the direction of the boundary of the design surface target area in the design surface, so as to obtain an updated control point matrix; The processing unit is further used to generate an updated design curved surface based on the updated control point matrix, wherein the updated design curved surface includes an extended curved surface matching the design curved surface target area.
7. A design surface data processing device, characterized in that: include: a memory storing computer-readable instructions; A processor reads the computer-readable instructions stored in the memory to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: Computer-readable instructions are stored thereon, and when the computer-readable instructions are executed by a processor of a computer, the computer is caused to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Offset calculation method for T-spline curved surface
CN112231901A
Curve graph generation method and device, electronic equipment and readable medium
CN118691706A