Two-dimensional sketch total intersection acceleration method and system, computer equipment and computer program product

By constructing a bounding box for voxels in two-dimensional sketches and establishing a spatial division index structure, the problem of high time complexity when the number of voxels increases is solved, and a more efficient two-dimensional sketch full interception is achieved, which improves the user experience.

CN119810243AActive Publication Date: 2025-04-11SHENZHEN POISSON SOFTWARE TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510294780.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-04-11
Estimated Expiration
2045-03-13

AI Technical Summary

Technical Problem

In two-dimensional sketches, as the number of voxels increases, the traditional traversal interleaving method will cause the time complexity to be n^2, causing the user to wait for a long time when it needs to interleave all voxels in the two-dimensional sketches, and the experience is poor.

Method used

By constructing a first bounding box for the first voxel in the target two-dimensional sketch, and when the ratio of the second voxel number and the first voxel number does not meet the preset threshold, the first crossover calculation is performed on the second voxel and the first bounding box to obtain the first crossover result. Then, a space division index structure is established for the first enclosure box, and the second interception calculation is performed to achieve a more efficient two-dimensional sketch full interception.

Benefits of technology

Through this method, the speed of crossing the two-dimensional sketches is significantly improved, the calculation time is reduced, and the user experience is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810243A_ABST
    Figure CN119810243A_ABST
Patent Text Reader

Abstract

The invention is applicable to the technical field of computer graphic processing, and provides a two-dimensional sketch total intersection acceleration method and system, computer equipment and computer program products.The two-dimensional sketch total intersection acceleration method comprises the steps that a first bounding box is constructed for a first voxel in a target two-dimensional sketch; under the condition that the ratio of the number of the second voxels in the target two-dimensional sketch to the number of the first voxels does not meet a preset threshold value, performing first intersection calculation on the second voxels in the target two-dimensional sketch and the first bounding box to obtain a first intersection result; establishing a space division index structure for the first bounding box, wherein the space division index structure comprises an index of the first bounding box; and performing second intersection calculation on each target bounding box in the first bounding box, the bounding box in the index of the target bounding box and the bounding box in the parent index of the index to obtain a second intersection result. According to the invention, the intersection calculation of all voxels in the two-dimensional sketch can be accelerated, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer graphics processing technology, and in particular, relates to a method, system, computer device and computer program product for accelerating the intersection of a two-dimensional sketch. Background Art

[0002] Solving the intersection between voxels in a two-dimensional sketch is often used to calculate the minimum closed domain, clipping extension, etc. When there are a large number of voxels in a two-dimensional sketch, as the number of voxels increases, the traditional traversal intersection method will increase exponentially with the increase in the number of voxels. The time complexity of solving the intersection between all voxels is n^2. In software such as CAD, the above problem causes users to wait for a long time when they need to perform intersection calculations on all voxels in the two-dimensional sketch, resulting in a poor experience.

[0003] Therefore, a more efficient method for full intersection of voxels in two-dimensional sketches is urgently needed to improve the speed of full intersection and user experience. Summary of the invention In view of this, the embodiments of the present application provide a method, system, computer device and computer program product for accelerating the full intersection of two-dimensional sketches to achieve more efficient full intersection of two-dimensional sketches and improve user experience.

[0004] A first aspect of an embodiment of the present application provides a two-dimensional sketch full-volume intersection acceleration method, comprising: constructing a first bounding box for a first voxel in the target two-dimensional sketch; When the ratio of the number of second voxels in the target two-dimensional sketch to the number of the first voxels does not meet a preset threshold, performing a first intersection calculation on the second voxels in the target two-dimensional sketch and the first bounding box to obtain a first intersection result; Establishing a space partitioning index structure for the first bounding box, wherein the space partitioning index structure includes an index of the first bounding box; A second intersection calculation is performed on each target bounding box in the first bounding box, the bounding box in the index of the target bounding box, and the bounding box in the parent index of the index to obtain a second intersection result.

[0005] In an implementation of the first aspect, establishing a space partition index structure for the first bounding box includes: According to a preset step size and a preset division threshold, recursively divide the plane space of the target two-dimensional sketch into a quadtree structure, and assign target index information to each target space obtained by the division; The target index information includes the target index of the target space and the index of the parent space of the target space; when the target space is not the minimum partition space, the target index information also includes the index of the subspace of the target space; For each target bounding box in the first bounding box, taking the index of the minimum partition space of the target bounding box as the index of the target bounding box; The paths in the quadtree structure that do not contain the bounding box are deleted.

[0006] In an implementation of the first aspect, establishing a space partition index structure for the first bounding box includes: For each target bounding box in the first bounding box, find the spatial index corresponding to the target bounding box and add it to the index tree.

[0007] In an implementation of the first aspect, the method further includes: When a ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch meets a preset threshold, constructing a hierarchical bounding volume structure for the first bounding box; A first intersection calculation is performed on the second voxel and the hierarchical bounding volume structure to obtain a first intersection result.

[0008] In an implementation of the first aspect, when a ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch satisfies a preset threshold, constructing a hierarchical bounding volume structure for the first bounding box includes: When the ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch is greater than or equal to 2, a hierarchical bounding volume structure is constructed for the first bounding box based on a surface area heuristic algorithm.

[0009] In an implementation of the first aspect, before constructing a first bounding box for a first voxel in the target two-dimensional sketch, the method further includes: Get all voxels in the target 2D sketch; All the voxels are divided into first voxels and second voxels according to the type and geometric data of the voxels.

[0010] In an implementation of the first aspect, before establishing a space partition index structure for the first bounding box, the method further includes: In the first intersection calculation process, if the first bounding box to be segmented is segmented for the first time, segmenting the first bounding box and storing sub-bounding box information obtained by segmenting the first bounding box into an acceleration cache; The method further comprises: In the first intersection calculation process or the second intersection calculation process, if the first bounding box to be segmented is not segmented for the first time, the sub-bounding box information of the first bounding box is obtained from the acceleration cache.

[0011] A second aspect of an embodiment of the present application provides a two-dimensional sketch full-volume intersection acceleration system, comprising: A bounding box construction module, for constructing a first bounding box for a first voxel in the target two-dimensional sketch; A first intersection module is used to perform a first intersection calculation on the second voxel in the target two-dimensional sketch and the first bounding box when the ratio of the number of the first voxel to the number of the second voxel in the target two-dimensional sketch does not meet a preset threshold, so as to obtain a first intersection result; A space partition index module, configured to establish a space partition index structure for the first bounding box, wherein the space partition index structure includes an index of the first bounding box; The second intersection module is used to perform a second intersection calculation on each target bounding box in the first bounding box, the bounding box in the index of the target bounding box, and the bounding box in the parent index of the index to obtain a second intersection result.

[0012] A third aspect of an embodiment of the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the first aspect when executing the computer program.

[0013] A fourth aspect of the embodiments of the present application provides a computer program product, including a computer program, wherein when the computer program is executed, the method according to the first aspect is executed.

[0014] The beneficial effect of the first aspect of the embodiment of the present application is: by constructing a first bounding box for the first voxel in the target two-dimensional sketch, and when the ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch does not meet the preset threshold, a first intersection calculation is performed on the second voxel in the target two-dimensional sketch and the first bounding box to obtain a first intersection result; then a spatial partitioning index structure is established for the first bounding box, and the spatial partitioning index structure includes the index of the first bounding box; a second intersection calculation is performed on each target bounding box in the first bounding box and the bounding box in the index of the target bounding box and the bounding box in the parent index of the index to obtain a second intersection result, thereby achieving more efficient full-scale intersection of the two-dimensional sketch and improving user experience.

[0015] It can be understood that the beneficial effects of the second to fourth aspects mentioned above can be found in the relevant description of the first aspect mentioned above, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0017] Figure 1 It is a schematic diagram of the implementation process of the two-dimensional sketch full intersection acceleration method provided in the embodiment of the present application; Figure 2 It is a schematic diagram of the implementation process of the two-dimensional sketch full intersection acceleration method provided in the embodiment of the present application; Figure 3 It is a schematic diagram of a two-dimensional sketch full-volume intersection acceleration system provided in an embodiment of the present application; Figure 4 is a schematic diagram of a computer device provided in an embodiment of the present application; Figure 5 It is a schematic diagram of a computer program product provided in an embodiment of the present application. DETAILED DESCRIPTION

[0018] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.

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

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

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

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

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

[0024] An embodiment of the present application provides a method for full intersection of two-dimensional sketches, which is used to achieve efficient full intersection between voxels in two-dimensional sketches. The method for full intersection of two-dimensional sketches provided in the present application constructs a first bounding box for the first voxel in the target two-dimensional sketch, and when the ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch does not meet a preset threshold, performs a first intersection calculation on the second voxel in the target two-dimensional sketch and the first bounding box to obtain a first intersection result; then establishes a space partitioning index structure for the first bounding box, the space partitioning index structure includes the index of the first bounding box; performs a second intersection calculation on each target bounding box in the first bounding box and the bounding box in the index of the target bounding box and the bounding box in the parent index of the index to obtain a second intersection result, thereby achieving more efficient full intersection of two-dimensional sketches.

[0025] The two-dimensional sketch full-volume intersection method provided in the embodiments of the present application can be applied to computer devices such as desktop computers, notebooks, PDAs and cloud servers, mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPC), netbooks, personal digital assistants (PDA), etc. The embodiments of the present application do not impose any restrictions on the specific types of computer devices.

[0026] like Figure 1 As shown, the first aspect of the embodiment of the present application provides a two-dimensional sketch full-volume intersection acceleration method, comprising: Step S11, constructing a first bounding box for the first voxel in the target two-dimensional sketch.

[0027] In the application, the target two-dimensional sketch is a two-dimensional sketch that needs to be fully intersected (intersected for all voxels in the two-dimensional sketch). By constructing a bounding box for the first voxel, the representation of the voxel can be simplified. Representing the voxel by a bounding box can speed up the voxel search. In the application, the first bounding box can be an axis-aligned bounding box AABB (Axis-Aligned Bounding-Box), a spherical bounding box, an OBB (Oriented Bounding Box), etc. It can be understood that the first voxel is a voxel type that can construct a bounding box. There can be one or more first bounding boxes constructed for each first voxel.

[0028] Step S12, when the ratio of the number of second voxels in the target two-dimensional sketch to the number of first voxels does not meet a preset threshold, a first intersection calculation is performed on the second voxels in the target two-dimensional sketch and the first bounding box to obtain a first intersection result.

[0029] In the application, the first voxel is a voxel that can construct a bounding box, and the second voxel is a voxel that cannot construct a bounding box. When the ratio of the number of second voxels in the target two-dimensional sketch to the number of first voxels does not meet a preset threshold, a first intersection calculation is performed on each second voxel in the target two-dimensional sketch and each first bounding box of each first voxel to obtain a first intersection result.

[0030] Step S13: establishing a space partition index structure for the first bounding box, wherein the space partition index structure includes an index of the first bounding box.

[0031] Step S14, performing a second intersection calculation on each target bounding box in the first bounding box, the bounding box in the index of the target bounding box, and the bounding box in the parent index of the index to obtain a second intersection result.

[0032] In the application, by performing intersection calculations on each target bounding box in each first bounding box and the bounding box in the target bounding box's index and the bounding box in the index's parent index, it is possible to avoid performing intersection calculations on the bounding boxes in the sibling voxel index and its child voxel index, thereby accelerating the efficiency of intersection calculations. For example, if the current voxel has an intersection with the bounding box of a parent voxel, the child voxel bounding box of the parent voxel will continue to be queried, thus avoiding unnecessary calculations and reducing the amount of calculations for each intersection. If two voxels are located in different parts of the space, their bounding boxes will not intersect, thereby skipping those voxel areas that do not need to be calculated.

[0033] In one embodiment, the step S13 of establishing a space partition index structure for the first bounding box includes: Step S131, recursively divide the plane space of the target two-dimensional sketch into a quadtree structure according to a preset step size and a preset division threshold, and assign target index information to each target space obtained by the division.

[0034] In the application, the plane space of the target 2D sketch is divided into small blocks of uniform size using a preset step size (or resolution). When the number of objects in a region exceeds the preset division threshold or the side length of the region is greater than the preset division threshold, the region will be further divided.

[0035] Step S132: The target index information includes the target index of the target space and the index of the parent space of the target space; when the target space is not the minimum partition space, the target index information also includes the index of the child space of the target space.

[0036] In the application, in the quadtree structure constructed by dividing the plane space of the target two-dimensional graph, all target space nodes except the root node and the leaf node have a parent node and a child node, so their index information includes the index of their parent node target space and the index of their child node target space; the root node target space (the entire plane space) has no parent node target space, and its target index information includes the index of its child node target space; the leaf node target space has no child node target space, and its target index information includes the index of its parent node target space.

[0037] Step S133: for each target bounding box in the first bounding box, use the index of the minimum partition space of the target bounding box as the index of the target bounding box.

[0038] In the application, the minimum partition space is actually a kd tree (K-Dimensional Tree), and the leaf nodes of the kd tree are the target bounding boxes.

[0039] Step S134, deleting the paths in the quadtree structure that do not contain the bounding box.

[0040] In an application, the recursion depth is reduced by deleting the paths that do not contain the bounding box in the quadtree structure.

[0041] In the application, the root space is a two-dimensional Axis Aligned space with the maximum threshold side length. If the depth of the constructed tree is k, it means that the number of space division levels is k. Therefore, the time complexity of traversing all divided spaces is equal to the number of dimensions of the current divided space; and if the division method is four-division, the number is at least 4^k.

[0042] In one embodiment, the step of establishing a space partition index structure for the first bounding box includes: For each target bounding box in the first bounding box, find the spatial index corresponding to the target bounding box and add it to the index tree.

[0043] In the application, the corresponding spatial index is found according to the target bounding box and added to the index tree to build a spatial partition index structure, thereby reducing the construction time complexity from O(4^k) to O(kn), where k is the maximum depth of the index tree and n is the number of bounding boxes added to the index tree.

[0044] like Figure 2 As shown, in one embodiment, the method further includes: Step S15, constructing a hierarchical bounding volume structure for the first bounding box when the ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch meets a preset threshold.

[0045] Step S16: performing a first intersection calculation on the second voxel and the hierarchical bounding volume structure to obtain a first intersection result.

[0046] In the application, when the ratio of the number of the second voxels to the number of the first voxels in the target two-dimensional sketch meets the preset threshold, a hierarchical bounding volume structure, BVH (Bounding Volume Hierarchy), is constructed for the first bounding box, and then a first intersection calculation is performed on the second voxel and the hierarchical bounding volume structure to achieve partial intersection calculation of filtering the second voxel and all bounding boxes in the BVH structure. Through the hierarchical structure of BVH, the intersection calculation will first try to intersect the root node bounding box of the hierarchical bounding volume structure of the first voxel. If the intersection fails, the bounding boxes of the entire subtree and all its child nodes can be excluded. This greatly reduces the number of bounding boxes that need to be calculated.

[0047] In the application, when the ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch does not meet the preset threshold, hierarchical bounding volume construction is not performed to avoid the computational overhead of hierarchical bounding volume construction being greater than the overhead of filtering intersection calculation.

[0048] In one embodiment, the step S15, when the ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch meets a preset threshold, constructing a hierarchical bounding volume structure for the first bounding box includes: Step S151, when the ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch is greater than or equal to 2, constructing a hierarchical bounding volume structure for the first bounding box based on a surface area heuristic algorithm.

[0049] In the application, constructing a hierarchical bounding volume structure for the first bounding box based on the surface area heuristic algorithm SAH (Surface Area Heuristic) includes the following steps: Initial division: start construction by taking all bounding boxes as root nodes.

[0050] Recursive segmentation: For all bounding boxes in the current node, try different segmentation schemes (such as cutting at different positions along the x and y axes).

[0051] SAH is used to calculate the cost of each partitioning scheme and select the one with the lowest cost. The cost model of SAH takes into account the traversal cost: the fixed cost of visiting a node each time; the intersection test cost: the cost of performing intersection tests on all primitives in the leaf node; the partition surface area: the sum of the surface areas of the bounding volumes of the two newly created child nodes, and other cost factors. , where the total cost , represents the expected cost of visiting and processing a node and all its children, represents the basic cost of visiting an internal node, represents the probability of the ray hitting the i-th child node, is the bounding box of the ith node The cost of doing an intersection test. For a leaf node, this is usually the cost of doing an intersection test with all primitives within the node; for an internal node, it is the cost of further recursion. N is the number of child nodes, which is usually 2 in the case of a binary tree.

[0052] According to the selected segmentation scheme, the bounding box is assigned to the left and right child nodes.

[0053] If the number of bounding boxes in a child node exceeds a predetermined threshold, the above process is repeated; otherwise, the node is marked as a leaf node.

[0054] When the number of bounding boxes contained in a node is less than a certain threshold or no better segmentation can be found, the segmentation is stopped and the node is marked as a leaf node.

[0055] In one embodiment, before constructing a first bounding box for the first voxel in the target two-dimensional sketch, step S11 further includes: Step S101, obtaining all voxels in the target two-dimensional sketch.

[0056] Step S102: Divide all the voxels into first voxels and second voxels according to the type and geometric data of the voxels.

[0057] In the application, the voxel type and its bounding box construction and segmentation methods are as follows: Straight line: The length of a straight line is infinite and no enclosing or construction is required; Line segment: If the line segment is horizontal or vertical, taking a vertical line segment as an example, the side length of the bounding box in the perpendicular direction of the line segment is set to a minimum accuracy threshold, and the side length of the bounding box in the direction of the line segment is equal to the length of the line segment; if it is a normal line segment, the x and y coordinates of the lower left corner of the bounding box are the minimum x and y coordinates of the two end points of the line segment, and the x and y coordinates of the upper right corner of the bounding box are the maximum x and y coordinates of the two end points of the line segment; when the bounding box of a horizontal or vertical line segment is split, it can be split into two along the direction of the line segment; when a normal line segment is split, it is equivalent to reconstructing two bounding boxes with the midpoint and two end points of the line segment; Circle: Calculate the four tangent points of the circle and the horizontal and vertical lines. The bounding box can be constructed with the minimum and maximum x, y coordinates of the four tangent points. When segmenting, the four tangent points are combined to form the bounding boxes of four arcs. The segmentation of the arc bounding box refers to the direct segmentation part of the arc bounding box. Arc: Determine the span of the arc. If it does not pass through a single quadrant with the center of the circle as the origin, the minimum and maximum values ​​of the x and y coordinates of the starting point and the end point respectively form the two endpoints of the bounding box, and the bounding box segmentation can refer to the segmentation of general line segments and be recorded as direct segmentation; if the span of the arc passes through a single quadrant with the center of the circle as the origin, record the horizontal / vertical tangent points passed and take the minimum and maximum values ​​together with the x and y coordinates of the starting point and the end point to form the two endpoints of the bounding box. When the first segmentation is performed, the bounding box is constructed based on the horizontal / vertical tangent points, and the subsequent direct segmentation of the arc is referred to; Ellipse and elliptical arc: The bounding box construction of ellipse and elliptical arc refers to the bounding box construction of circle and arc, the difference lies in the calculation of horizontal / vertical tangent points of ellipse; Spline curve: Only non-closed spline curves with control points are considered. This application uses the bisection method based on the chord length ratio to divide the bounding box. When the arc length to chord length ratio of the spline curve is less than a certain threshold and the first-order partial derivatives of the starting point and the end point are in the same quadrant, it is considered that the bounding box formed by the two endpoints of the starting point contains the spline curve. Otherwise, the x and y coordinates of the two endpoints of the bounding box are the minimum values ​​of the x and y coordinates of all control points.

[0058] In one embodiment, before the step S13 establishes the space partition index structure for the first bounding box, it further includes: Step S121, in the first intersection calculation process, if the first bounding box to be segmented is segmented for the first time, segment the first bounding box and store the sub-bounding box information obtained by segmenting the first bounding box into an acceleration cache; The method further comprises: Step S17: in the first intersection calculation or the second intersection calculation process, if the first bounding box to be segmented is not segmented for the first time, obtaining sub-bounding box information of the first bounding box from the acceleration cache.

[0059] In the application, by storing the sub-bounding box information obtained by the first segmentation of the first bounding box into the acceleration cache, when the first bounding box needs to be segmented later, its sub-bounding box information can be directly obtained from the acceleration cache, avoiding repeated segmentation calculations, saving the cost of recalculating the sub-bounding boxes, and thus improving the overall intersection speed.

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

[0061] The embodiment of the present application also provides a two-dimensional sketch full-volume intersection acceleration system, which is used to execute the steps in the above two-dimensional sketch full-volume intersection acceleration method embodiment. The two-dimensional sketch full-volume intersection acceleration system can be a virtual device (Virtual Appliance) in a computer device, which is run by a processor of the computer device, or it can be the computer device itself.

[0062] like Figure 3 As shown, the embodiment of the present application provides a two-dimensional sketch full-volume intersection acceleration system 300, including: A bounding box construction module 301 is used to construct a first bounding box for a first voxel in the target two-dimensional sketch; A first intersection module 302 is used to perform a first intersection calculation on the second voxel in the target two-dimensional sketch and the first bounding box when the ratio of the number of the first voxel to the number of the second voxel in the target two-dimensional sketch does not meet a preset threshold, so as to obtain a first intersection result; A space partition index module 303, configured to establish a space partition index structure for the first bounding box, wherein the space partition index structure includes an index of the first bounding box; The second intersection module 304 is configured to perform a second intersection calculation on each target bounding box in the first bounding box, the bounding box in the index of the target bounding box, and the bounding box in the parent index of the index to obtain a second intersection result.

[0063] In one embodiment, the space partition index module 303 is used to: According to a preset step size and a preset division threshold, recursively divide the plane space of the target two-dimensional sketch into a quadtree structure, and assign target index information to each target space obtained by the division; The target index information includes the target index of the target space and the index of the parent space of the target space; when the target space is not the minimum partition space, the target index information also includes the index of the subspace of the target space; For each target bounding box in the first bounding box, taking the index of the minimum partition space of the target bounding box as the index of the target bounding box; The paths in the quadtree structure that do not contain the bounding box are deleted.

[0064] In one embodiment, the space partition index module 303 is used to: For each target bounding box in the first bounding box, find the spatial index corresponding to the target bounding box and add it to the index tree.

[0065] In one embodiment, the first intersection module 302 is further configured to: When a ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch meets a preset threshold, constructing a hierarchical bounding volume structure for the first bounding box; A first intersection calculation is performed on the second voxel and the hierarchical bounding volume structure to obtain a first intersection result.

[0066] In one embodiment, the first intersection module 302 is specifically configured to: When the ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch is greater than or equal to 2, a hierarchical bounding volume structure is constructed for the first bounding box based on a surface area heuristic algorithm.

[0067] In one embodiment, the 2D sketch full volume intersection acceleration system 300 further includes a voxel partitioning module, which is used to: Get all voxels in the target 2D sketch; All the voxels are divided into first voxels and second voxels according to the type and geometric data of the voxels.

[0068] In one embodiment, the two-dimensional sketch full-volume intersection acceleration system 300 further includes an acceleration cache module for: In the first intersection calculation process, if the first bounding box to be segmented is segmented for the first time, segmenting the first bounding box and storing sub-bounding box information obtained by segmenting the first bounding box into an acceleration cache; The method further comprises an accelerated segmentation module, which is used to: In the first intersection calculation process or the second intersection calculation process, if the first bounding box to be segmented is not segmented for the first time, the sub-bounding box information of the first bounding box is obtained from the acceleration cache.

[0069] In application, each module in the data verification device may be a software program module, or may be implemented by different logic circuits integrated in a processor, or may be implemented by multiple distributed processors.

[0070] Figure 4 This is a schematic diagram of the structure of a computer device provided in one embodiment of the present application. Figure 4 As shown, the computer device 4 of this embodiment includes: at least one processor 40 ( Figure 4 Only one is shown in the figure) a processor, a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40, wherein the processor 40 implements the steps in any of the above-mentioned two-dimensional sketch full-volume intersection acceleration method embodiments when executing the computer program 42.

[0071] The computer device may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that Figure 4 It is only an example of the computer device 4 and does not constitute a limitation on the computer device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.

[0072] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0073] In some embodiments, the memory 41 may be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 may also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the computer device 4. The memory 41 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 41 may also be used to temporarily store data that has been output or is to be output.

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

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

[0076] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.

[0077] like Figure 5 As shown, an embodiment of the present application provides a computer program product 5, including a computer program 50. When the computer program 50 is run, the steps in the above-mentioned two-dimensional sketch full intersection acceleration method embodiments are executed.

[0078] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device that can carry the computer program code to the device / computer device, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.

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

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

[0081] In the embodiments provided in the present application, it should be understood that the disclosed computer devices and methods can be implemented in other ways. For example, the computer device embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.

[0082] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

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

Claims

1. A two-dimensional sketch full-volume intersection acceleration method, characterized in that: include: constructing a first bounding box for a first voxel in the target two-dimensional sketch; When the ratio of the number of second voxels in the target two-dimensional sketch to the number of the first voxels does not meet a preset threshold, performing a first intersection calculation on the second voxels in the target two-dimensional sketch and the first bounding box to obtain a first intersection result; Establishing a space partitioning index structure for the first bounding box, wherein the space partitioning index structure includes an index of the first bounding box; A second intersection calculation is performed on each target bounding box in the first bounding box, the bounding box in the index of the target bounding box, and the bounding box in the parent index of the index to obtain a second intersection result.

2. The two-dimensional sketch full-volume intersection acceleration method according to claim 1, characterized in that: The step of establishing a space partition index structure for the first bounding box includes: According to a preset step size and a preset division threshold, recursively divide the plane space of the target two-dimensional sketch into a quadtree structure, and assign target index information to each target space obtained by the division; The target index information includes the target index of the target space and the index of the parent space of the target space; when the target space is not the minimum partition space, the target index information also includes the index of the subspace of the target space; For each target bounding box in the first bounding box, taking the index of the minimum partition space of the target bounding box as the index of the target bounding box; The paths in the quadtree structure that do not contain the bounding box are deleted.

3. The two-dimensional sketch full-volume intersection acceleration method according to claim 1, characterized in that: The step of establishing a space partition index structure for the first bounding box includes: For each target bounding box in the first bounding box, find the spatial index corresponding to the target bounding box and add it to the index tree.

4. The two-dimensional sketch full-volume intersection acceleration method according to any one of claims 1 to 3, characterized in that: The method further comprises: When a ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch meets a preset threshold, constructing a hierarchical bounding volume structure for the first bounding box; A first intersection calculation is performed on the second voxel and the hierarchical bounding volume structure to obtain a first intersection result.

5. The two-dimensional sketch full-volume intersection acceleration method as claimed in claim 4, characterized in that: When the ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch meets a preset threshold, constructing a hierarchical bounding volume structure for the first bounding box includes: When the ratio of the number of second voxels to the number of first voxels in the target two-dimensional sketch is greater than or equal to 2, a hierarchical bounding volume structure is constructed for the first bounding box based on a surface area heuristic algorithm.

6. The two-dimensional sketch full-volume intersection acceleration method according to claim 1, characterized in that: Before constructing the first bounding box for the first voxel in the target two-dimensional sketch, the method further includes: Get all voxels in the target 2D sketch; All the voxels are divided into first voxels and second voxels according to the type and geometric data of the voxels.

7. The two-dimensional sketch full-volume intersection acceleration method according to claim 1, characterized in that: Before establishing the space partition index structure for the first bounding box, the method further includes: In the first intersection calculation process, if the first bounding box to be segmented is segmented for the first time, segmenting the first bounding box and storing sub-bounding box information obtained by segmenting the first bounding box into an acceleration cache; The method further comprises: In the first intersection calculation process or the second intersection calculation process, if the first bounding box to be segmented is not segmented for the first time, the sub-bounding box information of the first bounding box is obtained from the acceleration cache.

8. A two-dimensional sketch full-volume intersection acceleration system, characterized in that: include: A bounding box construction module, for constructing a first bounding box for a first voxel in the target two-dimensional sketch; A first intersection module is used to perform a first intersection calculation on the second voxel in the target two-dimensional sketch and the first bounding box when the ratio of the number of the first voxel to the number of the second voxel in the target two-dimensional sketch does not meet a preset threshold, so as to obtain a first intersection result; A space partition index module, configured to establish a space partition index structure for the first bounding box, wherein the space partition index structure includes an index of the first bounding box; The second intersection module is used to perform a second intersection calculation on each target bounding box in the first bounding box, the bounding box in the index of the target bounding box, and the bounding box in the parent index of the index to obtain a second intersection result.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that The invention comprises a computer program, which, when executed, enables the method according to any one of claims 1 to 7 to be performed.

Citation Information

Patent Citations

  • Rapid intersection method for STL (stereo lithography) models of products

    CN102508973A

  • Collision detection method and system, computer equipment and storage medium

    CN114494602A

  • Fast retrieval method based on space division and model voxelization

    WO2024138878A1