A RoboBuilder model intersection detection method, apparatus, terminal device, and storage medium

By projecting 3D models onto screen space for 2D geometric detection, the problem of high computational complexity in visual overlap detection is solved, achieving accurate visual overlap determination with low complexity, which is suitable for robot simulation and AR/VR systems.

CN121074043BActive Publication Date: 2026-01-06GUANGZHOU JOINMAX DIGITAL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511616180.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-06
Publication Date
2026-01-06
Estimated Expiration
2045-11-06

AI Technical Summary

Technical Problem

In interactive systems such as robot simulation, AR/VR, and 3D modeling editors, visual overlap detection has high computational complexity, making it difficult to meet the frame rate requirements of real-time interaction, and 3D bounding box detection is prone to misjudging front and back occlusion relationships.

Method used

By employing the concept of dimensionality reduction, the bounding box vertices of the 3D model are projected onto the screen space to generate a 2D point set. An extreme rectangle is constructed and axis-aligned intersection is determined. The separation axis theorem is used to verify the intersection of the convex hulls, thereby reducing computational complexity.

Benefits of technology

While ensuring the accuracy of visual overlap determination, the computational complexity is reduced from O(n²) to O(1)~O(m+n), which greatly improves the computational performance, avoids misjudgment, and is suitable for real-time interactive scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121074043B_ABST
    Figure CN121074043B_ABST
Patent Text Reader

Abstract

The application discloses a RoboBuilder model intersection detection method and device, terminal equipment and storage medium. The method comprises the following steps: constructing a first extreme value rectangle and a second extreme value rectangle and performing axis alignment intersection determination according to the extreme value of a first vertex projection point set and the extreme value of a second vertex projection point set respectively; if the first extreme value rectangle and the second extreme value rectangle intersect, determining a first convex hull corresponding to the first vertex projection point set and a second convex hull corresponding to the second vertex projection point set; using a separate axis theorem to perform intersection determination on the first convex hull and the second convex hull; if the first convex hull and the second convex hull intersect, the first RoboBuilder model and the second RoboBuilder model intersect. The application realizes the conversion of a 3D problem into a 2D geometric problem through a dimension reduction idea, and reduces the calculation complexity on the premise of ensuring the accuracy of visual overlap determination.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of model detection, and in particular to a RoboBuilder model intersection detection method, apparatus, terminal device, and storage medium. Background Technology

[0002] In interactive systems such as robot simulation, AR / VR, and 3D modeling editors, visual overlap detection (rather than physical collision) is a core requirement. For example, when a user drags a robot part, it is necessary to determine whether it visually overlaps with another part from the current camera's perspective (e.g., to avoid accidental operations, highlight selected areas, and prevent UI interactions from clashing). Accurate 3D spatial collision detection (such as the GJK algorithm and SDF distance field) has high computational complexity (O(n²) or more), making it difficult to meet the frame rate requirements of real-time interaction; however, relying solely on 3D bounding boxes for detection in the world coordinate system can lead to misjudgments of occlusion relationships. Summary of the Invention

[0003] This invention provides a RoboBuilder model intersection detection method, device, terminal equipment, and storage medium. By using the concept of dimensionality reduction, the 3D problem is transformed into a 2D geometric problem, thereby reducing computational complexity while ensuring the accuracy of visual overlap determination.

[0004] To achieve the above objectives, a first aspect of this application provides a RoboBuilder model intersection detection method, comprising:

[0005] Obtain the bounding box vertex coordinates of the first RoboBuilder model and the bounding box vertex coordinates of the second RoboBuilder model, and project them onto the camera screen respectively to obtain the first vertex projection point set and the second vertex projection point set;

[0006] Based on the extreme values ​​of the first vertex projection point set and the second vertex projection point set, a first extreme value rectangle and a second extreme value rectangle are constructed and their axis alignment and intersection are determined.

[0007] If the first extreme rectangle and the second extreme rectangle intersect, determine the first convex hull corresponding to the first vertex projection point set and the second convex hull corresponding to the second vertex projection point set;

[0008] The intersection of the first convex hull and the second convex hull is determined using the separating axis theorem.

[0009] If the first convex hull and the second convex hull intersect, then the first RoboBuilder model and the second RoboBuilder model intersect.

[0010] In one possible implementation of the first aspect, obtaining the bounding box vertex coordinates of the first RoboBuilder model and the bounding box vertex coordinates of the second RoboBuilder model, and projecting them onto the camera screen respectively to obtain the first vertex projection point set and the second vertex projection point set, specifically includes:

[0011] The coordinates of the eight vertices of the first RoboBuilder model are converted into two-dimensional projection coordinates through the camera projection interface to obtain the first vertex projection point set; the projection coordinates corresponding to each of the first RoboBuilder models retain the X and Y components with respect to the plane in which the camera projection is located;

[0012] The coordinates of the eight vertices of the second RoboBuilder model are converted into two-dimensional projection coordinates through the camera projection interface to obtain the second vertex projection point set; the projection coordinates corresponding to each second RoboBuilder model retain the X and Y components with respect to the plane where the camera projection is located.

[0013] In one possible implementation of the first aspect, the step of constructing a first extreme value rectangle and a second extreme value rectangle based on the extreme values ​​of the first vertex projection point set and the second vertex projection point set, and performing axis alignment and intersection determination, specifically includes:

[0014] For the first vertex projection point set, calculate the minimum and maximum values ​​in the X component and the minimum and maximum values ​​in the Y component to obtain the first extreme value rectangle;

[0015] For the second vertex projection point set, calculate the minimum and maximum values ​​in the X component and the minimum and maximum values ​​in the Y component to obtain the second extreme value rectangle;

[0016] An axis alignment and intersection determination is performed on the first and second extreme rectangles. If the first and second extreme rectangles are separated in the horizontal direction or in the vertical direction, the first and second extreme rectangles do not intersect. If the first and second extreme rectangles intersect in the horizontal direction and in the vertical direction, the first and second extreme rectangles intersect.

[0017] In one possible implementation of the first aspect, the first extreme rectangle and the second extreme rectangle are separated in the horizontal direction or in the vertical direction, specifically including:

[0018] The minimum value of the first vertex projection point set in the X component is greater than the maximum value of the second vertex projection point set in the X component, or the maximum value of the first vertex projection point set in the X component is less than the minimum value of the second vertex projection point set in the X component, and the first extreme rectangle and the second extreme rectangle are separated in the horizontal direction.

[0019] The minimum value of the first vertex projection point set in the Y component is greater than the maximum value of the second vertex projection point set in the Y component, or the maximum value of the first vertex projection point set in the Y component is less than the minimum value of the second vertex projection point set in the Y component, and the first extreme rectangle and the second extreme rectangle are separated in the vertical direction.

[0020] In one possible implementation of the first aspect, determining the first convex hull corresponding to the first vertex projection point set and the second convex hull corresponding to the second vertex projection point set specifically includes:

[0021] Find the point with the smallest Y-axis coordinate value from the first vertex projection point set and use it as the first starting point; sort the points other than the first starting point according to the polar angle relative to the first starting point from small to large, use a stack structure to process the sorted points, and arrange the vertices in the stack in counterclockwise order to form the first convex hull.

[0022] Find the point with the smallest Y-axis coordinate value from the second vertex projection point set as the second starting point; sort the points other than the second starting point in ascending order according to their polar angle relative to the second starting point, process the sorted points using a stack structure, and arrange the vertices in the stack in counterclockwise order to form the second convex hull.

[0023] In one possible implementation of the first aspect, the method of determining the intersection of the first convex hull and the second convex hull using the separating axis theorem includes:

[0024] Traverse each edge of the first convex hull, calculate the normal vector for each edge, and record the extreme values ​​of each point of the first convex hull and each point of the second convex hull on the normal vector to determine whether a separating axis exists.

[0025] Traverse each edge of the second convex hull, calculate the normal vector for each edge, and record the extreme values ​​of each point of the first convex hull and each point of the second convex hull on the normal vector to determine whether a separating axis exists.

[0026] If no separating axis is found on the normal vectors of all edges of the first convex hull and the second convex hull, the first convex hull and the second convex hull intersect.

[0027] In one possible implementation of the first aspect, determining whether a separation shaft exists specifically includes:

[0028] Record the minimum value of each point of the first convex hull on the normal vector as the first extreme value and the maximum value as the second extreme value; record the minimum value of each point of the second convex hull on the normal vector as the third extreme value and the maximum value as the fourth extreme value;

[0029] If the second extreme value is less than the third extreme value, or the fourth extreme value is less than the first extreme value, then a separation axis exists.

[0030] A second aspect of this application provides a RoboBuilder model intersection detection device, comprising:

[0031] The model projection module is used to obtain the bounding box vertex coordinates of the first RoboBuilder model and the bounding box vertex coordinates of the second RoboBuilder model, and project them onto the camera screen respectively to obtain the first vertex projection point set and the second vertex projection point set;

[0032] The first determination module is used to construct a first extreme value rectangle and a second extreme value rectangle based on the extreme values ​​of the first vertex projection point set and the second vertex projection point set, respectively, and to determine the axis alignment and intersection.

[0033] The convex hull determination module is used to determine the first convex hull corresponding to the first vertex projection point set and the second convex hull corresponding to the second vertex projection point set if the first extreme rectangle and the second extreme rectangle intersect.

[0034] The second determination module is used to determine the intersection of the first convex hull and the second convex hull using the separating axis theorem.

[0035] The intersection determination module is used to determine if the first convex hull and the second convex hull intersect, and if so, the first RoboBuilder model and the second RoboBuilder model intersect.

[0036] A third aspect of this application provides a terminal device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor executes the computer program to implement the RoboBuilder model intersection detection method as described above.

[0037] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the RoboBuilder model intersection detection method as described above.

[0038] Compared with existing technologies, this invention is based on the idea of ​​screen space dimensionality reduction and adopts a two-stage detection strategy: In the first stage, the vertices of the 3D model bounding box are projected onto the screen to generate a 2D point set. An axis-aligned rectangle is constructed by the extreme values ​​of the X / Y axes. It only takes O(1) time to detect whether the points are separated. If they are separated, they are directly determined to be non-intersecting and all subsequent calculations are skipped. In the second stage, the point set that meets the conditions in the first stage is used to generate a convex hull (counterclockwise boundary points) to ensure that the input is a strictly convex polygon. The normal vectors of all edges are traversed and the interval overlap is verified by projection. If any separating axis is found, it is determined to be non-intersecting. Intersection is only determined when all axes are not separated.

[0039] After implementing this invention, most detection scenarios can be quickly determined and terminated directly through the first stage of detection, avoiding the O(nlogn) complexity of convex hull calculation; in the second stage of detection, if a separating axis is found, the process terminates, avoiding redundant calculations. The two-stage detection covers almost all geometric scenarios (including cross-shaped intersections, front and rear occlusions, etc.), eliminating the risk of misjudgment. In addition, since the camera screen can be dynamically adjusted at any time, detection can be performed while meeting the needs of real-time interactive scenarios (such as robot editors, AR UIs). Attached Figure Description

[0040] Figure 1 This is a flowchart illustrating a RoboBuilder model intersection detection method according to an embodiment of the present invention;

[0041] Figure 2 This is a schematic diagram of the structure of a RoboBuilder model intersection detection device provided in an embodiment of the present invention. Detailed Implementation

[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0043] To resolve the above issues, please refer to [link / reference]. Figure 1 An embodiment of the present invention provides a RoboBuilder model intersection detection method, comprising:

[0044] S10. Obtain the bounding box vertex coordinates of the first RoboBuilder model and the bounding box vertex coordinates of the second RoboBuilder model, and project them onto the camera screen respectively to obtain the first vertex projection point set and the second vertex projection point set.

[0045] S11. Based on the extreme values ​​of the first vertex projection point set and the second vertex projection point set, construct a first extreme value rectangle and a second extreme value rectangle, and perform axis alignment and intersection determination.

[0046] S12. If the first extreme rectangle and the second extreme rectangle intersect, determine the first convex hull corresponding to the first vertex projection point set and the second convex hull corresponding to the second vertex projection point set.

[0047] S13. Use the separating axis theorem to determine the intersection of the first convex hull and the second convex hull.

[0048] S14. If the first convex hull and the second convex hull intersect, the first RoboBuilder model and the second RoboBuilder model intersect.

[0049] S10 transforms the occlusion relationship in 3D space into a geometric problem in 2D screen space, reducing the computational complexity from O(n²) to O(1). This step focuses only on visual presentation and does not rely on a 3D physics engine, making it suitable for pure UI interaction scenarios (such as drag-and-drop anti-collision in a robot editor). In practical applications, projection calculations can directly reuse the GPU pipeline without requiring additional computing resources.

[0050] S11 calculates the minimum and maximum values ​​of the X and Y axes for the first vertex projection point set PA and the second vertex projection point set PB, respectively, and constructs the first and second extreme value rectangles C and D aligned with the axes. The intersection of the rectangles is then determined based on their positional relationship. This allows for direct determination of non-intersection in most scenarios (such as models distributed on both sides of the screen) using a 4-order value comparison. Only extreme value calculation is required (O(n)), but in practical engineering, since the point set is fixed at 8 vertices, this can be considered constant time.

[0051] If the first extreme rectangle C and the second extreme rectangle D do not intersect in S12, the two RoboBuilder models are directly determined to be non-intersecting, without needing to perform subsequent convex hull calculations or SAT detection. Therefore, in typical robot simulation scenarios, more than 90% of the detection can be completed directly through this step, avoiding O(n log n) convex hull calculations.

[0052] Both the first and second convex hulls are minimal convex sets containing all points, which is a geometric prerequisite for satisfying the separating axis theorem. Forming convex hulls ensures that the input of S13 is a strictly convex polygon.

[0053] S13 uses the Separating Axis Theorem (SAT) to precisely verify the intersection scenario of the first extreme rectangle C and the second extreme rectangle D: handling complex cases such as cross-shaped intersections and front-to-back occlusion (e.g., A is in front and B is behind but their projections overlap, and they do not collide in actual 3D space). This step has a time complexity of O(m+n) and terminates upon finding the separating axis.

[0054] S14 is a comprehensive test and judgment of the first RoboBuilder model and the second RoboBuilder model based on the results of S13.

[0055] This embodiment can be applied to real-time interactive 3D systems (such as educational robot platforms). By using the concept of dimensionality reduction, it transforms a 3D problem into a 2D geometric problem. While ensuring the accuracy of visual overlap determination, it reduces the computational complexity from O(n²) to O(1)~O(m+n), making it an optimal solution for visual interaction in lightweight systems.

[0056] For example, obtaining the bounding box vertex coordinates of the first RoboBuilder model and the bounding box vertex coordinates of the second RoboBuilder model, and projecting them onto the camera screen respectively to obtain the first vertex projection point set and the second vertex projection point set, specifically includes:

[0057] The coordinates of the eight vertices of the first RoboBuilder model are converted into two-dimensional projection coordinates through the camera projection interface to obtain the first vertex projection point set; the projection coordinates corresponding to each of the first RoboBuilder models retain the X and Y components with respect to the plane in which the camera projection is located.

[0058] The coordinates of the eight vertices of the second RoboBuilder model are converted into two-dimensional projection coordinates through the camera projection interface to obtain the second vertex projection point set; the projection coordinates corresponding to each second RoboBuilder model retain the X and Y components with respect to the plane where the camera projection is located.

[0059] The bounding box is uniquely defined by min (minimum point) and max (maximum point), and its eight vertices are combinations of the coordinate components of min and max (e.g., (min.x, min.y, min.z), (max.x, max.y, max.z), etc.). Eight vertices must be used: using only the center point and radius cannot accurately describe non-cubic shapes (such as slender models), leading to projection distortion.

[0060] You can call Camera.WorldToScreenPoint to convert world coordinates to screen coordinates, retaining only the X / Y components. This is because screen space intersection detection only requires 2D geometric relationships, and the Z component does not contribute to visual overlap determination.

[0061] Note that the same camera coordinate system is used for all vertex projections to ensure that the relative relationships for extreme value calculations (X / Y minimum / maximum values) are naturally correct. For example, in Unity, the screen origin is at the lower left corner, but the Y coordinates of all points start increasing from 0 at the bottom to Screen.height at the top, and no additional conversion is required for extreme value calculations.

[0062] In Unity, the time consumption for 8-vertex projection + X / Y extreme value calculation is approximately 0.01 ms, while a complete 3D collision detection requires 1 - 5 ms. Therefore, the computing performance has been greatly improved.

[0063] Exemplarily, constructing the first extreme value rectangle and the second extreme value rectangle respectively according to the extreme values of the first vertex projection point set and the extreme values of the second vertex projection point set and performing axis-aligned intersection determination specifically includes:

[0064] For the first vertex projection point set, calculate the minimum value minX_A and the maximum value maxX_A in the X component, and the minimum value minY_A and the maximum value maxY_A in the Y component to obtain the first extreme value rectangle C.

[0065] For the second vertex projection point set, calculate the minimum value minX_B and the maximum value maxX_B in the X component, and the minimum value minY_B and the maximum value maxY_B in the Y component to obtain the second extreme value rectangle D.

[0066] Perform axis-aligned intersection determination on the first extreme value rectangle C and the second extreme value rectangle D. If the first extreme value rectangle C and the second extreme value rectangle D are separated in the horizontal direction or the first extreme value rectangle C and the second extreme value rectangle D are separated in the vertical direction, the first extreme value rectangle C and the second extreme value rectangle D do not intersect; if the first extreme value rectangle C and the second extreme value rectangle D intersect in the horizontal direction and the first extreme value rectangle C and the second extreme value rectangle D intersect in the vertical direction, the first extreme value rectangle C and the second extreme value rectangle D intersect.

[0067] The above steps only determine separation through numerical comparisons such as minX_A, maxX_A, minX_B, maxX_B, etc., without floating-point precision errors (such as maxX_A < minX_B strictly holds).

[0068] Exemplarily, the first extreme value rectangle C and the second extreme value rectangle D are separated in the horizontal direction or the first extreme value rectangle C and the second extreme value rectangle D are separated in the vertical direction specifically includes:

[0069] The minimum value of the first vertex projection point set in the X component is greater than the maximum value of the second vertex projection point set in the X component, or the maximum value of the first vertex projection point set in the X component is less than the minimum value of the second vertex projection point set in the X component, and the first extreme value rectangle C and the second extreme value rectangle D are separated in the horizontal direction.

[0070] The minimum value of the first vertex projection point set in the Y component is greater than the maximum value of the second vertex projection point set in the Y component, or the maximum value of the first vertex projection point set in the Y component is less than the minimum value of the second vertex projection point set in the Y component, and the first extreme value rectangle C and the second extreme value rectangle D are separated in the vertical direction.

[0071] In the drag-and-drop operation of the robot parts library, most of the movement occurs in the screen separation area. If the first extreme rectangle C and the second extreme rectangle D are found to be separated in a certain direction, the process can be terminated directly to avoid redundant calculations.

[0072] For example, determining the first convex hull corresponding to the first vertex projection point set and the second convex hull corresponding to the second vertex projection point set specifically includes:

[0073] Find the point with the smallest Y-axis coordinate value from the first vertex projection point set and use it as the first starting point; sort the points other than the first starting point according to the polar angle relative to the first starting point from small to large, use a stack structure to process the sorted points, and arrange the vertices in the stack in counterclockwise order to form the first convex hull.

[0074] Find the point with the smallest Y-axis coordinate value from the second vertex projection point set as the second starting point; sort the points other than the second starting point in ascending order according to their polar angle relative to the second starting point, process the sorted points using a stack structure, and arrange the vertices in the stack in counterclockwise order to form the second convex hull.

[0075] The mathematical premise of the Separating Axis Theorem (SAT) is that the normal vector of each edge must point to the outside of the convex hull (i.e., "outer normal"). For a counterclockwise convex hull, the normal vector of the edge vector v=(dx,dy) is (-dy,dx), which always points to the outside. If it is clockwise, the direction of the normal vector is reversed, resulting in incorrect projection calculation and SAT failure.

[0076] For example, if the edge vector (1,0) (horizontally to the right) is arranged in a counterclockwise direction, the normal vector (0,1) (upward) points outward; if arranged clockwise, the normal vector (0, -1) (downward) points inward, resulting in an error in the projection interval calculation.

[0077] In this embodiment, the minimum point on the Y-axis (or the minimum point on the X-axis if the Y-axis is the same) is selected as the starting point to ensure that the convex hull is constructed from the "bottom". This ensures that the starting point remains stable when dealing with irregular point distributions (such as U-shaped or L-shaped points), preventing the algorithm from failing due to disordered input order.

[0078] During the stack structure processing, "right turn" points need to be removed. This involves pushing points onto the stack sequentially and checking the top three points each time: if a right turn is formed (cross < 0), pop the stack apex (remove the depression); if a left turn or collinearity is found, retain the point. It's also necessary to retain the point farthest from the starting point (discarding intermediate points) to ensure accurate convex hull boundaries.

[0079] For example, the step of using the separating axis theorem to determine the intersection of the first convex hull and the second convex hull includes:

[0080] Traverse each edge of the first convex hull, calculate the normal vector for each edge, and record the extreme values ​​of each point of the first convex hull and each point of the second convex hull on the normal vector to determine whether a separating axis exists.

[0081] Traverse each edge of the second convex hull, calculate the normal vector for each edge, and record the extreme values ​​of each point of the first convex hull and each point of the second convex hull on the normal vector to determine whether a separating axis exists.

[0082] If no separating axis is found on the normal vectors of all edges of the first convex hull and the second convex hull, the first convex hull and the second convex hull intersect.

[0083] For example, determining whether a separation shaft exists specifically includes:

[0084] Record the minimum value of each point of the first convex hull on the normal vector as the first extreme value and the maximum value as the second extreme value; record the minimum value of each point of the second convex hull on the normal vector as the third extreme value and the maximum value as the fourth extreme value;

[0085] If the second extreme value is less than the third extreme value, or the fourth extreme value is less than the first extreme value, then a separation axis exists.

[0086] If any axis separates, the axes are considered non-intersecting; if all axes are not separate, the axes are considered intersecting. For example:

[0087] ① Calculate the convex hull point set of PA and PB, denoted as PAT and PBT. The convex hull point set is the set of convex hull vertices starting from the vertex of the lowest point on the Y-axis in the projection point set and proceeding counterclockwise.

[0088] ② Select the nth and (n+1)th points of PAT to form an edge, and calculate the normal vector V of the edge.

[0089] ③ Project the points of PAT and PBT onto V and denote them as two point sets PAF and PBF. If the maximum value of the point of PAF on the vertical line is less than the minimum value of the point of PBF on the vertical line, or the maximum value of the point of PBF on the vertical line is less than the minimum value of the point of PAF on the vertical line, then PAF and PBF do not intersect, that is, PAT and PBT do not intersect, that is, PA and PB do not intersect, that is, AB does not intersect.

[0090] ④ If they intersect, repeat steps ②-④.

[0091] ⑤ If the edges still intersect after all calculations are completed, select the edges of PBT and repeat process ②-④.

[0092] ⑥ If they still intersect after all calculations are completed, then AB intersects.

[0093] Compared with existing technologies, the above embodiments are based on the idea of ​​screen space dimensionality reduction and adopt a two-stage detection strategy: In the first stage, the vertices of the 3D model bounding box are projected onto the screen to generate a 2D point set. An axis-aligned rectangle is constructed through the extreme values ​​of the X / Y axes. It only takes O(1) time to detect whether the points are separated. If they are separated, they are directly determined to be non-intersecting and all subsequent calculations are skipped. In the second stage, the point set that meets the conditions in the first stage is used to generate a convex hull (counterclockwise boundary points) to ensure that the input is a strictly convex polygon. The normal vectors of all edges are traversed and the interval overlap is verified by projection. If any separating axis is found, it is determined to be non-intersecting. Intersection is only determined when all axes are not separated.

[0094] After implementing this embodiment, most detection scenarios can be quickly determined and terminated directly through the first stage of detection, avoiding the O(nlogn) complexity of convex hull calculation; in the second stage of detection, if a separating axis is found, the process terminates to avoid redundant calculations. The two-stage detection covers almost all geometric scenarios (including cross-shaped intersections, front and rear occlusions, etc.), eliminating the risk of misjudgment. In addition, since the camera screen can be dynamically adjusted at any time, detection can be performed while meeting the needs of real-time interactive scenarios (such as robot editors, AR UIs).

[0095] See Figure 2 One embodiment of this application provides a RoboBuilder model intersection detection device, including a model projection module 20, a first determination module 21, a convex hull determination module 22, a second determination module 23, and an intersection determination module 24.

[0096] The model projection module 20 is used to obtain the bounding box vertex coordinates of the first RoboBuilder model and the bounding box vertex coordinates of the second RoboBuilder model, and project them onto the camera screen respectively to obtain the first vertex projection point set and the second vertex projection point set.

[0097] The first determination module 21 is used to construct a first extreme value rectangle and a second extreme value rectangle based on the extreme values ​​of the first vertex projection point set and the second vertex projection point set, respectively, and to perform axis alignment and intersection determination.

[0098] The convex hull determination module 22 is used to determine the first convex hull corresponding to the first vertex projection point set and the second convex hull corresponding to the second vertex projection point set if the first extreme value rectangle and the second extreme value rectangle intersect.

[0099] The second determination module 23 is used to determine the intersection of the first convex hull and the second convex hull using the separating axis theorem.

[0100] The intersection determination module 24 is used to determine if the first convex hull and the second convex hull intersect, and if so, the first RoboBuilder model and the second RoboBuilder model intersect.

[0101] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the RoboBuilder model intersection detection device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0102] Compared with existing technologies, the above embodiments are based on the idea of ​​screen space dimensionality reduction and adopt a two-stage detection strategy: In the first stage, the vertices of the 3D model bounding box are projected onto the screen to generate a 2D point set. An axis-aligned rectangle is constructed through the extreme values ​​of the X / Y axes. It only takes O(1) time to detect whether the points are separated. If they are separated, they are directly determined to be non-intersecting and all subsequent calculations are skipped. In the second stage, the point set that meets the conditions in the first stage is used to generate a convex hull (counterclockwise boundary points) to ensure that the input is a strictly convex polygon. The normal vectors of all edges are traversed and the interval overlap is verified by projection. If any separating axis is found, it is determined to be non-intersecting. Intersection is only determined when all axes are not separated.

[0103] After implementing this embodiment, most detection scenarios can be quickly determined and terminated directly through the first stage of detection, avoiding the O(nlogn) complexity of convex hull calculation; in the second stage of detection, if a separating axis is found, the process terminates to avoid redundant calculations. The two-stage detection covers almost all geometric scenarios (including cross-shaped intersections, front and rear occlusions, etc.), eliminating the risk of misjudgment. In addition, since the camera screen can be dynamically adjusted at any time, detection can be performed while meeting the needs of real-time interactive scenarios (such as robot editors, AR UIs).

[0104] One embodiment of this application provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements a RoboBuilder model intersection detection method as described above.

[0105] One embodiment of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements a RoboBuilder model intersection detection method as described above.

[0106] The computer device may be a smartphone, tablet, desktop computer, or cloud server, among other computing devices. This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the figures are merely examples of computer devices and do not constitute a limitation on the computer device. It may include more or fewer components than illustrated, or a combination of certain components, or different components, such as input / output devices, network access devices, etc.

[0107] The processor referred to can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0108] In some embodiments, the memory may be an internal storage unit of the computer device, such as a hard drive or RAM. In other embodiments, the memory may be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory may include both internal and external storage units of the computer device. The memory is used to store the operating system, applications, bootloader, data, and other programs, such as the program code of the computer program. The memory can also be used to temporarily store data that has been output or will be output.

[0109] This application provides a computer program product that, when run on a computer device, enables the computer device to execute the steps described in the various method embodiments above.

[0110] In the several embodiments provided in this application, it will be understood that each block in the 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 marked in the blocks may occur in a different order than those shown in the figures. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved.

[0111] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0112] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A RoboBuilder model intersection detection method, characterized in that, The method comprises the following steps: obtaining the bounding box vertex coordinates of the first RoboBuilder model and the bounding box vertex coordinates of the second RoboBuilder model, and projecting them to the camera screen respectively to obtain a first vertex projection point set and a second vertex projection point set; constructing a first extreme value rectangle and a second extreme value rectangle according to the extreme values of the first vertex projection point set and the extreme values of the second vertex projection point set respectively, and performing axis-aligned intersection determination; if the first extreme value rectangle and the second extreme value rectangle intersect, determining the first convex hull corresponding to the first vertex projection point set and the second convex hull corresponding to the second vertex projection point set; performing intersection determination on the first convex hull and the second convex hull using the separate axis theorem; if the first convex hull and the second convex hull intersect, the first RoboBuilder model and the second RoboBuilder model intersect.

2. A RoboBuilder model intersection detection method as claimed in claim 1, wherein, The method comprises the following steps: converting the 8 vertex coordinates of the first RoboBuilder model into two-dimensional projection coordinates through a camera projection interface to obtain a first vertex projection point set; the projection coordinates corresponding to each first RoboBuilder model retain the X component and Y component of the plane on which the camera projects; converting the 8 vertex coordinates of the second RoboBuilder model into two-dimensional projection coordinates through a camera projection interface to obtain a second vertex projection point set; the projection coordinates corresponding to each second RoboBuilder model retain the X component and Y component of the plane on which the camera projects.

3. A RoboBuilder model intersection detection method as claimed in claim 1, wherein, The method comprises the following steps: for the first vertex projection point set, calculating the minimum and maximum values in the X component and the minimum and maximum values in the Y component to obtain a first extreme value rectangle; for the second vertex projection point set, calculating the minimum and maximum values in the X component and the minimum and maximum values in the Y component to obtain a second extreme value rectangle; performing axis-aligned intersection determination on the first extreme value rectangle and the second extreme value rectangle; if the first extreme value rectangle and the second extreme value rectangle are separated in the horizontal direction or the first extreme value rectangle and the second extreme value rectangle are separated in the vertical direction, the first extreme value rectangle and the second extreme value rectangle do not intersect; if the first extreme value rectangle and the second extreme value rectangle intersect in the horizontal direction and the first extreme value rectangle and the second extreme value rectangle intersect in the vertical direction, the first extreme value rectangle and the second extreme value rectangle intersect.

4. A RoboBuilder model intersection detection method as claimed in claim 3, wherein, The first extreme value rectangle and the second extreme value rectangle are separated in the horizontal direction or the first extreme value rectangle and the second extreme value rectangle are separated in the vertical direction, which comprises the following steps: The minimum value of the first vertex projection point set on the X component is greater than the maximum value of the second vertex projection point set on the X component, or the maximum value of the first vertex projection point set on the X component is less than the minimum value of the second vertex projection point set on the X component, and the first extreme value rectangle and the second extreme value rectangle are separated in the horizontal direction; The minimum value of the first vertex projection point set on the Y component is greater than the maximum value of the second vertex projection point set on the Y component, or the maximum value of the first vertex projection point set on the Y component is less than the minimum value of the second vertex projection point set on the Y component, and the first extreme value rectangle and the second extreme value rectangle are separated in the vertical direction.

5. A RoboBuilder model intersection detection method as described in claim 1, wherein, The determination of the first convex hull corresponding to the first vertex projection point set and the second convex hull corresponding to the second vertex projection point set specifically comprises: finding the point with the minimum Y-axis coordinate value in the first vertex projection point set as a first starting point, sorting the points other than the first starting point in ascending order of the polar angle relative to the first starting point, processing the sorted points using a stack structure, arranging the vertices in the stack in counterclockwise order, and forming a first convex hull; finding the point with the minimum Y-axis coordinate value in the second vertex projection point set as a second starting point, sorting the points other than the second starting point in ascending order of the polar angle relative to the second starting point, processing the sorted points using a stack structure, arranging the vertices in the stack in counterclockwise order, and forming a second convex hull.

6. A RoboBuilder model intersection detection method as described in claim 1, wherein, The intersection determination of the first convex hull and the second convex hull using the separation axis theorem comprises: traversing each edge of the first convex hull, calculating the normal vector of each edge, recording the extreme values of the points of the first convex hull and the points of the second convex hull on the normal vector, and determining whether there is a separation axis; traversing each edge of the second convex hull, calculating the normal vector of each edge, recording the extreme values of the points of the first convex hull and the points of the second convex hull on the normal vector, and determining whether there is a separation axis; if no separation axis is found on the normal vectors of all edges of the first convex hull and the second convex hull, the first convex hull and the second convex hull intersect.

7. A RoboBuilder model intersection detection method as in claim 6, wherein, The determination of whether there is a separation axis specifically comprises: recording the minimum value of the points of the first convex hull on the normal vector as a first extreme value, and the maximum value as a second extreme value; recording the minimum value of the points of the second convex hull on the normal vector as a third extreme value, and the maximum value as a fourth extreme value; if the second extreme value is less than the third extreme value, or the fourth extreme value is less than the first extreme value, there is a separation axis.

8. A RoboBuilder model intersection detection apparatus, characterized by, It comprises: a model projection module configured to obtain bounding box vertex coordinates of a first RoboBuilder model and bounding box vertex coordinates of a second RoboBuilder model, and project them to a camera screen to obtain a first vertex projection point set and a second vertex projection point set; a first determination module configured to construct a first extreme value rectangle and a second extreme value rectangle according to the extreme values of the first vertex projection point set and the extreme values of the second vertex projection point set, respectively, and perform axis-aligned intersection determination; a convex hull determination module, configured to determine a first convex hull corresponding to the first vertex projection point set and a second convex hull corresponding to the second vertex projection point set if the first extreme value rectangle and the second extreme value rectangle intersect; a second determination module, configured to determine intersection of the first convex hull and the second convex hull using a separation axis theorem; an intersection determination module, configured to determine that the first RoboBuilder model and the second RoboBuilder model intersect if the first convex hull and the second convex hull intersect.

9. A terminal device, comprising: A computer program product, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the RoboBuilder model intersection detection method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that, A computer program product, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the RoboBuilder model intersection detection method according to any one of claims 1 to 7 when executing the computer program.

Citation Information

Patent Citations

  • Mechanical arm collision detection method and system, storage medium and mechanical arm

    CN113211495A

  • Three-dimensional object collision detection package grid generation method and system, storage medium and program product

    CN120689554A