Two-dimensional-three-dimensional surface entity construction method for computer aided design system

By deriving a 2D surface entity class from the CAD system and combining it with high-precision 3D transformation and R-tree indexing, the accuracy and topological relationship problems of 2D-3D surface entity construction in the existing technology are solved, realizing efficient and accurate surface entity construction and management, and meeting the application needs of complex scenarios.

CN120995528APending Publication Date: 2025-11-21YUNNAN INST OF GEOLOGY & MINERAL SURVEYING & MAPPING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511111768.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-08
Publication Date
2025-11-21

AI Technical Summary

Technical Problem

Existing CAD systems suffer from problems in the construction of 2D-3D surface entities, such as inaccurate vertex coordinate calculation, insufficient adaptive display, unstable 3D geometric transformation, inaccurate topological relationship judgment, and non-standard attribute storage, making it difficult to meet the needs of efficient and accurate construction and management of complex surface entities.

Method used

By deriving a 2D surface entity class based on the AcDbEntity class, calculating vertex coordinates using trigonometric functions, and combining the viewport transformation matrix to achieve adaptive display; introducing height mapping and high-precision 3D rotation, translation, and scaling matrices; using an R-tree index structure to accelerate spatial relationship queries; constructing an intelligent entity representation module and a topology error correction mechanism to ensure the accurate application of colors, symbols, and textures; and establishing a strict topology relationship processing and attribute storage system.

Benefits of technology

It improves the accuracy and stability of surface entity construction, enhances the display effect, strengthens the accuracy of topological relationships and the standardization of attribute storage, meets the needs of multiple business scenarios, and significantly improves the overall performance of the CAD system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120995528A_ABST
    Figure CN120995528A_ABST
Patent Text Reader

Abstract

The invention discloses a two-dimensional-three-dimensional surface entity construction method for a computer aided design system, and the method comprises the steps: deriving a two-dimensional surface entity based on an AcDbEntity class, and combining the precise calculation of a trigonometric function vertex of a regular polygon and the interactive collection of an irregular polygon; dynamic adjustment of vertex coordinates under different zooming and viewing angles is achieved through a viewport transformation matrix, the display definition and accuracy are effectively improved, the effectiveness of two-dimensional plane geometry is guaranteed through multiple data verification and area initialization in a construction function, two-dimensional-three-dimensional height mapping and a high-precision three-dimensional rotation, translation and zooming matrix are introduced, and the display effect is improved. According to the method, an R-tree-based spatial index and polygon cutting algorithm is adopted, efficient and accurate spatial relation judgment between surface entities is achieved, surface entity boundary self-intersection detection and automatic error correction are achieved in combination with a ray method and a topology rule base, the topology integrity and reliability of data are enhanced, and the method is suitable for large-scale popularization and application. And the overall performance and the application value of CAD system surface entity construction and management are obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of two-dimensional-three-dimensional surface solid construction technology, and in particular to a two-dimensional-three-dimensional surface solid construction method for computer-aided design systems. Background Technology

[0002] With the widespread application of Computer-Aided Design (CAD) technology, the construction and representation of two-dimensional and three-dimensional surface entities has become one of the core functions of CAD systems. As the basic unit for representing spatial information in various fields such as geography, architecture, and machinery, the accuracy of surface entity construction and the quality and efficiency of subsequent design, analysis, and application directly affect the quality and efficiency of these processes. Especially in the fields of Geographic Information Systems (GIS), Building Information Modeling (BIM), and professional drafting, the demand for constructing complex two-dimensional and three-dimensional surface entities is increasing, driving continuous exploration of more efficient, accurate, and feature-rich CAD surface entity construction technologies.

[0003] Currently, most existing CAD systems use a two-dimensional surface entity class derived from AcDbEntity, providing basic surface entity drawing and editing capabilities. However, these systems have significant shortcomings in complex surface entity vertex coordinate calculation, adaptive display, 3D height mapping, and 3D geometric transformations. During the construction of two-dimensional surface entities, vertex coordinate errors often lead to distorted graphic shapes, resulting in unsatisfactory display effects during scaling and translation. 3D surface entity expansion lacks accurate height correlation and stable rotation, translation, and scaling algorithms, easily leading to model deformation and positional deviations. Furthermore, the shape design, color and symbol systems, and texture application of surface entities lack systematicity, failing to meet professional business needs. Topological relationship judgment is inaccurate and lacks automatic error correction mechanisms, affecting the reliability of spatial analysis. Regarding attribute storage, existing systems struggle to achieve high-precision, standardized, and highly scalable real-world attribute management, limiting the depth and breadth of business applications.

[0004] Therefore, in the 2D-3D surface solid construction technology of CAD systems, how to achieve accurate calculation and adaptive display of vertex coordinates, ensure the accurate correlation between 3D height information and 2D surface, develop efficient and stable 3D geometric transformation algorithms, improve the application system of color, symbol and texture in entity expression, and establish an accurate and reliable attribute storage system for topological relationship processing and standardized expansion have become key technical problems that urgently need to be solved. Summary of the Invention

[0005] This application provides a two-dimensional to three-dimensional surface solid construction method for computer-aided design systems, aiming to solve the problems of how to achieve accurate calculation and adaptive display of vertex coordinates, ensure the accurate correlation between three-dimensional height information and two-dimensional surfaces, develop efficient and stable three-dimensional geometric transformation algorithms, improve the application system of color, symbol and texture in solid representation, and establish an accurate and reliable attribute storage system for topological relationship processing and standardized expansion.

[0006] A method for constructing two-dimensional and three-dimensional surface solids for computer-aided design systems, the method comprising:

[0007] A two-dimensional face entity class is derived from the AcDbEntity class. For regular polygons, the two-dimensional coordinates of each vertex are accurately calculated using trigonometric functions based on the number of sides and side length. For irregular polygons, the vertex coordinates are collected by the user through interaction in the CAD interface and a vertex set is formed.

[0008] The viewport transformation matrix is ​​used to transform the vertex coordinates of a two-dimensional surface entity, so as to realize the dynamic adaptive adjustment of vertex coordinates under different scaling ratios and viewpoints. Specifically, it includes linear scaling of vertex coordinates according to the scaling factor and rotation transformation based on the rotation matrix.

[0009] In the constructor of the 2D surface entity class, a multi-factor data validation process is executed, including validating the vertex coordinates, removing duplicate vertices, and calculating and initializing the area attribute of the 2D surface entity using the vector cross product method.

[0010] Add a height attribute to the 2D surface entity class to establish a mapping relationship between the 2D surface vertices and the height value. The height value is obtained through user input or external elevation data to realize the height mapping of the 2D surface to the 3D surface and generate the 3D vertex coordinates. Apply a 3D rotation matrix based on the rotation axis vector and rotation angle to perform matrix multiplication operation on each vertex of the 3D surface entity to realize the rotation transformation of the 3D surface entity.

[0011] The vertex coordinates of the 3D surface entity are translated by adding the corresponding components of the translation vector to the vertex coordinates and scaling them by a uniform scaling factor to ensure the accuracy of the position and size changes of the 3D surface entity in space.

[0012] An intelligent entity representation module is constructed, which automatically matches the corresponding color code, symbol identifier and texture fill according to the geometric shape, type and business attributes of the surface entity. The color and symbol library is dynamically optimized based on big data analysis and machine learning models.

[0013] A spatial index structure based on R-tree is adopted to accelerate the query of spatial relationships between face entities. Combined with the boundary line segment discretization algorithm, the adjacency relationship between face entities can be accurately determined.

[0014] The Sutherland-Hodgman polygon clipping algorithm is used to accurately extract the intersecting parts between face entities. The color, symbol and business attributes of the intersecting areas are merged by combining attribute fusion rules. The inclusion relationship of face entities is accurately determined by ray casting and boundary determination rules. The automatic topology rule library is used to detect the self-intersection of face entity boundaries and the consistency of common boundaries in real time and perform intelligent error correction.

[0015] Optionally, in the above scheme, the step of calculating the vertex coordinates of the regular polygon specifically includes:

[0016] Based on the number of sides n and side length sideLength of the polygon input by the user, the two-dimensional coordinates of the i-th vertex are calculated using the polygon center point (centerX, centerY) as the reference, through the formulas x=centerX+sideLength*cos(2*π*i / 6) and y=centerY+sideLength*sin(2*π*i / 6); where i takes values ​​from 0 to 5.

[0017] Optionally, in the above scheme, the area calculation step of the two-dimensional surface entity includes:

[0018] Using the cross product method, the area S is calculated based on the vertex coordinate sequence (x1, y1), (x2, y2), ..., (xn, yn) of a two-dimensional surface entity. The formula used is:

[0019] Optionally, in the above scheme, the construction and application steps of the three-dimensional rotation matrix include: normalizing the rotation axis vectors (a, b, c) and assigning a rotation angle of theta, then the three-dimensional rotation matrix R is:

[0020]

[0021] For each vertex (x, y, z) of the 3D surface, the new coordinates of the vertex after rotation are calculated by matrix multiplication (x', y', z') = R*(x, y, z), thereby realizing the rotation operation of the 3D surface.

[0022] In the above scheme, optionally, the application of the viewport transformation matrix includes the following specific transformation steps:

[0023] 3D translation: If the translation vector is (tx,ty,tz), then each vertex (x,y,z) of the 3D surface is updated to (x+tx,y+ty,z+tz);

[0024] 3D scaling: Let the scaling factor be scale, and each vertex (x,y,z) of the 3D surface is updated to (x*scale,y*scale,z*scale).

[0025] Optionally, in the above scheme, the intelligent entity representation module specifically includes:

[0026] Based on the geometric features and business attributes of the surface entity, the system calls the predefined color library and symbol library to automatically match the corresponding color code and symbol style.

[0027] By leveraging big data analytics and machine learning technologies, color and symbol matching rules are dynamically optimized to support adaptation to multiple industries and application scenarios.

[0028] By dynamically adjusting the display details of textures and symbols based on the current view zoom level, the visual effects remain consistent and clear.

[0029] Optionally, in the above scheme, the spatial index structure adopts an R-tree tree index, and the construction steps include:

[0030] By using a recursive space partitioning algorithm, the two-dimensional space is divided, and multi-level index nodes are constructed to reduce the complexity of space queries;

[0031] During the spatial query phase, the R-tree is traversed to quickly locate the candidate set of face entities that may be adjacent or intersecting, reducing unnecessary computation.

[0032] The boundary segment discretization method is used to accurately determine whether the boundaries of candidate surface entities are adjacent, ensuring the correct identification of adjacent relationships.

[0033] Optionally, in the above scheme, the extraction steps for the intersecting parts of surface entities include:

[0034] For potentially intersecting face entities, the Sutherland-Hodgman polygon clipping algorithm is applied to calculate the intersecting polygon regions;

[0035] Attribute fusion is performed on intersecting areas, including color mixing, symbol merging, and business attribute priority processing, to ensure accurate reflection of the attributes of intersecting areas.

[0036] Optionally, the topology detection and error correction mechanism in the above scheme includes:

[0037] The ray casting method is used to detect whether a vertex of a face entity is located inside another face entity, thus realizing the determination of containment relationships.

[0038] A polygon self-intersection detection algorithm is used to locate and identify self-intersection points and mark topological errors in real time;

[0039] Check the consistency of the common boundary of adjacent face entities. If there is a boundary mismatch, automatically adjust the vertices or prompt the user to intervene and correct it.

[0040] The topology rule base contains multiple rules that check the topological relationships between surface entities in real time to ensure data integrity.

[0041] Optionally, the processing of specific types of surface entities in the above scheme includes:

[0042] Map patch: Automatically matches the corresponding color and symbol according to the land use code, and adjusts the symbol display ratio to adapt to different patch sizes to ensure clear visual expression;

[0043] Water surface: Blue gradient texture and different texture styles are used to distinguish oceans, rivers and lakes, and texture parameters are adjusted in combination with water quality and depth attributes;

[0044] Parcel: Supports multi-component and island-based structures, employs layered display technology to present the main parcel and its internal islands separately, maintains complex topological relationships, records the association information between multiple components, and achieves accurate cadastral management expression.

[0045] Compared with the prior art, this application has at least the following beneficial effects:

[0046] Based on further analysis and research of existing technical problems, this application ensures the high accuracy and diversity of face entity vertices by deriving two-dimensional face entities from the AcDbEntity class and combining precise calculation of trigonometric vertices of regular polygons with interactive acquisition of irregular polygons. This solves the shape distortion problem caused by inaccurate vertex calculation in traditional systems. The viewport transformation matrix is ​​used to dynamically adjust vertex coordinates under different scaling and viewing angles, effectively improving display clarity and accuracy and overcoming the defect of poor display effect. Multiple data checks and area initialization in the constructor ensure the validity of the two-dimensional face geometry and eliminate drawing errors caused by data anomalies. The introduction of two-dimensional-three-dimensional height mapping and high-precision three-dimensional rotation, translation, and scaling matrices solves the problems of three-dimensional face entity deformation and void... The system addresses the issue of positional deviations, ensuring the stability of 3D model operations. The intelligent entity representation module automatically matches colors, symbols, and textures based on big data and machine learning, meeting the needs of multiple business scenarios and improving the readability and professionalism of map information. Employing R-tree-based spatial indexing and polygon clipping algorithms, it achieves efficient and accurate spatial relationship judgment between surface entities, improving upon the inaccurate topological relationship judgment and low query efficiency issues in traditional systems. Combining ray casting and a topological rule base, it implements self-intersection detection and automatic error correction of surface entity boundaries, enhancing the topological integrity and reliability of the data. This comprehensively solves key technical challenges in the background technology, such as poor accuracy in 2D-3D surface construction, numerous topological errors, and limited representation, significantly improving the overall performance and application value of surface entity construction and management in CAD systems. Attached Figure Description

[0047] Figure 1A flowchart illustrating a two-dimensional-three-dimensional surface solid construction method for a computer-aided design system provided in one embodiment of this application;

[0048] Figure 2 A flowchart illustrating the derivation process of a two-dimensional surface entity class according to an embodiment of this application;

[0049] Figure 3 A three-dimensional surface solid extended architecture diagram provided for one embodiment of this application;

[0050] Figure 4 A schematic diagram illustrating the entity representation provided in one embodiment of this application;

[0051] Figure 5 This is a flowchart illustrating the topology relationship processing provided in one embodiment of this application;

[0052] Figure 6 This is a schematic diagram of an attribute storage structure provided in one embodiment of this application;

[0053] Figure 7 Example diagram of a specific type of face entity provided for one embodiment of this application. Detailed Implementation

[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0055] In one embodiment, such as Figure 1 As shown, a method for constructing two-dimensional and three-dimensional surface solids for computer-aided design systems is provided, including the following steps:

[0056] A two-dimensional face entity class is derived from the AcDbEntity class. For regular polygons, the two-dimensional coordinates of each vertex are accurately calculated using trigonometric functions based on the number of sides and side length. For irregular polygons, the vertex coordinates are collected by the user through interaction in the CAD interface and a vertex set is formed.

[0057] The viewport transformation matrix is ​​used to transform the vertex coordinates of a two-dimensional surface entity, so as to realize the dynamic adaptive adjustment of vertex coordinates under different scaling ratios and viewpoints. Specifically, it includes linear scaling of vertex coordinates according to the scaling factor and rotation transformation based on the rotation matrix.

[0058] In the constructor of the 2D surface entity class, a multi-factor data validation process is executed, including validating the vertex coordinates, removing duplicate vertices, and calculating and initializing the area attribute of the 2D surface entity using the vector cross product method.

[0059] Add a height attribute to the 2D surface entity class to establish a mapping relationship between the 2D surface vertices and the height value. The height value is obtained through user input or external elevation data to realize the height mapping of the 2D surface to the 3D surface and generate the 3D vertex coordinates. Apply a 3D rotation matrix based on the rotation axis vector and rotation angle to perform matrix multiplication operation on each vertex of the 3D surface entity to realize the rotation transformation of the 3D surface entity.

[0060] The vertex coordinates of the 3D surface entity are translated by adding the corresponding components of the translation vector to the vertex coordinates and scaling them by a uniform scaling factor to ensure the accuracy of the position and size changes of the 3D surface entity in space.

[0061] An intelligent entity representation module is constructed, which automatically matches the corresponding color code, symbol identifier and texture fill according to the geometric shape, type and business attributes of the surface entity. The color and symbol library is dynamically optimized based on big data analysis and machine learning models.

[0062] A spatial index structure based on R-tree is adopted to accelerate the query of spatial relationships between face entities. Combined with the boundary line segment discretization algorithm, the adjacency relationship between face entities can be accurately determined.

[0063] The Sutherland-Hodgman polygon clipping algorithm is used to accurately extract the intersecting parts between face entities. The color, symbol and business attributes of the intersecting areas are merged by combining attribute fusion rules. The inclusion relationship of face entities is accurately determined by ray casting and boundary determination rules. The automatic topology rule library is used to detect the self-intersection of face entity boundaries and the consistency of common boundaries in real time and perform intelligent error correction.

[0064] In this embodiment, the step of calculating the vertex coordinates of the regular polygon specifically includes:

[0065] Based on the number of sides n and side length sideLength of the polygon input by the user, the two-dimensional coordinates of the i-th vertex are calculated using the polygon center point (centerX, centerY) as the reference, through the formulas x=centerX+sideLength*cos(2*π*i / 6) and y=centerY+sideLength*sin(2*π*i / 6); where i takes values ​​from 0 to 5.

[0066] In this embodiment, the area calculation step of the two-dimensional surface entity includes:

[0067] Using the cross product method, the area S is calculated based on the vertex coordinate sequence (x1, y1), (x2, y2), ..., (xn, yn) of a two-dimensional surface entity. The formula used is:

[0068] In this embodiment, the construction and application steps of the three-dimensional rotation matrix include: normalizing the rotation axis vectors (a, b, c) and assigning a rotation angle of theta, then the three-dimensional rotation matrix R is:

[0069]

[0070] For each vertex (x, y, z) of the 3D surface, the new coordinates of the vertex after rotation are calculated by matrix multiplication (x', y', z') = R*(x, y, z), thereby realizing the rotation operation of the 3D surface.

[0071] In this embodiment, the application of the viewport transformation matrix includes the following specific transformation steps:

[0072] 3D translation: If the translation vector is (tx,ty,tz), then each vertex (x,y,z) of the 3D surface is updated to (x+tx,y+ty,z+tz);

[0073] 3D scaling: Let the scaling factor be scale, and each vertex (x,y,z) of the 3D surface is updated to (x*scale,y*scale,z*scale).

[0074] In this embodiment, the intelligent entity representation module specifically includes:

[0075] Based on the geometric features and business attributes of the surface entity, the system calls the predefined color library and symbol library to automatically match the corresponding color code and symbol style.

[0076] By leveraging big data analytics and machine learning technologies, color and symbol matching rules are dynamically optimized to support adaptation to multiple industries and application scenarios.

[0077] By dynamically adjusting the display details of textures and symbols based on the current view zoom level, the visual effects remain consistent and clear.

[0078] In this embodiment, the spatial index structure adopts an R-tree tree index, and the construction steps include:

[0079] By using a recursive space partitioning algorithm, the two-dimensional space is divided, and multi-level index nodes are constructed to reduce the complexity of space queries;

[0080] During the spatial query phase, the R-tree is traversed to quickly locate the candidate set of face entities that may be adjacent or intersecting, reducing unnecessary computation.

[0081] The boundary segment discretization method is used to accurately determine whether the boundaries of candidate surface entities are adjacent, ensuring the correct identification of adjacent relationships.

[0082] In this embodiment, the step of extracting the intersection of face entities includes:

[0083] For potentially intersecting face entities, the Sutherland-Hodgman polygon clipping algorithm is applied to calculate the intersecting polygon regions;

[0084] Attribute fusion is performed on intersecting areas, including color mixing, symbol merging, and business attribute priority processing, to ensure accurate reflection of the attributes of intersecting areas.

[0085] In this embodiment, the topology detection and error correction mechanism includes:

[0086] The ray casting method is used to detect whether a vertex of a face entity is located inside another face entity, thus realizing the determination of containment relationships.

[0087] A polygon self-intersection detection algorithm is used to locate and identify self-intersection points and mark topological errors in real time;

[0088] Check the consistency of the common boundary of adjacent face entities. If there is a boundary mismatch, automatically adjust the vertices or prompt the user to intervene and correct it.

[0089] The topology rule base contains multiple rules that check the topological relationships between surface entities in real time to ensure data integrity.

[0090] In this embodiment, the processing for specific types of surface entities includes:

[0091] Map patch: Automatically matches the corresponding color and symbol according to the land use code, and adjusts the symbol display ratio to adapt to different patch sizes to ensure clear visual expression;

[0092] Water surface: Blue gradient texture and different texture styles are used to distinguish oceans, rivers and lakes, and texture parameters are adjusted in combination with water quality and depth attributes;

[0093] Parcel: Supports multi-component and island-based structures, employs layered display technology to present the main parcel and its internal islands separately, maintains complex topological relationships, records the association information between multiple components, and achieves accurate cadastral management expression.

[0094] In one embodiment, a method and system for constructing two-dimensional and three-dimensional surface entities in a CAD system are provided. In the field of Computer-Aided Design (CAD), the construction and display of two-dimensional and three-dimensional graphics is one of its core functions. With the deepening application of CAD technology across various industries, the demand for constructing complex two-dimensional and three-dimensional surface entities is increasing daily.

[0095] Traditional CAD systems, while offering basic drawing capabilities for constructing 2D surface entities, suffer from several shortcomings when it comes to complex, custom 2D surface entities. For example, existing processes for deriving 2D surface entity classes from AcDbEntity are often inflexible and imprecise. In terms of drawing methods, many CAD systems lack the ability to accurately calculate vertex coordinates for various complex geometric shapes, resulting in inaccurate representation of shapes and boundaries when constructing complex 2D surface entities such as irregular polygons, impacting the accuracy and professionalism of the graphics. Furthermore, traditional drawing methods struggle to adapt to different scales and viewing angles, leading to poor display quality and failing to meet diverse user needs. Regarding constructor overriding, traditional CAD systems often experience inaccurate and inconsistent data when initializing member variables of 2D surface entity classes. For instance, initializing vertex coordinate sets can easily result in coordinate errors, leading to abnormal shapes of 2D surface entities. Additionally, the default values ​​for display attributes are relatively simplistic, failing to be configured appropriately for different application scenarios, reducing development efficiency and user experience.

[0096] Traditional CAD systems have limited scalability for constructing 3D surface entities. When adding 3D attributes, the association between height information and 2D surfaces is not handled properly, failing to ensure that the position and shape of the 3D surface in the vertical direction accurately meet expectations. When implementing 3D operations such as rotation, translation, and scaling, the lack of accurate geometric transformation matrix calculations and stable algorithms makes 3D surface entities prone to deformation and positional shifts during operations, affecting the quality and usability of the 3D model.

[0097] Traditional CAD systems have several shortcomings in representing entities. In graphic display, shape designs may be overly complex or fail to adhere to the principle of simplicity and clarity, making it difficult for users to quickly and accurately identify map information. The application of colors, symbols, and textures lacks systematicity and specificity, resulting in poor map readability and visual appeal. Furthermore, the implementation of display effects such as zooming and panning fails to balance performance and user experience; zooming can easily lead to loss of detail or display stuttering, while panning may result in inaccurate placement of face entities or disordered relative positions.

[0098] In handling topological relationships, traditional CAD systems are not precise enough in determining adjacency, intersection, and containment relationships. Geometric calculation methods may be inadequate, leading to inaccurate identification of intersections at surface entity boundaries, improper merging and processing of overlapping attribute information when handling intersections, and failure to correctly determine containment relationships, thus affecting the accuracy of spatial analysis in GIS and related applications. Furthermore, the lack of a rigorous topological rule checking mechanism makes it difficult to automatically detect and correct erroneous topological relationships during data entry and processing.

[0099] In terms of attribute storage, traditional CAD systems lack systematic and standardized storage of geometric features of surface entities and related real-world attribute data. Geometric feature location information is not recorded accurately enough, and the storage of area and shape calculation results may contain errors. When storing real-world related attribute data, data consistency, integrity, and scalability are poor. For example, land use attribute classification standards are not uniform, the accuracy and integrity of ownership attribute data cannot be guaranteed, and the attribute storage structure lacks expansion space, making it difficult to meet the needs of subsequent business development for adding new attribute fields.

[0100] In terms of deriving specific types of surface entities, traditional CAD systems cannot adequately meet diverse business needs. For specific types of surface entities such as map patches, water areas, and land parcels, there is a lack of targeted design in terms of graphical representation, topological relationships, and attribute storage. They cannot effectively handle complex situations such as multiple components and island removal for land parcels and boundary demarcation entities, making it difficult to meet the special needs of professional business areas such as land management and cadastral management.

[0101] In summary, existing CAD systems have many shortcomings in 2D-3D surface solid construction technology, and there is an urgent need for a more efficient, accurate, flexible 2D-3D surface solid construction technology that can meet diverse business needs.

[0102] This embodiment aims to address the aforementioned shortcomings of existing CAD systems in constructing 2D-3D surface entities by providing a comprehensive and refined construction technology route. This will enhance the capabilities of CAD systems in constructing, representing, processing topological relationships, and storing attributes of complex surface entities, thereby better meeting the growing needs of various professional fields.

[0103] In the derivation process of 2D surface entity classes, the focus is on optimizing the overriding of drawing methods and constructors. For drawing methods, by introducing more advanced and precise geometric algorithms, the vertex coordinates of different types of 2D surface entities, such as polygons and irregular shapes, can be accurately calculated. Using these algorithms, not only can the shape and boundaries of the surface be accurately determined, but also adaptive display adjustments can be achieved at different scales and viewpoints based on the geometric characteristics of the surface entity. For example, using an adaptive subdivision algorithm, the detail display of the surface entity is automatically adjusted at different scaling levels, ensuring that the graphics remain clear and accurate, greatly improving the adaptability and accuracy of the graphics display.

[0104] Regarding constructor overriding, a rigorous data validation mechanism is established to ensure the accuracy and consistency of the initialization of member variables in 2D surface entity classes. When initializing the vertex coordinate set, multiple validation and error correction algorithms are used to avoid abnormal surface entity shapes caused by coordinate errors. Simultaneously, flexible default value setting strategies for display attributes are designed according to different application scenarios and user needs. For example, in architectural design scenarios, default settings conform to architectural industry standards for color and fill style, improving development efficiency while enhancing the user experience in specific fields.

[0105] For the expansion of 3D surface entities, this invention proposes a comprehensive expansion scheme. When adding 3D related attributes, the close relationship between 2D surfaces and height information is fully considered. By establishing a precise coordinate mapping relationship, it ensures that the position and shape of the 3D surface in the vertical direction accurately meet expectations. For example, a height mapping algorithm based on the geometric center of the 2D surface is used, making the vertical positioning of the 3D surface more scientific and accurate.

[0106] To achieve 3D manipulation capabilities, high-precision 3D geometric transformation matrices and optimized algorithms are employed. For 3D rotation, the rotation angle and axis vectors are calculated in real time to accurately update the 3D coordinates of the vertices, ensuring the accurate shape and position of the rotated 3D surface entities. In translation and scaling operations, stable incremental calculation and scaling algorithms are introduced to guarantee the stability and accuracy of the 3D surface entities during operation, avoiding problems such as deformation or positional shifts, thereby significantly improving the construction quality and operability of the 3D model.

[0107] In the entity representation stage, comprehensive improvements were made across multiple dimensions, including shape design, color and symbol systems, texture application, and display effects. In shape design, the principles of simplicity, clarity, and adherence to professional domain cognitive habits were followed, and various surface entities were standardized. For common geometric shapes, standard graphics libraries were used for rapid access; for irregular shapes, optimized vertex setting algorithms ensured accurate representation and easy identification.

[0108] In terms of color and symbol system applications, an intelligent matching mechanism based on the type and purpose of surface entities is established. Utilizing big data analytics and machine learning, surface entities across different industries and application scenarios are categorized, and the most suitable color and symbol system is automatically matched for each category. For example, for power line surface entities, a striking yellow color and specific line symbols are automatically matched to improve map readability and professionalism. Regarding texture applications, a rich and diverse texture library is developed, selecting appropriate textures based on the properties of the surface entities. For instance, when representing terrain, realistic terrain textures are used to enhance the map's realism and visualization.

[0109] In terms of scaling and panning display effects, a perfect balance between performance and user experience is achieved by optimizing data loading and rendering algorithms. A progressive data loading strategy is adopted, gradually loading detailed data of face entities according to the scaling level during scaling. This ensures clear display of details while avoiding display stuttering caused by excessive data volume. During panning operations, a real-time position calibration algorithm is introduced to ensure accurate positioning of face entities and that their relative positional relationship with other entities remains constant, providing users with a smooth and accurate operating experience.

[0110] In handling topological relationships, this invention employs advanced geometric calculation and logical judgment methods to improve the accuracy of determining adjacency, intersection, and containment relationships. By introducing a spatial index structure, such as an R-tree, the querying and judgment of spatial relationships between face entities are accelerated. For adjacency relationships, a boundary line matching algorithm is used to accurately identify the intersection of face entity boundaries and accurately record common boundary information. When handling intersection relationships, polygon clipping and merging algorithms are used to correctly process the attribute information of overlapping parts, ensuring accurate merging and transmission of attribute information. For containment relationships, a point-polygon containment detection algorithm is used to accurately determine whether one face entity is completely inside another face entity. Simultaneously, a rigorous topological rule base is established, and an automatic topological checking and correction mechanism is developed. During data entry and processing, entities undergo real-time topological checks. Once an erroneous topological relationship is detected, an automatic error correction process is triggered, correcting it through an intelligent repair algorithm to ensure the correctness of topological relationships and the quality of the data.

[0111] Regarding attribute storage, a scientific, standardized, and scalable attribute storage system is constructed. For the storage of geometric features, a high-precision coordinate storage format and accurate area and shape calculation algorithms are adopted. For example, double-precision floating-point numbers are used to store vertex coordinates to ensure the accuracy of positional information. When calculating the area, the optimal geometric algorithm is selected for different types of face entities. For example, for complex polygons, Green's formula is used for area calculation to ensure the accurate storage of area and shape calculation results.

[0112] For storing relevant attribute data in the real world, unified data standards and specifications should be established. Based on standards and specifications from different industries, attributes such as land use and ownership should be classified and coded to ensure data consistency and integrity. Simultaneously, an object-oriented database design approach should be adopted to create independent attribute objects for each entity, reserving abundant extension fields and interfaces. This allows for easy addition of new attribute fields during subsequent business development, meeting evolving business needs and ensuring the scalability of the attribute storage structure.

[0113] Regarding the derivation of specific types of surface entities, targeted designs are implemented for specific types of surface entities such as map patches, water areas, and land parcels, based on different business needs. For map patches, specific symbols and colors are automatically matched according to different land use types in terms of graphical representation. For example, cultivated land patches are represented using green fill and specific field symbols. In terms of topological relationship processing, the complex adjacency and intersection relationships between map patches are analyzed in depth, and specialized topological processing algorithms are developed to ensure the accuracy of relationship processing. In terms of attribute storage, in addition to basic geometric attributes, detailed information such as land use type codes and area statistics are recorded, and a two-way association mechanism between attributes and graphics is established to facilitate user querying and analysis.

[0114] For water surfaces, a blue color scheme is used as the primary graphic representation, with different textures and symbols matched according to the different properties of the water, such as oceans, rivers, and lakes. In terms of topological relationship processing, the inclusion and intersection relationships between water surfaces and other surface entities such as land and islands are accurately analyzed using topological analysis algorithms. Regarding attribute storage, in addition to recording the water surface name and area, information such as depth and water quality is also stored, providing comprehensive data support for water resource management and other business operations.

[0115] For land parcels, specialized processing algorithms were developed to address the complexity of their multiple components and island juxtaposition. In terms of graphical representation, layering and color differentiation clearly display the relationships between components and the island juxtaposition details. For topological relationship processing, a complex topological relationship model is established to accurately handle the topological relationships between different parts of the land parcel and with other surface entities. Regarding attribute storage, in addition to conventional geometric and cadastral attributes, the system records the association information between multiple components and detailed information on island juxtaposition, meeting the needs of cadastral management and other business operations for processing complex land parcel information.

[0116] Derivation of a 2D face entity class and overriding of drawing methods: First, define a new 2D face entity class, inheriting from AcDbEntity. Different vertex coordinate calculation methods are used for face entities of different shapes. For example, for polygonal face entities, the vertex set is generated based on user-input vertex information or a certain algorithm. If it is a regular polygon, the coordinates of each vertex in the Cartesian coordinate system can be calculated using trigonometric functions based on the given number and length of sides. For example, for a regular hexagon, given the side length as sideLength and the center coordinates as (centerX, centerY), the coordinates (x, y) of the i-th vertex are calculated as follows:

[0117] x=center X+sideLength*cos(2*π*i / 6)

[0118] y = centerY + sideLength * sin(2 * π * i / 6), where i takes values ​​from 0 to 5.

[0119] For irregular polygons, users can sequentially click to determine the vertex positions on the CAD interface, and the system records these vertex coordinates. During the drawing process, a viewport transformation matrix is ​​introduced to adapt to different scales and viewing angles. When the user zooms or rotates the view, the vertex coordinates are transformed accordingly based on the viewport transformation matrix. For example, with a zoom factor of scaleFactor, the vertex coordinates (x, y) are updated to (x*scaleFactor, y*scaleFactor). Simultaneously, the drawing precision is appropriately selected based on the geometry of the solid and the display range to avoid jagged edges and other issues at high zoom levels.

[0120] Constructor Overriding: In the constructor, the geometric and display properties of the face entity are initialized. For geometric properties, the vertex coordinate set is first initialized to empty, and then filled with vertex information input by the user or calculated. During the filling process, strict data validation is performed, such as checking whether the coordinate values ​​are within a reasonable range to avoid invalid coordinates. For area properties, an appropriate area calculation method is selected based on the shape of the face entity. For example, for polygons, the cross product method can be used to calculate the area. Assuming that the polygon vertices are (x1, y1), (x2, y2), ..., (xn, yn), the area calculation formula is:

[0121]

[0122] For display attributes, default values ​​are set according to the application scenario. For example, in an architectural design scenario, the default color is set to gray, and the fill style is set to solid fill. An interface is also provided to allow users to modify these display attributes in subsequent operations.

[0123] Extending a 3D surface solid by adding 3D-related attributes:

[0124] Based on the derived 2D face entity class, add member variables related to height information, such as `height`. For each vertex of the 2D face, assign a corresponding height value to generate the 3D face. This can be achieved in various ways, such as the user manually inputting the height value, or automatically calculating the height based on certain attributes of the 2D face. For example, for terrain-related 2D faces, calculate the height of each vertex based on its elevation data. Assuming the coordinates of a 2D face vertex are (x, y), by querying the terrain elevation data to obtain the corresponding elevation `h`, the coordinates of the 3D vertex will be (x, y, h).

[0125] To ensure that the position and shape of the 3D surfaces in the vertical direction meet expectations, a correlation model between the 2D surfaces and their 3D heights is established. For example, by defining a reference plane, the height of all 3D surfaces is calculated and adjusted relative to this reference plane. When the 2D surfaces undergo translation, rotation, or other operations, the height information is also adjusted accordingly to ensure the overall consistency of the 3D surfaces.

[0126] Extended functionality to support 3D operations:

[0127] 3D Rotation: To implement 3D rotation, a 3D geometric transformation matrix is ​​used. Assuming the rotation axis is (a, b, c) and the rotation angle is theta, then the 3D rotation matrix R is:

[0128]

[0129] For each vertex (x,y,z) of the three-dimensional surface, the new coordinates of the vertex after rotation are calculated by matrix multiplication (x',y',z') = R*(x,y,z), thereby realizing the rotation operation of the three-dimensional surface.

[0130] 3D Translation: Translation operations are relatively simple. Assuming the translation vector is (tx, ty, tz), then each vertex (x, y, z) of the 3D surface is updated to (x+tx, y+ty, z+tz). During implementation, the display of the 3D surface is updated in real time to ensure that users can intuitively see the translation effect.

[0131] 3D scaling: Let the scaling factor be scale. Each vertex (x, y, z) of the 3D surface is updated to (x*scale, y*scale, z*scale). At the same time, considering the possible impact of scaling on the appearance and proportion of the 3D surface, relevant display parameters are adjusted, such as line thickness and texture scaling, to ensure that the 3D surface still has a good visual effect after scaling.

[0132] Solid representation and shape design: For basic shapes such as rectangles and circles, standard drawing functions provided by the CAD system are used directly. For example, when drawing a rectangle, the user only needs to specify the coordinates of two diagonal vertices, and the system can call the relevant functions to draw the rectangle. For irregular shapes, the user draws the outline on the CAD interface or imports external data files to obtain vertex information, and then constructs polygons based on this vertex information. During the construction process, the vertex order is optimized to ensure the correct orientation of the polygons and avoid problems such as self-intersection. Simultaneously, shape editing tools are provided, allowing users to move, add, and delete vertices on drawn shapes to meet different design needs.

[0133] Color, symbol system, and texture application: A color and symbol library is established, categorizing entities based on their type and purpose. For example, land use types are divided into arable land, forest land, and construction land, with arable land assigned green, forest land dark green, and construction land gray. Regarding symbols, specific symbols are defined for different types of entities, such as using field symbols for arable land and tree symbols for forest land. When an entity is created, the system automatically matches the appropriate color and symbol based on its type.

[0134] In terms of texture application, a texture management module has been developed. Users can select appropriate textures from the texture library to apply to surface entities, such as choosing brick textures for building surfaces and turf textures for grass. For some special texture requirements, texture editing functions are provided, allowing users to adjust parameters such as texture color, contrast, and scaling to achieve the desired visual effect.

[0135] Implementation of zooming and panning effects: A progressive data loading strategy is employed during zooming operations. When the user zooms the view, the required level of data detail is determined based on the current zoom level. For example, at low zoom levels, only the general outline of the face entities is displayed, reducing the amount of data and improving display speed; at high zoom levels, detailed information about the face entities, such as texture details and precise vertex coordinates, is loaded progressively. Simultaneously, a caching mechanism is used to cache already loaded data, avoiding duplicate loading and further improving performance.

[0136] During translation, the display position of the face entities is updated in real time. By recording the translation vector, the vertex coordinates of all face entities are adjusted accordingly, ensuring that the relative positional relationships between face entities remain unchanged. During translation, the display boundary is detected, and when a face entity moves out of the display range, the display area is automatically adjusted to ensure the continuity of user operation.

[0137] Topological relationship processing and adjacency determination: A spatial indexing structure, such as an R-tree, is used to spatially index all face entities. When determining whether two face entities are adjacent, the R-tree is first used to quickly locate the set of potentially adjacent face entities, reducing unnecessary computation. Then, for each face entity in the set, a boundary line matching algorithm is used. The boundary lines of the face entities are discretized into a set of line segments. The distance between the boundary line segments of two face entities is compared to determine whether they intersect. If intersecting line segments exist, the two face entities are considered adjacent, and their common boundary information is recorded.

[0138] Intersection Relationship Determination: A polygon clipping and merging algorithm is used to handle the intersection relationships of face entities. When two face entities are detected as potentially intersecting, a preliminary screening is performed based on coordinate range to exclude obviously non-intersecting cases. Then, for potentially intersecting face entities, they are represented as polygons, and the Sutherland-Hodgman polygon clipping algorithm is used to calculate the polygons of the intersection portion. During the calculation process, the attribute information of the face entities, such as color and texture, is considered, and the attributes of the intersection portion are reasonably merged. For example, if two face entities have different colors, the intersection portion can be represented by a mixed color, or the color of the intersection portion can be determined according to a certain priority rule.

[0139] Inclusion determination: A point-polygon inclusion detection algorithm is used to determine whether one face entity is completely inside another face entity. For each face entity to be detected, one vertex is selected, and the ray casting method is used to determine whether that vertex is inside the other face entity. If the vertex is inside, the same detection is performed on other vertices. If all vertices are inside the other face entity, then the face entity is considered to be included. During the determination process, the boundary conditions of the face entities are considered, such as whether points on the boundary are within the scope of the inclusion relationship determination, to ensure the accuracy of the determination results.

[0140] Topology rule checking and correction: A topology rule base is established, including rules such as face entity boundaries cannot self-intersect and adjacent face entities should have consistent common boundaries. During data entry and processing, topology checks are performed on entities in real time. When a violation of topology rules is detected, an automatic correction mechanism is triggered. For example, if a face entity boundary self-intersects, the location and cause of the self-intersection are analyzed, and a vertex adjustment algorithm is attempted to repair it. If automatic repair fails, the user is prompted to intervene manually, and relevant editing tools are provided to help the user correct erroneous topological relationships.

[0141] Attribute and geometric feature storage: Double-precision floating-point numbers are used to store the vertex coordinates of face entities, ensuring high-precision storage of positional information. For area and shape information, an appropriate calculation method is selected based on the type of face entity, and the calculation results are stored in the database. For example, for polygonal face entities, the cross product method described above is used to calculate the area, and the area value is associated with the face entity's identification information for storage. For shape information, the number of polygon vertices, vertex coordinate sequences, etc., can be stored for subsequent shape analysis and comparison.

[0142] Real-world related attribute data storage: Attributes such as land use and ownership are classified and coded according to different industry standards. For example, land use is divided into primary and secondary categories according to national standards, with a unique code assigned to each category. In the database design, an attribute table is created for each polygon entity, containing geometric feature attributes and real-world related attribute fields. For land use attributes, their coded values ​​are stored, and a mapping relationship between the codes and detailed descriptions is established for easy user querying and management. For ownership attributes, the accuracy and integrity of the data are ensured, such as by checking the format and authenticity of ownership information through data validation mechanisms. Simultaneously, extension fields are reserved for the attribute table to meet future attribute requirements. For example, several general text and numeric fields are reserved so that when new attributes need to be stored, these fields can be used directly without large-scale modifications to the database structure.

[0143] Derivation of specific type face entities, image patch:

[0144] Graphical Representation: Based on the land use type code, specific colors and symbols are automatically matched from a color and symbol library. For example, if the land use type is arable land, the color is set to green, and the symbol is a field pattern. Simultaneously, the display ratio and position of the symbols are adjusted appropriately according to the shape and size of the map patch to ensure clear and accurate graphic representation.

[0145] Topological Relationship Processing: For complex adjacency and intersection relationships between map patches, specialized topological analysis algorithms were developed. When determining adjacency, in addition to using the aforementioned general boundary line matching algorithm, differences in land use types among the map patches are also considered. For example, when map patches with different land use types are adjacent, their boundaries may need to be highlighted. When processing intersection relationships, the land use type of the intersecting portion is determined according to land use type priority rules. For example, when cultivated land intersects with construction land, the use of the intersecting portion is determined according to relevant regulations, and the topological relationships and attribute information are updated.

[0146] Attribute storage: In addition to storing basic geometric attributes, the system focuses on recording information such as land use type codes and area statistics. To facilitate data analysis and querying, a two-way association between attributes and graphics is established. For example, by using the unique identifier of a map patch in the database, not only can its attribute information be retrieved, but its location in the CAD drawing can also be quickly determined. Simultaneously, area statistics are updated regularly to ensure data accuracy.

[0147] Water Surface: Graphic Representation: The primary color scheme is blue, with different textures and symbols selected based on the type of water surface (ocean, river, lake, etc.). For example, oceans use blue gradient textures and wave symbols, while rivers use blue lines and flowing arrow symbols. During display, the scaling of textures and the distribution of symbols are adjusted appropriately according to the extent and shape of the water surface to enhance the realism and readability of the graphics.

[0148] Topological relationship processing: Accurately analyze the inclusion and intersection relationships between water surfaces and other surface entities (land, islands, etc.). For inclusion relationships, the point-polygon inclusion detection algorithm described above is used for judgment, and information such as included islands is recorded. When processing intersection relationships, the interaction between water and land is considered, such as the determination of coastlines. Through topological analysis algorithms, the boundary information and attributes of relevant surface entities are updated to ensure the accuracy of topological relationships.

[0149] Attribute storage: In addition to recording the name and area of ​​the water body, it stores relevant information such as depth and water quality. For depth information, it can be stored in various ways, such as average depth and maximum depth, to meet different application needs. Water quality information can be classified and coded according to relevant standards, such as classifying water quality into Class I, Class II, etc., and recording corresponding information such as the detection time. Simultaneously, it establishes a link between water surface attributes and graphics, allowing users to easily query attribute information through graphics or filter specific water surfaces based on attributes.

[0150] Land Parcel: Graphical Representation: For complex situations involving multiple components and islands, a layered display and color-coded distinction method is employed. Different parcels within a multi-component land use are drawn on separate layers and distinguished by different colors. Relationships between them are indicated by connecting lines. For islands, their boundaries are represented by special colors or line types to differentiate them from the outer boundaries of the land parcel. During display, the visibility of each layer can be flexibly controlled according to user needs, facilitating viewing and editing.

[0151] Topology Relationship Processing: A complex topology relationship model is established, comprehensively considering the topology relationships between different parts of the parcel and with other surface entities. For topology relationships between multiple components, the aforementioned methods for determining adjacency and intersection are used, and the connection information between components is recorded. For island truncation, the topology relationships between the parcel and surface entities within the island are accurately processed to ensure accurate recording of boundary information and attributes. During data updates, the consistency of topology relationships is checked and maintained in real time to avoid topology errors.

[0152] Attribute storage: In addition to regular geometric and cadastral attributes, the focus is on recording the relationship information between multiple components and detailed information on islands. For the relationship information between multiple components, the relative positions and connection methods of each component are stored. For the island information, the area, shape, and internal attributes of the island are recorded. Simultaneously, a two-way association between parcel attributes and graphics is established to facilitate the querying, statistics, and analysis of complex parcel information for cadastral management and other business operations.

[0153] The 2D-3D surface solid construction technology route for CAD systems proposed in this embodiment brings many significant benefits.

[0154] In terms of 2D solid class derivation, the optimized drawing method achieves more precise shape and boundary accuracy by accurately calculating vertex coordinates. Taking irregular polygons as an example, traditional methods may suffer from vertex coordinate deviations, leading to shape distortion. This technology, however, accurately locates each vertex, ensuring accurate graphic presentation. Simultaneously, the adaptive display adjustment function greatly enhances the user experience. Under different scales and viewing angles, the graphics maintain a clear and accurate display, avoiding the blurry or distorted display problems of traditional methods. Whether viewing the macro layout or examining micro-details, it provides users with reliable visual information, improving the efficiency and quality of design work. The data validation mechanism during constructor overriding and the flexible default value settings for display attributes ensure the accuracy and consistency of the initialization of 2D solid class member variables, reducing shape anomalies caused by data errors. Furthermore, the automatically adaptable default values ​​for display attributes based on different application scenarios save time spent on manual settings during development, improving development efficiency and enhancing the convenience and professionalism for users employing CAD systems in specific fields.

[0155] The 3D surface entity expansion section employs precise methods for adding relevant 3D attributes, such as establishing accurate height mapping relationships based on 2D surfaces, ensuring that the position and shape of the 3D surface in the vertical direction precisely match expectations. Compared to traditional methods where inaccurate association between height information and 2D surfaces leads to 3D model deformation, this technology constructs a more realistic and reliable 3D model. High-precision 3D geometric transformation matrices and optimization algorithms guarantee the stability and accuracy of 3D surface entities during rotation, translation, and scaling during 3D operations. In the field of architectural design, designers can perform various operations on 3D architectural models without worrying about model deformation or positional shifts. This is crucial for accurately showcasing architectural structures and spatial layouts, providing strong support for the evaluation and optimization of design schemes.

[0156] Comprehensive improvements to entity representation enhance map information display and user comprehension across multiple dimensions. Concise and clear shape designs, aligned with professional cognitive habits, allow users to quickly identify different surface entities, reducing difficulties in interpreting information caused by complex shapes. An intelligent color and symbol matching system, based on big data analysis and machine learning, automatically matches the most suitable colors and symbols for different types of surface entities, significantly enhancing map readability. For example, in power industry maps, the use of specific colors and symbols allows staff to quickly identify surface entities such as power lines and substations. Rich and diverse, targeted texture applications add realism and visualization to the map, making it more vivid and helping users better understand geographic information. Regarding zooming and panning, optimized data loading and rendering algorithms achieve a perfect balance between performance and user experience. A progressive data loading strategy avoids display stuttering during zooming, ensuring clear detail display, while real-time position calibration algorithms guarantee the accuracy of panning operations, providing users with a smooth and efficient operating experience, enabling them to easily handle large-scale map data browsing.

[0157] Improvements in topological relationship processing, achieved through advanced geometric calculations and logical judgment methods, along with a rigorous topological rule checking and correction mechanism, significantly enhance the accuracy and quality of topological relationship determination. Precise determination of adjacency, intersection, and containment relationships provides an accurate spatial analysis foundation for GIS and related applications. In urban planning, accurate topological relationships help planners better analyze the spatial relationships between different plots and rationally plan land use. The automatic topological checking and correction mechanism operates in real-time during data entry and processing, promptly identifying and correcting erroneous topological relationships. This reduces the workload and error rate of manual checks, ensuring data consistency and reliability, and providing solid data support for subsequent data analysis and decision-making.

[0158] The scientifically constructed attribute storage system enables high-precision and standardized storage of geometric features and real-world related attribute data. High-precision coordinate storage format and accurate area and shape calculation algorithms ensure the accuracy of geometric feature information, providing a reliable data foundation for subsequent graphic analysis and processing. Unified data standards and specifications, along with object-oriented database design methods, guarantee the consistency, integrity, and scalability of real-world related attribute data. In the field of land management, standardized storage of attributes such as land use and ownership facilitates data statistics, querying, and analysis. Meanwhile, reserved extended fields can meet the storage needs of newly added attributes in future business development, protecting data investment and extending the system's lifespan.

[0159] The targeted design of specific types of surface entities meets the special needs of different business areas. Optimizations in graphic representation, topological relationship processing, and attribute storage for land parcels facilitate accurate identification and analysis of land use types, providing a powerful tool for land resource management. The design of water area surfaces, from graphic display to attribute storage, fully supports water resource management and other business operations, facilitating comprehensive understanding and utilization of water area information. The handling of complex situations involving multiple components and islands in parcel surface management meets the needs of cadastral management for processing complex parcel surface information, improving the efficiency and accuracy of cadastral data management.

[0160] In summary, the 2D-3D surface solid construction technology approach of the CAD system in this embodiment comprehensively improves the capabilities of the CAD system in surface solid construction, expression, topological relationship processing, and attribute storage, bringing higher efficiency, accuracy, and reliability to CAD applications in various professional fields, and has significant economic benefits and practical value.

[0161] The key points of this embodiment are: When deriving a 2D surface entity class based on AcDbEntity, the precise rewriting of the drawing method and constructor ensures accurate construction and display of the 2D surface entity. In the 3D surface entity extension, the precise association between the added 3D related attributes and the 2D surface, and the high-precision algorithms for implementing 3D operations. In entity representation, a comprehensive optimization strategy for shape design, color and symbol systems, texture application, and display effects. In topological relationship processing, advanced geometric calculation and logical judgment methods, as well as a strict topological rule checking and error correction mechanism. Regarding attribute storage, a high-precision geometric feature storage method and a standardized, scalable real-world related attribute storage system. Targeted design and processing based on business needs for specific types of surface entities (map surfaces, water surfaces, land parcels, etc.).

[0162] This embodiment covers the specific drawing method rewriting algorithm and the data verification and default value setting mechanism for constructor rewriting during the derivation of two-dimensional surface entities. When expanding three-dimensional surface entities, it includes the addition of associated models for three-dimensional attributes and the specific algorithms and transformation matrix applications for implementing three-dimensional operations. It also covers the specific methods used to optimize various aspects of entity representation, such as intelligent color and symbol matching algorithms, texture application management methods, and display effect optimization algorithms. In topological relationship processing, it covers the specific algorithms for determining adjacent, intersecting, and contained relationships, as well as the implementation of topological rule checking and error correction mechanisms. In the attribute storage system, it covers the geometric feature storage format and calculation methods, and the classification encoding and storage structure design of relevant attribute data from the real world. Finally, it outlines the unique design and implementation methods for the graphical representation, topological relationship processing, and attribute storage of different types of surface entities during derivation.

[0163] like Figure 2As shown, a flowchart of the 2D surface entity class derivation process is provided: it shows the process of starting from inheriting AcDbEntity, overriding the drawing method and constructor, including vertex coordinate calculation, data verification, attribute initialization and other steps, with squares and arrows indicating the process flow.

[0164] like Figure 3 As shown, a diagram of the extended architecture of a 3D surface entity is provided: it shows how a 2D surface entity class can be extended into a 3D surface entity, including the way to add a height attribute, and the module architecture for implementing 3D rotation, translation, and scaling functions. The modules are connected by lines to indicate the data flow and interaction relationship.

[0165] like Figure 4 As shown, a schematic diagram of entity representation is provided: using example maps to demonstrate the graphics of different face entities under different shape designs, color and symbol applications, texture display, and scaling and panning effects, intuitively presenting the optimized effect of entity representation.

[0166] like Figure 5 As shown, a flowchart for topological relationship processing is provided: describing the algorithm flow for judging adjacent, intersecting, and containing relationships, as well as the process of topological rule checking and error correction, and graphically displaying the logical judgment and processing steps.

[0167] like Figure 6 As shown, a schematic diagram of the attribute storage structure is provided: it shows the storage structure of geometric feature attributes and real-world related attribute data in the database, and uses tables and field relationship diagrams to represent the storage method and association relationship.

[0168] like Figure 7 As shown, example diagrams of specific types of surface entities are provided: schematic diagrams of the graphical representation, topological relationship presentation, and attribute storage of patch surfaces, water surfaces, and parcel surfaces, respectively, to help understand how specific types of surface entities are processed.

[0169] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

Claims

1. A method for constructing two-dimensional and three-dimensional surface solids for computer-aided design systems, characterized in that, The method includes: A two-dimensional face entity class is derived from the AcDbEntity class. For regular polygons, the two-dimensional coordinates of each vertex are accurately calculated using trigonometric functions based on the number of sides and side length. For irregular polygons, the vertex coordinates are collected by the user through interaction in the CAD interface and a vertex set is formed. The viewport transformation matrix is ​​used to transform the vertex coordinates of a two-dimensional surface entity, so as to realize the dynamic adaptive adjustment of vertex coordinates under different scaling ratios and viewpoints. Specifically, it includes linear scaling of vertex coordinates according to the scaling factor and rotation transformation based on the rotation matrix. In the constructor of the 2D surface entity class, a multi-factor data validation process is executed, including validating the vertex coordinates, removing duplicate vertices, and calculating and initializing the area attribute of the 2D surface entity using the vector cross product method. Add a height attribute to the 2D surface entity class to establish a mapping relationship between the 2D surface vertices and the height value. The height value is obtained through user input or external elevation data to realize the height mapping of the 2D surface to the 3D surface and generate the 3D vertex coordinates. Apply a 3D rotation matrix based on the rotation axis vector and rotation angle to perform matrix multiplication operation on each vertex of the 3D surface entity to realize the rotation transformation of the 3D surface entity. The vertex coordinates of the 3D surface entity are translated by adding the corresponding components of the translation vector to the vertex coordinates and scaling them by a uniform scaling factor to ensure the accuracy of the position and size changes of the 3D surface entity in space. An intelligent entity representation module is constructed, which automatically matches the corresponding color code, symbol identifier and texture fill according to the geometric shape, type and business attributes of the surface entity. The color and symbol library is dynamically optimized based on big data analysis and machine learning models. A spatial index structure based on R-tree is adopted to accelerate the query of spatial relationships between face entities. Combined with the boundary line segment discretization algorithm, the adjacency relationship between face entities can be accurately determined. The Sutherland-Hodgman polygon clipping algorithm is used to accurately extract the intersecting parts between face entities. The color, symbol and business attributes of the intersecting areas are merged by combining attribute fusion rules. The inclusion relationship of face entities is accurately determined by ray casting and boundary determination rules. The automatic topology rule library is used to detect the self-intersection of face entity boundaries and the consistency of common boundaries in real time and perform intelligent error correction.

2. The method according to claim 1, characterized in that, The specific steps for calculating the vertex coordinates of the regular polygon include: Based on the number of sides n and side length sideLength of the polygon input by the user, the two-dimensional coordinates of the i-th vertex are calculated using the polygon center point (centerX, centerY) as the reference, through the formulas x=centerX+sideLength*cos(2*π*i / 6) and y=centerY+sideLength*sin(2*π*i / 6); where i takes values ​​from 0 to 5.

3. The method according to claim 1, characterized in that, The steps for calculating the area of ​​the two-dimensional surface entity include: Using the cross product method, the area S is calculated based on the vertex coordinate sequence (x1, y1), (x2, y2), ..., (xn, yn) of a two-dimensional surface entity. The formula used is:

4. The method according to claim 1, characterized in that, The steps for constructing and applying the three-dimensional rotation matrix include: normalizing the rotation axis vectors (a, b, c), with the rotation angle being theta, then the three-dimensional rotation matrix R is: For each vertex (x, y, z) of the 3D surface, the new coordinates of the vertex after rotation are calculated by matrix multiplication (x', y', z') = R*(x, y, z), thereby realizing the rotation operation of the 3D surface.

5. The method according to claim 1, characterized in that, The application of the viewport transformation matrix includes the following specific transformation steps: 3D translation: If the translation vector is (tx,ty,tz), then each vertex (x,y,z) of the 3D surface is updated to (x+tx,y+ty,z+tz); 3D scaling: Let the scaling factor be scale, and each vertex (x,y,z) of the 3D surface is updated to (x*scale,y*scale,z*scale).

6. The method according to claim 1, characterized in that, The intelligent entity representation module specifically includes: Based on the geometric features and business attributes of the surface entity, the system calls the predefined color library and symbol library to automatically match the corresponding color code and symbol style. By leveraging big data analytics and machine learning technologies, color and symbol matching rules are dynamically optimized to support adaptation to multiple industries and application scenarios. By dynamically adjusting the display details of textures and symbols based on the current view zoom level, the visual effects remain consistent and clear.

7. The method according to claim 1, characterized in that, The spatial index structure adopts an R-tree index, and the construction steps include: By using a recursive space partitioning algorithm, the two-dimensional space is divided, and multi-level index nodes are constructed to reduce the complexity of space queries; During the spatial query phase, the R-tree is traversed to quickly locate the candidate set of face entities that may be adjacent or intersecting, reducing unnecessary computation. The boundary segment discretization method is used to accurately determine whether the boundaries of candidate surface entities are adjacent, ensuring the correct identification of adjacent relationships.

8. The method according to claim 1, characterized in that, The steps for extracting the intersection of facets include: For potentially intersecting face entities, the Sutherland-Hodgman polygon clipping algorithm is applied to calculate the intersecting polygon regions; Attribute fusion is performed on intersecting areas, including color mixing, symbol merging, and business attribute priority processing, to ensure accurate reflection of the attributes of intersecting areas.

9. The method according to claim 1, characterized in that, Topology detection and error correction mechanisms include: The ray casting method is used to detect whether a vertex of a face entity is located inside another face entity, thus realizing the determination of containment relationships. A polygon self-intersection detection algorithm is used to locate and identify self-intersection points and mark topological errors in real time; Check the consistency of the common boundary of adjacent face entities. If there is a boundary mismatch, automatically adjust the vertices or prompt the user to intervene and correct it. The topology rule base contains multiple rules that check the topological relationships between surface entities in real time to ensure data integrity.

10. The method according to claim 1, characterized in that, Processing for specific types of facet entities includes: Map patch: Automatically matches the corresponding color and symbol according to the land use code, and adjusts the symbol display ratio to adapt to different patch sizes to ensure clear visual expression; Water surface: Blue gradient texture and different texture styles are used to distinguish oceans, rivers and lakes, and texture parameters are adjusted in combination with water quality and depth attributes; Parcel: Supports multi-component and island-based structures, employs layered display technology to present the main parcel and its internal islands separately, maintains complex topological relationships, records the association information between multiple components, and achieves accurate cadastral management expression.