CN117349914B - Boolean operation method based on surrounding number - Google Patents

Boolean operation method based on surrounding number Download PDF

Info

Publication number
CN117349914B
CN117349914B CN202311661470.8A CN202311661470A CN117349914B CN 117349914 B CN117349914 B CN 117349914B CN 202311661470 A CN202311661470 A CN 202311661470A CN 117349914 B CN117349914 B CN 117349914B
Authority
CN
China
Prior art keywords
nodes
intersecting
node
model
triangular
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311661470.8A
Other languages
Chinese (zh)
Other versions
CN117349914A (en
Inventor
谈玲
陈鹏
夏景明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Information Science and Technology
Original Assignee
Nanjing University of Information Science and Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University of Information Science and Technology filed Critical Nanjing University of Information Science and Technology
Priority to CN202311661470.8A priority Critical patent/CN117349914B/en
Publication of CN117349914A publication Critical patent/CN117349914A/en
Application granted granted Critical
Publication of CN117349914B publication Critical patent/CN117349914B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/10Geometric CAD
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Geometry (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • Mathematical Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Abstract

The invention discloses a Boolean operation method based on surrounding number, which is applied to basic geometric calculation of computer aided design software, the method searches intersecting line segments and grid surfaces by a three-dimensional surrounding number and a nearest distance method, calculates intersection points of the grid surfaces and the line segments, takes a chain type adjacency list as a storage structure and takes a triangular grid linked list as a topological structure description model, and mainly comprises the following steps: acquiring triangular mesh data of two intersecting models; searching for intersecting line segments based on a surrounding number method; searching the intersecting grid surface through the shortest distance; calculating an intersection ring chain; and traversing redundant nodes on the surface of the deletion model based on breadth first, and marking nodes in the loop chain. The invention quantitatively tracks the positions of the intersecting nodes through the surrounding numbers, thereby reducing the calculation amount for searching the intersecting points, in addition, the surrounding numbers are not influenced by the surface gaps, and the robustness of the algorithm is improved.

Description

Boolean operation method based on surrounding number
Technical Field
The invention belongs to the field of computer aided design, and particularly relates to a Boolean operation method for improving modeling accuracy and calculation efficiency in three-dimensional modeling and engineering analysis.
Background
Boolean operation is a core technology in industrial design and computer aided design, and is widely applied to a plurality of industries such as mechanical engineering, architectural design, three-dimensional printing, game development, film making and the like. In particular, such algorithms play an indispensable role in dealing with the construction, modification and analysis of complex geometries. Particularly, with the rise of three-dimensional printing technology, precise and efficient boolean operations on geometric objects are becoming urgent needs of the industry. Traditional boolean operation methods often suffer from low computational efficiency and poor stability when dealing with complex models or grid-dense scenes. Especially in the field of high-precision industrial simulation, designers often need to quickly and accurately modify and check the geometry of complex workpieces, and the prior art often has difficulty meeting these high-standard real-time boolean operation requirements.
In addition, the self-intersection, the void and other surface defects commonly found in the geometric model can cause great interference to the traditional Boolean operation method, and influence the reliability of the operation result. And the Boolean operation method based on the surrounding number can effectively solve the problems. The surrounding number method utilizes the characteristics of mathematical continuity and discontinuous boundary conditions, and can accurately judge the relative position relation between the spatial midpoint and the model even if the geometric model has defects, thereby greatly improving the stability and accuracy of Boolean operation.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, provides a high-efficiency stable Boolean operation method, and realizes more accurate geometric model processing through an improved data structure and algorithm flow. The Boolean operation method based on the surrounding number can greatly improve the calculation efficiency, reduce unnecessary node search time, and improve the robustness of the algorithm when facing complex geometric bodies through novel algorithm design, and particularly can keep high stability and reliability when facing geometric models containing self-intersecting and gaps. Provides a new solving way for the calculation problems in the fields of high-precision industrial design, simulation analysis, rapid prototype development and the like.
The technical scheme of the invention comprises a series of steps from model data input to triangular mesh reconstruction, including surrounding number calculation, intersecting line segment searching, intersection point solving and final Boolean operation type determination and execution. Each step is carefully designed to ensure that the calculated amount is reduced in the operation process, the operation path is optimized, and the purpose of improving the overall Boolean operation performance is achieved.
The technical scheme is as follows: the invention discloses a Boolean operation method based on a surrounding number, which comprises the following steps:
step 1, respectively obtaining two triangular models of a target workpieceABSTL data of (a);
step 2, two triangle models are formedABSTL data of (1) is converted into a linked list taking grid nodes as root nodes;
step 3, searching two triangle models based on a surrounding number methodABIntersecting line segments between;
step 4, searching triangular patches of the intersecting line segments by using a surrounding number method;
step 5, solving an intersection point set through the intersection line segment and the corresponding triangular patch;
step 6, solving the internal nodes and the intersecting surfaces of the intersection point set;
step 7, adding and deleting calculation is carried out on the intersecting surfaces according to the Boolean operation type;
step 8, reconstructing two triangle modelsABEdge structure of STL data, updating triangle modelABAnd checking the target workpiece.
Further, the step 2 specifically includes: the STL data of the model is converted into a linked list structure taking grid points as root nodes, a dynamic grid node vector is constructed, adjacent relations among nodes are constructed, each triangular grid point is used as a root node to establish a linked list, the linked list is inserted according to the adjacent relations of the triangular grid, the method is that triangular grid nodes are traversed sequentially, all grid node subscripts adjacent to the nodes are searched, and the adjacent nodes serving as the nodes are inserted into the linked list structure taking the nodes as the table heads.
Further, the step 3 specifically includes: sequentially traversing triangular mesh nodesATriangular grid node of modelaUp to the nodeaIs positioned atBInside the model, by calculationAModel surface nodeaAnd modelBComputing the sum of solid angles for all triangles of a surfacesumComparing the value with the boundary range to judge the nodeaAnd modelBIf the spatial relationship of (a)sumOutside the boundary range, then the nodeaIn the modelBOutside, ifsumWithin the boundary range, then the nodeaIn the modelBIf the point is in the modelBInternally, and when the nodeaThere is a certain neighboring nodeb,bNode is located modelBExternal time of (2) then nodea,bThe two points form an intersecting node pair; using adjacent node marking methods, in known node pairsa,bOn the basis of (a), traverseaAdjacent node of (a)cWhen (when)cNot be ofbAnd is also provided withcIs positioned on the modelBAnd (2) outside of andcthere is also a certain neighboring nodedThe nodedIs positioned on the modelBInside (1) thencdThe node is the target node, which willc,dThe nodes are input as recursive calculations of the next pair of intersecting node pairs until the modelAAll the intersecting node pairs are calculated, and a model is judged by judging whether the external node sets of all the intersecting node pairs are adjacent to each other or not to form a ringAWhether the computation is complete or not for all intersecting node pairs.
Further, the step 4 specifically includes: traversingBJudging whether the current triangular surface intersects with an intersecting node pair, wherein the intersecting node pair isa,bTriangle vertexx,y,zCalculating a vectorxyAndxais calculated again as the cross product of (2)xyAnd (3) withxbIf the sign of the two cross products is the same, the intersecting node pair is not intersected with the triangular surface, if the sign is opposite, the intersecting node pair is possibly intersected, then the intersection point of the intersecting line segment and the plane of the triangular surface patch is calculated, and the surrounding number of the intersection point and the triangular surface patch is calculated based on a two-dimensional plane surrounding number methodwIf (if)wWithin the boundary range, the triangular face intersects with the intersecting node pair ifwOutside the boundary range, the triangle does not intersect the intersecting node pair.
Further, the step 5 specifically includes: and calculating to obtain node pairs of all grid planes and corresponding line segments, and calculating the intersection points when judging whether the node pairs intersect with the triangles, discarding intersection point sets which do not intersect with the corresponding triangular planes, wherein the rest intersection point sets are all intersection node sets, and calculating the intersection points of the two intersection point sets.
Further, the step 6 specifically includes: the intersecting nodes are used as boundary points, the intersecting nodes are connected at one time according to the adjacent sequence of the intersecting node pair set to form an intersecting ring chain, and a calculation model is calculatedBThe distance between the triangle vertex and the intersection point is taken as the corresponding point of the intersection point, the coordinates of the corresponding point are stretched to the intersection point, the corresponding point set of all the intersection point sets is calculated, all the corresponding points are sequentially connected according to the connection sequence among all the intersection points in the intersection point set to form a corresponding point ring chain, any point of the corresponding point set is taken as an initial node, the corresponding point ring chain is taken as a boundary, and the corresponding point ring chain passes inside the corresponding point ring chainThe topology sequence is traversed in breadth first, all nodes are marked, and the marked nodes form internal nodes of the corresponding point ring chain.
Further, the step 7 specifically includes: screening nodes of the intersecting surfaces according to Boolean operation, if the Boolean calculation type is a modelAAnd modelBThe intersection is calculated again according to the steps 1 to 6AThe intersecting surface nodes on the model are deleted respectivelyAMiddle non-intersecting surface node and deleting modelBMerging the rest nodes; if the Boolean calculation type isAAnd (3) withBCombining, deleting the models respectivelyAAnd modelBMerging the remaining nodes; if the Boolean calculation type isAAnd (3) withBDifference is found, then deleteAThe intersection surface node in (a) is deletedBThe non-intersecting surface nodes in (a) and merging the remaining nodes.
Further, the step 8 specifically includes: and extending and contracting the corresponding points to the positions of the intersections through the corresponding relation between the nodes of the intersection ring chain and the nodes of the corresponding point ring chain to obtain updated triangular grid and coordinate data, traversing the triangular grid and coordinate data sequentially through a marking method, and outputting all the triangular grid data from the cache to an STL format.
Further, the invention discloses a communication device, comprising a processor and a memory, wherein the memory is used for storing a computer program; the processor is configured to execute the computer program to implement the method.
Further, the present invention discloses a computer readable storage medium having stored therein computer executable instructions which when executed by a processor are adapted to carry out the method.
The beneficial effects are that: compared with the prior art, the invention has the following remarkable advantages:
(1) The invention quantitatively evaluates the positions of the nodes through the surrounding numbers, and when the input grid contains self-intersecting and gaps, the continuous nature and discontinuous boundary conditions of the surrounding numbers in the space range enable the surrounding numbers to robustly judge the space relation between the nodes and the model, thereby improving the stability of the algorithm.
(2) According to the method, the search of irrelevant nodes is avoided through the traversing method of the adjacent nodes, the Boolean operation time is effectively reduced, meanwhile, the searching range is reduced by searching the grid surface corresponding to the intersecting line segment through the breadth-first traversing method, and the algorithm efficiency is improved.
Drawings
FIG. 1 is a general flow chart of the present invention;
FIG. 2 is a diagram of a grid linked list of the present invention;
FIG. 3 is a schematic diagram of the wrap-around calculation of the present invention;
FIG. 4 is a plot of the intersection location of the present invention;
FIG. 5 is a flow chart of nodes inside a search intersecting line segment according to the present invention;
FIG. 6 is a flow chart of finding intersecting line segments of the present invention;
FIG. 7 is a grid node intersection schematic of the present invention;
FIG. 8 is a schematic diagram illustrating the intersection of a judgment triangle and a line segment according to the present invention;
FIG. 9 is a schematic diagram of the intersection point calculation of the present invention;
FIG. 10 is a schematic diagram of the edge node, intersecting node, internal node distribution of the present invention;
FIG. 11 is a schematic illustration of the intersection node telescoping computation of the present invention;
FIG. 12 is a Boolean differencing test result of the present invention;
FIG. 13 is a Boolean union test result of the present invention;
FIG. 14 is a Boolean intersection test result of the present invention;
FIG. 15 is a graph of the efficiency of the present invention versus the CORK, meshLab algorithm.
Detailed Description
The technical scheme of the invention is further described below with reference to the accompanying drawings.
As shown in fig. 1, the present invention provides a boolean difference operation method based on a surrounding number, comprising the following steps:
step 1, inputting model data;
step 2, the mould is moldedSTL data is converted into a linked list with grid nodes as root nodes, and the grid nodes are dynamically constructed as shown in figure 2vectorEach element serves as a root node to establish a linked list. According to the adjacent relation of triangular grids, linked lists are inserted, as in FIG. 2, triangular grid model nodes 0, 1, 2, 3, etc. with coordinates added tovectorIn the method, the adjacent points of the node 0 are 2, 3, 4 and 5, thenNode 0 is a root node, and a one-way linked list is constructed, wherein the root node 0 points to node 2, the node 2 points to 3, and the node 3 points to 4 in the figure.
Step 3, searching intersecting line segments based on a surrounding number method: calculation modelANumber of wraps of a node relative to the B model:. Wherein the method comprises the steps ofpFor the node->Is the solid angle of the point relative to the triangular mesh, triangle +.>Relative to the originOIs +.>Is provided with->,/>,/>The solid angle is calculated as:
as shown in fig. 3, due to the solid angle of the unit sphereAnd is->I.e. +.>1, then when the node is inside the model, +.>When the node is outside the model, the node,when a node is located on the model, +.>The distribution of the positions of the intersections is shown in fig. 4. By defining the boundary condition to obtain the position relation between the node and the model, the flow chart is shown in figure 5, figure 5 illustrates the flow of searching the internal node of the intersecting line segment based on the round number method, and the model is calculatedANode in (a)iAnd modelBThe sum of the solid angles of all triangular patches in (a)WBy encircling the numberWComparing with boundary condition, determiningiWhether or not to be in the modelBIf not, continue in the modelAContinues to search nodes until the first model is foundBInternal nodes. The flow chart for finding all the intersecting line segments is shown in FIG. 6, because in the triangular meshes, the intersecting nodes are adjacent to each other between meshes, i.e. distributed in the modelAIntersecting line segment node pairs in triangular meshesIs adjacent in turn, i.e. node +.>And node->Adjacent, find algorithm slave modelBA kind of electronic devicevectorFind in +.>Slave chain, which is a linked list of root nodesSearching intersecting line segment node pairs in nodes of the table>I.e.And satisfy->New intersecting line segment node pairs due to intersecting line segments and modelsAIs connected end to end as shown in FIG. 7, FIG. 7 includes an internal node and an external node, node pairs of intersecting line segments +.>In,afor external node->As internal nodes, since the intersecting points are continuous in the triangular mesh, the external nodes of the intersecting node pair are adjacent to each other, i.e., in +.>And->In the node point of the network, the node point,aand (3) withbNode adjacency due toAA kind of electronic devicevectorIn order to getaA linked list of the root node is used as the adjacent node thereof byvectorAll neighboring nodes can be quickly found, fig. 7aAdjacent node +.>The nodes judge in turn and receive the information>Is an internal node, unconditionally, +.>The number of windings of (2) satisfies the condition, and +.>Adjacent node of node->The condition of the internal nodes is met, namely, two adjacent intersecting line segment nodes can be identical to the internal nodes, and the external nodes cannot be identical. In addition, the intersecting node pairs iteratively search for external nodes, i.ea,b,c,dUp tomNode, when algorithm is fromvectorTo search formWhen the node is a linked list of root nodes, the adjacent nodes are +.>Then due to->Has been already an external node->,Having been marked as an internal node, the algorithm cannot find a new and not marked as an external nodemStopping searching when adjacent nodes are located, and finishing searching all the node pairs of the intersecting line segments by the algorithm, namely, node pairs
Step 4, searching the intersecting grid surface by a surrounding numerical method, and calculating the node pairs of the intersecting line segments and the model by the step 3BIntersecting, and accurate calculation of intersecting points, i.e. calculation of intersecting surfaces and intersecting triangular mesh surfaces, modelBIs in one-to-one correspondence with the intersecting line segment nodes. According to the invention, all the line segments and the triangular mesh surfaces are searched by calculating the shortest distance between the line segments and the triangular mesh surfaces. As shown in fig. 8, fig. 8 illustrates how a line segment is determined to intersect a triangular mesh surface. The steps are as follows
1. Three vertices of the triangle and two endpoints of the line segment are determined.
2. The three vertices of the triangle are named sequentiallyA,B,CThe two endpoints of the line segment are named asPAndQ
3. judgingWhether the two endpoints of the line segment are on the same side of the triangle. The judgment can be made using the normal vector of the triangle and the positional relationship of the points. Calculating vectorsABSum vectorAPIs calculated again as the cross product of (2)ABAndAQis a cross product of (a). If the directions of the two cross products are the same, then P and Q are on the same side of the triangle, and do not intersect; if the two cross products are in different directions, then P and Q may intersect on both sides of the triangle; if one of the cross products is zero, indicating that one end of the line segment is on a triangle, it can also be considered an intersection.
4. And judging whether the intersection point of the line segment and the plane of the triangle patch is in the triangle or not. And (3) combining the linear equation where the line segments are positioned with the triangular plane equation, and solving the intersection point of the linear equation and the triangular plane equation. As shown in FIG. 8, the solved line segmentsPQAnd triangular dough sheetABCThe intersection point isIPoint, the algorithm calculates through the number of circles of the two-dimensional planeIThe points are plane and triangleABCJudging whether the position relationship of the line segment is in the triangle or not, if so, determining the line segmentPQIntersecting with the triangle patch, if not, then not intersecting. As shown in fig. 8, the angle is calculatedAIBBIC,CIASum of them andthe ratio of (2) is the number of windings.
Step 5, calculating an intersection point set, and calculating an intersection line segment node pair and a model calculated in the step 4BThe intersection set is calculated and the flow is shown in fig. 9. Cycling through intersecting nodes to data setslRecirculating through the modelBTriangular mesh onfJudging whether the segment nodes are in the process of calculating the intersection points according to the step 3fOn both sides of the plane, if not, the triangular surface patchfIs not in contact withlIntersecting, and continuing to traverse the next triangular patch; if yes, calculatelAnd (3) withfIs the intersection of (2)iCalculating the intersection pointiAt the position offOn plane andfis the number of turns aroundWJudging whether it is infAnd if so, adding the intersection point into the intersection point set, otherwise, continuing traversing the next triangle patch.
Step 6, solving the internal nodes of the intersection point setAn intersection surface node; the foregoing has described how to solve for pairs of intersecting link chain nodes, i.e., as shown in FIG. 7, the set of external nodes, i.e., nodes, of the intersecting node pairsa-b-c-d-e-f-g-h-i-j-k-l- mThe algorithm uses breadth-first traversal, arbitrarily in the modelBSelecting vector node where intersection node pair is locatedaSelecting adjacent nodes positioned in the intersecting loop chainThen use +.>And performing breadth-first traversal for the root node, and solving all internal nodes. Similarly, for the modelARepeating the steps to solve all the internal nodes.
And 7, screening nodes of the intersecting surface according to Boolean operation. If the Boolean calculation type isAAnd (3) withBThe models are deleted respectively when the intersection is foundAMiddle non-intersecting surface node and deleting modelBMerging the rest nodes; if the Boolean calculation type isAAnd (3) withBCombining, deleting the models respectivelyAAnd modelBAnd merging the remaining nodes. If the Boolean calculation type isAAnd (3) withBDifference is found, then deleteAThe intersection surface node in (a) is deletedBThe non-intersecting surface nodes in (a) and merging the remaining nodes. The method comprises the steps of 1, deleting nodes and adjacent relations, inquiring adjacent nodes of array elements to be deleted in a marking model, and deleting node elements of a corresponding linked list of the nodes. Extending and retracting edge nodes to intersection points, as shown in fig. 10 and 11, edge node setStretch to->The adjacency relation is preserved.
And 8, updating the model, wherein the STL data of the model A and the model B record the triangular relationship and the node data, and the step 6 marks all the deleted nodes.
Algorithm efficiency test:
as shown in fig. 12 to 14, the boolean operation method based on the number of circles is tested, and a bear and a cube model are tested, and difference, merging and intersection are calculated respectively, and the result is shown in fig. 12.
In order to show the performance difference between the method and other methods, test models consisting of different numbers of triangles are constructed, boolean calculation is performed respectively, and the calculation time under different numbers of triangles is shown as shown in FIG. 15. When the number of the inputted triangles is large, the advantages of the algorithm are more remarkable, and the Boolean calculation efficiency is obviously faster than that of main stream algorithms such as CORK, meshLab and the like.
TABLE 1
The above embodiments are only for illustrating the technical idea of the present invention, and the protection scope of the present invention is not limited thereto, and any modification made on the basis of the technical scheme according to the technical idea of the present invention falls within the protection scope of the present invention.

Claims (7)

1. The Boolean operation method based on the surrounding number is characterized by comprising the following steps:
step 1, respectively acquiring STL data of two triangular models A, B of a target workpiece;
step 2, converting STL data of two triangle models A, B into a linked list with grid nodes as root nodes;
step 3, searching an intersecting line segment between two triangle models A, B based on a surrounding number method;
the method comprises the following steps: sequentially traversing triangular grid nodes a of a triangular grid node A model until the nodes a are positioned in a model B, calculating the sum of solid angles of all triangles on the surface of the model A and the surface of the model B by calculating the sum of the solid angles of the nodes a and the surface of the model B, comparing the sum with a boundary range to judge the spatial relationship between the nodes a and the model B, if the sum is out of the boundary range, the nodes a are outside the model B, if the sum is in the boundary range, the nodes a are inside the model B, if the nodes are inside the model B, and when a certain adjacent node B exists in the node a and the node B is outside the model B, two points of the nodes a and B form an intersecting node pair; traversing adjacent nodes c of a on the basis of known node pairs a and B, and judging whether all the intersecting node pairs in the model A are calculated by judging whether all the intersecting node pairs in the model A are adjacent to each other or not through whether the external node sets of all the intersecting node pairs are adjacent to each other or not to form a ring shape when c is not B and c is located outside the model B and a certain adjacent node d exists in c, wherein the node d is located inside the model B;
step 4, searching triangular patches of the intersecting line segments by using a surrounding number method;
the method comprises the following steps: traversing a triangular surface patch of a B model, judging whether a current triangular surface is intersected with an intersecting node pair, wherein the intersecting node pair is a, B triangular vertex x, y and z, calculating a cross product of vectors xy and xa, calculating a cross product of vectors xy and xb, if the sign of the two cross products is the same, the intersecting node pair is not intersected with the triangular surface, if the sign is opposite, the intersecting line segment is possibly intersected with the plane of the triangular surface patch, calculating the intersection point of the intersection point and the plane of the triangular surface patch based on a two-dimensional plane surrounding number method, calculating the surrounding number w of the intersection point and the triangular surface patch, if w is in the boundary range, the triangular surface is intersected with the intersecting node pair, and if w is outside the boundary range, the triangular surface is not intersected with the intersecting node pair
Step 5, solving an intersection point set through the intersection line segment and the corresponding triangular patch;
step 6, solving the internal nodes and the intersecting surfaces of the intersection point set;
the method comprises the following steps: the method comprises the steps of using intersecting nodes as boundary points, connecting the intersecting nodes at one time according to the adjacent sequence of intersecting node pair sets to form an intersecting point ring chain, calculating the distance between triangle vertexes and intersecting points of a model B, taking shortest distance vertexes as corresponding points of the intersecting points, stretching coordinates of the corresponding points to the intersecting points, calculating corresponding point sets of all intersecting point sets, connecting all corresponding points in sequence according to the connection sequence among all intersecting points in the intersecting point sets to form the corresponding point ring chain, using any point of the corresponding point sets as an initial node, using the corresponding point ring chain as a boundary, performing breadth-first traversal in the corresponding point ring chain through topological sequence, marking all nodes, and marking all marked nodes to form internal nodes of the corresponding point ring chain;
step 7, adding and deleting calculation is carried out on the intersecting surfaces according to the Boolean operation type;
and 8, reconstructing the edge structures of the STL data of the two triangular models A, B, updating the triangular model A, B, and checking the target workpiece.
2. The boolean operation method based on the surrounding number according to claim 1, wherein the step 2 is specifically: the STL data of the model is converted into a linked list structure taking grid points as root nodes, a dynamic grid node vector is constructed, adjacent relations among nodes are constructed, each triangular grid point is used as a root node to establish a linked list, the linked list is inserted according to the adjacent relations of the triangular grid, the method is that triangular grid nodes are traversed sequentially, all grid node subscripts adjacent to the nodes are searched, and the adjacent nodes serving as the nodes are inserted into the linked list structure taking the nodes as the table heads.
3. The boolean operation method based on the surrounding number according to claim 1, wherein the step 5 is specifically: and calculating to obtain node pairs of all grid planes and corresponding line segments, and calculating the intersection points when judging whether the node pairs intersect with the triangles, discarding intersection point sets which do not intersect with the corresponding triangular planes, wherein the rest intersection point sets are all intersection node sets, and calculating the intersection points of the two intersection point sets.
4. The boolean operation method based on the surrounding number according to claim 1, wherein the step 7 is specifically: screening nodes of the intersecting surface according to Boolean operation, if the Boolean calculation type is that the model A and the model B are intersected, calculating the nodes of the intersecting surface on the model A again according to the steps 1 to 6, deleting non-intersecting surface nodes in the model A respectively, deleting non-intersecting surface nodes in the model B, and merging the rest nodes; if the Boolean calculation type is that A and B are combined, respectively deleting the nodes of the intersection surfaces of the model A and the model B, and merging the rest nodes; if the Boolean calculation type is that A and B are differenced, deleting the intersecting surface nodes in A, deleting the non-intersecting surface nodes in B, and merging the rest nodes.
5. The boolean operation method based on the surrounding number according to claim 1, wherein the step 8 is specifically: and extending and contracting the corresponding points to the positions of the intersections through the corresponding relation between the nodes of the intersection ring chain and the nodes of the corresponding point ring chain to obtain updated triangular grid and coordinate data, traversing the triangular grid and coordinate data sequentially through a marking method, and outputting all the triangular grid data from the cache to an STL format.
6. A communication device comprising a processor and a memory, wherein the memory is for storing a computer program; the processor is configured to execute the computer program to implement the method of any one of claims 1-5.
7. A computer readable storage medium having stored therein computer executable instructions which when executed by a processor are for implementing the method of any of claims 1-5.
CN202311661470.8A 2023-12-06 2023-12-06 Boolean operation method based on surrounding number Active CN117349914B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311661470.8A CN117349914B (en) 2023-12-06 2023-12-06 Boolean operation method based on surrounding number

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311661470.8A CN117349914B (en) 2023-12-06 2023-12-06 Boolean operation method based on surrounding number

Publications (2)

Publication Number Publication Date
CN117349914A CN117349914A (en) 2024-01-05
CN117349914B true CN117349914B (en) 2024-03-08

Family

ID=89367226

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311661470.8A Active CN117349914B (en) 2023-12-06 2023-12-06 Boolean operation method based on surrounding number

Country Status (1)

Country Link
CN (1) CN117349914B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510225A (en) * 2009-03-26 2009-08-19 山东理工大学 STL model boolean operation method of products
CN105022865A (en) * 2015-06-30 2015-11-04 西安交通大学 STL model Boolean calculation based method for extracting inner surface model of fuel tank in airplane
CN106952324A (en) * 2017-04-07 2017-07-14 山东理工大学 The parallel overlap-add procedure device and method of vector polygon rasterizing
CN112288874A (en) * 2020-10-20 2021-01-29 哈尔滨工程大学 Gamma radiation modeling calculation simulation method based on CAD model and Boolean operation
CN115270500A (en) * 2022-08-10 2022-11-01 南京信息工程大学 Boolean difference calculation method and device and electronic equipment
CN115859524A (en) * 2022-12-21 2023-03-28 南京信息工程大学 Cylinder Boolean difference calculation method based on STL model

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510225A (en) * 2009-03-26 2009-08-19 山东理工大学 STL model boolean operation method of products
CN105022865A (en) * 2015-06-30 2015-11-04 西安交通大学 STL model Boolean calculation based method for extracting inner surface model of fuel tank in airplane
CN106952324A (en) * 2017-04-07 2017-07-14 山东理工大学 The parallel overlap-add procedure device and method of vector polygon rasterizing
CN112288874A (en) * 2020-10-20 2021-01-29 哈尔滨工程大学 Gamma radiation modeling calculation simulation method based on CAD model and Boolean operation
CN115270500A (en) * 2022-08-10 2022-11-01 南京信息工程大学 Boolean difference calculation method and device and electronic equipment
CN115859524A (en) * 2022-12-21 2023-03-28 南京信息工程大学 Cylinder Boolean difference calculation method based on STL model

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Boolean operations of STL models based on loop detection;K.-B. Guo 等;《The International Journal of Advanced Manufacturing Technology 》;第33卷;627–633 *
复杂开曲面的鲁棒布尔运算;刘凯正 等;《图学学报》;第41卷(第1期);1-9 *

Also Published As

Publication number Publication date
CN117349914A (en) 2024-01-05

Similar Documents

Publication Publication Date Title
US7372460B2 (en) Method and program for generating volume data from boundary representation data
Hu et al. Robust interval algorithm for curve intersections
CA2852706A1 (en) Compression and decompression of a 3d modeled object
CN113650301B (en) 3D printing filling path planning method based on level set
JP3988925B2 (en) Numerical analysis system using mixed grid type solution adaptive grid method
CN115270500A (en) Boolean difference calculation method and device and electronic equipment
CN113987610B (en) Matching method of different-resolution clothing curved surface meshes based on mesh mapping
CN113742829B (en) Method for reading and processing arbitrary section of bridge structure and calculating section characteristics
CN114861500A (en) Method and system for automatically generating tunnel structure finite element model based on three-dimensional point cloud
CN117349914B (en) Boolean operation method based on surrounding number
CN115859524B (en) Cylinder Boolean difference operation method based on STL model
Wang et al. Application of A* algorithm in intelligent vehicle path planning
Quadros et al. LayTracks: a new approach to automated geometry adaptive quadrilateral mesh generation using medial axis transform
CN108493931B (en) Electric power system static voltage stable domain boundary approximation method based on space tangent vector
CN113111612B (en) Discrete point cloud repeated point fast searching method based on self-adaptive space subdivision
Wei et al. A point clouds fast thinning algorithm based on sample point spatial neighborhood
Qi et al. Robust slicing procedure based on surfel-grid
Srinivas et al. Surface design using cyclide patches
CN112149244A (en) Method for planning contour line processing track in material increase and decrease manufacturing
Shen et al. An adaptive triangulation optimization algorithm based on empty circumcircle
Ma et al. An automated approach to quadrilateral mesh generation with complex geometric feature constraints
CN110868325B (en) Uniform grid division method capable of reducing rigidity matrix construction difficulty
CN112581625B (en) Method for embedding overlapped grid boundary
Jablokow et al. Topological and geometric consistency in boundary representations of solid models of mechanical components
CN115828774A (en) Cartesian grid generation algorithm based on region growing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant