Curved surface selfing detection method executed by electronic equipment and electronic equipment

By constructing root nodes and solving self-intersection lines, the problem of computational complexity and low efficiency in surface self-intersection detection in complex engineering design environments is solved, achieving efficient and accurate self-intersection detection and improving the accuracy of computer-aided design and visual effects.

CN121962039APending Publication Date: 2026-05-01ACAD OF MATHEMATICS & SYSTEMS SCIENCE - CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ACAD OF MATHEMATICS & SYSTEMS SCIENCE - CHINESE ACAD OF SCI
Filing Date
2025-12-31
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing surface self-intersection detection methods are difficult to meet the accuracy, precision, and computational efficiency requirements of complex engineering design environments in practical applications. They suffer from problems such as computational complexity, large computational load, high resource consumption, and low computational efficiency.

Method used

By constructing root nodes, self-intersection is detected based on the surface parameter information of the surface to obtain initial detection results. Then, the self-intersection line is solved under the condition that the solution is satisfied, and the self-intersection line is displayed.

Benefits of technology

It improves the efficiency of surface self-intersection detection, saves computing resources, ensures the robustness of modeling functions, avoids unnecessary calculations, and improves the accuracy of computer-aided design and special effects rendering.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121962039A_ABST
    Figure CN121962039A_ABST
Patent Text Reader

Abstract

The invention provides a curved surface selfing detection method executed by electronic equipment and the electronic equipment, and the method comprises the steps: responding to a control instruction generated by a controller, constructing a root node through an arithmetic unit according to curved surface parameter information of a curved surface, and storing the root node in a register; performing selfing detection on the curved surface on the basis of the root node according to the control instruction and the curved surface parameter information of the curved surface through an arithmetic unit to obtain an initial detection result, and storing the initial detection result in a register; under the condition that the initial detection result meets a solving condition, an arithmetic unit carries out selfing intersection solving on the curved surface based on the control instruction, the curved surface parameter information of the curved surface and the root node, at least one initial intersection point is obtained, and the at least one initial intersection point is stored in a register; determining a selfing intersection line of the curved surface according to the at least one initial intersection point through an arithmetic unit based on the control instruction, and storing the selfing intersection line in a register; and displaying the selfing intersection line through a display unit.
Need to check novelty before this filing date? Find Prior Art

Description

Method for detecting surface self-intersections performed by electronic devices and electronic devices Technical Field

[0001] This application relates to the fields of computer graphics and computer surface intersection technology, and more specifically, to a surface self-intersection detection method and electronic device executed by an electronic device. Background Technology

[0002] Surface self-intersection refers to a surface intersecting itself to form one or more closed loops. Surface self-intersection alters the surface's topology and geometric properties, thus affecting surface computational analysis and subsequent processing. In the field of Computer-Aided Design (CAD), surface self-intersection detection is a crucial task because many modeling operations have strict requirements regarding the non-self-intersection of surfaces. Typically, self-intersecting surfaces lack practical application value in industrial scenarios, their display effects are unsatisfactory, they can easily interfere with subsequent product design, and may even lead to errors in surface-based computational and geometric processes.

[0003] In the process of realizing the concept of this application, the inventors found that the relevant surface self-intersection detection methods have certain limitations in practical applications. They are difficult to meet the requirements of accuracy, precision and computational efficiency of self-intersection detection in increasingly complex engineering design environments. When implementing surface self-intersection detection calculations, there are problems such as computational complexity, large computational load, high resource consumption and low computational efficiency. Summary of the Invention

[0004] In view of the above problems, this application provides a method, apparatus, medium and program product for detecting surface self-intersections performed by an electronic device.

[0005] According to one aspect of this application, a surface self-intersection detection method executed by an electronic device is provided, comprising: responding to a control command generated by a controller, constructing a root node based on surface parameter information of the surface using an arithmetic unit, and storing the root node in a register, wherein the surface parameter information of the surface includes the order of the surface, control point information, node vector information, maximum subdivision level, and clipping boundary information, and the root node represents the bounding box surrounding the surface; performing self-intersection detection on the surface based on the root node and the surface parameter information of the surface using the arithmetic unit according to the control command, obtaining an initial detection result, and storing the initial detection result in a register, wherein the initial detection result represents the self-intersection probability of the surface; if the initial detection result satisfies the solution conditions, performing self-intersection line calculation on the surface based on the root node and the surface parameter information of the surface using the arithmetic unit according to the control command, obtaining at least one initial intersection point, and storing the at least one initial intersection point in a register; determining the self-intersection line of the surface based on the at least one initial intersection point using the arithmetic unit according to the control command, and storing the self-intersection line in a register; and displaying the self-intersection line through a display unit.

[0006] Another aspect of this application provides an electronic device comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.

[0007] Another aspect of this application provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed by a processor, implement the steps of the above-described method.

[0008] Another aspect of this application provides a computer program product, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description

[0009] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0010] Figure 1 schematically illustrates a flowchart of a surface self-intersection detection method performed by an electronic device according to an embodiment of this application;

[0011] Figure 2 schematically illustrates the BVH structure according to an embodiment of this application;

[0012] Figure 3 illustrates a self-intersecting surface according to an embodiment of this application;

[0013] Figure 4A schematically illustrates a flowchart of a surface self-intersection detection method according to an embodiment of this application;

[0014] Figure 4B schematically illustrates a flowchart of intra-node self-intersection detection according to an embodiment of this application;

[0015] Figure 4C schematically illustrates a flowchart of node intersection detection according to an embodiment of this application;

[0016] Figure 5 schematically illustrates the principle of determining the self-intersection line of a surface according to an embodiment of this application; and

[0017] Figure 6 schematically illustrates a block diagram of an electronic device suitable for implementing a surface self-intersection detection method according to an embodiment of this application. Detailed Implementation

[0018] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.

[0019] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0020] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0021] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).

[0022] Surface self-intersection refers to a surface intersecting itself to form one or more closed loops. Surface self-intersection alters the surface's topology and geometric properties, thus affecting surface computational analysis and subsequent processing. In the field of Computer-Aided Design (CAD), surface self-intersection detection is a crucial task because many modeling operations have strict requirements regarding the non-self-intersection of surfaces. Typically, self-intersecting surfaces lack practical application value in industrial scenarios, their display effects are unsatisfactory, they can easily interfere with subsequent product design, and may even lead to errors in surface-based computational and geometric processes.

[0023] In the process of realizing the concept of this application, the inventors found that the relevant surface self-intersection detection methods have certain limitations in practical applications. They are difficult to meet the requirements of accuracy, precision and computational efficiency of self-intersection detection in increasingly complex engineering design environments. When implementing surface self-intersection detection calculations, there are problems such as computational complexity, large computational load, high resource consumption and low computational efficiency.

[0024] In view of this, embodiments of this application provide a method, device, medium, and program product for detecting self-intersection of a surface executed by an electronic device. The method includes: responding to a control command generated by a controller, constructing a root node based on surface parameter information of the surface using an arithmetic unit, and storing the root node in a register. The surface parameter information includes the order of the surface, control point information, node vector information, maximum subdivision level, and clipping boundary information; the root node represents the bounding box enclosing the surface. The arithmetic unit then performs self-intersection detection on the surface based on the root node and the surface parameter information, according to the control command. The system performs a test to obtain an initial detection result, which is then stored in a register. This initial detection result represents the self-intersection probability of the surface. If the initial detection result satisfies the solution conditions, the arithmetic unit, based on control instructions and the surface parameter information, solves for the self-intersection line of the surface based on the root node, obtaining at least one initial intersection point, which is then stored in a register. The arithmetic unit, based on control instructions and the at least one initial intersection point, determines the self-intersection line of the surface and stores it in a register. Finally, the self-intersection line is displayed through a display unit.

[0025] According to embodiments of this application, the surface self-intersection detection method (hereinafter referred to as "this method") performed by an electronic device can be applied in geometric solid modeling scenarios, such as computer-aided design (CAD), computer-aided engineering (CAE), computer-aided manufacturing (CAM), geometric modeling, visual effects, facial recognition, and other specific technical fields. This method can be applied to representing complex objects, Boolean operations, mesh generation, finite element discretization, computer animation, facial recognition, etc., and has high practical application value.

[0026] Figure 1 schematically illustrates a flowchart of a surface self-intersection detection method performed by an electronic device according to an embodiment of this application.

[0027] As shown in Figure 1, the method 100 includes operations S110 to S150.

[0028] In operation S110, in response to the control command generated by the controller, the arithmetic unit constructs the root node based on the surface parameter information of the surface and stores the root node in the register. The surface parameter information of the surface includes the order of the surface, control point information, node vector information, maximum subdivision level, and clipping boundary information. The root node represents the bounding box that encloses the surface.

[0029] According to embodiments of this application, this method can be applied to at least one of the following: engineering design, architectural design, computer animation, and facial recognition, as well as the drawing design of curved surface representation geometry.

[0030] For example, this method can be applied to scenarios involving the modeling of various types of complex surface entities, such as mechanical component surface entities, architectural component surface entities, animation objects, and human body part surface entities, or to path planning scenarios involving robots, drones, and automobiles.

[0031] According to embodiments of this application, surfaces can be used to characterize the drafting design of geometric objects, which can be understood as surface entities. Parametric surfaces can be understood as parametric surfaces established based on various types of surface entities. For example, the aforementioned parametric surfaces can be selected as non-uniform rational B-spline curves (NURBS surfaces), rational or polynomial B-spline curves (B-spline curves), rational or polynomial Bezier surfaces, etc., without limitation. The aforementioned various types of surface entities can include, for example, mechanical component surface entities, architectural component surface entities, animation object surface entities, human body part surface entities, etc. For example, mechanical component surface entities can include, but are not limited to, solid modeling surfaces of aircraft fuselage exterior parts, automobile body exterior parts, train body exterior parts, ship hull exterior parts, etc. In other words, this method can be applied to solid modeling scenarios in the design field of mechanical equipment such as aircraft, automobiles, trains, and ships.

[0032] In operation S120, the arithmetic unit performs self-intersection detection on the surface based on the root node according to the surface parameter information of the surface and the control instructions, obtains the initial detection result, and stores the initial detection result in the register. The initial detection result represents the self-intersection probability of the surface.

[0033] In operation S130, if the initial detection result meets the solution conditions, the arithmetic unit, based on the control instructions and the surface parameter information of the surface, performs self-intersection line calculation on the surface based on the root node to obtain at least one initial intersection point and stores at least one initial intersection point in the register.

[0034] In operation S140, the arithmetic unit determines the self-intersection line of the surface based on control instructions and at least one initial intersection point, and stores the self-intersection line in a register.

[0035] When operating S150, the self-intersection line is displayed through the display unit.

[0036] According to embodiments of this application, a surface can be understood as a three-dimensional geometric shape, such as a trimmed non-uniform rational B-spline (NURBS) surface. Surface parameter information can be used to precisely define and describe the surface shape through mathematical formulas and parameterization methods, forming the basis for constructing and manipulating complex surfaces. Exemplarily, surface parameter information may include parameters in parameter space and parameters in model space.

[0037] According to embodiments of this application, model space can be understood as the three-dimensional (or higher-dimensional) space in which geometric objects actually exist. In model space, objects have actual geometric dimensions and positions. Parameter space can be understood as an abstract space used to define geometric objects in a parametric form. In parameter space, each point is represented by a pair of parameters (typically u and v), which are mapped to points in model space through parametric equations. Parameter space determines the parametric representation of curves or surfaces, while model space describes the actual spatial shape of curves or surfaces.

[0038] According to embodiments of this application, the order refers to the order of the polynomial defining the surface plus 1, for example, the order of a quadratic polynomial surface is 3. The order of the surface determines its smoothness and complexity. Control points are key points defining the shape of the surface; the control point information may include, for example, the distribution and location of the control points. A knot vector is a non-decreasing sequence of real numbers that can be used to define the parameterized range of the surface; the knot vector information may include, for example, the length of the knot vector. A trimming loop can be used to define a closed curve or path of the trimmed region of the surface; the trimming loop information may include, for example, a parameterized representation of the trimming loop to specify the area of ​​the surface that needs to be retained or removed. The maximum subdivision level can be understood as the maximum number of subdivision levels allowed when constructing, for example, a BVH (Bounding Volume Hierarchy) structure. The art can set a reasonable maximum subdivision level according to actual needs or application scenarios, for example, it can be set to 8 levels. For example, the number of subdivisions of the root node can be set to 1.

[0039] Figure 2 schematically illustrates a BVH structure according to an embodiment of this application.

[0040] According to embodiments of this application, the root node can be understood as the top-level node of the BVH structure. The BVH structure is a data structure used to optimize spatial queries and geometric calculations. In a BVH structure, the root node typically represents the outermost bounding volume of the entire dataset; specifically, in this embodiment, the root node can represent the bounding box that encloses the entire surface. During the construction of the BVH structure, geometric objects can be recursively divided into smaller regions, and a bounding volume can be generated for each region, forming a hierarchical tree structure. As shown in Figure 2, the parameter space corresponding to the surface entity can be divided into multiple regions, with each region generating a bounding volume, forming a hierarchical BVH structure.

[0041] According to embodiments of this application, a bounding box can be understood as a simple geometric structure used to define the position and extent of an object in space. A bounding box can be used to enclose complex geometric objects (such as 3D curved surfaces). The basic idea is to approximate complex geometric objects with a bounding box that is slightly larger and has simpler characteristics. By utilizing bounding boxes, the spatial extent of complex geometries can be quickly estimated, aiding in tasks such as collision detection, intersection / self-intersection detection, accelerated rendering, and spatial segmentation. Exemplarily, the bounding box can be selected as an AABB (Axis-Aligned Bounding Box), a Sphere, an Oriented Bounding Box (OBB), etc., without limitation.

[0042] According to embodiments of this application, in response to control commands generated by the controller, a root node can be constructed by the arithmetic unit based on the surface parameter information of the surface, and the root node can be stored in a register. Further, the arithmetic unit can perform self-intersection detection on the surface based on the root node and the surface parameter information of the surface, based on the control commands, to obtain an initial detection result, and store the initial detection result in a register.

[0043] As an example, if the initial detection result indicates that the surface cannot self-intersect, then it can be determined that the initial detection result does not meet the solution conditions. For instance, based on control instructions generated by the controller, the display unit can be instructed to show the conclusion that "the surface cannot self-intersect." As another example, if the initial detection result indicates that the surface may self-intersect, and the user only requires the output of whether the surface self-intersects, the display unit can be instructed to show the conclusion that "the surface may self-intersect" based on control instructions generated by the controller; however, if the user requires the output of the precise self-intersection line, then it can be determined that the initial detection result meets the solution conditions.

[0044] According to an embodiment of this application, if the initial detection result meets the solution conditions, the arithmetic unit can use control instructions to solve for the self-intersection line of the surface based on the surface parameter information and the root node, obtaining at least one initial intersection point, and storing the at least one initial intersection point in a register. Further, the arithmetic unit can use control instructions to determine the self-intersection line of the surface based on the at least one initial intersection point, and store the self-intersection line in a register, thereby displaying the self-intersection line through a display unit.

[0045] According to embodiments of this application, by constructing root nodes based on surface parameter information and performing self-intersection detection on the surface based on the root nodes, it is possible to efficiently and quickly determine whether a surface may have self-intersections, thus avoiding unnecessary calculations and significantly saving computational resources and improving the efficiency of surface self-intersection detection. Furthermore, if the initial detection results meet the solution conditions, by solving for the self-intersection lines of the surface based on the root nodes, the self-intersection lines of the surface can be determined, facilitating the removal of self-intersection parts in subsequent modeling and guiding the repair of the self-intersection surface model to ensure the robustness of the modeling function. Since the BVH structure allows for coarse-to-fine surface self-intersection detection to quickly eliminate regions where self-intersections are impossible, detailed self-intersection detection of the entire surface can be avoided, further saving computational resources and improving the efficiency of surface self-intersection detection.

[0046] In one embodiment, such as in the field of visual effects, if high-precision curved surface models (such as character skin, fluid effects, or complex scenes) have self-intersection issues, it can easily lead to rendering distortion, abnormal lighting, or errors in physical simulation. The method provided in this embodiment can detect whether the aforementioned high-precision curved surfaces have self-intersections and solve for the self-intersection lines, so as to guide the subsequent automatic trimming or reconstruction of self-intersecting curved surfaces by special effects modeling tools, avoiding model discrepancies. For example, in character muscle deformation or cloth simulation, performing surface self-intersection detection on the corresponding curved surfaces can help correct model tearing or overlapping caused by excessive movement, thereby helping to ensure the visual coherence of special effects rendering.

[0047] In another embodiment, such as in facial recognition and 3D facial modeling scenarios, excessive stretching of the facial mesh during expression capture may cause local surface self-intersections at locations such as the mouth or around the eyes, leading to feature point localization offsets or facial animation distortion. The method provided in this embodiment can detect whether the aforementioned local surfaces self-intersect and solve for the self-intersecting intersection lines, so as to guide the repair of the self-intersecting local surface model, thereby helping to improve the accuracy of the facial model and the precision of facial feature recognition.

[0048] Figure 3 illustrates an example of a self-intersecting surface according to an embodiment of this application.

[0049] As shown in Figure 3, in three-dimensional space, a part of a self-intersecting surface intersects with another part of itself. This intersection may be local or global. The topological structure and geometric properties of self-intersecting surfaces are more complex than those of non-self-intersecting surfaces, which brings difficulties in modeling and calculation. When displayed, self-intersecting surfaces may also exhibit overlapping, flickering, and other visual effects.

[0050] According to one embodiment of this application, in a mechanical engineering modeling scenario, it is necessary to model the appearance of a workpiece. Surface self-intersection detection is a crucial step in this process. For example, automotive body exterior components may include a hood, front skirt, rear skirt, front and rear fenders, etc. Each component is a separate surface, and the body styling design can be viewed as breaking down the entire body into different surface combinations. During the modeling process, it is necessary to ensure that there are no self-intersections within each surface. If self-intersecting surfaces exist, it may lead to errors in calculating the intersection lines between multiple surfaces, thus affecting the splicing of components. By performing self-intersection detection on each surface to ensure that there are no self-intersections within each surface, and calculating the intersection lines of all adjacent surfaces, the surfaces corresponding to all surface components can be spliced ​​together to form a complete body model, thus completing the body modeling.

[0051] According to an embodiment of this application, constructing a root node using an arithmetic unit based on the surface parameter information of the surface includes: determining the effective range of the parameter domain of the surface using an arithmetic unit based on the order of the surface, control point information, node vector information, and clipping boundary information; and constructing the root node using an arithmetic unit based on the effective range of the parameter domain.

[0052] According to embodiments of this application, a parameter domain can be understood as an abstract space (parameter space) used to describe and manipulate parameterized surfaces or curves, representing the range of parameters of a parameterized geometric object (such as a surface or curve). Through parameterized mapping, complex geometric shapes can be defined in the parameter domain, supporting both efficient computation and flexible manipulation. For example, each point in the parameter domain can be transformed into a point in the model space through parameterized mapping, thereby defining the shape and position of the curve or surface.

[0053] As an example, the effective range of the surface's parameter domain can be determined using the arithmetic unit based on the surface's order, control point information, node vector information, and clipping boundary information. The arithmetic unit can then calculate the bounding box enclosing the entire surface based on this effective range and store it in the root node of the BVH structure.

[0054] According to an embodiment of this application, the arithmetic unit performs self-intersection detection on the surface based on the root node according to the surface parameter information of the surface, based on the control instructions, to obtain an initial detection result. This includes: the arithmetic unit performs a first self-intersection detection on the surface based on the node vector information of the surface to obtain a first initial detection result, wherein the first initial detection result characterizes the attribute information of the cusps and / or sharp lines of the surface; if the first initial detection result indicates that the surface has cusps and / or sharp lines, the arithmetic unit performs a second self-intersection detection on the surface based on the clipping boundary information and the position information of the cusps and / or sharp lines of the surface to obtain a second initial detection result, wherein the second initial detection result characterizes the positional relationship between the cusps and / or sharp lines of the surface and the clipping boundary; and the arithmetic unit determines the initial detection result based on the first initial detection result and the second initial detection result.

[0055] According to one embodiment of this application, a processor can determine the knot multiplicity of a surface based on its node vector information to obtain a first initial detection result. This first initial detection result can characterize whether the surface contains cusps and / or sharp lines. Cubs and sharp lines are singularities on the surface, which may lead to surface self-intersection or local self-intersection. Knot multiplicity can be understood as the number of times a node value appears repeatedly in the surface's node vectors. If the multiplicity of a node is close to or equal to the surface's order, the geometric properties at that node may become singular, leading to the appearance of cusps or sharp lines. Therefore, by determining the knot multiplicity of the surface, a first initial detection result can be obtained, facilitating the identification of cusps and / or sharp lines on the surface based on this result. For example, if the first initial detection result indicates the presence of cusps and / or sharp lines on the surface, the processor can further calculate the positional information of the cusps and / or sharp lines.

[0056] According to one embodiment of this application, when the first initial detection result indicates the presence of cusps and / or sharp lines on the surface, a second initial detection result can be obtained by using a calculator to determine the positional relationship between the cusps and / or sharp lines on the surface and the clipping boundary based on the clipping boundary information and the positional information of the cusps and / or sharp lines on the surface, using the winding number. The winding number describes the number of times a closed curve (or path) wraps around a point and is widely used in problems involving determining whether a point is inside a polygon.

[0057] As an example, if the wrap number is 0, the cusp and / or cusp line can be considered to be outside the clipping boundary. If the cusp and / or cusp line are outside the clipping boundary, they will not have a self-intersection effect on the clipped surface. As another example, if the wrap number is not 0, the cusp and / or cusp line can be considered to be inside the clipping boundary. If the cusp and / or cusp line are inside the clipping boundary, they may cause the surface to fold at that point, resulting in surface self-intersection and / or local surface self-intersection.

[0058] In one embodiment, the arithmetic unit can determine that the surface represented by the first initial detection result may have self-intersections if the surface represented by the first initial detection result contains cusps and / or sharp lines, and the cusps and / or sharp lines represented by the second initial detection result are located inside the trimming boundary. In another embodiment, the arithmetic unit can determine that the surface represented by the initial detection result cannot have self-intersections if the surface represented by the first initial detection result does not contain cusps and / or sharp lines. In yet another embodiment, the surface represented by the initial detection result cannot have self-intersections if the surface represented by the first initial detection result contains cusps and / or sharp lines, and the cusps and / or sharp lines represented by the second initial detection result are located outside the trimming boundary.

[0059] According to an embodiment of this application, the solution conditions include: the initial detection result indicates that the surface may have self-intersections; the arithmetic unit, based on control commands and surface parameter information, solves for the self-intersection lines of the surface based on the root node to obtain at least one initial intersection point; the arithmetic unit performs normal cone detection on the surface based on the control point information of the surface to obtain the normal cone detection result; if the normal cone detection result indicates that the surface satisfies the subdivision conditions, the arithmetic unit subdivides the root node and the surface to obtain multiple leaf nodes and multiple subsurfaces corresponding to the multiple leaf nodes, wherein the leaf node represents the bounding box surrounding the subsurface, and the subsurface... The subsurface parameter information includes the control point information, node vector information, and subdivision level of the subsurface. The arithmetic unit iteratively performs intra-node self-intersection detection on the subsurfaces corresponding to each leaf node based on the subsurface parameter information of each subsurface until the termination condition is met, obtaining multiple candidate leaf nodes that meet the intersection detection condition. These candidate leaf nodes and their corresponding candidate subsurfaces are stored in registers. The arithmetic unit then performs inter-node intersection detection on the multiple leaf node pairs determined based on the candidate leaf nodes, based on the subsurface parameter information of each candidate subsurface, to obtain at least one initial intersection point.

[0060] According to embodiments of this application, a normal cone can be used to describe the distribution range of the normal vector of a surface at a certain point or in a certain region. The normal cone can be defined by an axis (usually the normal vector of the surface at that point) and a vertex angle (usually the half angle of the normal cone).

[0061] According to one embodiment of this application, the normal cone of a surface can be determined by an arithmetic unit based on the control point information of the surface. Exemplarily, the arithmetic unit can determine multiple normal vectors of the surface based on multiple control point information, and then the normal cone of the surface can be determined based on these multiple normal vectors. The normal cone can be detected based on the half-angle of the normal cone to obtain the normal cone detection result. As an example, when the half-angle of the normal cone is less than π / 2, the normal cone detection result indicates that the surface cannot have self-intersections. As another example, when the half-angle of the normal cone is greater than or equal to π / 2, the normal cone detection result indicates that the surface may have self-intersections.

[0062] According to one embodiment of this application, the subdivision conditions may include the current node's subdivision level (e.g., the root node's subdivision level is 1) not reaching the maximum subdivision level (e.g., 8), and the normal cone detection result indicating that the surface corresponding to the current node may have self-intersections. When the surface satisfies the subdivision conditions, the root node and the surface can be subdivided using an arithmetic unit to obtain multiple leaf nodes and multiple subsurfaces corresponding to each leaf node. The leaf nodes represent the bounding boxes enclosing the subsurfaces, and the subsurface parameter information includes the subsurface's control point information, node vector information, and subdivision level.

[0063] For example, the maximum number of subdivision levels can be set to 8, and the root node can have a subdivision level of 1. If the normal cone half-angle of the surface corresponding to the root node is greater than or equal to π / 2, it indicates that the surface may have self-intersections. In this case, the root node can be subdivided into 4 second-level leaf nodes (the second-level leaf nodes have a subdivision level of 2) using the arithmetic unit, thus subdividing the aforementioned surface into 4 second-level subsurfaces. The second-level leaf nodes represent the bounding boxes enclosing the second-level subsurfaces, and each second-level subsurface has corresponding control point information and node vector information.

[0064] According to one embodiment of this application, the arithmetic unit can iteratively perform intra-node self-intersection detection on the subsurfaces corresponding to each of the multiple leaf nodes based on the subsurface parameter information of each of the multiple subsurfaces, until the termination condition is met, thereby obtaining multiple candidate leaf nodes that meet the intersection detection condition. The multiple candidate leaf nodes and their corresponding candidate subsurfaces are stored in a register. Based on this, the arithmetic unit can perform inter-node intersection detection on the multiple leaf node pairs determined based on the multiple candidate leaf nodes, according to the subsurface parameter information of each of the multiple candidate subsurfaces, to obtain at least one initial intersection point.

[0065] Figure 4A schematically illustrates a flow diagram of a surface self-intersection detection method according to an embodiment of this application.

[0066] As shown in Figure 4A, in operation S401, the arithmetic unit constructs the root nodes enclosing the surface based on the surface parameter information. In operation S402, the arithmetic unit performs a first self-intersection detection on the surface based on the node vector information of the surface, obtaining a first initial detection result. The first initial detection result can characterize whether the surface has cusps and / or sharp lines. In operation S403, the arithmetic unit performs a second self-intersection detection on the surface based on the clipping boundary information and the position information of the cusps and / or sharp lines of the surface, obtaining a second initial detection result. The second initial detection result can characterize whether the cusps and / or sharp lines are inside the clipping boundary. In operation S404, the arithmetic unit determines an initial detection result based on the first and second initial detection results. The initial detection result can characterize whether the surface may have self-intersections.

[0067] For example, the solution conditions may include the possibility that the initial detection result representation surface may be self-intersecting. If the initial detection result representation surface is unlikely to be self-intersecting, the detection process can end. If the initial detection result representation surface may be self-intersecting, then proceed to operation S405.

[0068] When operating S405, the normal cone detection of the surface can be performed by the arithmetic unit based on the control point information of the surface. The normal cone detection result of the surface can be determined based on the normal cone half angle. The normal cone detection result can characterize whether the surface may have self-intersection.

[0069] For example, the subdivision conditions may include the normal cone detection result indicating that the surface / subsurface may have self-intersections, and the subdivision level of the surface / subsurface is less than the maximum subdivision level. If the normal cone half-angle < π / 2, it can be determined that the surface cannot have self-intersections, and the detection process can end. If the normal cone half-angle ≥ π / 2, it can be determined that the surface may have self-intersections. Since the subdivision level of the surface is 1, it can be further determined that the surface meets the subdivision conditions, and operation S406 can be entered.

[0070] In operation S406, the arithmetic unit can subdivide the root node and the surface to obtain multiple leaf nodes and multiple subsurfaces corresponding to each leaf node. In operation S407, the arithmetic unit can iteratively perform intra-node self-intersection detection on the subsurfaces corresponding to each leaf node according to the subsurface parameter information of each subsurface, until the termination condition is met, obtaining multiple candidate leaf nodes that meet the intersection detection condition, and storing the multiple candidate leaf nodes and their corresponding subsurfaces in a register. In operation S408, the arithmetic unit can perform inter-node intersection detection on the multiple leaf node pairs determined based on the multiple candidate leaf nodes according to the subsurface parameter information of each candidate subsurface, obtaining at least one initial intersection point.

[0071] In operation S409, the arithmetic unit can determine the self-intersection line of the surface based on at least one initial intersection point and store the self-intersection line in a register. In operation S410, the self-intersection line can be displayed through the display unit.

[0072] According to the embodiments of this application, during the calculation process, the root node and surface are subdivided into multiple leaf nodes and multiple sub-surfaces corresponding to the multiple leaf nodes by the arithmetic unit, so as to transform the global calculation into a local calculation. Therefore, multiple local calculations can be implemented in parallel in the arithmetic unit. Furthermore, due to the use of parallel calculation, multiple threads on the register can execute calculation tasks synchronously. The arithmetic unit improves the calculation speed during the solution process and can obtain the calculation results in a shorter time. At the same time, due to the use of the local calculation method, the large calculation area is subdivided into multiple small calculation areas. In the small calculation areas, the leaf nodes and sub-surfaces are relatively simple, and the requirements for computer registers and arithmetic units are also relatively low. This improves the calculation speed while reducing the hardware cost.

[0073] Furthermore, during the computation process, intra-node self-intersection detection is iteratively performed on the subsurfaces corresponding to each leaf node to identify multiple candidate leaf nodes that meet the intersection detection conditions. Inter-node intersection detection and subsequent intersection point calculation are only performed on a smaller number of candidate leaf nodes, eliminating the need to perform inter-node intersection detection on all leaf nodes. This significantly reduces the computational load of the arithmetic unit and improves its processing efficiency. Simultaneously, this method only stores the multiple candidate leaf nodes and their corresponding candidate subsurfaces in registers, greatly reducing storage space, lowering hardware requirements for registers, and improving storage efficiency.

[0074] According to an embodiment of this application, the arithmetic unit iteratively performs intra-node self-intersection detection on the subsurfaces corresponding to each of the multiple leaf nodes based on the subsurface parameter information of each of the multiple subsurfaces until the termination condition is met, obtaining multiple candidate leaf nodes that meet the intersection detection condition. This includes: when the subsurface subdivision level has not reached the maximum subdivision level, the arithmetic unit iteratively performs the following steps on the subsurface until the subsurface subdivision level reaches the maximum subdivision level: based on the clipping boundary information and the node vector information of the i-th subsurface, the clipping boundary intersection detection is performed on the i-th subsurface to obtain the clipping boundary intersection detection result of the i-th subsurface, where 2≤i<N, i is the subdivision level, and N Let i and N be the maximum number of subdivision layers. Let i and N be positive integers. The intersection detection result of the clipping boundary of the i-th subsurface represents the positional relationship between the i-th subsurface and the clipping boundary. If the intersection detection result of the i-th subsurface indicates that the i-th subsurface is located inside the clipping boundary, then based on the node vector information of the i-th subsurface, a first self-intersection detection is performed on the i-th subsurface to obtain a first sub-detection result. The first sub-detection result represents the attribute information of the cusps and / or sharp lines of the i-th subsurface. If the first sub-detection result indicates that the i-th subsurface has cusps and / or sharp lines, then based on the clipping boundary information and the positional information of the cusps and / or sharp lines of the i-th subsurface, a second self-intersection detection is performed on the i-th subsurface. Two self-intersection checks are performed to obtain a second sub-detection result, which represents the positional relationship between the cusps and / or cusps of the i-th layer subsurface and the clipping boundary. Based on the first and second sub-detection results, a sub-detection result corresponding to the i-th layer subsurface is determined, representing the self-intersection probability of the i-th layer subsurface. If the sub-detection result of the i-th layer subsurface indicates that self-intersection is impossible, the i-th layer leaf node corresponding to the i-th layer subsurface is determined as a candidate i-th layer leaf node satisfying the intersection detection condition, and the candidate i-th layer leaf node is stored in a register. If the sub-detection result of the i-th layer subsurface indicates that self-intersection is possible, based on... The control point information of the i-th layer subsurface is used to perform normal cone detection on the i-th layer subsurface to obtain the normal cone detection result of the i-th layer subsurface. If the normal cone detection result of the i-th layer subsurface indicates that the i-th layer subsurface cannot have self-intersection, the i-th layer subsurface is determined as the i-th layer candidate leaf node that satisfies the intersection detection condition, and the i-th layer candidate leaf node is stored in a register. If the normal cone detection result of the i-th layer subsurface indicates that the i-th layer subsurface may have self-intersection, the i-th layer leaf node and the i-th layer subsurface corresponding to the i-th layer subsurface are subdivided to obtain multiple i+1 layer leaf nodes and multiple i+1 layer subsurfaces that correspond one-to-one with the multiple i+1 layer leaf nodes.When the subsurface reaches its maximum subdivision level: the calculator performs clipping boundary intersection detection on the Nth-level subsurface based on the clipping boundary information and the node vector information of the Nth-level subsurface, obtaining the clipping boundary intersection detection result of the Nth-level subsurface. This result characterizes the positional relationship between the Nth-level subsurface and the clipping boundary. If the clipping boundary intersection detection result indicates that the Nth-level subsurface is located inside the clipping boundary, the calculator identifies the corresponding Nth-level leaf node as a candidate Nth-level leaf node that satisfies the intersection detection condition.

[0075] According to one embodiment of this application, the maximum number of subdivision layers can be set to, for example, 8 layers. For instance, the root node can be subdivided into four second-layer leaf nodes using an arithmetic unit, and the surface corresponding to the root node can be subdivided into four second-layer subsurfaces (e.g., subsurfaces a1, a2, a3, and a4). It can be assumed that the subdivision layer number of the root node and surface is 1, then the subdivision layer number of the second-layer leaf nodes and second-layer subsurfaces is 2, and the subdivision layer number of the second-layer leaf nodes and second-layer subsurfaces has not reached the maximum subdivision layer number. The arithmetic unit can iteratively execute a node self-intersection detection process on each subdivided subsurface until the subsurface's subdivision layer number reaches the maximum subdivision layer number.

[0076] For example, the process for detecting intra-node self-intersections of subdivided subsurfaces can be as follows:

[0077] 1) Perform clipping boundary intersection checks on each of the four subdivided second-layer leaf nodes. During calculation, the arithmetic unit uses the winding number to determine the positional relationship between each of the four second-layer sub-surfaces and the clipping boundary based on the clipping boundary information and the node vector information of each of the four second-layer sub-surfaces, thus obtaining the clipping boundary intersection detection results for each of the four second-layer sub-surfaces. For example, if the clipping boundary intersection detection results for each of the four second-layer sub-surfaces indicate that sub-surfaces a1, a2, and a3 are located inside the clipping boundary, and sub-surface a4 is located outside the clipping boundary, then sub-surface a4, located outside the clipping boundary, is excluded.

[0078] 2) For subsurfaces a1, a2, and a3 located inside the clipping boundary, the arithmetic unit can perform a knot multiplicity test on each of the three second-layer subsurfaces based on their respective node vector information to obtain the first sub-detection result for each of the three second-layer subsurfaces. The first sub-detection result can characterize whether the subsurface contains cusps and / or sharp lines. For example, if the first sub-detection result indicates that the subsurface contains cusps and / or sharp lines, the arithmetic unit can further calculate the position information of the cusps and / or sharp lines. For instance, the first sub-detection result for each of the three second-layer subsurfaces indicates that subsurfaces a1, a2, and a3 all contain cusps and / or sharp lines.

[0079] 3) For subsurfaces a1, a2, and a3 containing cusps and / or sharp lines, the operator can use the winding number to determine the positional relationship between the cusps and / or sharp lines of the three second-layer subsurfaces and the clipping boundary based on the clipping boundary information and the positional information of the cusps and / or sharp lines of the three second-layer surfaces, thus obtaining the second sub-detection result. For example, the second sub-detection result for subsurfaces a1 and a2 indicates that the cusps and / or sharp lines are inside the clipping boundary, while the second sub-detection result for subsurface a3 indicates that the cusps and / or sharp lines are outside the clipping boundary.

[0080] 4) Using the arithmetic unit, the sub-detection results of each of the three second-layer subsurfaces are determined based on the first and second sub-detection results of each subsurface. For example, the sub-detection results of the three second-layer subsurfaces indicate that subsurfaces a1 and a2 may have self-intersections, while subsurface a3 cannot have self-intersections. The arithmetic unit can then determine the leaf node corresponding to subsurface a3 as a candidate leaf node for the second layer and store this candidate leaf node in a register.

[0081] 5) For subsurfaces a1 and a2 that may self-intersect, the normal cones of each of the two second-layer subsurfaces can be determined by the arithmetic unit based on the control point information of each subsurface. Normal cone detection can then be performed on the two second-layer subsurfaces based on their respective normal cone half-angles, yielding the detection results. For example, the detection results of the normal cones of the two second-layer subsurfaces indicate that subsurface a1 may self-intersect, while subsurface a2 cannot self-intersect.

[0082] 6) The arithmetic unit can determine the leaf node corresponding to the subsurface a2 as the second-level candidate leaf node and store the second-level candidate leaf node in the register.

[0083] 7) Using the arithmetic unit, the second-level leaf nodes corresponding to subsurface a1 can be subdivided into four third-level leaf nodes (the number of subdivisions for the third-level leaf nodes is 3), thus subdividing the aforementioned subsurface a1 into four third-level subsurfaces. Then, a single-node self-intersection detection process is performed on each of the four subdivided third-level subsurfaces until the number of subdivisions of the subsurfaces reaches the maximum number of subdivisions of 8.

[0084] The termination conditions of the above single-node self-intersection detection process include: 1) determining that the subsurface cannot self-intersect, and determining the leaf node corresponding to the subsurface as a candidate leaf node that satisfies the intersection detection condition; or 2) the subsurface reaches the maximum number of subdivision layers.

[0085] It's important to note that the single-node self-intersection detection process primarily checks for self-intersections within a single leaf node, without considering intersections between leaf nodes. At the end of the single-node self-intersection detection process, multiple candidate leaf nodes at different sub-levels may be obtained. These candidate leaf nodes will then be included in the inter-node intersection detection process. The single-node self-intersection detection process only removes leaf nodes outside the trimming boundary; it does not exclude leaf nodes inside the trimming boundary that are not self-intersecting.

[0086] For each subsurface reaching the maximum subdivision level (e.g., 8 levels) and its corresponding leaf nodes, the arithmetic unit can use the winding number to determine the positional relationship between the 8th-level subsurface and the clipping boundary based on the clipping boundary information and the node vector information of the 8th-level subsurface, thus obtaining the intersection detection result of the clipping boundary of the 8th-level subsurface. The arithmetic unit can exclude 8th-level subsurfaces located outside the clipping boundary. The arithmetic unit can also identify the corresponding 8th-level leaf nodes of 8th-level subsurfaces located inside the clipping boundary as candidate 8th-level leaf nodes that satisfy the intersection detection condition, and store these 8th-level leaf nodes in a register.

[0087] Figure 4B schematically illustrates a flowchart of intra-node self-intersection detection for subdivided subsurfaces according to an embodiment of this application.

[0088] Taking the i-th subsurface as an example (2≤i≤N, i is the number of subdivision layers, N is the maximum number of subdivision layers, and i and N are integers), as shown in Figure 4B, in operation S411, the arithmetic unit can determine whether the number of subdivision layers of the i-th subsurface has reached the maximum number of subdivision layers. If yes, proceed to operation S418; otherwise, proceed to operation S412.

[0089] In operation S418, the arithmetic unit performs clipping boundary intersection detection on the Nth layer subsurface based on the clipping boundary information and the node vector information of the Nth layer subsurface. The result of the clipping boundary intersection detection indicates whether the Nth layer subsurface is located inside the clipping boundary. If the result indicates that the Nth layer subsurface is outside the clipping boundary, it can be removed, and the detection process ends. If the result indicates that the Nth layer subsurface is inside the clipping boundary, operation S419 is initiated.

[0090] In operation S412, the arithmetic unit performs clipping boundary intersection detection on the i-th layer subsurface based on the clipping boundary information and the node vector information of the i-th layer subsurface, obtaining the clipping boundary intersection detection result of the i-th layer subsurface. The clipping boundary intersection detection result can indicate whether the i-th layer subsurface is located inside the clipping boundary. If the clipping boundary intersection detection result indicates that the i-th layer subsurface is located outside the clipping boundary, the i-th layer subsurface can be removed, and the detection process ends. If the clipping boundary intersection detection result indicates that the i-th layer subsurface is located inside the clipping boundary, operation S413 is initiated.

[0091] In operation S413, the arithmetic unit performs a first self-intersection detection on the i-th subsurface based on the node vector information of the i-th subsurface, obtaining a first sub-detection result. The first sub-detection result indicates whether the i-th subsurface has cusps and / or sharp lines. In operation S414, the arithmetic unit performs a second self-intersection detection on the i-th subsurface based on the clipping boundary information and the position information of the cusps and / or sharp lines of the i-th subsurface, obtaining a second sub-detection result. The second sub-detection result indicates whether the cusps and / or sharp lines are inside the clipping boundary. In operation S415, the arithmetic unit determines the sub-detection result of the i-th subsurface based on the first and second sub-detection results. The sub-detection result indicates whether the i-th subsurface may have self-intersection.

[0092] If the sub-detection result indicates that the i-th layer subsurface cannot have self-intersection, then proceed to operation S419; if the sub-detection result indicates that the i-th layer subsurface may have self-intersection, then proceed to operation S416. In operation S419, the arithmetic unit can determine the i-th layer leaf nodes corresponding to the i-th layer subsurface as candidate i-th layer leaf nodes that satisfy the intersection detection condition, and store these candidate i-th layer leaf nodes in a register. In operation S416, the arithmetic unit can perform normal cone detection on the i-th layer subsurface based on the control point information of the i-th layer subsurface. The normal cone detection result of the i-th layer subsurface can be determined based on the normal cone half-angle, and the normal cone detection result can indicate whether the i-th layer subsurface may have self-intersection.

[0093] If the normal cone detection result of the i-th subsurface indicates that the i-th subsurface cannot have self-intersection, then proceed to operation 419. If the normal cone detection result of the i-th subsurface indicates that the i-th subsurface may have self-intersection, then proceed to operation S417.

[0094] In operation S417, the arithmetic unit can be used to subdivide the leaf nodes of the i-th layer and the subsurfaces of the i-th layer respectively, to obtain multiple leaf nodes of the (i+1)-th layer and multiple subsurfaces of the (i+1)-th layer corresponding to the multiple leaf nodes of the (i+1)-th layer. Each subsurface of the (i+1)-th layer enters operation S411.

[0095] According to embodiments of this application, by excluding subsurfaces and leaf nodes located outside the trimming boundary, the area requiring detailed self-intersection detection can be significantly reduced, unnecessary calculations can be reduced, thereby improving computational efficiency and saving resource consumption.

[0096] According to an embodiment of this application, the process of performing node intersection detection on multiple leaf node pairs determined based on multiple candidate leaf nodes using an arithmetic unit based on their respective subsurface parameter information to obtain at least one initial intersection point includes: determining multiple leaf node pairs based on the subdivision level of each of the multiple candidate subsurfaces using an arithmetic unit, each leaf node pair including a first candidate leaf node and a second candidate leaf node, the first candidate leaf node and the second candidate leaf node having the same subdivision level, the first candidate leaf node corresponding to a first subsurface, and the second candidate leaf node corresponding to a second subsurface; for leaf node pairs at the Nth layer where the subdivision level reaches the maximum subdivision level: determining the positional relationship between the first candidate leaf node and the second candidate leaf node at the Nth layer based on their respective node vector information using an arithmetic unit; and performing a third self-intersection detection on the merged subsurface at the Nth layer determined based on the first subsurface and the second subsurface at the Nth layer using an arithmetic unit based on their respective subsurface parameter information. The third sub-detection result of the merged subsurface at layer N is obtained, which characterizes the self-intersection probability of the merged subsurface at layer N. If the first candidate leaf node and the second candidate leaf node at layer N are adjacent, and the third sub-detection result at layer N indicates that the merged subsurface at layer N may have self-intersection, the arithmetic unit performs a first intersection point solution operation on the first and second subsurfaces at layer N to obtain a first solution result. If the first candidate leaf node and the second candidate leaf node at layer N are not adjacent, and the third sub-detection result at layer N indicates that the merged subsurface at layer N may have self-intersection, the arithmetic unit performs a first intersection point solution operation on the first and second subsurfaces at layer N to obtain a first solution result. If the test results indicate that the merged subsurfaces of the Nth layer may have self-intersections, the arithmetic unit performs a second intersection point calculation operation on the first subsurface and the second subsurface of the Nth layer to obtain a second solution result. If the test results indicate that the merged subsurfaces of the Nth layer cannot have self-intersections, the arithmetic unit performs a third intersection point calculation operation on the first subsurface and the second subsurface of the Nth layer to obtain a third solution result. Based on the first solution result, the second solution result, and / or the third solution result, the arithmetic unit determines at least one initial intersection point.

[0097] According to one embodiment of this application, the maximum number of subdivision layers can be set to, for example, 8 layers. For the multiple candidate leaf nodes and their corresponding subsurfaces that satisfy the intersection detection conditions, they can be paired into multiple leaf node pairs according to the number of subdivision layers, with each pair containing two leaf nodes having the same number of subdivision layers. For each leaf node pair, one candidate leaf node can be called the first candidate leaf node, and the other candidate leaf node can be called the second candidate leaf node. The subsurface corresponding to the first candidate leaf node is called the first subsurface, and the subsurface corresponding to the second candidate leaf node is called the second subsurface.

[0098] For leaf node pairs at level 8 (including the first and second candidate leaf nodes at level 8) that have reached the maximum subdivision level, the intersection detection process between nodes can be as follows:

[0099] 1) The positional relationship between the first candidate leaf node and the second candidate leaf node of the 8th layer can be determined by the arithmetic unit based on the node vector information of the first candidate leaf node and the second candidate leaf node of the 8th layer, such as whether they are adjacent or not.

[0100] 2) The arithmetic unit can perform a third self-intersection test on the merged subsurface of layer 8, determined based on the subsurface parameters of the first and second subsurfaces of layer 8, to obtain the third sub-detection result of the merged subsurface of layer 8. The third sub-detection result characterizes the self-intersection probability of the merged subsurface of layer 8. Specifically, firstly, the directed bounding boxes of the two leaf nodes are calculated, and the separation axis judgment technique is used to determine whether the two bounding boxes corresponding to the two leaf nodes intersect. If the two bounding boxes do not intersect, then the two leaf nodes do not intersect; if the two bounding boxes intersect, then the normal cones of the two subsurfaces are calculated, and these two normal cones are merged to obtain a new merged normal cone. Whether the half angle of the normal cone of the merged normal cone is greater than π / 2 is used to determine whether the merged subsurface formed by the two subsurfaces self-intersects. If the half-angle of the normal cone of the merged normal cone is greater than or equal to π / 2, it indicates that the merged subsurfaces may have self-intersection; if the half-angle of the normal cone of the merged normal cone is less than π / 2, it indicates that the merged subsurfaces cannot have self-intersection.

[0101] 3) If the first candidate leaf node and the second candidate leaf node of the 8th layer are adjacent, and there may be self-intersections in the merged subsurfaces of the 8th layer, the first intersection point can be solved by the arithmetic unit on the first subsurface and the second subsurface of the 8th layer to obtain the first solution result.

[0102] Taking node A and node B as examples, where the first candidate leaf node and the second candidate leaf node of the 8th layer are node A and node B respectively, the first intersection line solution operation may include:

[0103] For node A and node B, n sampling points are taken from the parameter domains of node A and node B respectively by uniform sampling, and then n*n sampling point pairs are formed in pairs.

[0104] Map all the sampling points in the above n*n sampling point pairs to three-dimensional space to obtain n*n mapped point pairs. Calculate the distance between any two points in each mapped point pair.

[0105] The gradient descent method is used to iteratively generate an initial list of intersection points. The direction of gradient descent is the direction that reduces the distance between points until the distance between points decreases to 0. At this point, the two points within a pair are considered to be the same point, thus obtaining the initial intersection points.

[0106] 4) If the first candidate leaf node and the second candidate leaf node of the 8th layer are not adjacent, and the third sub-detection result of the 8th layer indicates that the merged subsurface of the 8th layer may have self-intersection, the second intersection point solution operation can be performed on the first subsurface and the second subsurface of the 8th layer by the arithmetic unit to obtain the second solution result.

[0107] If two leaf nodes are not adjacent and their corresponding merged normal cones intersect, the calculation operation for the closed intersection line is applied. Taking node A and node B as examples, the second intersection line calculation operation can include, for example:

[0108] 1. Calculate the normal range of each of the two subsurfaces. If the normal ranges do not overlap, then there is no closed curve, and the second intersection line solution operation is stopped;

[0109] 2. When the normal regions overlap, construct a discriminant function system based on the parameter space model and tangent vector function model of each of the two subsurfaces, and obtain the number of solutions to the discriminant function system. If the number is 0, there is no closed curve; if the number is not 0, determine the points corresponding to these solutions as the initial intersection points.

[0110] 5) If the third sub-detection result of the 8th layer indicates that the merged sub-surface of the 8th layer cannot have self-intersection, the third intersection point solution operation can be performed on the first sub-surface of the 8th layer and the second sub-surface of the 8th layer by the arithmetic unit to obtain the third solution result.

[0111] If two leaf nodes are not adjacent and their corresponding merged normal cones do not intersect, the open intersection calculation operation is applied. Taking node A and node B as examples, the third intersection solution operation can include, for example:

[0112] 1. Take the edge curves of each of the two sub-surfaces, resulting in a total of 8 boundary curves (4 for each sub-surface, 4x2);

[0113] 2. Select one of the eight boundary curves and the other surface. The selected curve and surface can be represented as C(t) and S(u,v), respectively.

[0114] 3. Within the domain, uniformly select several sets of (t, u, v) values, and use Newton's iteration to solve C(t) = S(u, v). There may be a solution or no solution. If there is a solution, determine that point as the initial intersection point; otherwise, there is no intersection point.

[0115] According to an embodiment of this application, the process of performing node intersection detection on multiple leaf node pairs determined based on multiple candidate leaf nodes using an arithmetic unit based on their respective subsurface parameter information to obtain at least one initial intersection point further includes, for leaf node pairs at the i-th layer whose subdivision level has not reached the maximum subdivision level, iteratively executing the following steps by the arithmetic unit until the subdivision level of the i-th layer leaf node pair reaches the maximum subdivision level: performing a third self-intersection detection on the merged subsurface at the i-th layer determined based on the first subsurface and the second subsurface at the i-th layer, based on their respective subsurface parameter information, to obtain a third sub-detection result for the merged subsurface at the i-th layer, the third sub-detection result representing the self-intersection probability of the merged subsurface at the i-th layer; and, if the third sub-detection result represents that the merged subsurface at the i-th layer cannot have self-intersection, performing a third self-intersection detection on the first subsurface and the second subsurface at the i-th layer. The third intersection point solution operation yields the third solution result. In the case where the merged subsurfaces at layer i may have self-intersections, the first candidate leaf node and the first subsurface at layer i corresponding to the first subsurface at layer i are subdivided to obtain multiple first candidate leaf nodes at layer i+1 and multiple first subsurfaces at layer i+1 corresponding to each first candidate leaf node. The second candidate leaf node and the second subsurface at layer i corresponding to the second subsurface at layer i are subdivided to obtain multiple second candidate leaf nodes at layer i+1 and multiple second subsurfaces at layer i+1 corresponding to each second candidate leaf node. Based on the multiple first candidate leaf nodes and the multiple second candidate leaf nodes at layer i+1, multiple pairs of leaf nodes at layer i+1 are determined, each pair including a first candidate leaf node and a second candidate leaf node at layer i+1.

[0116] According to one embodiment of this application, for leaf node pairs whose subdivision level has not reached the maximum subdivision level, the node intersection detection process can be iteratively executed by the arithmetic unit until the subdivision level reaches the maximum subdivision level.

[0117] For example, taking the leaf nodes of the third layer as an example, the intersection detection process between leaf node pairs can be as follows:

[0118] 1) The positional relationship between the first candidate leaf node and the second candidate leaf node of the third layer can be determined by the arithmetic unit based on the node vector information of the first candidate leaf node and the second candidate leaf node of the third layer, such as whether they are adjacent or not.

[0119] 2) The arithmetic unit can perform a third self-intersection detection on the merged subsurface of the third layer determined based on the subsurface parameters of the first subsurface of the third layer and the second subsurface of the third layer, based on the subsurface parameter information of the first subsurface of the third layer and the second subsurface of the third layer, to obtain the third sub-detection result of the merged subsurface of the third layer. The third sub-detection result characterizes the self-intersection probability of the merged subsurface of the third layer.

[0120] 3) If the third sub-detection result of the third-layer merged subsurface indicates that the third-layer merged subsurface cannot have self-intersections, a third intersection point solution operation can be performed on the first and second subsurfaces of the third layer to obtain a third solution result. For example, if the third-layer merged subsurfaces do not have self-intersections, the calculation operation of open intersection lines can be applied to solve for the initial intersection point.

[0121] 4) If the third sub-detection result of the merged subsurfaces in the third layer indicates that the merged subsurfaces in the third layer may have self-intersections, the arithmetic unit can be used to subdivide the first subsurface of the third layer and its corresponding first candidate leaf node of the third layer, and subdivide the second subsurface of the third layer and its corresponding second candidate leaf node of the third layer. Then, a single-node self-intersection detection process is performed on each of the subdivided subsurfaces until the number of subdivision layers of the subsurfaces reaches the maximum number of subdivision layers of 8.

[0122] For example, if the maximum subdivision level is 8, and the current candidate leaf node pair, node A and node B, has a subdivision level of 3, then the nodes can be further subdivided. If the merged normal cones of node A and node B intersect, then node A is subdivided into A1-A4, and node B is subdivided into B1-B4, resulting in a total of 8 grandchild nodes (subdivision level + 1, reaching level 4). Then, one grandchild node is selected from A1-A4, and one grandchild node is selected from B1-B4, and these pairs are combined to form new grandchild node pairs. This self-intersection detection process is iteratively executed until the maximum subdivision level is reached.

[0123] The termination conditions for the node self-intersection detection process include: 1) The merging normal cones of the leaf node pairs do not self-intersect, and the initial intersection point is solved by applying the open intersection line calculation operation; or 2) The number of subdivision layers of the leaf nodes reaches the maximum number of subdivision layers and the merging normal cones have self-intersection, then the initial intersection point is solved by using the gradient descent method.

[0124] Figure 4C schematically illustrates a flowchart for intersection detection between nodes according to an embodiment of this application.

[0125] As shown in Figure 4C, in operation S420, the arithmetic unit determines multiple leaf node pairs based on the subdivision levels of multiple candidate subsurfaces. Each leaf node pair includes a first candidate leaf node and a second candidate leaf node. The first and second candidate leaf nodes have the same subdivision level. The first candidate leaf node corresponds to the first subsurface, and the second candidate leaf node corresponds to the second subsurface. Taking the leaf node pair of the i-th layer as an example (2≤i≤N, i is the subdivision level, N is the maximum subdivision level, and i and N are integers), the leaf node pair of the i-th layer includes the first candidate leaf node and the second candidate leaf node of the i-th layer, both with the same subdivision level of i. The first candidate leaf node of the i-th layer corresponds to the first subsurface of the i-th layer, and the second candidate leaf node of the i-th layer corresponds to the second subsurface of the i-th layer.

[0126] In operation S421, the arithmetic unit can determine whether the number of subdivision layers of the i-th layer leaf node pair has reached the maximum number of subdivision layers. If yes, proceed to operation S422; otherwise, proceed to operation S429.

[0127] In operation S422, the positional relationship between the first candidate leaf node and the second candidate leaf node of the Nth layer can be determined by the arithmetic unit based on the node vector information of the first candidate leaf node and the second candidate leaf node of the Nth layer.

[0128] In operation S423, the arithmetic unit can perform a third self-intersection detection on the Nth layer merged subsurface determined based on the subsurface parameters of the first subsurface and the second subsurface of the Nth layer, and obtain the third sub-detection result of the Nth layer merged subsurface.

[0129] In operation S424, the arithmetic unit can determine whether the first subsurface of the Nth layer and the second subsurface of the Nth layer are adjacent, and whether the merged subsurface of the Nth layer may have self-intersection.

[0130] If the first candidate leaf node of layer N is adjacent to the second candidate leaf node of layer N, and the third sub-detection result of layer N indicates that the merged subsurface of layer N may have self-intersection, proceed to operation S425; if the first candidate leaf node of layer N is not adjacent to the second candidate leaf node of layer N, and the third sub-detection result of layer N indicates that the merged subsurface of layer N may have self-intersection, proceed to operation S426; if the third sub-detection result of layer N indicates that the merged subsurface of layer N cannot have self-intersection, proceed to operation S427.

[0131] When operating S425, the arithmetic unit can perform the first intersection point solution operation on the first subsurface of the Nth layer and the second subsurface of the Nth layer to obtain the first solution result.

[0132] In operation S426, the second intersection point solution operation can be performed on the first subsurface of the Nth layer and the second subsurface of the Nth layer through the arithmetic unit to obtain the second solution result.

[0133] In operation S427, the arithmetic unit can be used to perform a third intersection point solution operation on the first subsurface of the Nth layer and the second subsurface of the Nth layer to obtain the third solution result.

[0134] In operation S428, at least one initial intersection point can be determined by the arithmetic unit based on the first solution result, the second solution result, and / or the third solution result.

[0135] In operation S429, the arithmetic unit can perform a third self-intersection detection on the merged subsurface of the i-th layer determined based on the subsurface parameters of the first subsurface and the second subsurface of the i-th layer, and obtain the third sub-detection result of the merged subsurface of the i-th layer.

[0136] If the third sub-detection result of the i-th layer merged subsurface indicates that the i-th layer merged subsurface cannot have self-intersection, proceed to operation S430; if the third sub-detection result of the i-th layer merged subsurface indicates that the i-th layer merged subsurface may have self-intersection, proceed to operation S431.

[0137] In operation S430, the arithmetic unit can be used to perform the third intersection point solution operation on the first subsurface of the i-th layer and the second subsurface of the i-th layer to obtain the third solution result, and then proceed to operation S428.

[0138] In operation S431, the arithmetic unit can subdivide the first candidate leaf node and the first subsurface of the i-th layer corresponding to the first subsurface of the i-th layer to obtain multiple first candidate leaf nodes of the (i+1)-th layer and multiple first subsurfaces of the (i+1)-th layer corresponding to the multiple first candidate leaf nodes of the (i+1)-th layer; and subdivide the second candidate leaf node and the second subsurface of the i-th layer corresponding to the second subsurface of the i-th layer to obtain multiple second candidate leaf nodes of the (i+1)-th layer and multiple second subsurfaces of the (i+1)-th layer corresponding to the multiple second candidate leaf nodes of the (i+1)-th layer.

[0139] In operation S432, the arithmetic unit can determine multiple leaf node pairs of layer i+1 based on multiple first candidate leaf nodes of layer i+1 and multiple second candidate leaf nodes of layer i+1. Each leaf node pair of layer i+1 includes a first candidate leaf node of layer i+1 and a second candidate leaf node of layer i+1. Each leaf node pair of layer i+1 enters operation S421.

[0140] It should also be noted that operation S408 in Figure 4 embodies the concept of transformation. To a certain extent, operation S408 can be seen as transforming the relatively complex single-node self-intersection detection problem for the arithmetic unit into a relatively simple node-to-node intersection detection problem for the arithmetic unit. In other words, the processing logic of operation S408 can also be applied to surface intersection detection methods executed by electronic devices.

[0141] In an optional example, intersection detection between multiple surfaces can be performed based on electronic devices. Taking the intersection detection of two surfaces as an example only, a surface intersection detection method performed by an electronic device may include, for example:

[0142] In response to the control commands generated by the controller, the arithmetic unit constructs the first root node and the second root node respectively based on the surface parameter information of the first surface and the second surface, and stores the first root node and the second root node in the register. The surface parameter information of the first surface and the second surface includes the order of the surface, control point information, node vector information, maximum subdivision level and clipping boundary information. The first root node represents the bounding box that surrounds the first surface, and the second surface represents the bounding box that surrounds the second surface.

[0143] Based on control commands, the arithmetic unit performs merging normal cone detection on the merged surface determined by the first and second surfaces according to the control point information of the first and second surfaces, and obtains the normal cone detection result of the merged surface.

[0144] If the normal cone detection result of the merged surface indicates that the first surface and the second surface meet the subdivision conditions, the first root node and the first surface, the second node and the second surface are subdivided by the arithmetic unit to obtain multiple leaf nodes and multiple sub-surfaces corresponding to the multiple leaf nodes. The leaf nodes represent the bounding boxes that surround the sub-surfaces. The sub-surface parameter information of the sub-surfaces includes the control point information, node vector information and subdivision level of the sub-surfaces.

[0145] Based on control instructions, the arithmetic unit performs intersection detection on multiple leaf node pairs determined by multiple candidate leaf nodes according to their respective subsurface parameter information, thereby obtaining at least one initial intersection point and storing the at least one initial intersection point in a register.

[0146] The arithmetic unit, based on control instructions and at least one initial intersection point, determines the self-intersection lines of the surface and stores them in a register; and

[0147] Self-intersection lines are displayed through the display unit.

[0148] In an optional example, the above-mentioned normal cone detection of the merged surface determined based on the control point information of the first and second surfaces, and the resulting normal cone detection results of the merged surface, include:

[0149] Determine whether the two bounding boxes corresponding to the first node and the second node intersect based on the separation axis judgment technology;

[0150] If the two bounding boxes do not intersect, determine that the first node and the second node do not intersect; if the two bounding boxes intersect:

[0151] Calculate the first normal cone corresponding to the first surface and the second normal cone corresponding to the second surface, and merge the first normal cone and the second normal cone to obtain the merged normal cone;

[0152] The detection result of the normal cone of the merged surface is determined based on the half-angle of the normal cone of the merged normal cone. If the half-angle of the normal cone of the merged normal cone is greater than or equal to π / 2, it is determined that the first surface and the second surface may intersect; if the half-angle of the normal cone of the merged normal cone is less than π / 2, it is determined that the first surface and the second surface cannot intersect.

[0153] In an optional example, the normal cone detection result of the merged surface described above indicates that the first surface and the second surface meet the subdivision conditions, which may include: the subdivision level of the first root node and the second root node has not reached the maximum subdivision level, and the normal cone detection result of the merged surface indicates that the first surface corresponding to the first node and the second surface corresponding to the second node may intersect.

[0154] In an optional example, the above-mentioned process of using an arithmetic unit to perform node intersection detection on multiple leaf node pairs determined based on multiple candidate leaf nodes, according to the subsurface parameter information of each of the multiple candidate subsurfaces, to obtain at least one initial intersection point includes:

[0155] The arithmetic unit determines multiple leaf node pairs based on the subdivision levels of each of the multiple candidate subsurfaces. Each leaf node pair includes a first candidate leaf node and a second candidate leaf node. The first candidate leaf node and the second candidate leaf node have the same subdivision level. The first candidate leaf node corresponds to the first subsurface, and the second candidate leaf node corresponds to the second subsurface.

[0156] For leaf node pairs at level N that have reached the maximum subdivision level:

[0157] The arithmetic unit determines the positional relationship between the first and second candidate leaf nodes of the Nth layer based on their respective node vector information.

[0158] The arithmetic unit performs a third self-intersection detection on the merged subsurface of the Nth layer determined based on the subsurface parameters of the first subsurface and the second subsurface of the Nth layer, and obtains the third sub-detection result of the merged subsurface of the Nth layer. The third sub-detection result characterizes the self-intersection probability of the merged subsurface of the Nth layer.

[0159] When the first candidate leaf node of the Nth layer is adjacent to the second candidate leaf node of the Nth layer, and the third sub-detection result of the Nth layer indicates that the merged subsurface of the Nth layer may have self-intersection, the first intersection point solution operation is performed on the first subsurface of the Nth layer and the second subsurface of the Nth layer by the arithmetic unit to obtain the first solution result;

[0160] When the first candidate leaf node and the second candidate leaf node of the Nth layer are not adjacent, and the third sub-detection result of the Nth layer indicates that the merged subsurface of the Nth layer may have self-intersection, the second intersection point solution operation is performed on the first subsurface of the Nth layer and the second subsurface of the Nth layer by the arithmetic unit to obtain the second solution result;

[0161] When the third sub-detection result of the Nth layer indicates that the merged sub-surface of the Nth layer cannot have self-intersection, the third intersection point solution operation is performed on the first sub-surface of the Nth layer and the second sub-surface of the Nth layer by the arithmetic unit to obtain the third solution result;

[0162] The arithmetic unit determines at least one initial intersection point based on the first solution result, the second solution result, and / or the third solution result.

[0163] In an optional example, the above-mentioned process of using an arithmetic unit to perform node intersection detection on multiple leaf node pairs determined based on multiple candidate leaf nodes, according to the subsurface parameter information of each of the multiple candidate subsurfaces, to obtain at least one initial intersection point, further includes:

[0164] For leaf node pairs at level i that have not reached the maximum number of subdivisions, the following steps are iteratively executed by the arithmetic unit until the number of subdivisions for the leaf node pairs at level i reaches the maximum number of subdivisions:

[0165] Based on the subsurface parameter information of the first subsurface and the second subsurface of the i-th layer, a third self-intersection detection is performed on the merged subsurface of the i-th layer determined based on the first subsurface and the second subsurface of the i-th layer, and the third sub-detection result of the merged subsurface of the i-th layer is obtained. The third sub-detection result of the merged subsurface of the i-th layer characterizes the self-intersection possibility of the merged subsurface of the i-th layer.

[0166] If the third sub-detection result of the merged subsurface in the i-th layer indicates that the merged subsurface in the i-th layer cannot have self-intersection, then the third intersection point solution operation is performed on the first subsurface in the i-th layer and the second subsurface in the i-th layer to obtain the third solution result;

[0167] When the third sub-detection result of the merged subsurface in the i-th layer indicates that the merged subsurface may have self-intersection, the first candidate leaf node and the first subsurface of the i-th layer corresponding to the first subsurface of the i-th layer are subdivided to obtain multiple first candidate leaf nodes of the (i+1)-th layer and m first subsurfaces of the (i+1)-th layer corresponding to the multiple first candidate leaf nodes of the (i+1)-th layer; the second candidate leaf node and the second subsurface of the i-th layer corresponding to the second subsurface of the i-th layer are subdivided to obtain multiple second candidate leaf nodes of the (i+1)-th layer and multiple second subsurfaces of the (i+1)-th layer corresponding to the multiple second candidate leaf nodes of the (i+1)-th layer.

[0168] Based on m first candidate leaf nodes and m second candidate leaf nodes of the (i+1)th layer, multiple pairs of leaf nodes of the (i+1)th layer are determined, and each pair of leaf nodes of the (i+1)th layer includes a first candidate leaf node of the (i+1)th layer and a second candidate leaf node of the (i+1)th layer.

[0169] The explanations of the first and second surfaces mentioned above can be found in the section on surfaces in this paper, and will not be repeated here. The explanations of the first and second root nodes mentioned above can be found in the section on root nodes in this paper, and will not be repeated here.

[0170] According to an embodiment of this application, determining the self-intersection line of a surface by means of an arithmetic unit based on control instructions and at least one initial intersection point includes: determining multiple target intersection points on the self-intersection line by means of an arithmetic unit based on a step length and at least one initial intersection point, and storing the multiple target intersection points in a register, wherein the step length is used to control the solution accuracy of the self-intersection line; performing topological connection on the multiple target intersection points by means of an arithmetic unit to obtain an intermediate self-intersection line, and storing the intermediate self-intersection line in a register; and performing interpolation processing on the intermediate self-intersection line by means of an arithmetic unit based on a preset interpolation method to obtain the self-intersection line, and storing the self-intersection line in a register.

[0171] According to one embodiment of this application, at least one initial intersection point can be stored in a register to obtain a list of initial intersection points. After obtaining the list of initial intersection points, for each pair of candidate leaf nodes that intersect, the calculation of the self-intersection line of the entire surface can be transformed into the calculation of the intersection line of the two subsurfaces corresponding to the candidate leaf node pair. The Lipschitz constant of the two subsurfaces corresponding to the candidate leaf node pair can be calculated by the arithmetic unit. The Lipschitz continuity is defined as follows:

[0172] For functions in a subset of the real number set If there exists a constant L such that Then it is called The condition that satisfies the Lipschitz condition is that the smallest constant L is called... The Lipschitz constant.

[0173] Understandably, the Lipschitz constant reflects the maximum rate of change of a function within a local region. In geometric modeling scenarios, for a Lipschitz continuous surface or curve, its change within an arbitrarily small neighborhood will not exceed the Lipschitz constant multiplied by the size of that neighborhood. That is, in geometric modeling scenarios, the Lipschitz constant can be used to reflect the maximum rate of change (hereinafter referred to as the upper bound) of a geometric object (e.g., a curve, surface) within a local region. This upper bound limits the amount of change between any two points, and can thus be used to estimate the accuracy required for solving intersection operations within a specific region.

[0174] According to one embodiment of this application, the formula for calculating the Lipschitz constant of a parametric surface (such as the two surfaces mentioned above) on one coordinate axis component can be as follows:

[0175] (1)

[0176] Where u and v are two relevant parameters of the parametric surface; Let be the extreme value of the derivative of the parametric surface in the u direction. This represents the extreme value of the derivative of the parametric surface in the v direction.

[0177] Furthermore, the formula for calculating the Lipschitz constant of the parametric surface is as follows:

[0178] (2)

[0179] Where L is the Lipschitz constant of the parametric surface, and L1, L2, and L3 are the Lipschitz constants of the parametric surface in the x-axis, y-axis, and z-axis components, respectively.

[0180] Furthermore, the step length can be calculated using an arithmetic unit. Now consider the intersection of two subsurfaces (e.g., subsurfaces S1 and S2), whose respective Lipschitz constants are L and L'. The Lipschitz constants can be used as a mapping from the four-dimensional parameter space to the three-dimensional model space to control the approximation accuracy of the intersection line. The step length can be calculated using an arithmetic unit. ,in It is the required precision for the intersection line in a given three-dimensional space.

[0181] According to embodiments of this application, the step size can be understood as the change in parameter space from one parameter point to the next. For example, when the surface is selected as a NURBS surface (non-uniform rational B-spline surface), the step size may include the increment of parameter u or v. The step size can be used to control the density of the surface being "unfolded" or "sampled" in the parameter space. Correspondingly, the smaller the step size, the denser the sampling points of the surface in the parameter space during the intersection process, and the higher the accuracy of the intersection operation; the larger the step size, the sparser the sampling points of the surface in the parameter space during the intersection process, and the lower the accuracy of the intersection operation.

[0182] In one embodiment, the arithmetic unit can determine multiple target intersection points on the self-intersection line based on the step size and the initial intersection points in the initial intersection point list, and store these multiple target intersection points in a register. For example, the arithmetic unit can solve for the target intersection points in the parameter space using a tracing method. During computation, a forward direction is calculated using the derivative of the current point; then, a step size of d is advanced; subsequently, an optimization method (e.g., Newton's method, gradient descent, etc.) is used to iterate the point to the intersection line until traversal is complete.

[0183] In one embodiment, after obtaining multiple target intersection points, a calculator can perform topological connections on these points to determine how they can be interconnected to form continuous boundaries or paths, i.e., to obtain intermediate intersection lines. Further, the intermediate intersection lines can be interpolated using a preset interpolation method to obtain the target intersection lines. Those skilled in the art can select appropriate interpolation methods based on actual needs or application scenarios, and no limitations are imposed here. For example, the preset interpolation method can be linear interpolation, B-spline curve interpolation, etc.

[0184] Figure 5 schematically illustrates the principle of determining the self-intersection line of a surface according to an embodiment of this application.

[0185] Taking the candidate leaf node pair as an example, where the two sub-surfaces corresponding to it are surface patch 1 (shown as S(s,t) in Figure 5) and surface patch 2 (shown as S(u,v) in Figure 5), as shown in Figure 5, for a given target accuracy... (This can be understood as the accuracy of solving the self-intersection lines.) The BVH structures of surface patch 1 and surface patch 2 can be constructed separately, and the Lipschitz constants (L1 and L2, respectively) of surface patch 1 and surface patch 2 can be calculated. This can be achieved with a given target accuracy. The maximum iteration step size d corresponding to surface patch 1 and surface patch 2 in four-dimensional space is calculated respectively. The aforementioned maximum iteration step size d can be mapped to the parameter space of the two surface patches to obtain the maximum iteration step size of their respective parameter spaces (shown as ds1 and ds2 in Figure 5, respectively). By using the method of traversing the parameter space and other methods, the geometric accuracy of the solution in the parameter domain (shown as (s1,t1), (s2,t2), and (u1,v1), (u2,v2) in Figure 5) when mapped to three-dimensional space can be controlled, thereby obtaining the solution in three-dimensional space (shown as P1 and P2 in Figure 5), and then the self-intersection line under the target accuracy can be solved.

[0186] Figure 6 schematically illustrates a block diagram of an electronic device suitable for implementing a surface self-intersection detection method according to an embodiment of this application.

[0187] As shown in FIG6, an electronic device 600 according to an embodiment of the present application includes a processor 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage portion 608 into a random access memory (RAM) 603. The processor 601 may include, for example, a general-purpose microprocessor (e.g., a CPU), an instruction set processor and / or an associated chipset and / or a special-purpose microprocessor (e.g., an application-specific integrated circuit (ASIC)), etc. The processor 601 may also include onboard memory for caching purposes. The processor 601 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present application.

[0188] RAM 603 stores various programs and data required for the operation of electronic device 600. Processor 601, ROM 602, and RAM 603 are interconnected via bus 604. Processor 601 executes various operations of the method flow according to embodiments of this application by executing programs in ROM 602 and / or RAM 603. It should be noted that the programs may also be stored in one or more memories other than ROM 602 and RAM 603. Processor 601 may also execute various operations of the method flow according to embodiments of this application by executing programs stored in said one or more memories.

[0189] According to embodiments of this application, the electronic device 600 may further include an input / output (I / O) interface 605, which is also connected to a bus 604. The electronic device 600 may also include one or more of the following components connected to the input / output (I / O) interface 605: an input section 606 including a keyboard, mouse, etc.; an output section 607 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the input / output (I / O) interface 605 as needed. A removable medium 611, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 610 as needed so that computer programs read from it can be installed into the storage section 608 as needed.

[0190] This application also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.

[0191] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include ROM 602 and / or RAM 603 and / or one or more memories other than ROM 602 and RAM 603 described above.

[0192] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code enables the computer system to implement the surface self-intersection detection method provided in the embodiments of this application.

[0193] When the computer program is executed by the processor 601, it performs the functions defined in the system / apparatus of this application embodiment. According to the embodiments of this application, the systems, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0194] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and downloaded and installed via the communication section 609, and / or installed from the removable medium 611. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.

[0195] In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 609, and / or installed from the removable medium 611. When the computer program is executed by the processor 601, it performs the functions defined in the system of this application embodiment. According to the embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.

[0196] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, languages ​​such as Java, C++, Python, "C", or similar programming languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).

[0197] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0198] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.

[0199] The embodiments of this application have been described above. However, these embodiments are merely illustrative and not intended to limit the scope of this application. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. Without departing from the scope of this application, those skilled in the art can make various substitutions and modifications, all of which should fall within the scope of this application.

Claims

1. A method for detecting surface self-intersections performed by an electronic device, comprising: In response to control commands generated by the controller, the arithmetic unit constructs a root node based on the surface parameter information of the surface and stores the root node in a register. The surface parameter information includes the order of the surface, control point information, node vector information, maximum subdivision level, and clipping boundary information. The root node represents the bounding box enclosing the surface. Based on the control commands and the surface parameter information, the arithmetic unit performs self-intersection detection on the surface based on the root node to obtain an initial detection result, which is then stored in the register. The initial detection result characterizes the self-intersection probability of the surface; when the initial detection result satisfies the solution conditions, the arithmetic unit, based on the control instructions and according to the surface parameter information of the surface, solves for the self-intersection line of the surface based on the root node, obtaining at least one initial intersection point, and storing the at least one initial intersection point in the register; the arithmetic unit, based on the control instructions and according to the at least one initial intersection point, determines the self-intersection line of the surface, and stores the self-intersection line in the register; and the self-intersection line is displayed through the display unit.

2. The method according to claim 1, characterized in that, The step of constructing the root node based on the surface parameter information of the surface using the arithmetic unit includes: determining the effective range of the parameter domain of the surface using the arithmetic unit based on the order of the surface, control point information, node vector information, and the clipping boundary information; and constructing the root node using the arithmetic unit based on the effective range of the parameter domain.

3. The method according to claim 1, characterized in that, The step of using the arithmetic unit to perform self-intersection detection on the surface based on the root node, according to the control instructions and the surface parameter information of the surface, to obtain an initial detection result includes: using the arithmetic unit to perform a first self-intersection detection on the surface based on the node vector information of the surface to obtain a first initial detection result, wherein the first initial detection result represents the attribute information of the cusps and / or sharp lines of the surface; if the first initial detection result indicates that the surface has cusps and / or sharp lines, using the arithmetic unit to perform a second self-intersection detection on the surface based on the clipping boundary information and the position information of the cusps and / or sharp lines of the surface to obtain a second initial detection result, wherein the second initial detection result represents the positional relationship between the cusps and / or sharp lines of the surface and the clipping boundary; and using the arithmetic unit to determine the initial detection result based on the first initial detection result and the second initial detection result.

4. The method according to claim 1, characterized in that, The solution conditions include the initial detection result indicating that the surface may have self-intersections. The step of using the arithmetic unit, based on the control commands and the surface parameter information of the surface, to solve for the self-intersection lines of the surface based on the root node to obtain at least one initial intersection point includes: using the arithmetic unit to perform normal cone detection on the surface based on the control point information of the surface, obtaining the normal cone detection result of the surface; if the normal cone detection result indicates that the surface meets the subdivision conditions, the arithmetic unit subdivides the root node and the surface to obtain multiple leaf nodes and multiple subsurfaces corresponding one-to-one with the multiple leaf nodes, wherein the leaf node represents the bounding box enclosing the subsurface. The subsurface parameter information includes the control point information, node vector information, and subdivision level of the subsurface. The arithmetic unit iteratively performs intra-node self-intersection detection on the subsurfaces corresponding to each of the multiple leaf nodes based on their respective subsurface parameter information until a termination condition is met, obtaining multiple candidate leaf nodes that satisfy the intersection detection condition. These multiple candidate leaf nodes and their corresponding multiple candidate subsurfaces are stored in the register. The arithmetic unit then performs inter-node intersection detection on the multiple leaf node pairs determined based on the multiple candidate leaf nodes, based on their respective subsurface parameter information, to obtain at least one initial intersection point.

5. The method according to claim 4, characterized in that, The step of using the arithmetic unit to iteratively perform intra-node self-intersection detection on the subsurfaces corresponding to each of the multiple leaf nodes based on their respective subsurface parameter information until a termination condition is met, thereby obtaining multiple candidate leaf nodes that satisfy the intersection detection condition, includes: when the subsurface's subdivision level has not reached the maximum subdivision level, the arithmetic unit iteratively performs the following steps on the subsurface until the subsurface's subdivision level reaches the maximum subdivision level: based on the clipping boundary information and the node vector information of the i-th layer subsurface, performing clipping boundary intersection detection on the i-th layer subsurface to obtain the clipping boundary intersection detection result of the i-th layer subsurface. Where 2≤i<N, i is the number of subdivision layers, N is the maximum number of subdivision layers, and i and N are positive integers. The intersection detection result of the clipping boundary of the i-th subsurface represents the positional relationship between the i-th subsurface and the clipping boundary. When the intersection detection result of the clipping boundary of the i-th subsurface indicates that the i-th subsurface is located inside the clipping boundary, a first self-intersection detection is performed on the i-th subsurface based on the node vector information of the i-th subsurface to obtain a first sub-detection result. The first sub-detection result represents the attribute information of the cusps and / or sharp lines of the i-th subsurface. When the first sub-detection result indicates that the i-th subsurface has cusps and / or sharp lines... In the case of the clipping boundary information and the position information of the cusps and / or sharp lines of the i-th layer subsurface, a second self-intersection detection is performed on the i-th layer subsurface to obtain a second sub-detection result. The second sub-detection result represents the positional relationship between the cusps and / or sharp lines of the i-th layer subsurface and the clipping boundary. Based on the first sub-detection result and the second sub-detection result, a sub-detection result corresponding to the i-th layer subsurface is determined. The sub-detection result represents the self-intersection probability of the i-th layer subsurface. If the sub-detection result of the i-th layer subsurface indicates that the i-th layer subsurface cannot have self-intersection, the i-th layer leaf node corresponding to the i-th layer subsurface is determined to satisfy the condition. The i-th layer candidate leaf nodes are selected based on the intersection detection conditions and stored in the register. If the sub-detection result of the i-th layer subsurface indicates that the i-th layer subsurface may have self-intersections, then based on the control point information of the i-th layer subsurface, normal cone detection is performed on the i-th layer subsurface to obtain the normal cone detection result. If the normal cone detection result of the i-th layer subsurface indicates that the i-th layer subsurface cannot have self-intersections, then the i-th layer leaf node corresponding to the i-th layer subsurface is determined as the i-th layer candidate leaf node satisfying the intersection detection conditions, and the i-th layer candidate leaf node is stored in the register.And when the normal cone detection result of the i-th layer subsurface indicates that the i-th layer subsurface may self-intersect, the i-th layer leaf nodes corresponding to the i-th layer subsurface and the i-th layer subsurface are subdivided to obtain multiple (i+1)-th layer leaf nodes and multiple (i+1)-th layer subsurfaces corresponding one-to-one with the multiple (i+1)-th layer leaf nodes; when the subsurface subdivision level reaches the maximum subdivision level: the arithmetic unit, based on the clipping boundary information and the node vector information of the N-th layer subsurface, subdivides the i-th layer leaf nodes and the i-th layer subsurface. The Nth layer subsurface undergoes a clipping boundary intersection detection process to obtain the clipping boundary intersection detection result of the Nth layer subsurface. This result characterizes the positional relationship between the Nth layer subsurface and the clipping boundary. If the Nth layer subsurface is located inside the clipping boundary, the operator identifies the corresponding Nth layer leaf node as a candidate Nth layer leaf node that satisfies the intersection detection condition.

6. The method according to claim 5, characterized in that, The step of performing node intersection detection on multiple leaf node pairs determined based on the multiple candidate leaf nodes according to the subsurface parameter information of each of the multiple candidate subsurfaces by the arithmetic unit to obtain the at least one initial intersection point includes: determining multiple leaf node pairs by the arithmetic unit based on the subdivision level of each of the multiple candidate subsurfaces, each leaf node pair including a first candidate leaf node and a second candidate leaf node, the first candidate leaf node and the second candidate leaf node having the same subdivision level, the first candidate leaf node corresponding to a first subsurface, and the second candidate leaf node corresponding to a second candidate leaf node. Two subsurfaces; for leaf node pairs in the Nth layer where the subdivision level reaches the maximum subdivision level: the operator determines the positional relationship between the first and second candidate leaf nodes in the Nth layer based on their respective node vector information; the operator performs a third self-intersection detection on the merged subsurface in the Nth layer determined based on the first and second subsurfaces in the Nth layer based on their respective subsurface parameter information, to obtain the merged subsurface in the Nth layer. The third sub-detection result of the subsurface, wherein the third sub-detection result characterizes the self-intersection probability of the merged subsurfaces of the Nth layer; when the first candidate leaf node of the Nth layer is adjacent to the second candidate leaf node of the Nth layer, and the third sub-detection result of the Nth layer characterizes the possibility of self-intersection of the merged subsurfaces of the Nth layer, the arithmetic unit performs a first intersection point solution operation on the first subsurface of the Nth layer and the second subsurface of the Nth layer to obtain a first solution result; when the first candidate leaf node of the Nth layer is not ... If the Nth layer merged subsurface may have self-intersections, the arithmetic unit performs a second intersection point calculation operation on the Nth layer first subsurface and the Nth layer second subsurface to obtain a second solution result; if the Nth layer third sub-detection result indicates that the Nth layer merged subsurface cannot have self-intersections, the arithmetic unit performs a third intersection point calculation operation on the Nth layer first subsurface and the Nth layer second subsurface to obtain a third solution result; the arithmetic unit determines at least one initial intersection point based on the first solution result, the second solution result, and / or the third solution result.

7. The method according to claim 6, characterized in that, The step of performing node intersection detection on multiple leaf node pairs determined based on the multiple candidate leaf nodes using the arithmetic unit according to the subsurface parameter information of each of the multiple candidate subsurfaces to obtain the at least one initial intersection point further includes, for the i-th layer leaf node pair whose subdivision level has not reached the maximum subdivision level, iteratively executing the following steps by the arithmetic unit until the subdivision level of the i-th layer leaf node pair reaches the maximum subdivision level: performing a third self-intersection detection on the i-th layer merged subsurface determined based on the i-th layer first subsurface and the i-th layer second subsurface according to the subsurface parameter information of each of the i-th layer first subsurface and the i-th layer second subsurface, obtaining a third sub-detection result of the i-th layer merged subsurface, the third sub-detection result of the i-th layer merged subsurface representing the self-intersection probability of the i-th layer merged subsurface; if the third sub-detection result of the i-th layer merged subsurface represents that the i-th layer merged subsurface cannot have self-intersection, then performing a third self-intersection detection on the i-th layer first subsurface and the i-th layer second subsurface... The surface undergoes a third intersection point calculation operation to obtain a third solution result. If the third sub-detection result of the merged subsurface at layer i indicates that the merged subsurface may have self-intersections, the first candidate leaf node at layer i corresponding to the first subsurface at layer i and the first subsurface at layer i are subdivided to obtain multiple first candidate leaf nodes at layer i+1 and m first subsurfaces at layer i+1 corresponding to these multiple first candidate leaf nodes. The i-th subsurface at layer i corresponding to the second subsurface at layer i... The second candidate leaf node of the i-th layer and the second subsurface of the i-th layer are subdivided to obtain multiple second candidate leaf nodes of the (i+1)-th layer and multiple second subsurfaces of the (i+1)-th layer that correspond one-to-one with the multiple second candidate leaf nodes of the (i+1)-th layer; based on the m first candidate leaf nodes of the (i+1)-th layer and the m second candidate leaf nodes of the (i+1)-th layer, multiple pairs of leaf nodes of the (i+1)-th layer are determined, and each pair of leaf nodes of the (i+1)-th layer includes a first candidate leaf node of the (i+1)-th layer and a second candidate leaf node of the (i+1)-th layer.

8. The method according to claim 1, characterized in that, The step of determining the self-intersection line of the surface by the arithmetic unit based on the control instructions and according to the at least one initial intersection point includes: determining multiple target intersection points on the self-intersection line by the arithmetic unit according to the step length and the at least one initial intersection point, and storing the multiple target intersection points in the register, wherein the step length is used to control the solution accuracy of the self-intersection line; performing topological connection on the multiple target intersection points by the arithmetic unit to obtain an intermediate self-intersection line, and storing the intermediate self-intersection line in the register; and performing interpolation processing on the intermediate self-intersection line by the arithmetic unit based on a preset interpolation method to obtain the self-intersection line, and storing the self-intersection line in the register.

9. The method according to any one of claims 1-8, characterized in that, The method is applied to at least one of the following fields: engineering design, architectural design, computer animation, and facial recognition, for the drafting design of the surface representation geometry.

10. An electronic device, comprising: One or more processors; A memory for storing one or more computer programs, characterized in that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 9.