Method, device and equipment for projecting curve to curved surface based on fluid simulation and medium
By determining the target projection direction of the curve and segmenting the projection curve, the problems of inconsistent projection direction and missing topological relationships when the curve is projected to the surface are solved, and the continuity and topological correlation of the projection results are achieved, which is suitable for fluid simulation.
Patent Information
- Application Number
- CN202411296588.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2024-12-31
AI Technical Summary
When the prior art is projected onto a curve, the projection directions of each curve are inconsistent, resulting in the projection results that exceed the expected deformation results, and the projection curve has no topological relationship with the curve surface and cannot be used in fluid simulation.
By determining the target projection direction of the original curve to the original surface, obtain the projection curve and divide the projection curve at the intersection. Use the segmentation curve to segment the original surface to ensure that the projection result is related to the surface topology.
The endpoint continuity and topological correlation of projection results are achieved, ensuring that the projection curve can effectively segment the surface and are suitable for the industry needs of fluid simulation.
Smart Images

Figure CN119227363A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer graphics processing, and in particular to a method, device, equipment and medium for projecting a curve onto a curved surface based on fluid simulation. Background Art
[0002] In the geometric algorithm, the current geometric engine uses the following processing method in the algorithm of projecting a curve onto a surface: first sample the curve to obtain the sampling points on the curve, then find the extreme values of each sampling point and the surface respectively, and obtain the point on the surface that is closest to the sampling point; after obtaining the extreme values of all sampling points on the surface, use the extreme values to fit a spline curve, thereby generating a projection curve of the curve on the surface.
[0003] When this method is used to project a curve onto a surface, each sampling point uses an extreme value to calculate the projection point. Since the projection directions of the curves are inconsistent, the projection results may be deformed beyond expectations. At the same time, after obtaining the projection result of the curve onto the surface, the projection curve has no topological relationship with the surface. The projection curve is an isolated curve and has no use value in fluid simulation products. It is even considered a geometric defect that needs to be repaired. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device, equipment and medium for projecting a curve onto a surface based on fluid simulation, so as to solve the problem that when projecting a curve onto a surface by the existing technology, the projection directions of the curves are inconsistent, which easily leads to the projection results being deformed beyond expectations, and the projection curve has no topological relationship with the surface.
[0005] In order to solve the above technical problems, a technical solution adopted by the present invention is to provide a curve-to-surface projection method based on fluid simulation, the method comprising the following steps: determining the target projection direction of the original curve to the original surface; according to the target projection direction, obtaining the projection curve corresponding to the original curve on the original surface; performing intersection operation on the projection curve, dividing the projection curve at the intersection point, and obtaining multiple divided curves; using each divided curve, dividing the original surface to obtain the target surface.
[0006] In some embodiments, determining the target projection direction of the original curve to the original surface includes the steps of: sampling the original curve, calculating the straight-line distance value of each sampling point projected to the original surface, and obtaining the projection extreme value of the original curve; according to the projection extreme value of the original curve, obtaining the target sampling point with the smallest straight-line distance value and the projection extreme value point of the target sampling point projected on the original surface; and determining the target projection direction according to the target sampling point and the projection extreme value point.
[0007] In some embodiments, obtaining the projection curve corresponding to the original curve on the original surface according to the target projection direction includes the steps of: dividing the original curve with a first step length to obtain multiple sampling points; wherein the original curve is divided into multiple curve segments with the first step length, and the two ends of each curve segment with the first step length correspond to two adjacent sampling points respectively; performing projection calculations on the multiple sampling points along the target projection direction respectively, obtaining corresponding projection points of the multiple sampling points projected on the original surface, and constructing a projection point set; and obtaining the projection curve according to the projection point set.
[0008] In some embodiments, the step of performing projection calculation on a plurality of sampling points respectively along the target projection direction to obtain projection points of the plurality of sampling points projected onto the original surface includes the following steps: for two adjacent sampling points, if one sampling point has the projection point along the target projection direction and the other sampling point does not have the projection point along the target projection direction, then performing discrete subdivision between the two adjacent sampling points, repeating the step of performing projection calculation on a plurality of sampling points respectively along the target projection direction to obtain projection points of the plurality of sampling points projected onto the original surface, and constructing a set of projection points, wherein the discrete subdivision includes dividing the curve line segment of the first step length corresponding to the two adjacent sampling points by a second step length to obtain a plurality of sampling points.
[0009] In some embodiments, the projection calculation is performed on multiple sampling points along the target projection direction respectively, and the projection points of the multiple sampling points projected on the original surface are obtained correspondingly, including the steps of: starting from a starting sampling point, performing projection calculation on each sampling point in turn along the target projection direction, and the starting sampling point corresponds to the beginning of the original curve; grouping the projection points to obtain at least one projection point set; wherein, it is determined whether two adjacent sampling points can both be calculated to the projection point, and if the two adjacent sampling points can both be calculated to the projection point, the corresponding two sampling points belong to the same projection point set; if the current sampling point cannot be calculated to the projection point, and the next sampling point can be calculated to the projection point, the projection point corresponding to the next sampling point belongs to a new projection point set; if the current sampling point can be calculated to the projection point, and the next sampling point cannot be calculated to the projection point, then all the currently obtained projection points are stored in the same projection point set, and the projection calculation is continued for the subsequent sampling points, and the subsequent projection points are grouped until the termination sampling point is reached, and the termination sampling point corresponds to the end of the original curve.
[0010] In some embodiments, before using each segmentation curve to segment the original surface to obtain the target surface, the step of: cleaning up overlaps of each segmentation curve so that the segmentation curves do not overlap with each other and do not overlap with the edges of the original surface.
[0011] In some embodiments, the overlapping cleaning of each segmentation curve so that the segmentation curves do not overlap with each other and the segmentation curves do not overlap with the edge of the original surface includes the steps of: judging whether there are at least two overlapping segmentation curves among the segmentation curves, and if there are at least two overlapping segmentation curves, removing at least one of the at least two overlapping segmentation curves and retaining only one of the segmentation curves; judging whether there is a segmentation curve overlapping with the edge of the original surface among the segmentation curves, and if there is a segmentation curve overlapping with the edge of the original surface, removing the segmentation curve overlapping with the edge of the original surface.
[0012] The present invention also provides a device for projecting a curve onto a surface based on fluid simulation, the device comprising: a direction determination unit, used to determine a target projection direction of an original curve to an original surface; a curve projection unit, used to obtain a projection curve corresponding to the original curve on the original surface according to the target projection direction; a curve segmentation unit, used to perform an intersection operation on the projection curve, segment the projection curve at the intersection point, and obtain a plurality of segmentation curves; and a surface segmentation unit, used to segment the original surface using the segmentation curves to obtain a target surface.
[0013] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0014] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0015] The beneficial effects of the present invention are as follows: the present invention discloses a method, device, equipment and medium for projecting a curve onto a surface based on fluid simulation, the method comprising the following steps: determining the target projection direction of the original curve onto the original surface; obtaining the projection curve corresponding to the original curve on the original surface according to the target projection direction; performing intersection operations on the projection curves, dividing the projection curves at the intersection points, and obtaining a plurality of divided curves; using each divided curve to divide the original surface, and obtaining the target surface. In the curve-to-surface projection method of the present invention, when multiple original curves are projected onto the same original surface, the projection directions remain consistent, thereby ensuring the continuity of the endpoints of the projection results, and then using the projection curves projected onto the original surface to divide the original surface, and marking the projection curves that cannot be divided as scratches on the target surface, thereby obtaining the target surface, so that the projection results are topologically associated with the original surface, which is more in line with the industry needs of fluid simulation. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 It is a flow chart of an embodiment of a method for projecting a curve onto a surface based on fluid simulation according to the present invention;
[0017] Figure 2 It is a specific flow chart of step S1 in an embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0018] Figure 3 It is an initial state diagram of an original curve and an original surface used in an embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0019] Figure 4 It is a schematic diagram of the result of step S1 in an embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0020] Figure 5 It is a specific flow chart of step S2 in an embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0021] Figure 6 It is a schematic diagram of part of the results of step S2 in an embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0022] Figure 7 It is a schematic diagram of the result of step S3 in an embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0023] Figure 8 is a schematic diagram of the result of step S2 in another embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0024] Fig. 9 It is a schematic diagram of the result of step S3 in an embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0025] Fig.10 is a schematic diagram of the result of step S2 in another embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0026] Fig.11 It is a schematic diagram of the result of step S3 in another embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0027] Fig.12 It is a schematic diagram of the result of step S4 in an embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0028] Fig.13 It is a schematic diagram of the result before step S4 in another embodiment of a method for projecting a curve onto a surface based on fluid simulation of the present invention;
[0029] Fig.14 It is a structural block diagram of an embodiment of a device for projecting a curve onto a curved surface based on fluid simulation according to the present invention;
[0030] Fig.15 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention;
[0031] Fig.16 It is a schematic block diagram of an embodiment of a computer-readable storage medium of the present invention. DETAILED DESCRIPTION
[0032] In order to facilitate the understanding of the present invention, the present invention is described in more detail below in conjunction with the accompanying drawings and specific embodiments. Preferred embodiments of the present invention are provided in the accompanying drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described in this specification. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.
[0033] It should be noted that, unless otherwise defined, all technical and scientific terms used in this specification have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used in this specification includes any and all combinations of one or more related listed items.
[0034] like Figure 1 As shown, a method for projecting a curve onto a surface based on fluid simulation of the present invention is shown, and the method comprises the following steps:
[0035] Step S1: Determine the target projection direction of the original curve to the original surface.
[0036] It should be noted that the original curves generally include multiple ones, while there is only one original surface. For each original curve, multiple sampling points can be obtained by sampling it; according to the nearest straight line distance from each sampling point to the original surface, the projection extreme value and optimal projection direction of the corresponding original curve can be determined. By comparing the projection extreme values of each original curve, the required target projection direction can be determined, and each subsequent original curve will be projected onto the original surface along the target projection direction.
[0037] In an optional embodiment, specifically, Figure 2 As shown, step S1 includes the following sub-steps:
[0038] Step S11: Sampling the original curve, calculating the straight-line distance value of each sampling point projected to the original surface, and obtaining the projection extreme value of the original curve.
[0039] It should be noted that the straight-line distance value here refers to the value with the minimum distance between the corresponding sampling point and the original surface. The projection extreme value is the straight-line distance value with the shortest straight-line distance between a sampling point in the corresponding original curve and the original surface. The projection direction of the corresponding sampling point can be regarded as the optimal projection direction of the original curve onto the original surface.
[0040] In an optional embodiment, for each original curve, sampling is first performed to determine multiple sampling points; then the straight-line distance value of each sampling point projected onto the original surface is calculated, and the straight-line distance values corresponding to each sampling point are compared, and the value with the smallest straight-line distance value is obtained as the projection extreme value of the original curve, and then the projection extreme value corresponding to each original curve projected onto the original surface can be determined.
[0041] As an example, Figure 3 As shown, the figure shows an original surface 1 and five original curves (l1~l5), of which four original curves (l2~l5) correspond to the four edges of the closed figure 2.
[0042] Taking the first curve l1 as an example, it is first sampled to determine fifty-one sampling points, where the step length (curve distance) between every two adjacent sampling points is equal. Then the straight-line distance values of the fifty-one sampling points projected onto the original surface 1 are calculated, and the straight-line distance values corresponding to the fifty-one sampling points are compared to obtain the minimum straight-line distance value as the projection extreme value of the first curve l1. The specific sampling process is similar to the process of obtaining sampling points in the subsequent step S21. The process of obtaining sampling points will be described in detail in step S21, which will not be repeated here.
[0043] for Figure 3 The specific operation of obtaining the corresponding projection extreme value of the other original curves (l2~l5) is similar to the specific operation of obtaining the projection extreme value of the first curve l1, which will not be repeated here. It should be pointed out that when sampling each original curve, the number of sampling points corresponding to different original curves should be determined according to the length of different original curves, and the step length between every two adjacent sampling points of each original curve is equal, which can ensure that the determined target projection direction is more accurate and the accuracy of the subsequent projection process is guaranteed.
[0044] Step S12: According to the projection extreme value of the original curve, the target sampling point with the smallest straight-line distance value and the projection extreme value point of the target sampling point projected on the original surface are obtained.
[0045] It should be noted that the target sampling point is a sampling point corresponding to the original curve with the smallest projection extreme value among the multiple original curves, specifically a sampling point in the original curve whose straight-line distance value with the original surface is the projection extreme value.
[0046] In this embodiment, the sizes of the projection extreme values of multiple original curves projected onto the original surface are compared, an original curve with the smallest projection extreme value is determined, and the target sampling point with the smallest straight-line distance value to the original surface and the projection extreme value point of the target sampling point projected onto the original surface are obtained.
[0047] As an example, combining Figure 4 , shows the sampling points corresponding to the projection extreme values of the five original curves (l1~l5) and the projection points on the original surface 1. The straight-line distance between the corresponding sampling points and the projection points is the projection extreme value. Compare the projection extreme values of the five original curves (l1~l5), determine that the original curve with the smallest projection extreme value is the first curve l1, and obtain the target sampling point O1 and the projection extreme value point O2.
[0048] Step S13: Determine the target projection direction according to the target sampling point and the projection extreme point.
[0049] It should be noted that the target projection direction is the direction from the target sampling point to the corresponding projection extreme point.
[0050] Combination Figure 4 , the target projection direction is the direction from the target sampling point O1 to the projection extreme point O2, corresponding to the direction of the arrow in the figure.
[0051] In some embodiments, if the sampling points here are only the endpoints of each original curve, the sampling point with the smallest straight-line distance value can be directly obtained as the target sampling point based on the straight-line distance value of each endpoint projected to the original surface, and the projection extreme point of the corresponding target sampling point projected on the original surface can be directly obtained to determine the target projection direction.
[0052] Step S2: According to the target projection direction, obtain the projection curve corresponding to the original curve on the original surface.
[0053] In this process, each original curve uses the same projection direction, so that the projection result can still maintain the continuity of the same endpoints between the original curves, while also reducing the deformation probability of the projection curve obtained later.
[0054] As an example, Figure 6 As shown, the first curve l1 and the original curved surface 1 are shown, as well as a projection curve corresponding to the first curve l1 projected onto the original curved surface 1 along the target projection direction.
[0055] Specifically, if Figure 5 As shown, step S2 includes the following sub-steps:
[0056] Step S21: Divide the original curve by the first step length to obtain multiple sampling points.
[0057] It should be noted that the original curve is divided into multiple curve segments of the first step length, and the two ends of a curve segment correspond to two adjacent sampling points respectively; at the same time, in two adjacent curve segments, the end of one curve segment and the beginning of the other curve segment correspond to the same sampling point, then the curve distance between the two adjacent sampling points is the first step length, and the curve distance here is the length of the curve segment.
[0058] As an example, combining Figure 6 , divide the corresponding first curve l1 into fifty curve segments of the first step length, that is, divide the parameter domain corresponding to the first curve l1 into fifty equal parts, and fifty-one sampling points can be obtained.
[0059] Step S22: performing projection calculations on the multiple sampling points along the target projection direction respectively, obtaining corresponding projection points of the multiple sampling points projected on the original surface, and constructing a projection point set.
[0060] It should be noted that for each original curve, the beginning of the original curve is the starting sampling point, and the end of the original curve is the ending sampling point. Starting from the starting sampling point to the ending sampling point, each sampling point is projected along the target projection direction in turn, and the projection points of multiple sampling points projected on the original surface are obtained. The starting sampling point corresponds to the beginning of the original curve, and the ending sampling point corresponds to the end of the original curve; at the same time, the projection points are grouped to obtain at least one projection point set.
[0061] In this embodiment, the projection calculation method is: at each sampling point, a projection straight line is constructed that passes through the sampling point and extends along the target projection direction, and the projection straight line of each sampling point is intersected with the original surface to obtain the projection point of each sampling point on the original surface.
[0062] Among them, for two adjacent sampling points, if one sampling point has a projection point along the target projection direction and the other sampling point has no projection point along the target projection direction, discrete subdivision is performed between the two adjacent sampling points, and projection calculations are repeatedly performed on multiple sampling points along the target projection direction, corresponding to the step of obtaining projection points of multiple sampling points projected on the original surface, wherein the discrete subdivision includes dividing the curve segment of the first step length corresponding to the two adjacent sampling points with the second step length to obtain multiple sampling points.
[0063] In this embodiment, through discrete subdivision, projection points close to the edge of the original surface or the edge of the hole can be obtained, so that the projection curve obtained later is more accurate.
[0064] It should be noted that when the original curve is projected onto the original surface in the corresponding target projection direction, the corresponding projection may pass through the edge of the original surface and / or the holes on the original surface. At this time, the projection of the original curve on the original surface may have multiple projection parts. Therefore, for each original curve, one or more projection point sets on the original surface can be obtained.
[0065] Among them, the specific method of constructing the projection point set is: determine whether two adjacent sampling points can both be calculated to the projection point. If the two adjacent sampling points can both be calculated to the projection point, the corresponding two sampling points belong to the same projection point set; if the current sampling point cannot be calculated to the projection point, and the next sampling point can be calculated to the projection point, the projection point corresponding to the next sampling point belongs to a new projection point set; if the current sampling point can be calculated to the projection point, and the next sampling point cannot be calculated to the projection point, then all the currently obtained projection points are stored in the same projection point set, and the projection calculation of the subsequent sampling points continues, and the subsequent projection points are grouped at the same time.
[0066] As an example, Figure 6 As shown, for the first curve l1, its projection on the original surface 1 includes two projection parts, so two sets of projection point sets can be obtained accordingly.
[0067] Among them, for the fifty-one sampling points corresponding to the first curve l1, starting from the first sampling point (the starting sampling point, that is, the target sampling point O1), at each sampling point, a projection line passing through the sampling point and extending along the target projection direction is constructed, and the projection line of each sampling point is intersected with the original surface to obtain the projection point of each sampling point on the original surface. At the same time, a projection point set is constructed, Figure 6 The fifty-one sampling points in can be divided into three parts. The sampling points in the first part are the sampling points in the line segment O1-O3, the sampling points in the second part are the sampling points in the line segment O3-O4, and the sampling points in the third part are the sampling points in the line segment O4-O5. The projections of the sampling points in the first part and the sampling points in the third part correspond to the two projection parts in the figure, that is, the projection points corresponding to the sampling points in the first part and the sampling points in the third part correspond to a projection point set.
[0068] And for Figure 6The sampling points in the second part obviously cannot be projected onto the original surface 1. If the corresponding projection points cannot be obtained at the (i+1)th sampling point, a discrete subdivision is performed between the i-th sampling point where the projection point can be obtained and the (i+1)th sampling point, and multiple new sampling points are obtained. The step length between two adjacent new sampling points is less than the first step. Then, at each new sampling point, projection calculation is performed to obtain projection points that are close to the edge of the original surface 1. If the corresponding projection points can be obtained again at the (j+1)th sampling point, a discrete subdivision is performed between the j-th sampling point where the projection point cannot be obtained and the (j+1)th sampling point, and multiple new sampling points are obtained. The step length between two adjacent new sampling points is less than the first step. Then, at each new sampling point, projection calculation is performed to obtain projection points that are close to the edge of the original surface 1, where 0 <i<j<50。
[0069] As an example, Figure 7 As shown, for Figure 3 The projection parts of the other original curves (l2~l5) in the original surface 1 are obtained by the same method to obtain a set of projection points corresponding to each original curve (l2~l5), which will not be repeated here.
[0070] In another embodiment, it should be noted that the curved surface includes a plane. Figure 8 As shown, when the sixth curve l6 is projected onto the original plane 3 in the corresponding target projection direction, the corresponding projection will pass through the edge of the original plane 3 and two holes on the original plane 3. For the sixth curve l6, three sets of projection point sets can be obtained.
[0071] In some other embodiments, after the projection point of the current sampling point is obtained, the position of the next sampling point needs to be appropriately adjusted according to the curvature of the current sampling point on the curve and the curvature of the projection point of the current sampling point on the surface. The greater the curvature, the smaller the step size between adjacent sampling points.
[0072] Step S23: Obtain a projection curve according to the projection point set.
[0073] It should be noted that each projection point set corresponds to a projection curve. For each original curve, all projection points in each projection point set are fitted using a fitting algorithm to calculate the corresponding projection curve.
[0074] As an example, Figure 7 As shown, a fitting algorithm is used to fit all projection points in the obtained six projection point sets to obtain six corresponding projection curves (t1-t6).
[0075] Step S3: performing an intersection operation on the projection curve, dividing the projection curve at the intersection point, and obtaining multiple divided curves.
[0076] Among them, an intersection operation is performed on all the projection curves obtained in step S2 to obtain the intersection points between different projection curves, and the corresponding projection curves are divided at the intersection points to obtain multiple segmentation curves, so that the intersection points between the segmentation curves are all at the end points of each segmentation curve, and there are no other intersection points between different segmentation curves, and the corresponding segmentation curves do not intersect with each other.
[0077] As an example, Figure 7 and Fig. 9 As shown, among the corresponding six projection curves, the projection curve t1 intersects the projection curve t3 at the projection extreme point O2, and the projection curve t3 is segmented using the projection extreme point O2 to obtain two segmentation curves, namely t7 and t8; and the other projection curves (t1, t2, t4~t6) are retained as segmentation curves to obtain seven segmentation curves, namely t1, t2, t7, t8, t4, t5 and t6.
[0078] In order to describe this process more clearly, another embodiment is taken as an example. Fig.10 and Fig.11 As shown, three original curves and three corresponding projection curves (f1-f3) projected on an original surface are shown. It can be seen that one projection curve f3 intersects with the other two projection curves f1 and f2, and the intersection points are the first intersection point j1 and the second intersection point j2. The projection curve f1 and the projection curve f3 are divided at the first intersection point j1, and the projection curve f2 and the projection curve f3 are divided at the second intersection point j2, thereby obtaining 7 segmented curves, namely g1, g2, g3, g4, g5, g6 and g7. Among them, g1 and g2 correspond to f1, g3 and g4 correspond to f2, and g5, g6 and g7 correspond to f3.
[0079] Step S4: Use each segmentation curve to segment the original surface to obtain the target surface.
[0080] The original surface is segmented using each segmentation curve, so that each segmentation (projection) curve is associated with the original surface in topological structure, thereby obtaining a target surface.
[0081] It should be noted that among all the segmentation curves, there may be segmentation curves that cannot segment the original surface. The segmentation curves that cannot segment the original surface are represented by scratches in the target surface.
[0082] As an example, Fig. 9 and Fig.12As shown, three target surfaces are obtained, namely, a first target surface 11, a second target surface 12 and a third target surface 13. There is a scratch 4 on the third target surface 13, and the scratch 4 represents a segmentation (projection) curve t2 corresponding to the first curve l1.
[0083] In some other embodiments, before step S4, the method further includes the step of performing overlapping cleaning on each segmentation curve so that each segmentation curve does not overlap with each other and each segmentation curve does not overlap with the edge of the original surface.
[0084] It is necessary to determine whether there are at least two overlapping segmentation curves in each segmentation curve. If there are at least two overlapping segmentation curves, at least one of the at least two overlapping segmentation curves is removed and only one segmentation curve is retained.
[0085] It is also necessary to determine whether there is a segmentation curve that overlaps with the edge of the original surface in each segmentation curve. If there is a segmentation curve that overlaps with the edge of the original surface, the segmentation curve that overlaps with the edge of the original surface is removed. It should be noted that the overlap here refers to complete overlap, not partial overlap. Since the segmentation curve is obtained by segmentation at the intersection, there is only complete overlap between different segmentation curves, and there is no partial overlap. There may be partial overlap between the segmentation curve and the edge of the original surface. If the segmentation curve partially overlaps with the edge of the original surface, it is only necessary to remove the portion of the segmentation curve that overlaps with the edge of the original surface, without removing the entire segmentation curve.
[0086] As an example, Fig.13 As shown, two partially overlapping original curves are displayed, and the projection curves of the two original curves on the original surface also partially overlap. After the two projection curves are segmented, two segmentation curves are obtained, namely d1, d2, d3 and d4. Among them, d2 and d3 overlap, so one of the segmentation curves (d2 / d3) is removed and the other segmentation curve (d3 / d2) is retained.
[0087] In the present invention, by performing overlapping cleaning on each segmentation curve, repeated segmentation of the original surface by multiple overlapping segmentation curves can be avoided, thereby ensuring rapid segmentation of the original surface.
[0088] It should be noted that, in the above embodiment, the curve-to-surface projection method of the present invention is mainly described based on the projection process of five original curves (l1~l5) onto an original surface 1. In some other embodiments, other numbers of original curves may be projected onto another original surface. The specific operations are similar to those in the above embodiment and will not be repeated here.
[0089] Based on the same inventive concept, Fig.14As shown, the present invention also provides a device for projecting a curve onto a curved surface based on fluid simulation, the device comprising:
[0090] The direction determining unit 101 is used to determine the target projection direction of the original curve to the original surface.
[0091] The curve projection unit 102 is used to obtain a projection curve corresponding to the original curve on the original surface according to the target projection direction.
[0092] The curve segmentation unit 103 is used to perform an intersection operation on the projection curve, segment the projection curve at the intersection point, and obtain multiple segmentation curves.
[0093] The surface segmentation unit 104 is used to segment the original surface using each segmentation curve to obtain a target surface.
[0094] In the present application, other technical features of the above-mentioned curve-to-curved-surface projection device based on fluid simulation are the same as the features disclosed in the above-mentioned method embodiment, and will not be repeated here.
[0095] Based on the same inventive concept, the present application also provides an electronic device, which includes a processor, a memory and a communication circuit, and the processor is connected to the memory and the communication circuit respectively; wherein the communication circuit is used for communication connection, the memory is used to store a computer program, and the processor is used to execute the computer program to implement the above method.
[0096] As an example, see Fig.15 The electronic device described in the embodiment of the present application may specifically include a processor 210 and a memory 220. The memory 220 is coupled to the processor 210.
[0097] The processor 210 is used to control the operation of the electronic device. The processor 210 may also be referred to as a CPU (Central Processing Unit). The processor 210 may be an integrated circuit chip having the ability to process signals. The processor 210 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor 210 may also be any conventional processor, etc.
[0098] The memory 220 is used to store computer programs, and may be a RAM, a ROM, or other types of storage terminals. Specifically, the memory 220 may include one or more computer-readable storage media, which may be non-transitory or transient. The memory 220 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage terminals, flash memory storage terminals. In some embodiments, the non-transitory computer-readable storage medium in the memory 220 is used to store at least one program code.
[0099] The processor 210 is used to execute the computer program stored in the memory 220 to implement the methods described in the various method embodiments of the present application.
[0100] In some embodiments, the electronic device may further include: a peripheral terminal interface 230 and at least one peripheral terminal. The processor 210, the memory 220 and the peripheral terminal interface 230 may be connected via a bus or a signal line. Each peripheral terminal may be connected to the peripheral terminal interface 230 via a bus, a signal line or a circuit board. Specifically, the peripheral terminal includes: at least one of a radio frequency circuit 240, a display screen 250, an audio circuit 260 and a power supply 270.
[0101] The peripheral terminal interface 230 may be used to connect at least one peripheral terminal related to I / O (Input / output) to the processor 210 and the memory 220. In some embodiments, the processor 210, the memory 220, and the peripheral terminal interface 230 are integrated on the same chip or circuit board; in some other implementations, any one or two of the processor 210, the memory 220, and the peripheral terminal interface 230 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0102] The radio frequency circuit 240 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 240 communicates with the communication network and other IoT devices through electromagnetic signals, and the radio frequency circuit 240 is the communication circuit of the electronic device. The radio frequency circuit 240 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 240 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, an operator identity module card, and the like. The radio frequency circuit 240 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 240 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0103] The display screen 250 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 250 is a touch display screen, the display screen 250 also has the ability to collect touch signals on the surface or above the surface of the display screen 250. The touch signal can be input to the processor 210 as a control signal for processing. At this time, the display screen 250 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 250 can be one, set on the front panel of the electronic device; in other embodiments, the display screen 250 can be at least two, respectively set on different surfaces of the electronic device or in a folding design; in other embodiments, the display screen 250 can be a flexible display screen, set on a curved surface or a folding surface of the electronic device. Even, the display screen 250 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 250 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light□EmittingDiode, organic light-emitting diode).
[0104] The audio circuit 260 may include a microphone and a speaker. The microphone is used to collect sound waves from the operator and the environment, and convert the sound waves into electrical signals and input them into the processor 210 for processing, or input them into the radio frequency circuit 240 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there may be multiple microphones, which are respectively arranged in different parts of the electronic device. The microphone may also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 210 or the radio frequency circuit 240 into sound waves. The speaker may be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 260 may also include a headphone jack.
[0105] The power supply 270 is used to power various components in the electronic device. The power supply 270 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 270 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged through a wired line, and a wireless rechargeable battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0106] For a detailed description of the functions and execution processes of each functional module or component in the electronic device embodiment of the present application, reference can be made to the description in the above-mentioned method embodiments of the present application, which will not be repeated here.
[0107] In the several embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the various embodiments of the electronic devices described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0108] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0109] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0110] Based on the same inventive concept, the present application also provides a computer-readable storage medium storing a computer program, which can be executed by a processor to implement the above method.
[0111] See also Fig.16 , if the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium 300. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions / computer programs to enable an IoT device (which can be a personal computer, server, or network terminal, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), magnetic disks or optical disks, and electronic terminals such as computers, mobile phones, laptops, tablet computers, cameras, etc. having the above-mentioned storage media.
[0112] The description of the execution process of the program data in the computer-readable storage medium can refer to the description in the above-mentioned method embodiments of the present application, and will not be repeated here.
[0113] It can be seen that the present invention discloses a method, device, equipment and medium for projecting a curve onto a surface based on fluid simulation, the method comprising the following steps: determining the target projection direction of the original curve onto the original surface; obtaining the projection curve corresponding to the original curve on the original surface according to the target projection direction; performing intersection operation on the projection curve, dividing the projection curve at the intersection point, and obtaining multiple segmentation curves; using each segmentation curve to segment the original surface to obtain the target surface. In the curve-to-surface projection method of the present invention, when multiple original curves are projected onto the same original surface, the projection direction remains consistent, thereby ensuring the endpoint continuity of the projection result, and then using the projection curve projected onto the original surface to segment the original surface, and marking the projection curve that cannot be segmented as a scratch on the target surface, thereby obtaining the target surface, so that the projection result is topologically associated with the original surface, which is more in line with the industry needs of fluid simulation.
[0114] The above are only embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any equivalent structural transformations made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are included in the protection scope of the present invention.
Claims
1. A method for projecting a curve onto a surface based on fluid simulation, characterized in that: The method comprises the following steps: Determine the target projection direction of the original curve to the original surface; According to the target projection direction, obtaining a projection curve corresponding to the original curve on the original surface; Performing an intersection operation on the projection curve, dividing the projection curve at the intersection point, and obtaining a plurality of divided curves; The original curved surface is segmented using each segmentation curve to obtain a target curved surface.
2. The method for projecting a curve onto a curved surface according to claim 1, characterized in that: The step of determining the target projection direction of the original curve to the original surface comprises the following steps: Sampling the original curve, calculating the straight-line distance value of each sampling point projected to the original surface, and obtaining the projection extreme value of the original curve; According to the projection extreme value of the original curve, the target sampling point with the smallest straight-line distance value and the projection extreme value point of the target sampling point projected on the original surface are obtained; The target projection direction is determined according to the target sampling point and the projection extreme point.
3. The method for projecting a curve onto a curved surface according to claim 1, characterized in that: The step of obtaining the projection curve corresponding to the original curve on the original surface according to the target projection direction comprises the following steps: Dividing the original curve with the first step length to obtain a plurality of sampling points; wherein the original curve is divided into a plurality of curve segments with the first step length, and two ends of each curve segment with the first step length correspond to two adjacent sampling points respectively; Performing projection calculations on a plurality of sampling points along the target projection direction, respectively, obtaining projection points of the plurality of sampling points projected on the original surface, and constructing a projection point set; The projection curve is obtained according to the projection point set.
4. The method for projecting a curve onto a curved surface according to claim 3, characterized in that: The method of performing projection calculation on the plurality of sampling points along the target projection direction, obtaining projection points of the plurality of sampling points projected on the original surface, and constructing a set of projection points comprises the following steps: For two adjacent sampling points, if one sampling point has the projection point along the target projection direction and the other sampling point does not have the projection point along the target projection direction, discrete subdivision is performed between the two adjacent sampling points, and the steps of performing projection calculations on multiple sampling points along the target projection direction are repeated to obtain projection points of multiple sampling points projected on the original surface, and construct a set of projection points, wherein the discrete subdivision includes dividing the curve segment of the first step length corresponding to the two adjacent sampling points with a second step length to obtain multiple sampling points.
5. The method for projecting a curve onto a curved surface according to claim 3 or 4, characterized in that: The method of performing projection calculation on the plurality of sampling points along the target projection direction, obtaining projection points of the plurality of sampling points projected on the original surface, and constructing a set of projection points comprises the following steps: Starting from a starting sampling point, projection calculation is performed on each sampling point in turn along the target projection direction, wherein the starting sampling point corresponds to the beginning of the original curve; The projection points are grouped to obtain at least one projection point set; wherein, it is determined whether two adjacent sampling points can both be calculated as projection points, and if the two adjacent sampling points can both be calculated as projection points, the corresponding two sampling points belong to the same projection point set; If the current sampling point cannot be calculated to a projection point, but the next sampling point can be calculated to a projection point, the projection point corresponding to the next sampling point belongs to a new projection point set; if the current sampling point can be calculated to a projection point, but the next sampling point cannot be calculated to a projection point, all currently obtained projection points are stored in the same projection point set, and projection calculations are continued for subsequent sampling points, and subsequent projection points are grouped until a termination sampling point is reached, and the termination sampling point corresponds to the end of the original curve.
6. The method for projecting a curve onto a curved surface according to claim 1, characterized in that: Before the original curved surface is segmented by using each segmentation curve to obtain the target curved surface, the following steps are also included: The segmentation curves are overlapped and cleaned up so that the segmentation curves do not overlap each other and do not overlap with the edge of the original curved surface.
7. The method for projecting a curve onto a curved surface according to claim 6, characterized in that: The overlapping cleaning of each segmentation curve so that each segmentation curve does not overlap each other and each segmentation curve does not overlap with the edge of the original curved surface comprises the steps of: Determine whether there are at least two overlapping segmentation curves among the segmentation curves, and if there are at least two overlapping segmentation curves, remove at least one of the at least two overlapping segmentation curves and retain only one segmentation curve; It is determined whether there is a segmentation curve overlapping with the edge of the original curved surface among the segmentation curves; if there is a segmentation curve overlapping with the edge of the original curved surface, the segmentation curve overlapping with the edge of the original curved surface is removed.
8. A device for projecting a curve onto a curved surface based on fluid simulation, characterized in that: The device comprises: A direction determination unit, used for determining a target projection direction of the original curve to the original surface; A curve projection unit, used for obtaining a projection curve corresponding to the original curve on the original surface according to the target projection direction; A curve segmentation unit, used for performing an intersection operation on the projection curve, segmenting the projection curve at the intersection point, and obtaining a plurality of segmentation curves; The surface segmentation unit is used to segment the original surface using the segmentation curves to obtain a target surface.
9. An electronic device, characterized in that: The method comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
