Intersection curve intersection method and device, electronic equipment and storage medium

Through adaptive segmentation collision detection and curve ring detection, the problem of high efficiency of the curve of the curve is solved, and the efficient and accurate intersection calculation is achieved.

CN119378274APending Publication Date: 2025-01-28SHENZHEN POISSON SOFTWARE TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411955393.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-28
Publication Date
2025-01-28

AI Technical Summary

Technical Problem

It is difficult for the prior art to achieve high efficiency and high precision interception of intersection curves, especially in the case of intersection curves without geometric features.

Method used

By obtaining the cross -curve and parameter curve, the curve segment composed of it is added to the collision queue to conduct adaptive subdivision collision detection to determine whether the curve segment meets whether the intersection conditions are met, including the segmentation of the termination conditions, the collision detection results are collision, curve ring ring ring ring, curve ring ring ring ring The detection results are non -loop and meet the direct judgment conditions, and use the curve segment that meets the intersecting conditions to the target intersection of the calculation intercourse curve and the parameter curve.

Benefits of technology

The calculation efficiency of the intersection of the cross -curve and the parameter curve is improved, the accuracy of the calculation is ensured, and the number of collision detection is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119378274A_ABST
    Figure CN119378274A_ABST
Patent Text Reader

Abstract

The invention is suitable for the technical field of modeling, and provides an intersection curve intersection method and device, electronic equipment and a storage medium, and the method comprises the steps: obtaining an intersection curve and a parameter curve, the intersection curve being an intersection line of a first parameter curved surface and a second parameter curved surface; adding a curve segment pair formed by the intersection curve and the parameter curve into a collision queue; performing adaptive subdivision collision detection on each curve segment pair in the collision queue to judge whether the curve segment pair meets an intersection condition, the intersection condition comprising that the curve segment pair meets a subdivision termination condition, or a collision detection result of the curve segment pair is collision, and a curve ring detection result is acyclic and meets a straightness judgment condition; and calculating a target intersection point of the intersection curve and the parameter curve by using the curve segment pair meeting the intersection condition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of modeling, and in particular relates to a method and device for calculating intersection curves, an electronic device, and a computer-readable storage medium. Background Art

[0002] An intersection curve is the intersection of two parametric surfaces, usually described by ordered discrete surface intersection points and corresponding surface parameters. In modeling software, how to efficiently and accurately calculate the intersection points of an intersection curve with other parametric curves is related to the efficiency and stability of the software.

[0003] In the related art, the intersection of an intersection curve and other parameter curves is mainly calculated using a discrete intersection algorithm, and its basic idea is "segmentation" and "straightening". "Segmentation" refers to the use of a midpoint discrete algorithm to divide the curve into small segments; "straightening" refers to replacing the segmented small segments with line segments connecting their two end points, and then calculating the closest point of the two segments as the approximate intersection of the curve. In the "segmentation" process, a strategy can be adopted to pre-calculate the subdivision depth, and then directly perform binary subdivision according to the depth, and perform collision detection during the subdivision process. However, calculating the subdivision depth requires calculating the extreme value of the second-order derivative of the curve, which is generally difficult to determine in advance efficiently and accurately, especially for intersection curves without any geometric features. Therefore, efficient and high-precision intersection of intersection curves is still a problem to be solved. Summary of the invention

[0004] The embodiments of the present application provide a method and device for finding the intersection of intersection curves, an electronic device, and a computer-readable storage medium, which can solve the problem that the related art cannot achieve high-efficiency and high-precision intersection of intersection curves.

[0005] In a first aspect, an embodiment of the present application provides a method for finding the intersection of intersection curves, the method comprising: obtaining an intersection curve and a parametric curve, the intersection curve being the intersection line of a first parametric surface and a second parametric surface; adding a curve segment pair consisting of the intersection curve and the parametric curve to a collision queue; performing adaptive subdivision collision detection on each curve segment pair in the collision queue to determine whether the curve segment pair satisfies an intersection condition, the intersection condition comprising that the curve segment pair satisfies a subdivision termination condition, or that the collision detection result of the curve segment pair is a collision, the curve ring detection result is a loop-free curve and satisfies a straightness judgment condition; using the curve segment pair that satisfies the intersection condition to calculate a target intersection point of the intersection curve and the parametric curve.

[0006] In the second aspect, an embodiment of the present application provides an intersection curve intersection device, which includes: an acquisition module, used to acquire an intersection curve and a parameter curve, the intersection curve being the intersection line of a first parameter surface and a second parameter surface; an adding module, used to add a curve segment pair consisting of the intersection curve and the parameter curve to a collision queue; a detection module, used to perform adaptive subdivision collision detection on each curve segment pair in the collision queue to determine whether the curve segment pair satisfies the intersection condition, the intersection condition includes that the curve segment pair satisfies the subdivision termination condition, or the collision detection result of the curve segment pair is a collision, the curve ring detection result is a loop-free and satisfies the straightness judgment condition; a calculation module, used to use the curve segment pair that meets the intersection condition to calculate the target intersection point of the intersection curve and the parameter curve.

[0007] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein when the processor executes the computer program, the method for calculating intersection curves described in the first aspect is implemented.

[0008] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the intersection curve intersection method described in the first aspect.

[0009] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the intersection curve intersection method described in the first aspect above.

[0010] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by obtaining an intersection curve and a parameter curve, the intersection curve is the intersection line of a first parameter surface and a second parameter surface; adding a curve segment pair consisting of the intersection curve and the parameter curve to a collision queue; performing adaptive subdivision collision detection on each curve segment pair in the collision queue to determine whether the curve segment pair meets an intersection condition, wherein the intersection condition includes that the curve segment pair meets a subdivision termination condition, or that the collision detection result of the curve segment pair is a collision, and the curve ring detection result is a loop-free curve and satisfies a straightness judgment condition; using the curve segment pair that meets the intersection condition to calculate a target intersection point of the intersection curve and the parameter curve; in the adaptive subdivision collision detection, the curve segment pair meets the intersection condition, and the curve ring detection result is a loop-free curve and satisfies a straightness judgment condition ... Curve loop detection and the judgment of subdivision termination conditions and straightness conditions are introduced in the subdivision collision detection, and only curve segments that meet the intersection conditions are used to calculate the target intersection points of the intersection curve and the parameter curve. The introduction of the subdivision termination condition can adaptively adjust the number of subdivision layers to avoid the problem that the fixed number of subdivision layers may be too deep, resulting in invalid subdivision and waste of computing resources, and too shallow may miss the intersection points. It ensures the calculation accuracy while reducing the number of collision detections. At the same time, only using curve segments that meet the intersection conditions to calculate the target intersection points can effectively reduce the number of curve segment pairs that need to be calculated for intersection points, thereby improving the calculation efficiency of the intersection points of the intersection curve and the parameter curve. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0012] Figure 1 is a structural schematic diagram of an electronic device provided by an embodiment of the present application; Figure 2 It is a flowchart of a method for finding intersection curves provided in an embodiment of the present application; Figure 3 yes Figure 2 A specific process diagram of S3 in FIG. Figure 4 is a schematic diagram of using a tangent cone of a curve segment to perform curve ring detection in a specific example of the present application; Figure 5 It is a schematic diagram of a pair of curve segments satisfying the intersection condition obtained by performing adaptive subdivision collision detection on an intersection curve obtained by intersecting two cylinders and a parametric curve in a specific example of the present application; Figure 6 yes Figure 2 A specific flow diagram of S4; Figure 7 yes Figure 6 A specific flow diagram of S41; Figure 8 It is a specific flow chart of a method for finding intersection curves provided in a specific embodiment of the present application; Fig. 9 It is a structural schematic diagram of an intersection curve intersection calculation device provided in one embodiment of the present application. DETAILED DESCRIPTION In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

[0013] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.

[0014] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0015] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.

[0016] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0017] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0018] The intersection curve intersection method provided in the embodiment of the present application can be applied to electronic devices, including but not limited to servers, server clusters, mobile phones, tablet computers, laptop computers, desktop computers, personal digital assistants, wearable devices and other electronic devices with computing functions. The embodiment of the present application does not impose any restrictions on the specific type of electronic devices.

[0019] Figure 1 FIG. 1 is a block diagram of a partial structure of an electronic device provided in an embodiment of the present application. Figure 1 , the electronic device includes: a processor 10, a memory 20, a bus 30, an input device 40, an output device 50 and a communication device 60. The processor 10 and the memory 20 are connected to each other through the bus 30, and the input device 40, the output device 50 and the communication device 60 are also connected to the bus 30. Those skilled in the art can understand that Figure 1The structure of the electronic device shown in the figure does not constitute a limitation of the electronic device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.

[0020] Combine the following Figure 1 A detailed introduction to the various components of electronic equipment: The processor 10 is the control center of the electronic device, and can run the program stored in the memory 20 to perform various functions and process data. The processor 10 can be a central processing unit (CPU), and the processor 10 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In some embodiments, the processor 10 may include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0021] The memory 20 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as program codes of computer programs. The memory 20 can also be used to temporarily store data required for executing the program and generated. The memory 20 may include a high-speed random access memory, and may also include a non-volatile memory, such as a flash memory, a hard disk, a multimedia card, a card-type memory, etc. The memory 20 may include a storage unit disposed inside the electronic device, such as a hard disk of the electronic device, and / or a removable external storage unit, such as a mobile hard disk, a USB flash drive, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, etc.

[0022] The input device 40 may include at least one of a keyboard, a mouse, a touch panel, a joystick, etc., and is used to collect user input operations to generate corresponding operation instructions.

[0023] The output device 50 is used to output information to be provided to the user. The output device 50 generally includes a display, and optionally, a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. can be used. In addition, the output device can further include a speaker.

[0024] The communication device 60 may include a modem, a network card, etc., for establishing a network connection with other electronic devices and communicating with each other.

[0025] The intersection curve intersection method provided in the embodiment of the present application can be implemented as a computer software program. For example, the embodiment of the present application provides a computer program product, which includes a computer program carried on a computer readable medium, and the computer program contains program code for executing the method shown in the flow chart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 60, and / or installed from a detachable external storage unit. When the computer program is executed by the processor 10, the various functions defined in the intersection curve intersection method provided in the embodiment of the present application are implemented.

[0026] Figure 2 A schematic flow chart of a method for finding intersection curves provided in an embodiment of the present application is shown. As an example but not a limitation, the method can be applied to the above-mentioned electronic device.

[0027] S1: Get the intersection curve and parameter curve.

[0028] The intersection curve is the intersection of the first parametric surface and the second parametric surface. Parametric surfaces are similar to parametric curves in that they can be represented by a small number of parameters. The parametric expression of a parametric curve is set as , the parametric expression of the first parametric surface is , the parametric expression of the second parametric surface is .

[0029] In rare cases, such as when there is an analytical solution to the equation for calculating the intersection curve, the intersection curve can be expressed parametrically as ,In most cases, the intersection curve is described by an ordered set of discrete ,surface intersection points and the corresponding surface parameters.

[0030] The parameters of a parametric curve / surface may include coefficients and exponents of each term in its parametric expression, and / or parameters used to derive its parametric expression (such as control points of a B-spline curve / surface). In addition, the parameters may also include the value range of the independent variable in its parametric expression, etc.

[0031] S2: Add the curve segment pair consisting of the intersection curve and the parameter curve to the collision queue.

[0032] S3: Perform adaptive subdivision collision detection on each curve segment pair in the collision queue to determine whether the curve segment pair meets the intersection condition.

[0033] Optionally, to reduce the computational effort of adaptive subdivision collision detection, before performing adaptive subdivision collision detection, the world coordinate system can be adjusted so that the parametric curve belongs to one axis of the world coordinate system or to a plane defined by two axes. Generally, the coordinate system is adjusted only when the parametric curve is a planar curve. Adjusting the world coordinate system is equivalent to performing the same rotation and translation on the parametric curve and the two parametric surfaces.

[0034] For example, if the parametric curve is a straight line, you can try to adjust the world coordinate system so that the parametric curve belongs to a coordinate axis (such as the Z axis) of the adjusted world coordinate system. Belonging to a coordinate axis means that the entire parametric curve is located on the coordinate axis. If the parametric curve is a plane curve, you can adjust the world coordinate system so that the plane where the parametric curve is located is the plane defined by two coordinate axes of the adjusted world coordinate system (such as the OXY plane). Generally speaking, the former of these two adjustment strategies has a higher priority, so the parametric curve using the second adjustment strategy is often not a straight line, but a curve, such as a circle, ellipse, parabola, hyperbola, B-spline curve, etc.

[0035] The intersection condition includes that the curve segment pair meets the subdivision termination condition, or the collision detection result of the curve segment pair is collision, the curve ring detection result is no ring and meets the straightness judgment condition.

[0036] like Figure 3 As shown, in a specific embodiment of the present application, S3 specifically includes the following parts.

[0037] S31: Determine whether the curve segment pair meets the subdivision termination condition.

[0038] The segmentation termination condition may include at least one of the following: 1. The bounding boxes of the curve segments do not collide (that is, the bounding box of a curve segment in a curve segment pair does not collide with the bounding boxes of all subdivided curve segments of another curve).

[0039] 2. The tangential deflection of the curve (i.e., the angle of the tangent of the curve from the beginning to the end of the curve) is less than the preset value (for example, pi / 64).

[0040] 3. The subdivision depth (i.e., the number of subdivisions experienced by the current curve segment pair) reaches a maximum value (e.g., 8).

[0041] When the number of subdivision termination conditions is greater than 1, the combination method is generally or, that is, as long as any one of the above conditions is met, it can be considered that the subdivision termination condition is met.

[0042] If satisfied, jump to S32; otherwise jump to S33.

[0043] S32: Determine whether the curve segment pair meets the intersection condition.

[0044] S33: Perform midpoint bisection on the curve segment pair to obtain two new curve segment pairs.

[0045] S34: Perform collision detection on the new curve segment pair to obtain a collision detection result.

[0046] S34 and subsequent steps are executed for each new pair of curve segments.

[0047] The axis-aligned bounding boxes of the two curve segments in the new curve segment pair can be calculated, and then the bounding boxes can be used for collision detection to obtain collision detection results.

[0048] If the collision detection result is no collision, jump to S35; otherwise jump to S36.

[0049] S35: Discard the new curve segment pair.

[0050] S36: Perform curve loop detection on the new curve segment pair to obtain a curve loop detection result and determine whether the straightness determination condition is met.

[0051] The straightness judgment condition may be that the tangential deflection of the curve is less than a preset threshold (eg, pi / 16).

[0052] You can use the tangent cone of the curve segment to detect the curve ring. For details, refer to Figure 4 In the given example, if the tangent cones and their inverses of two curve segments do not intersect, the two curve segments have at most one intersection point, and the curve loop is detected as loopless; otherwise, the curve loop is detected as looped. The tangent cone of a curve segment refers to the cone that surrounds all tangents of the curve segment within its independent variable range. Calculate all tangents of the curve segment within its independent variable range, set the starting points of these tangents to the same point, and calculate the cone that surrounds all tangents to be the tangent cone. The inverse of the tangent cone refers to the cone in the opposite direction of symmetry.

[0053] There is no restriction on the order of curve loop detection and straightness judgment conditions.

[0054] Optionally, since the amount of calculation for curve ring detection is relatively large, it may be possible to first determine whether the straightness condition is met, and then perform curve ring detection only on the curve segments that meet the straightness condition, so as to reduce the amount of calculation.

[0055] If the new curve segment pair meets the straightness judgment condition and the curve ring detection result is no ring, jump to S37; otherwise jump to S38.

[0056] S37: Determine whether the new pair of curve segments meets the intersection condition.

[0057] S38: Add the new curve segment pair to the collision queue.

[0058] The method provided in this embodiment is executed for each curve segment pair in the collision queue.

[0059] For example, Figure 5 As shown, an intersection curve 41 obtained by intersecting two cylinders is subjected to adaptive subdivision collision detection with a parameter curve 42 (which is a circle) to obtain a pair of curve segments 43 that meet the intersection condition.

[0060] S4: Calculate the target intersection point between the intersection curve and the parameter curve using the curve segment pairs that meet the intersection condition.

[0061] like Figure 6 As shown, in a specific embodiment of the present application, S4 specifically includes the following parts.

[0062] S41: Calculate the initial intersection point between the intersection curve and the parameter curve using the curve segment pair that meets the intersection condition.

[0063] Specifically, alternative straight line segments of two curve segments in a pair of curve segments that meet the intersection condition may be obtained, where the alternative straight line segments are straight line segments connecting the two end points of the corresponding curve segments; and then the shortest point between the alternative straight line segments is calculated as the initial intersection point.

[0064] The distance between two closest points is the minimum distance between any pair of points in the two alternative straight line segments, that is, the closest distance. There is a special case where the two alternative straight line segments are parallel and there are multiple pairs of points whose distance is the closest distance (also called parallel distance). In this case, one pair can be selected from the multiple pairs of points as the closest points, for example, a pair of points corresponding to the median of the independent variable of the parametric curve in the multiple pairs of points can be selected.

[0065] like Figure 7 As shown, in a specific embodiment of the present application, in order to further reduce the number of initial intersection points that need to be processed, the chord height of the curve segment can be used to screen the curve segment pairs. In this case, S41 specifically includes the following parts.

[0066] S411: Estimate the chord height of the curve segment using curvature.

[0067] S412: Obtain alternative straight line segments of two curve segments in a pair of curve segments that meet the intersection condition.

[0068] S413: Calculate the shortest distance between the alternative straight line segments and the shortest point.

[0069] S414: Determine whether the shortest distance is greater than the sum of the chord heights of the two curve segments.

[0070] If so, jump to S415; otherwise jump to S416.

[0071] S415: Discard the curve segment pair.

[0072] S416: Taking the closest point as the initial intersection point.

[0073] S42: Taking the initial intersection point as the starting point, iteratively calculate and solve the equation group to obtain the target intersection point.

[0074] In the related technology, the closest point of two line segments can be used as the initial solution, and the Newton iteration method can be used to obtain a more accurate solution. The Newton iteration method uses the differential properties of the intersection curve to express the equation of the intersection of the intersection curve and the parameter curve (the parameterized expression is ) needs to calculate the derivatives of the intersection curve, which means that higher-order derivatives of the first and second parametric surfaces need to be calculated. This process is not only time-consuming, but may also face the problem of insufficient surface continuity and inability to calculate higher-order derivatives of the surface.

[0075] In this embodiment, a set of equations is used to replace the equation representing the intersection of the intersection curve and the parametric curve. The set of equations includes a first equation representing the intersection of the first parametric surface and the second parametric surface (parameterized as ), which represents the second equation for the intersection of the first parametric surface and the parametric curve (the parameterized expression is ), and a third equation representing the intersection of the second parametric surface and the parametric curve (parametrically expressed as )

[0076] The initial intersection point includes the coordinates of the two closest points in the world coordinate system, based on which the independent variable value of the closest point belonging to the parametric curve on the parametric curve, i.e., the t value, and the independent variable values ​​of the closest point belonging to the intersection curve on the first parametric surface and the second parametric surface, i.e., the u, v, α, β values, can be calculated. These independent variable values, i.e., t, u, v, α, β, can be recorded in the initial intersection point for subsequent use in solving the equation group, or they can be not recorded in the initial intersection point and calculated before solving the equation group. Using these independent variable values ​​as the starting point, the Newton iteration method is used to calculate and solve the equation group to obtain the target intersection point. The target intersection point has higher accuracy than the initial intersection point.

[0077] Specifically, the Newton iteration method generally sets a very small threshold. If the calculation result of substituting the current independent variable value into the left half of the above equation is less than or equal to the threshold, the iteration can be terminated, and the current independent variable value is used as the calculation result of solving the equation group. According to the independent variable value and the parameterized expression of the parametric curve and the first / second parametric surface, the coordinates of the target intersection point in the world coordinate system can be calculated.

[0078] It can be seen that the above threshold determines the accuracy of the final target intersection point. The setting of the threshold is generally based on most cases. When the intersection curve and the parameter curve are approximately tangent, the calculation result of the left half of the equation near the intersection point changes more dramatically. Considering that the threshold in most cases may not be applicable to special tangent cases, the accuracy of the target intersection point may be reduced. To solve this problem, the calculated target intersection point can be tangent processed.

[0079] Specifically, for each calculated target intersection point, it can be determined whether it satisfies the tangency condition. In theory, whether the normal of the parametric curve at the target intersection point approximately coincides with the intersection curve can be used as the tangency condition. Since the intersection curve is generally represented by a series of points, the above tangency condition is difficult to apply. In practice, the tangent line of the parametric curve at the target intersection point is compared with the normals of the two parametric surfaces. If the tangent line is perpendicular to the normals of the two parametric surfaces at the same time, it can be considered that the parametric curve is tangent to the intersection curve.

[0080] The actual tangency condition can be used to determine Is the absolute value of less than the set value? represents the normal direction of the first parametric surface, represents the normal direction of the second parametric surface, represents vector outer multiplication, Indicates vector multiplication, and the set value is generally a positive number close to 0.

[0081] If a target intersection point satisfies the tangency condition, add a fourth equation (which can be ) and then use the solved equation group to calculate the target intersection point again. Specifically, the current target intersection point can be used as the starting point, and the modified iterative equation group can be calculated using the Newton iteration method to update the target intersection point.

[0082] In addition, after completing the calculation of the target intersection point, multiple identical target intersection points may be obtained. To solve this problem, the calculated target intersection points can be deduplicated. Specifically, all target intersection points can be sorted according to the size of the independent variable values ​​on the parameter curve, and then the independent variable difference between two adjacent target intersection points can be calculated in turn. If the independent variable difference is less than the set threshold, the two target intersection points can be considered to be the same point and need to be deduplicated, such as removing one of them and calculating the midpoint of the two to replace the two target intersection points. Otherwise, no deduplication is performed.

[0083] Through the implementation of this embodiment, curve ring detection and the judgment of subdivision termination conditions and straightness conditions are introduced in the adaptive subdivision collision detection, and only curve segment pairs that meet the intersection conditions are used to calculate the target intersection points of the intersection curve and the parameter curve. The introduction of the subdivision termination conditions can adaptively adjust the number of subdivision layers to avoid the problem that a fixed number of subdivision layers may be too deep, resulting in invalid subdivision and waste of computing resources, and too shallow, which may miss the intersection points. This ensures the calculation accuracy while reducing the number of collision detections. At the same time, only using curve segment pairs that meet the intersection conditions to calculate the target intersection points can effectively reduce the number of curve segment pairs that need to perform intersection calculations, thereby improving the calculation efficiency of the intersection points of the intersection curve and the parameter curve.

[0084] The specific process of the intersection curve intersection method is explained below with reference to the accompanying drawings.

[0085] like Figure 8 As shown, in a specific embodiment of the present application, the intersection curve intersection method includes the following parts. This embodiment is a further extension of the above embodiment, and the same parts are not repeated here.

[0086] S10: Obtain the intersection curve and the parameter curve.

[0087] S11: Try to adjust the world coordinate system so that the parametric curve belongs to one axis of the world coordinate system or to a plane defined by two axes.

[0088] S12: Add the curve segment pair consisting of the intersection curve and the parameter curve to the collision queue.

[0089] S13: Performing adaptive subdivision collision detection on each curve segment pair in the collision queue to determine whether the curve segment pair meets the intersection condition.

[0090] S14: Calculate the initial intersection point between the intersection curve and the parameter curve using the curve segment pair that meets the intersection condition.

[0091] S15: Taking the initial intersection point as the starting point, iteratively calculate and solve the equation group to obtain the target intersection point.

[0092] S16: Determine whether the target intersection point satisfies the tangency condition.

[0093] If yes, jump to S17; otherwise jump to S18.

[0094] S17: After adding a fourth equation representing the tangency between the parameter curve and the intersection curve to the solution equation group, the target intersection point is calculated again using the solution equation group.

[0095] S18: De-duplicate target intersection points.

[0096] Fig. 9A schematic structural diagram of an intersection curve intersection calculation device provided in an embodiment of the present application is shown. The intersection curve intersection calculation device includes an acquisition module 11, an adding module 12, a detection module 13 and a calculation module 14.

[0097] The acquisition module 11 is used to acquire an intersection curve and a parameter curve, where the intersection curve is the intersection line of the first parameter surface and the second parameter surface.

[0098] The adding module 12 is used to add the curve segment pair consisting of the intersection curve and the parameter curve into the collision queue.

[0099] The detection module 13 is used to perform adaptive subdivision collision detection on each curve segment pair in the collision queue to determine whether the curve segment pair meets the intersection condition. The intersection condition includes that the curve segment pair meets the subdivision termination condition, or the collision detection result of the curve segment pair is a collision, the curve ring detection result is a loop-free and meets the straightness judgment condition.

[0100] The calculation module 14 is used to calculate the target intersection point between the intersection curve and the parameter curve using the curve segment pairs that meet the intersection condition.

[0101] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / modules / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0102] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0103] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0104] An embodiment of the present application further 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 in the above-mentioned method embodiments can be implemented.

[0105] If the 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. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / electronic device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

[0106] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0107] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0108] In the embodiments provided in the present application, it should be understood that the disclosed devices / network equipment and methods can be implemented in other ways. For example, the device / network equipment embodiments described above are merely schematic. For example, the division of the 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0109] 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 solution of this embodiment.

[0110] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for finding intersection curves, characterized in that: The method comprises: Obtaining an intersection curve and a parametric curve, wherein the intersection curve is an intersection line of a first parametric surface and a second parametric surface; Adding a curve segment pair consisting of the intersection curve and the parameter curve into a collision queue; Performing adaptive subdivision collision detection on each curve segment pair in the collision queue to determine whether the curve segment pair meets an intersection condition, wherein the intersection condition includes that the curve segment pair meets a subdivision termination condition, or that the collision detection result of the curve segment pair is a collision, the curve ring detection result is a loop-free curve, and the straightness judgment condition is met; A target intersection point between the intersection curve and the parameter curve is calculated using a pair of curve segments that satisfy the intersection condition.

2. The method according to claim 1, characterized in that The step of performing adaptive subdivision collision detection on each curve segment pair in the collision queue to determine whether the curve segment pair meets the intersection condition includes: Determining whether the curve segment pair satisfies the subdivision termination condition; If so, it is determined that the curve segment pair satisfies the intersection condition, otherwise the curve segment pair is divided into two parts at the midpoint to obtain two new curve segment pairs; Performing collision detection on the new pair of curve segments to obtain the collision detection result; If the collision detection result is no collision, the new curve segment pair is discarded, otherwise, a curve ring detection is performed on the new curve segment pair to obtain the curve ring detection result and determine whether the straightness judgment condition is met; If the new pair of curve segments meets the straightness determination condition and the curve loop detection result is no loop, then it is determined that the new pair of curve segments meets the intersection condition; otherwise, the new pair of curve segments is added to the collision queue.

3. The method according to claim 1, characterized in that The calculating the target intersection point between the intersection curve and the parameter curve using the curve segment pair satisfying the intersection condition comprises: Calculating an initial intersection point between the intersection curve and the parameter curve using the curve segment pair that meets the intersection condition; The target intersection point is obtained by iteratively calculating and solving a set of equations with the initial intersection point as a starting point, wherein the set of equations includes a first equation representing the intersection of the first parametric surface and the second parametric surface, a second equation representing the intersection of the first parametric surface and the parametric curve, and at least two of a third equation representing the intersection of the second parametric surface and the parametric curve.

4. The method according to claim 3, characterized in that The calculating the initial intersection point between the intersection curve and the parameter curve using the curve segment pair satisfying the intersection condition comprises: Obtaining alternative straight line segments of two curve segments in the pair of curve segments that meet the intersection condition, wherein the alternative straight line segments are straight line segments connecting two end points of the corresponding curve segments; The point with the shortest distance between the alternative straight line segments is calculated as the initial intersection point.

5. The method according to claim 4, characterized in that The calculating the shortest point between the alternative straight line segments as the initial intersection point comprises: estimating the chord height of the curve segment using curvature, and calculating the closest distance between the alternative straight line segments and the closest point of the distance; When the closest distance is less than or equal to the sum of the chord heights, the point with the closest distance is taken as the initial intersection point; otherwise, the curve segment pair that meets the intersection condition is discarded.

6. The method according to any one of claims 3 to 5, characterized in that: Also includes: When the target intersection point satisfies the tangency condition, the fourth equation indicating that the parameter curve is tangent to the intersection curve is added to the solution equation group, and the target intersection point is calculated again using the solution equation group.

7. The method according to any one of claims 1 to 5, characterized in that: Also includes: Deduplication is performed on the target intersection points.

8. The method according to any one of claims 1 to 5, characterized in that: Before the adaptive subdivision collision detection is performed on each curve segment pair in the collision queue to determine whether the curve segment pair satisfies the intersection condition, the method further includes: The world coordinate system is adjusted so that the parametric curve belongs to one coordinate axis of the world coordinate system or a plane defined by two coordinate axes.

9. A device for finding intersection curves, characterized in that: The device comprises: An acquisition module, used for acquiring an intersection curve and a parameter curve, wherein the intersection curve is an intersection line of a first parameter surface and a second parameter surface; An adding module, used for adding a curve segment pair consisting of the intersection curve and the parameter curve into a collision queue; A detection module, configured to perform adaptive subdivision collision detection on each curve segment pair in the collision queue to determine whether the curve segment pair satisfies an intersection condition, wherein the intersection condition includes that the curve segment pair satisfies a subdivision termination condition, or that the collision detection result of the curve segment pair is a collision, the curve ring detection result is a loopless curve, and the straightness judgment condition is satisfied; A calculation module is used to calculate a target intersection point between the intersection curve and the parameter curve using a pair of curve segments that meet the intersection condition.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable by the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 8 is implemented.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Generation method and device of curved surface model in geometric engine, program product and medium

    CN120411422A