Building design modeling method and system based on parameter entity and boolean relationship thereof
By dividing the grid in architectural design and using the isosurface of the signed distance field for geometric topology integration, the problems of low efficiency in modeling complex geometries and unstable topology analysis in existing technologies are solved, realizing fast and accurate modeling of complex geometries and improving computational efficiency and robustness.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- ZHEJIANG UNIV
- Filing Date
- 2026-01-13
- Publication Date
- 2026-05-12
AI Technical Summary
Existing technologies struggle to efficiently and accurately model complex geometries based on implicit surfaces and Boolean operations in architectural design, particularly exhibiting low computational efficiency and unstable topology analysis when dealing with complex Boolean operations.
An improved modeling method is adopted, which divides a preset mesh in a limited space and extracts the effective part, uses the isosurface of the signed distance field for geometric topological integration, generates an approximate geometric mesh step by step, and designs a two-level structure to define the data structure of the geometry and Boolean operation tree, thereby optimizing the data storage and query process.
It enables rapid modeling of complex geometries composed of simple geometries through Boolean operations, improves the robustness and computational efficiency of topology analysis, is applicable to architectural design scenarios, and has wide applicability.
Smart Images

Figure CN121502893B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer-aided design and manufacturing, and relates to a method and system for architectural design modeling based on parametric entities and their Boolean relationships. Background Technology
[0002] Computer-aided design (CAD) is an applied science that integrates mathematics, computer science, and other disciplines. Its core lies in the study of how to construct and manipulate geometric shapes. Due to its controllability, accuracy, intuitiveness, and efficiency, CAD technology has been widely applied in the design and production processes of various manufacturing industries. Currently, this technology has become an important component in fields such as mechanical engineering, electronic engineering, civil engineering, aerospace, and animation / games.
[0003] A CAD kernel is a type of software component that is essentially the computational core and geometric engine of CAD software. It encapsulates the core algorithms and data structures for processing geometric shapes, providing a solid geometric modeling foundation for upper-level CAD applications. A mature CAD kernel typically possesses the capabilities to generate and represent curves and surfaces, construct solid models, implement geometric transformations (translation, rotation, scaling) and complex Boolean operations (union, intersection, difference), and handle topological relationships between geometric entities. Architecturally, CAD kernels generally adopt object-oriented design principles, abstracting complex geometric operations into callable programming interfaces by defining classes (such as points, lines, surfaces, and volumes) and methods (such as intersection and stitching). This allows developers to directly utilize these optimized low-level functions within a specific programming environment, significantly reducing the workload of developing from scratch and ensuring that the final application exhibits superior performance and stability when handling complex designs.
[0004] As an application area of CAD software systems, architectural design requires modeling the shape and basic structure of buildings, which involves large-scale complex surface modeling scenarios. This requires the corresponding CAD kernel to provide surface and body modeling capabilities with both good performance and accuracy. At the same time, architectural design also involves a large number of Boolean operations between geometric entities, such as drilling holes in walls to install windows. Considering that many of these entities have curved or surface-shaped boundaries, the CAD software system must also ensure the correctness of the Boolean operation results for these entities, which requires the CAD kernel to have robust Boolean operation processing capabilities.
[0005] Over the decades, CAD surface modeling has developed into a geometric theoretical system based on two representation methods: NURBS parametric surfaces and implicit surfaces, and three processing methods: interpolation, fitting, and approximation. Meanwhile, independent surfaces often form a unified model through complex Boolean operations. Therefore, the watertightness and computational efficiency of Boolean operations have a crucial impact on the stability and reliability of 3D modeling capabilities. NURBS parametric surfaces are difficult to handle complex Boolean operations watertightly because such operations require intersection calculations on the NURBS parametric surfaces, making it very challenging to simultaneously improve accuracy, stability, and efficiency. Implicit surfaces, on the other hand, are defined by the signed distance from a point in space to its nearest surface, thus possessing clear internal and external distinctions, easy geometric boundary determination, and sound mathematical properties. This makes handling complex Boolean operations intuitive and straightforward, ensuring model watertightness when the surface itself is well-defined.
[0006] When dealing with modeling problems based on implicit surfaces and Boolean operations, an effective approach is to discretize and polygonize the implicit surfaces within a given spatial range and precision, thereby constructing a geometrically and topologically defined network. In this approach, some researchers choose to first construct an explicit background mesh, then consider the implicit surfaces one by one, using the functional definition of the implicit surfaces to subdivide the background mesh (e.g., Bagley B, Sastry SP, Whitaker R T. AMarching-tetrahedra Algorithm for Feature-preserving Meshing of Piecewise-smooth Implicit Surfaces[J]. Procedia Engineering, 2016, 163: 162-174 and Guo J, Wang X, Wang J, et al. Three-dimensional geological modeling and spatial analysis from geotechnical borehole data using an implicit surface and marching tetrahedra algorithm[J]. Engineering Geology, 2021, 284: 106047.). However, due to the constraints of implicit function values on grid point coordinates and numerical precision, such methods may produce erroneous or discontinuous geometric structures. Other researchers choose to construct solid networks for each implicit surface separately (e.g., Doi A, Koide A. An Efficient Method of Triangulating Equi-Valued Surfaces by Using Tetrahedral Cells[J]. Ieice Trans, 1991, E74-D(1): 214-224.), and then combine these networks through intersection relationships; however, this method often has low computational efficiency. Currently, efficiently and accurately calculating polygonal networks composed of three-dimensional implicit surfaces remains a challenge.
[0007] Based on this, the present invention proposes an improved rapid modeling method and system to solve the problem of efficient and accurate modeling of complex geometric shapes composed of simple geometric shapes through Boolean operations in architectural design scenarios. Summary of the Invention
[0008] The purpose of this invention is to address the shortcomings of existing technologies by providing a method for rapidly modeling complex geometries composed of geometric bodies that provide signed distance fields, starting from the premise that architectural design modeling can be decomposed into a series of relatively simple geometric entities. The main idea of this method is to divide a pre-defined mesh within a finite space and extract the effective portion, thereby rapidly generating an approximate geometric mesh while preserving geometric topological information. Specifically, this invention obtains the isosurfaces of the signed distance field through linear approximation within a background tetrahedral mesh, and then progressively integrates its geometric topology until the subsurfaces remaining after Boolean operations are clearly defined. Simultaneously, during the progressive integration of the geometric topology, topological information beneficial to other applications can be output, such as an approximate polygonal intersection network between geometric bodies, thus facilitating further processing by other software systems.
[0009] The technical solution adopted in this invention is as follows:
[0010] A method for architectural design modeling based on parametric entities and their Boolean relationships is disclosed. The method includes: converting several architectural components into geometric data based on their structural shapes; and abstracting individual geometric shapes into a complete model according to the Boolean relationships between the architectural components required for the design. For example, a wall with a window can be considered as a wall with a portion subtracted via Boolean difference, and then combined with the window via Boolean union. The wall, the subtracted portion, and the window can all be converted into thin hexahedrons. This invention first preprocesses the user-provided architectural design-related data, including: redefining the geometry using a two-level structure and storing the geometry using a specific method; for the Boolean relationships between components, this invention represents them using a tree structure and stores this structure using a linked list structure during input processing, subsequently converting the linked list structure into a more efficient continuous structure for storage during mesh generation. The preprocessed input data is further fed into a mesh generation solver. After three steps—background mesh and isosurface construction, topological information integration, and mesh post-processing—a three-dimensional model based on the input architectural components and Boolean relationships, along with associated topological information, is obtained.
[0011] This invention employs a two-level structure to define the geometry: a bottom layer and a top layer. The bottom layer consists of subsurfaces, each of which, in its data structure, contains at least pointers to a data cache pool, affine transformation matrices, and their inverses. It also statically defines whether it is a parametric surface or an implicit surface. The interface requires each subsurface to provide functional interfaces including querying the signed distance field, the gradient of the signed distance field, and mappings and inverse mappings from 3D Cartesian space to the surface parameter space. The top layer is defined as the space enclosed by a series of subsurfaces; that is, the boundary of the geometry is the union of the subsurface sets. Simultaneously, the geometry maintains an axis-aligned bounding box (AABB) to reflect the approximate boundary information of the entire geometry.
[0012] Based on the above definitions, this invention considers the case of overlapping subsurfaces in three-dimensional space and performs degenerate storage. It uses affine transformation matrices for each subsurface type with tolerance-based hash encoding to ensure that infinitely large or self-enclosed surfaces always maintain only a single instance. Simultaneously, when storing pointers to subsurface instances in the geometry, their pointers are also recorded to solve the problem of inconsistent normals for the same subsurface in different geometries. This invention further uses a container designed based on pooling principles to store affine transformation matrices and subsurface instances, conveniently maintaining a single instance and mitigating the overhead of frequent instance creation and destruction.
[0013] Based on the abstract Boolean relationships between components using a tree structure (Boolean operation tree), this invention designs and employs different data structures for storage in two different application scenarios. Considering the frequent modification of the Boolean operation tree structure during input, this invention uses a linked list structure to store runtime operation tree nodes. Specifically, each node in the tree holds a pointer to its parent or child node; the outermost node only needs to maintain a pointer to any valid node in the tree to retrieve any other pointer. When intervening in mesh generation, this invention transforms the linked list structure into a more efficient continuous structure, while directly storing the set of geometric node indices, pointers to geometry and subsurfaces, and mapping relationships to facilitate traversal and access during the mesh generation stage.
[0014] Based on preprocessed data, this invention designs a mesh generation solver, which consists of three steps: background mesh and isosurface construction, topological information integration, and mesh post-processing. First, in the background mesh and isosurface construction step, an axis-aligned uniform tetrahedral mesh is generated as the background mesh within a finite space. The signed distance field of each subsurface is sampled at each grid point. Then, a linear interpolation method is used to incrementally construct approximate isosurfaces of the subsurfaces within each background mesh cell, thereby extracting the approximate mesh of the subsurfaces. Next, in the topological information integration step, based on the properties of existing geometric elements, a method of pure topological analysis rather than geometric analysis is used to progressively integrate higher-level topological structures until the entire finite space is divided into a series of closely packed sub-regions. Specifically, starting from the connectivity and properties of the approximate isosurface network, continuous approximate surface regions belonging to the same surface instance and approximate intersection lines between different surface instances are integrated. Based on this, the adjacency relationships of continuous surface regions are organized, and topological ray tracing is added to determine the adjacency relationships of the shells formed by the continuous surface regions, thus organizing the closely packed spatial sub-regions. Finally, in the mesh post-processing step, the post-processing includes linking the boundary shell of the above-mentioned sub-regions with the inside and outside of the sub-surfaces, and extracting the required sub-regions based on the data of the Boolean operation tree during traversal, thereby forming the output model.
[0015] The present invention also provides an electronic device, comprising:
[0016] One or more processors;
[0017] Memory, used to store one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors perform the method as described in any of the preceding methods.
[0019] A computer-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the method described in any of the preceding claims.
[0020] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0021] (1) The framework proposed in this invention for rapidly modeling complex geometries composed of simple geometries based on the transformation of building components through Boolean operations has good robustness. The geometry definition and algorithm framework adopted in this invention guides the division of finite spatial regions without overlap or ambiguity, thus significantly improving the robustness of topology analysis, thereby ensuring good robustness in the architectural design modeling process.
[0022] (2) The framework proposed in this invention for rapidly modeling complex geometries composed of simple geometries based on the transformation of building components through Boolean operations has good computational efficiency. This invention designs or applies a variety of efficient data structures for the algorithm, mainly to improve the performance of the algorithm in querying and traversing data; it helps to ensure that the architectural design modeling process has good computational efficiency.
[0023] (3) Although the framework proposed in this invention for rapidly modeling complex geometries composed of simple geometries based on the transformation of building components through Boolean operations is designed for architectural design scenarios, this method framework has relatively wide applicability. As long as the geometry and its boundaries (subsurfaces) conform to the definition within the algorithm framework and the relevant interface implementation can be provided, the expected function can be achieved without making significant rewrites to the subsequent algorithm. Attached Figure Description
[0024] Figure 1 This is an overall flowchart of the method of the present invention;
[0025] Figure 2 A schematic diagram of a parametric solid (a) to a subsurface-geometry secondary structure (b) of a building component;
[0026] Figure 3 This is a schematic diagram of the Boolean operation tree during runtime and the related data structures and relationships of the Boolean operation tree during computation in an example of the present invention;
[0027] Figure 4This is a schematic diagram of two fixed arrangements of tetrahedral units constructed from voxels;
[0028] Figure 5 This is a schematic diagram of an approximate isosurface constructed by sampling a signed distance field within a tetrahedral cell in an example of the present invention;
[0029] Figure 6 This is a schematic diagram of the continuous curved surface region and its boundary (approximate intersection case) in an example of the present invention;
[0030] Figure 7 A schematic diagram of semi-continuous surface regions and their classification methods;
[0031] Figure 8 This is a schematic diagram of the algorithm for determining the adjacency relationship of continuous curved surface regions within the same tetrahedral unit in an example of the present invention. Detailed Implementation
[0032] This invention provides a method for rapid modeling in the field of architectural design, which transforms building components into simple geometric shapes that provide signed distance fields, and then uses Boolean operations to assemble complex geometric shapes. A flowchart of this method is shown below. Figure 1 As shown, the following sections will provide a detailed description of the present invention, covering aspects such as geometric definition and requirements, subsurface instance storage method, Boolean operation tree data structure, and mesh generation algorithm steps. It should be noted that the mesh generation algorithm incorporates some references to existing technologies. To ensure the completeness of the specific implementation of this invention, a general description of its functions and principles will be provided in the corresponding sections below. Those skilled in the art can refer to relevant materials for specific implementation details.
[0033] The contributions of this invention can be summarized as follows:
[0034] (1) This invention proposes a framework for rapidly modeling complex geometries composed of simple geometries in architectural design scenarios through Boolean operations. It quickly constructs an approximate isosurface network by approximating the isosurfaces of the signed distance fields of the geometries within each cell of the background grid. Then, based on graph connectivity and the properties of approximate surfaces and sub-regions in space, the approximate isosurface network is used to progressively integrate continuous approximate surface regions belonging to the same surface instance, approximate intersection lines between different surface instances, and closely arranged spatial sub-regions with continuous approximate surface regions as interfaces. Finally, the internal and external relationships of these spatial sub-regions in each geometries are confirmed, and the required spatial sub-regions and their external interfaces are extracted based on the user-input Boolean operation tree. These extracted external interfaces constitute the modeling of the external interfaces of complex geometries composed of simple geometries through Boolean operations.
[0035] (2) To address the problem that directly modeling with the signed distance field of a geometric body results in the lack of sharp boundaries in its approximate isosurface network, leading to errors in topology analysis, this invention proposes a method to define the original geometry using a two-level structure of subsurface-geometry. It also provides the corresponding data structure and an efficient storage method considering non-repetitive surfaces, along with definitions for related data query, modification, and functional interfaces. Furthermore, this invention outlines algorithms for parallel establishment of the background mesh and sampling of the signed distance field at the grid points of the background mesh within this defined framework.
[0036] (3) To address the issue that the different needs of Boolean operation trees during user input construction and computation make it difficult to use the same data structure, this invention designs data structures for Boolean operation trees in two scenarios. For the user input construction scenario, this invention uses a common linked list of binary trees as the data structure for the Boolean operation tree; while for the computation scenario, this invention designs a continuous linear data structure that can be converted from the former, and directly stores references to commonly used data during grid generation to accelerate queries.
[0037] (4) In the case where there are only a few subsurfaces in the background mesh, the present invention proposes a parallel algorithm. Its function is to determine whether there are subsurfaces in the cell by the sign of the signed distance field sampling value of the corresponding subsurface at the vertex of each cell of the background mesh, thereby clarifying the subsurface instances with isosurfaces in each cell and the active background mesh cells.
[0038] (5) To address the problem of transforming (approximate) isosurfaces into higher-level primitives, this invention proposes a class of algorithms that require only topological relationships and not geometric relationships to solve the problem, including: determining continuous approximate surface regions and their boundaries belonging to the same surface instance; dividing the boundaries of continuous approximate surface regions according to the intersection relationships between different surface instances to obtain approximate intersection lines; determining the adjacency relationships between (virtual) half-faces and using this as a connected graph to obtain the boundary shell of the sub-region; and determining all independent sub-regions by the adjacency relationships of the boundary shell.
[0039] (6) To address the problem of extracting the required sub-regions from closely arranged sub-regions in space according to the Boolean operation tree and further extracting the external interface, this invention proposes several related and efficient algorithms to solve the problem, including: determining the internal and external relationship of the spatial sub-regions in each geometry, determining the required set of spatial regions by bottom-up traversal of the Boolean operation tree, and obtaining the external interface of the sub-regions by breadth-first traversal of the spatial region connectivity graph.
[0040] The following sections will provide a more detailed description of the technical solution of the present invention in conjunction with the accompanying drawings and specific examples.
[0041] 1. Definition and requirements of geometric solids
[0042] As mentioned earlier, components involved in architectural design can be viewed as various parametric entities, and can be further abstracted into simple geometric shapes that facilitate model construction. For example, a window can be abstracted as a thin hexahedron, and a tilted column can be abstracted as a part of a tilted cylinder (see...). Figure 2 (a)). Based on this, the present invention transforms the building components involved in architectural design into geometric data based on their structural shapes, and uses the linear approximation of the isosurface of the signed distance field to define the surface mesh of the geometry. Therefore, the accuracy of the signed distance field will directly affect the correctness of the topology analysis and the quality of the final mesh. If the signed distance field of the geometry (such as a cylinder) is defined as a whole, the isosurface mesh generated by it is likely to lose the characteristics at sharp boundaries (such as the intersection of the upper and lower end faces and the side faces of the cylinder), ultimately resulting in incorrect topology analysis, which in turn affects the correctness of Boolean operation modeling. Based on the above analysis, the present invention adopts a B-rep-like approach, defining the geometry as a space enclosed by a series of subsurfaces, ultimately forming a two-level structure of geometry-subsurface. For example, a cylinder is defined as a space enclosed by two planes and one surface (see Figure 2 (b)
[0043] Following this approach, each type of subsurface These all correspond to a definition of a signed distance field. Since a signed distance field requires clear inner and outer boundaries, each subsurface is either self-enclosed (like a sphere) or infinitely extending (like a plane). Furthermore, each subsurface requires at least one pair of affine transformation matrices. and its inverse matrix , respectively corresponding The mapping from standard definitions to external three-dimensional space and its inverse mapping are used to meet the needs of basic operations such as translation, scaling, and rotation of geometry in practical applications. This maps geometries with different parameters in the design to a unified standard geometry for computation (e.g., ...). Figure 2 In addition, based on the calling requirements of the upper-level modules, each type of subsurface should provide implementations of the following interfaces:
[0044] (1) Signed distance field at any location in space: .
[0045] (2) Gradient of the signed range field at any location in space: .
[0046] (3) Mapping of any point on the surface to the surface parameter space: .
[0047] (4) Mapping of any point in the surface parameter space to three-dimensional space: .
[0048] Based on the definitions of various types of surfaces, various types of geometric bodies It is then defined as a set of subsurfaces. A geometry is a closed space enclosed by a series of subsurfaces. This invention further defines subsurface enclosure as a Boolean intersection operation of the subsurfaces; that is, a geometry is defined as a simple model formed by the Boolean intersection operations of the subsurfaces it governs. Furthermore, unlike subsurfaces, which may extend infinitely, a geometry is necessarily located within a finite spatial region. Therefore, a geometry should also contain an AABB representing its approximate spatial region. Each geometry is provided with the following category labels:
[0049] (1) Types of geometric solids.
[0050] (2) Geometry management The types are listed in order.
[0051] and the following data operation interfaces:
[0052] (1) Obtain geometry management The pointer.
[0053] (2) Obtain initialization of and List them in order.
[0054] (3) Perform translation, scaling, and rotation operations on the geometry, applying them to the geometry's AABB and its... of and .
[0055] 2. Subsurface instance storage method
[0056] 2.1. Degenerate storage of subsurfaces
[0057] For the simple that is frequently used in architectural design Some may occur Management of the same kind The spatial distribution is very close or even completely consistent. This invention addresses this by providing each type with... Define different hash functions for simplified storage Thus optimizing While ensuring the number of instances, it also ensures the consistency of subsequent topology analysis. In this case, The hash function is defined by its or Extract feature vectors or characteristic matrix After tolerance processing, a continuous integer hash operation is performed. Consider that general tolerance processing is defined as... That is, the minimum distance between corresponding elements between variables is within a given threshold. This invention adopts a mapping... This is used to handle tolerance in the hash.
[0058] Using degenerate form storage Based on the examples, it is easy to find the same Instances in different The orientation may be opposite. For example, the top surface of a cylinder and the end face of a cone share the same orientation, based on... Depend on The definition obtained from Boolean intersection is shared. In two The directions in the two are exactly opposite. To solve this problem, the present invention... Chinese records Pointers are also recorded in boolean form. The sign of the symbol needs to be flipped when its value is true. In the implementation, it is recorded... A pointer is defined as a type of tagged pointer, and each pointer has... The offset, the remaining space of the pointer after the offset. It is then used to record the above. The symbols included in the markings.
[0059] This invention provides the design of hash functions for both planar and cylindrical surfaces, and explains their principles. Those skilled in the art can refer to this design and related materials to design other [other functions]. The hash function. In the following text, the hash function for consecutive integers with tolerance processing is labeled VecFloatHashFunc.
[0060] For a plane, its standard form is defined here as follows: Consider a plane in standard form that satisfies the form Therefore, after performing an affine transformation, there is Then the plane Desirable The first line should be normalized. Furthermore, as mentioned above, the plane may exhibit inconsistent orientations, i.e. In this regard, the present invention defines a vector pointing to the upper half-space ( If the value is positive, then flipping the vector in the lower half-space will normalize its pointer and give the recorded pointer. Symbols. The pseudocode for the algorithm is as follows:
[0061]
[0062] For cylindrical surfaces, their standard form is defined here as follows: Each quadratic surface can be represented by a quadratic form. To describe, here After considering affine transformations, we have Therefore, it is acceptable Furthermore, in three-dimensional space, the orientation of a cylinder cannot be changed through affine transformation; therefore, it is only necessary to apply affine transformations to specific... (For example, thin-walled pipes) Pay attention to their notation when declaring them. The pseudocode for the algorithm is as follows:
[0063]
[0064] For subsurfaces of parametric surface type, a similar hash function can be designed to achieve the same purpose, but the input parameters need to consider... The parameter set itself. Further explanation is not provided here.
[0065] 2.2. Data Structure for Subsurface Storage
[0066] To store indexed by discrete hash values For example, a common approach is to use a key-value mapping container. However, since there's no need to consider the order of the keys here, and we need to satisfy the requirements for fast insertion, lookup, and deletion of instances in the application, this invention chooses to use a container like a hash table for storage. Example.
[0067] C++11 provides an implementation of hash table containers, `std::unordered_map`, which can perform insertion, lookup, and deletion operations in amortized constant time and allows redefining the hash function and comparison function for keys. This example uses the open-source high-performance hash table container `flat_hash_map` based on C++ to achieve the above functionality, which provides more efficient insertion, lookup, and deletion operations while offering lower memory usage. Building upon this, to further reduce... of and To reduce memory usage caused by using the hash as the key, choose to manually calculate the hash value and use the calculated hash value directly as the key.
[0068] At the same time, due to multiple It is possible to hold a certain pointers, therefore in these It is uncertain whether to release at the time of release. This means that a control block management needs to be implemented. The lifecycle of the hash table container. In this example, this is accomplished by appending a reference count to the values of the hash table container. The reference count is initialized to 1. After carrying the reference count, the hash table container is allocated and released. The pseudocode for the examples is as follows:
[0069]
[0070]
[0071] 3. Boolean operation tree data structure
[0072] Another important input provided by the user in architectural design is the Boolean relationship between building components, which gradually forms a complex overall model. To address this, this invention uses a common tree structure to represent these Boolean relationships and employs two different data structures for storage, one for user input and the other for mesh generation calculations.
[0073] 3.1. Description of Boolean operation tree structure
[0074] A Boolean operation tree is a tree-like structure that abstracts the process of forming a final model from a basic model through Boolean operations. Each node in the tree either represents a Boolean operation (hereinafter referred to as an operation node) or a node that participated in the Boolean operation. Instances (hereinafter referred to as instance nodes). Boolean operations include intersection, union, and difference, referring to pairs of... Perform intersection, union, and difference operations on the corresponding point sets to obtain a new result. Based on the properties of Boolean operations, a well-structured Boolean tree should satisfy the following characteristics:
[0075] (1) A Boolean operation tree is a binary tree.
[0076] (2) The leaf nodes of the Boolean operation tree are all instance nodes, and all other nodes are operation nodes.
[0077] (3) The leaf nodes of each operation node must be full.
[0078] In the existing Boolean operation tree and all the nodes pointed to by its leaf nodes In this case, the modeling process can be reconstructed by traversing upwards from the leaf nodes, and the overall model can be obtained in the end.
[0079] 3.2. Construction of Boolean operation tree at runtime
[0080] The application first needs to construct a Boolean operation tree structure at runtime based on user input. At this point, the structure of the operation tree may change rapidly under user operation, while there is basically no need to look up nodes or access and modify the content of instance nodes.
[0081] Based on this, the runtime Boolean operation tree is stored in the form of a linked list structure (e.g., Figure 3 As shown in (a), each node stores pointers to its parent node, left child node, and right child node, and also stores the node content. In the implementation, the node content is stored using std::variant provided by C++17, whose type list is pointers to... Pointers and Boolean enumerations.
[0082] Given the storage method of the Boolean operation tree at runtime, the algorithm for constructing this tree is not much different from that for constructing an ordinary binary tree, and will not be elaborated here.
[0083] 3.3. Construction of Boolean operation tree during computation
[0084] After entering the grid generation calculation, the structure of the Boolean operation tree remains unchanged. At this point, the upper-level algorithm needs to efficiently traverse the nodes and frequently access the instances pointed to by them. and To meet these requirements, this invention converts the Boolean operation tree into a continuously linear structure container for storage before it enters the grid generation algorithm (e.g., ...). Figure 3 (b) and some data structures are added for use by subsequent algorithms.
[0085] During computation, the Boolean operation tree essentially stores all nodes of the entire tree in post-order traversal order so that subsequent algorithms can perform a bottom-up traversal process. At this point, each type of node in the tree is encoded as a 128-bit integer, and the meaning of the encoding for each segment of binary bits is shown in the table below:
[0086]
[0087] The tree nodes are initialized with the maximum value that can be encoded by a 128-bit unsigned integer. Simultaneously, during computation, additional data structures are added to the Boolean operation tree, including: the set of indices of all leaf nodes in the node sequence, and all the nodes involved in the leaf nodes. set , All involved set , Management arrive Mapping relationships in Subordinate arrive The mapping relationship in (see) Figure 3 (b)
[0088] In this invention, the computation-time Boolean operation tree can only be derived from the runtime Boolean operation tree; users are not allowed to construct it themselves. The algorithm for converting the runtime Boolean operation tree to the computation-time Boolean operation tree can be divided into two steps. First, the algorithm performs a depth-first traversal of the runtime Boolean operation tree, constructing a sequence of nodes arranged in post-order traversal order, and simultaneously extracting the index set of the leaf nodes in the node sequence and all the nodes involved in the leaf nodes. set , All involved set The information. The pseudocode for this algorithm is as follows:
[0089]
[0090]
[0091] Due to multiple Instances may share the same For example, the result obtained from the previous algorithm is... There may be duplicates. The algorithm then executes the algorithm once more on the... Deduplication, and reorganize during deduplication. Management arrive Mapping relationships in Subordinate arrive The mapping relationship in the algorithm is as follows: The pseudocode for this step is as follows:
[0092]
[0093] 4. Mesh Generation Algorithm Steps
[0094] After preprocessing the parametric entities and Boolean relations, the next step is to generate the mesh model using a mesh generation algorithm. This process includes three main steps: background mesh and isosurface construction, topological information integration, and mesh post-processing. The background mesh and isosurface construction primarily involves the construction of the background mesh and the mapping of grid points. Information extraction, generation of approximate planes within cells, and Isosurface construction; topological information integration is mainly by The isosurface information is gradually extracted to form continuous curved surface regions, boundary intersections, curved shells, and the space enclosed by the curved shells; the mesh post-processing extracts the Boolean operation model from the space enclosed by the curved shells.
[0095] 4.1. Construction of Background Mesh and Isosurfaces
[0096] The method for generating meshes in this invention essentially constructs within the cells of the background mesh. The algorithm uses isosurfaces, connected in series, to divide a finite space, and finally extracts the required portion based on a Boolean operation tree. To complete the algorithm, the finite space must first be clearly defined. And construct a background mesh within it. .
[0097] In this invention, a finite space for All The example provides the union of approximate distribution ranges AABB, i.e.:
[0098]
[0099] Given a background grid resolution Below, the background grid points are evenly distributed throughout. In the middle, a grid network is formed. To facilitate the recording of information at grid points, a hash function for the grid point indices is defined. Its function is to map a grid point to a 64-bit unsigned integer. There is also a corresponding inverse hash function, InvHash, to decompose the hash value back into the grid point index, and a function, GetVertPos, to obtain the grid point's spatial coordinates based on this.
[0100] Once the grid points have been planned, they can be used to organize the background grid. For the construction within the unit For simplicity, this embodiment chooses a square pyramid as the isosurface algorithm. The basic unit is not the hexahedron as in the general case. For a closely packed voxel in three-dimensional space, there is a definite way to decompose it into a closely packed square pyramid, and conversely, one can know the decomposition from each... The determination method of the grid-organized tetrahedron and its vicinity (the two types of determined arrangements can be referred to) Figure 4 Meanwhile, a copy is needed in subsequent algorithms. middle A directed acyclic graph (DAG) connecting the edges of the quadrangular pyramid cells according to the maximum hash reduction is used to... Ray tracing is performed on the graph, and in this example, the graph is calculated here as well. The pseudocode for parallel organization of the background mesh is as follows:
[0101]
[0102] Then, the algorithm needs to Each Upsampling Each of them The value of the signed distance field. Let be... Up by The vector formed by the signed distance field is .for Each of them Obviously, its isosurfaces are only distributed in Within a finite number of units. A certain unit within Does it exist? The isosurface is composed only of each The above corresponds to of The sign is determined if and only if the corresponding sign is... When not all values are positive or negative The isosurface is only in This exists. To reduce the computational load of subsequent algorithms, this invention further utilizes the above-mentioned properties to... Active units in Extraction is performed. The corresponding algorithm pseudocode is as follows:
[0103]
[0104] Extracting active units After that, all those who previously depended on The data, including residual grid points, signed distance field vectors sampled from the grid points, and directed acyclic graphs sorted in descending order of hash value, all need to be processed according to active cells. set Restructuring was carried out. The original symbols for these data will still be used in the following text, but their meanings have been replaced with the corresponding data that underwent the above restructuring.
[0105] Then the algorithm will be in each Above, through each of its contents corresponding Interpolation calculates a linear approximation (plane) of all isosurfaces. For one of them... The principle behind the calculation of approximate isosurfaces is that, Each edge Above, if its two endpoints The signed distance field values are opposite in sign (i.e. Then, points that lie exactly on the isosurface can be obtained by linear interpolation:
[0106]
[0107] The points on the isosurface after the above linear interpolation, together with middle The vertices together form the isosurface point set. .exist Connecting these isosurface points internally forms an approximate plane of the isosurface. . Figure 5 A certain The above single The general generation process.
[0108] However, whenever one exist Internally generated, its vertex set It will become In attempting to construct Further sampling is required at this time. The value of this will lead to a rapid increase in computational load. This invention references a class of high-performance algorithms that can utilize the latest... and existing Calculate The value is calculated simultaneously and quickly to determine its corresponding sign. The principle is to... The inner corresponds to the same of Reorganized into vectors ,So any point inside Can be regarded as Interpolate the barycenter coordinates at all vertices. Simultaneously, on existing isosurfaces, the latest... The barycentric coordinates are interpolated at all vertices of the isosurface. It's always 0. Solving the above relationships together will give us the answer. For details on the implementation of this algorithm, please refer to the paper "Robust computation of implicit surface networks for piecewiselinear functions".
[0109] 4.2. Topology Information Integration
[0110] In this step, the present invention first processes all the generated... Merge into as few continuous surface regions as possible. The meaning of a continuous surface region is a series belonging to the same... Topologically continuous The set. To make If the number of elements in the middle is as small as possible, then each All should be as large as possible, so that each All should continue to belong to the same group based on their adjacency. of Extend until no more adjacent elements belong to the same group. of Or reach a limited area The boundary.
[0111] At the same time, based on the definition of a continuous surface region, it can be found that when Not terminated in a limited area When it reaches a boundary, it either terminates at a point where it meets another boundary. A corresponding one Either terminated at The self-intersecting region. For a certain continuous surface region. These terminating topologically continuous edge sets This determines both its boundaries and the linear approximation of all its intersection lines. Based on the above analysis, when a certain... Adjacent When there is only one, Termination in a limited area The boundary; when adjacent When there are two, the It should be The internal edge; when adjacent When there are three or more, the This is a linear approximation of the intersection line (in this case) and The schematic diagram is as follows Figure 6 (As shown).
[0112] Based on the above definitions and properties, in the known... edge set and Adjacent In this case, breadth-first traversal can determine the result simultaneously. And its approximate intersection line and boundary. The corresponding pseudocode of the algorithm is as follows:
[0113]
[0114] Based on this, it is noted The approximate intersection line may be due to different The intersection is divided into many segments. This is to facilitate clear differentiation in subsequent processing of the intersection. above and different The present invention further uses a breadth-first traversal to distinguish these approximate intersection lines formed by the intersections, and stores each approximate intersection line separately. Index, starting edge related Index, Approximate Intersection Segment Related Index. The corresponding pseudocode for the algorithm is as follows:
[0115]
[0116] Then, to facilitate Organization is a series of closely arranged spaces The present invention will each Treat as a semi-continuous surface region The set, and Pointing to the corresponding The positive and negative sign spaces of the signed distance field (e.g.) Figure 7 (As shown). Although the aforementioned steps have been determined The adjacency relationship exists, but it cannot be determined. The adjacency relationship. For the algorithm for fast calculation of linear approximations of isosurfaces cited in this invention, it can provide a pair of units from the approximate plane of the isosurface. Segmentation .because Some The set of elements, therefore the above algorithm has been determined. The adjacency relationship. From The starting edge of the approximate intersection segment is related to and Starting with the index, The adjacency relationship is split into Inside The above function can be accomplished by using adjacency relationships. The following is related to the starting edge. All in the same (i.e., the starting edge is in this) The algorithm pseudocode for (within) is roughly as follows: Figure 8 As shown. For the starting edge in For cases at boundaries or interfaces, the algorithm steps are similar, except that it crosses multiple boundaries or interfaces. Therefore, additional processing of adjacent elements is required. This relates to the mapping relationships between boundaries, interfaces, and vertices. The pseudocode for this part of the algorithm will not be explained further.
[0117]
[0118]
[0119] In all known Based on the adjacency relationship, a breadth-first traversal can be used to describe the relationship between the two adjacencies. Connected boundary shells The algorithm steps are similar to those described in the main body of Algorithm 4-3, and its pseudocode will not be elaborated here.
[0120] In order to be formed by the boundary shell The entire finite space Divided into closely spaced spaces This invention employs a topological ray tracing algorithm. Its principle is that, within a defined finite space... All spatial components (here, the background grid and the expected set of spatial regions) Assuming all elements are simply connected, spatial components can be defined by their boundaries (here, boundary shells). The network follows the sorting relationship between the same discrete grid points (here, a directed acyclic graph arranged in descending order of hash value). Ray tracing is used to determine the boundary. In particular, if a ray tracing of a boundary starts at or terminates at the boundary of the entire space, then that boundary can be definitively identified as the outermost boundary. For details on the specific implementation of this algorithm, please refer to the paper "Robustcomputation of implicit surface networks for piecewise linear functions".
[0121] Specifically, this invention uses a topological ray tracing algorithm to determine the boundary shell. The adjacency relationships between networks are determined, and then the closely packed spatial components are identified through breadth-first traversal. The latter's algorithm steps are similar to those described in the main body of Algorithm 4-3, but it requires special handling of whether it starts or terminates in the entire space. Further details will not be elaborated here.
[0122] 4.3. Mesh Post-processing
[0123] After completing the hierarchical integration of topological relationships, the present invention then proceeds according to... All subordinates and corresponding Determine each Each corresponding The internal and external relationships, and then based on the Boolean operation tree during computation. The relationship transforms it into each Each corresponding The internal and external relationships, and finally based on The included Boolean operations transform internal and external relationships layer by layer and filter them out. Whether the boolean sequence exists in the output model. Selected based on the above sequence. All included boundaries This forms the final model required.
[0124] First, the present invention addresses Perform a breadth-first traversal and, based on subordinates Half-face symbol inference region In the corresponding Is it inside or outside? Among them, The connectivity relationship is categorized by the interface as belonging to the same A pair Definition. Although each interface They are not entirely consistent, that is Directly related Not entirely consistent, but because Self-enclosed or terminated The boundary, therefore each Indirectly related The internal and external relationships of a component can be derived from the other components in its connected components. Directly related This is deduced from the internal and external relationships. At the same time, as long as... If the structure is good, then each pair of adjacent... There is one and only one pair on the boundary. corresponding The internal and external relationships are opposite, and other relationships between the two are... They are either inconsistent or have the same internal and external relationships. According to the algorithm described above, Each exist Both internal and external relationships can be determined.
[0125] Building upon this, to facilitate rapid Boolean operations in subsequent steps, this example uses the boolean type to denote internal and external relationships, with internal and external relationships corresponding to true and false, respectively. This allows each... exist The internal and external relationships are compressed into a set of integers, where each binary bit of the corresponding index represents the corresponding internal and external relationship.
[0126] The pseudocode for this algorithm step is as follows:
[0127]
[0128] In each known exist Internal and external relationships Subsequently, the present invention is based on Mapping and corresponding exist Whether the above needs to perform multiple sign reversals or Boolean intersection operations on the flag it points to, Transform into each exist Internal and external relationships Through the analysis of By performing a bottom-up traversal and processing a Boolean operation at each node, we can obtain... Whether a boolean sequence exists in the output model. Because... Since the nodes are stored sequentially in post-order traversal, a stack structure is needed to assist in recording the nodes to be processed during the traversal process. The pseudocode for this step of the algorithm is as follows:
[0129]
[0130] In the known In this case, the actual required space area It has been confirmed. But not all of them. All of them need to be presented in the output model, because only a part of it is included. It is the external interface. This invention finally performs a breadth-first traversal to iterate through all remaining components. Select the corresponding external interface The pseudocode for this algorithm step is as follows:
[0131]
[0132] At this point, the external interface corresponds to sequence It has already been extracted; we only need to iterate through it. and all of them This allows for the acquisition of a 3D model composed of polygonal meshes. Users can visualize this result or further process it using other architectural design software systems, such as using the topological information provided by this invention during the hierarchical integration of topology to perform structural analysis, finite element calculations, and other operations on the model.
[0133] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0134] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0135] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0136] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0137] The embodiments described above are merely some preferred embodiments of the present invention, and are not intended to limit the invention. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the invention. Therefore, all technical solutions obtained by equivalent substitution or equivalent transformation fall within the protection scope of the present invention.
Claims
1. A method for architectural design modeling based on parametric entities and their Boolean relationships, characterized in that, This method involves converting several building components into geometric data based on their structural shapes, and then abstracting individual geometric shapes into a complete model based on the Boolean relationships between the building components required by the design. Specifically, it includes the following: First, the architectural design-related component data given by the user is preprocessed. The preprocessing includes: redefining the geometry using a two-level structure and storing the geometry, wherein the Boolean relationship between components is represented by a tree structure and stored in a linked list structure during input processing, and the linked list structure is converted into a continuous structure for storage during mesh generation. The preprocessed input data is further fed into the mesh generation solver. After three steps—construction of background mesh and isosurface, integration of topological information, and mesh post-processing—the final 3D model and associated topological information are obtained. The two-level structure redefines the geometry as a bottom layer and a top layer. The bottom layer consists of subsurfaces, each of which contains at least a pointer to the data cache pool, a pointer to the affine transformation matrix and its inverse matrix in its data structure. It also statically defines whether it is a parametric surface or an implicit surface. Each subsurface must provide functional interfaces including querying the signed distance field, the gradient of the signed distance field, and the mapping and inverse mapping from the three-dimensional Cartesian space to the surface parameter space. The top layer is the geometry, which is the space enclosed by a series of subsurfaces. That is, the boundary of the geometry is the union of the subsurface sets. At the same time, the geometry maintains an axis-aligned bounding box to reflect the approximate boundary information of the entire geometry.
2. The architectural design modeling method based on parametric entities and their Boolean relationships according to claim 1, characterized in that, In the case of overlapping subsurfaces in 3D space, degenerate storage is performed. Affine transformation matrices for each type of subsurface are used for tolerance-tolerant hashing to ensure that infinitely large or self-enclosed surfaces always maintain only a single instance. When storing pointers to subsurface instances in the geometry, their pointers are also recorded.
3. The architectural design modeling method based on parametric entities and their Boolean relationships according to claim 1, characterized in that, The linked list structure is used for storage during input processing. Specifically, the linked list structure is used to store the Boolean operation tree nodes during runtime. Each node in the tree holds a pointer to the parent node or child node. The outermost node only needs to hold any one valid tree node pointer to query any other pointer. During mesh generation and computation, the linked list structure is transformed into a continuous structure. Simultaneously, the set of geometric node indices, pointers to geometry and subsurfaces, and mapping relationships are directly stored to facilitate traversal and access during mesh generation. Specifically, the runtime Boolean operation tree is transformed into a computation-time Boolean operation tree in two steps. First, a depth-first traversal of the runtime Boolean operation tree is performed, constructing a sequence of nodes arranged in post-order traversal. Simultaneously, the set of leaf node indices in the node sequence and all geometry involved in the leaf nodes are extracted. set Geometric shapes All subsurfaces involved set Then execute a test on Deduplication and reorganization at the same time. Management arrive Mapping relationships in Subordinate arrive The mapping relationship in the diagram.
4. The architectural design modeling method based on parametric entities and their Boolean relationships according to claim 1, characterized in that, The construction of the background mesh and isosurface specifically includes: generating an axis-aligned uniform tetrahedral mesh as the background mesh in a finite space, sampling the signed distance field of each subsurface at each grid point, and then using a linear interpolation method to incrementally construct the approximate isosurface of the subsurface within each background mesh cell, thereby extracting the approximate mesh of the subsurface.
5. The architectural design modeling method based on parametric entities and their Boolean relationships according to claim 4, characterized in that, The topological information integration includes: based on the properties of existing geometric elements, using a simple topological analysis method to integrate higher-level topological structures step by step until the entire finite space is divided into a series of closely arranged sub-regions. Specifically, starting from the connectivity and properties of the approximate isosurface network, a breadth-first traversal is used to integrate continuous approximate surface regions belonging to the same surface instance and approximate intersection lines between different surface instances. On this basis, the adjacency relationships of continuous surface regions are sorted out, and after adding topological ray tracing to determine the adjacency relationships of the shells formed by the continuous surface regions, closely arranged spatial sub-regions are obtained.
6. The architectural design modeling method based on parametric entities and their Boolean relationships according to claim 5, characterized in that, The mesh post-processing specifically includes: linking the boundary shell of the sub-region with the inner and outer surfaces of the sub-surface, and extracting the required sub-regions based on the data of the Boolean operation tree during traversal, thereby forming the output model.
7. A building design modeling system based on parametric entities and their Boolean relationships, characterized in that, Used to implement the method as described in any one of claims 1-6.
8. An electronic device, characterized in that, include: One or more processors; Memory, used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.
9. A computer-readable storage medium storing computer-executable instructions, which, when executed, are used to implement the method of any one of claims 1-6.