Intelligent generation method for component deepening drawing based on IFC and reinforcement learning
By combining IFC and reinforcement learning with OCCT technology and Rtree data structure, the problems of repetitive input and manual adjustment in the process of generating detailed component drawings are solved, realizing fast and accurate component digitization and intelligent annotation layout, and generating high-quality detailed design drawings.
Patent Information
- Application Number
- CN202411070541.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-06
- Publication Date
- 2024-11-15
AI Technical Summary
Existing design software consumes a lot of time repeatedly inputting data when generating detailed component drawings, making it difficult to handle complex components. Furthermore, the layout of dimension annotations relies on rules or manual adjustments, resulting in low levels of digitization, automation, and intelligence.
A digital model is established using the IFC general standard, and OCCT technology is used for model transformation and planar data acquisition. The Rtree data structure is combined with annotation collision detection, and reinforcement learning algorithm is used to realize intelligent layout of dimension annotations and generate detailed design drawings of components.
It enables the rapid and accurate creation of digital models of components, and the automated generation of detailed design drawings for complex components, thereby improving the level of digitalization and intelligence and reducing manual intervention and errors.
Smart Images

Figure CN118965578A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to computer-aided design technology, and in particular to an intelligent generation method for component deepening drawings based on IFC and reinforcement learning. Background Art
[0002] IFC (Industry Foundation Class) is a common data exchange standard in the construction industry. Its purpose is to achieve data exchange and sharing between different software throughout the entire life cycle of the construction. This standard uses the EXPRESS language for data definition, thereby achieving information description and acquisition.
[0003] Reinforcement learning is a branch of machine learning. It mainly studies how intelligent agents adjust their behavior in the environment through continuous trial and error to obtain the maximum cumulative reward. Through long-term interaction with the environment, intelligent agents can learn to complete a task in the environment.
[0004] The shortcomings of the existing technology are that although the current design software can automatically generate detailed drawings of some components, it takes a lot of time to repeatedly input data, and the existing software usually only supports simple component shapes and is difficult to meet the actual requirements for complex components. In addition, in terms of dimensioning layout, it relies entirely on rules or manual adjustments, and the degree of digitization, automation, and intelligence is low.
[0005] Therefore, there is an urgent need to provide an intelligent generation method of component deepening drawings based on IFC and reinforcement learning to solve the above technical problems. Summary of the invention
[0006] In view of this, the present invention provides a method for intelligently generating component deepening drawings based on IFC and reinforcement learning, so as to solve the technical problems in the existing methods, such as low digitization, automation and intelligence, labor-intensiveness and easy errors.
[0007] In order to achieve the above object, the specific technical solution adopted by the present invention is as follows:
[0008] A method for intelligently generating component detailed drawings based on IFC and reinforcement learning includes the following steps:
[0009] S1: Input components, reinforcement and structural information, and build a digital model using the IFC general standard;
[0010] S2: extracting structural information from the digital model and establishing an OCC model using OCCT (Open CASCADE Technology);
[0011] S3: using OCCT technology to perform a model transformation operation on the OCC model, and obtaining plane data after the model transformation;
[0012] S4: Create a drawing template file and set the annotation style, text style and layer style;
[0013] S5: Draw a plane graphic using the plane data and assign layer information;
[0014] S6: Using Rtree data structure to implement hybrid bounding box based annotation collision detection;
[0015] S7: Using reinforcement learning algorithm to realize intelligent layout of dimensioning;
[0016] S8: Generate component detailed design drawings.
[0017] Optionally, the construction information in the digital model includes reserved hole information, tongue and groove position and shape information, and roughening requirement information, and the steel bar information in the digital model includes actual cutting size and shape of the steel bar.
[0018] Optionally, the model transformation in step S3 includes a rotation operation, a projection operation and a sectioning operation.
[0019] Optionally, in step S4, a DXF drawing template file is created using AutoCAD, and then 1:20 and 1:10 dimensioning styles are added to the drawing template file, and component outline layers, structural reinforcement layers, stress-bearing reinforcement layers, elevation symbol layers, structural detail layers, and embedded parts outline layers are selectively added.
[0020] Optionally, in step S5, the plane data transformed by the OCC model is used to draw the plane graphics, the smallest structural unit in the plane data is two points of a line segment, the largest structural unit is a set of countless adjacent points at the beginning and the end, and the smallest line segment composed of adjacent points represents the accuracy of the projection transformation.
[0021] Optionally, in step S6, the Rtree data structure is used to perform label collision detection based on a hybrid bounding box label collision detection algorithm that combines an axis-aligned bounding box with a directed bounding box.
[0022] Optionally, the reinforcement learning algorithm described in step S7 is a Q-learning algorithm, and the two-dimensional drawing is used as the reinforcement learning environment. The environment contains objects to be annotated and other graphics, and the annotation text box to be added is used as an intelligent agent. The state of the intelligent agent is the position of the annotation text box to be added, and its state space is the two-dimensional drawing. The action space of the intelligent agent is: up, down, left, and right.
[0023] Optionally, the reward rules for the agent in the reinforcement learning algorithm include: whether it reaches the unlabeled collision area, the distance from the center point of the object, whether it collides with other graphics, and whether it crosses the graphics boundary. When the agent moves to the unlabeled collision or the maximum number of adjustment steps, the round ends.
[0024] Optionally, the component detailed design drawing generated in step S8 includes three views of the component, a reinforcement drawing, a material table and processing details, the three views are a main view, a top view and a side view, the reinforcement drawing includes a cross-sectional reinforcement drawing and a side reinforcement drawing, the material table includes a steel bar cutting table, a component information table, a pre-embedded accessories list and a prefabricated component material strength table, and the processing details include three views of embedded parts and a connection method drawing.
[0025] Optionally, the reinforcement learning algorithm accumulates experience through continuous learning, and stores the learned experience values in Q-table. When intelligent layout of dimensioning for the same problem is required, the experience values in the Q-table are directly migrated for processing.
[0026] Compared with the prior art, the intelligent generation method of component detailed drawings based on IFC and reinforcement learning provided by the present invention has the following beneficial effects:
[0027] The present invention uses the IFC universal standard to quickly and accurately establish digital models of components and steel bars: the powerful BRep boundary representation method of OCCT technology, as well as model transformation, projection, and sectioning functions, can be used to accurately express the OCC model, and can obtain any high-precision projection or sectioning contour; the reinforcement learning algorithm is used to regard the two-dimensional drawing as a reinforcement learning environment, and the text to be annotated is used as an intelligent agent. The reward and punishment values are set according to the readability requirements of the drawing, so that the intelligent agent can continuously try and fail and finally learn to complete the intelligent layout of dimensioning, and finally generate the detailed design drawings of the components;
[0028] By adopting the above method, the number of component modeling times can be reduced, the geometric shapes of simple and complex components can be accurately expressed, digital models can be automatically generated, and component in-depth design drawings can be generated at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] Figure 1 An operation flow chart of the intelligent generation method of component deepening drawings based on IFC and reinforcement learning provided by the present invention;
[0030] Figure 2 It is a schematic diagram of the component parts in a specific embodiment;
[0031] Figure 3 It is a schematic diagram of the components of the steel bars and embedded parts in a specific embodiment;
[0032] Figure 4It is the OCC model linked to the IFC model;
[0033] Figure 5 It is the component projection contour map based on OCCT technology;
[0034] Figure 6 It is the cross-sectional profile of the component based on OCCT technology;
[0035] Figure 7 is a diagram of the Rtree data structure in a specific embodiment of the present invention;
[0036] Figure 8 is a flow chart of collision detection based on a hybrid bounding box in a specific embodiment of the present invention;
[0037] Fig. 9 This is a flow chart of intelligent labeling based on reinforcement learning in a specific embodiment of the present invention;
[0038] Fig.10 For drawings with overlapping annotated graphics;
[0039] Fig.11 Drawings that have been intelligently adjusted for annotation. DETAILED DESCRIPTION
[0040] The present invention is described in detail below through specific embodiments. It is pointed out that the following embodiments are only used to further illustrate the present invention and cannot be understood as limiting the scope of protection of the present invention. Those skilled in the art can make some non-essential improvements and adjustments to the present invention based on the above invention content.
[0041] like Figure 1 As shown, the present invention provides a method for intelligently generating component detailed drawings based on IFC and reinforcement learning, comprising the following steps:
[0042] S1: Input the component, reinforcement and structural information, and establish a digital model using the IFC general standard; the information usually input includes component size and structural details, such as reserved holes, tongues and grooves, anti-slip grooves, etc. The reinforcement digital model includes the actual cutting size, position, diameter and strength grade of all reinforcements, and the embedded parts digital model includes the shape, position, quantity and components of the embedded parts; compared with other component 3D models (which do not contain digital information), the digital model can be used for information exchange between different software;
[0043] S2: Extract construction information from the digital model, and establish an OCC model using OCCT technology; the OCC model is a model expressed using BRep boundary representation, that is, a three-dimensional entity is defined using points, edges, faces, loops, and their mutual adjacency relationships, and the surface of the body, boundary lines, intersection lines, etc. are all explicitly expressed; in specific implementation, the information of the elements required for deepening the drawings can be extracted based on the IFC digital model, and the OCC model can be established using the stretching, sweeping, rotation, and Boolean operations (intersection, union, and subtraction) of the OCCT technology, and the number of models is generally greater than or equal to 1; usually, when the view content constitutes a template drawing, it includes a top view, a side view, a front view, and a sectional view; when the view content constitutes a reinforcement drawing, it includes a plane reinforcement drawing, a vertical reinforcement drawing, and a sectional reinforcement drawing; when the view content constitutes a material table, it includes a steel bar cutting table, a component information table, a pre-embedded accessories list, and a prefabricated component material table; when the view content constitutes a processing detail drawing, it includes three views of embedded parts, a horizontal connection method drawing, a vertical connection method drawing, etc.;
[0044] S3: using OCCT technology to perform a model transformation operation on the OCC model, and obtaining plane data after the model transformation;
[0045] Model transformation usually includes rotation operation, projection operation and sectioning operation, etc. The above operations are combined to form a model transformation matrix. Projection is to use the hidden line elimination algorithm to define the viewpoint in the model, set the line of sight from the viewpoint to the projection surface, and the visible line is a solid line, and the invisible line is a dotted line; sectioning is to use the Boolean operation in the OCCT technology to create a sectioning plane at the position to be sectioned in the OCC model, and then use the Boolean operation intersection operation to obtain the sectioning contour information of the OCC model;
[0046] S4: Create a drawing template file and set the annotation style, text style and layer style;
[0047] The dimension annotation style includes all the annotation styles that may be needed in the drawing space (annotation scale, annotation number size, annotation number position, dimension line style, dimension start and end mark style, etc.);
[0048] Text style includes text size, font, and color;
[0049] The layer styles include component outline layer, component outline invisible line layer, structural steel bar layer, stress steel bar layer, etc.
[0050] In specific implementation, AutoCAD is usually used to create a DXF drawing template file, and then 1:20 and 1:10 dimensioning styles are added to the drawing template file, and component outline layers, structural reinforcement layers, stress reinforcement layers, elevation symbol layers, structural detail layers, and embedded part outline layers are selectively added;
[0051] S5: Draw a plane graphic using the plane data and assign layer information;
[0052] Part of the plane data is used for drawing graphics and is assigned layer information (color, line type, line width); the other part of the plane data is used for dimensioning, text annotation and other symbol positioning, and is assigned layer information (color, text size, font);
[0053] During implementation, the plane data transformed by the OCC model is used to draw the plane graphics. The smallest structural unit in the plane data is two points of a line segment, and the largest structural unit is a set of countless adjacent points at the beginning and the end. The smallest line segment composed of adjacent points represents the accuracy of the projection transformation.
[0054] S6: Using Rtree data structure to implement hybrid bounding box based annotation collision detection;
[0055] Rtree is a balanced tree data structure used for multidimensional spatial indexing. The basic unit is the minimum bounding rectangle of each element. In specific implementation, a hybrid bounding box annotation collision detection algorithm based on axis-aligned bounding box (AABB) and oriented bounding box (OBB) is used for annotation collision detection.
[0056] S7: Using reinforcement learning algorithm to realize intelligent layout of dimensioning;
[0057] During implementation, the dimensioning intelligent layout method adopts the Q-learning algorithm of reinforcement learning, which is a value-based reinforcement learning method. The intelligent agent completes a task by interacting with the environment, and accumulates experience through continuous trial and error, and its experience is stored in the Q-table. In the intelligent annotation reinforcement learning model, the two-dimensional drawing is modeled as a reinforcement learning environment, which contains objects to be annotated and other graphics. The annotation text box to be added is an intelligent agent, and its state is the position of the annotation text box to be added. In order to facilitate calculation, the two-dimensional drawing is discretized into a plane grid, the state space of the intelligent agent is the entire two-dimensional drawing, and the action space of the intelligent agent is: up, down, left, and right. In the intelligent annotation reinforcement learning model, the reward rules of the intelligent agent are as follows: whether it reaches the unannotated collision area, the distance from the center point of the object, whether it collides with other graphics, and whether it crosses the boundary of the graphic; when the body moves to the unannotated collision or the maximum adjustment step number, the round ends;
[0058] S8: Generate component detailed design drawings.
[0059] The component detailed design drawing generated in step S8 includes the three views of the component, the reinforcement drawing, the material table and the processing details drawing, the three views are the main view, the top view and the side view, the reinforcement drawing includes the cross-sectional reinforcement drawing and the side reinforcement drawing, the material table includes the steel bar cutting table, the component information table, the embedded accessories list and the prefabricated component material strength table, and the processing details drawing includes the three views of the embedded parts and the connection method drawing.
[0060] In addition, the reinforcement learning algorithm can also accumulate experience through continuous learning, and store the learned experience values in Q-table. When intelligent layout of dimensioning for the same problem is required, the experience values in the Q-table are directly migrated for processing.
[0061] In specific implementation, component graphics can be drawn based on DXF template layer information, and then for each object to be annotated, a collision detection method based on a hybrid bounding box is used to determine whether the object to be annotated collides with the graphics. If there is no collision, the next object to be annotated is determined. If a collision occurs, an intelligent annotation method based on reinforcement learning is used to annotate the objects to be annotated and intelligently layout them until the layout of all objects to be annotated is completed. Finally, all graphics, annotations and texts are merged to form a detailed design drawing of the component.
[0062] In order to facilitate the understanding of the above process, some case drawings are provided below for further explanation.
[0063] Figure 2 The figure shows the components of the component. It can be seen that the component entity includes anti-slip grooves, lifting tongues, demoulding tongues, railing embedded tongues, connecting holes and other structural details.
[0064] Figure 3 The figure shows the components of steel bars and embedded parts. The model includes steel mesh cage, hoisting embedded parts, railing embedded parts, demoulding embedded parts, etc. The diameter, number and shape of all steel bars in the steel mesh cage are determined by the relevant specifications of the component design. The number and position of hoisting embedded parts and demoulding embedded parts are determined according to actual production and assembly requirements. The number and position of railing embedded parts are determined by the construction engineer according to the needs of the building and structural functions.
[0065] Combination Figure 4-Figure 5 It can be seen that in the model space, a prefabricated staircase OCC model is constructed. By setting the viewpoint and sight direction at the top of the model, a hidden projection plan view can be obtained. Figure 6 A prefabricated stair model and sectioning plane were constructed, and the OCCT technology was used to obtain a refined sectioning contour map.
[0066] Figure 7It is an Rtree data structure. The structure of the Rtree tree is relatively simple. In two-dimensional space, the bottom leaf node (R7-R16) contains the minimum enclosing rectangle of the graphic element. The leaf nodes with similar distances are enclosed in a larger rectangle and used as the nodes of the upper layer (R3-R6, R1-R2). The layers are aggregated layer by layer until all the graphics are contained in one rectangle, which is the root node (R0) at the top level.
[0067] Figure 8 For the collision detection process based on hybrid bounding box, input the graphic W in the plane drawing P, calculate the axis-aligned bounding box (AABB) and directed bounding box (OBB) of W, then calculate the AABB of the existing graphics in the plane drawing P and store it in the S1 set, and at the same time calculate the OBB of the existing graphics in the plane drawing P and store it in the S2 set, then determine whether the AABB of the graphic W intersects with the AABB in the S1 set, if so, extract the OBB of the possible collision graphic T in the S2 set, then determine whether the OBB of the graphic W intersects with the OBB of the graphic T, if so, the graphic W collides with the graphic in the plane drawing P, if not, no collision occurs, in addition, if the AABB of the graphic W does not intersect with the AABB in the set S1, no collision occurs.
[0068] Fig. 9 For the specific implementation, the intelligent labeling flowchart based on reinforcement learning is input. The labeling object B, the object to be labeled O, the plane drawing P and the number of reinforcement learning training rounds are input. The position of the labeling object B is initialized, and then the collision labeling object B is checked to see whether it collides with the original graphics on the plane drawing P. If no collision occurs, the position of the labeling B is output. If a collision occurs, the reinforcement learning Q-learning algorithm is called. In the reinforcement learning algorithm, the labeling object B is used as an intelligent agent and the plane drawing P is used as a reinforcement learning environment. The intelligent agent makes decisions continuously, and the environment gives it rewards or penalties. The reward and punishment values are used to update the action value function Q(s,a) of the current state. After a large number of rounds of training, the intelligent agent can learn to label layout tasks and finally generate labeling positions that meet the needs.
[0069] Fig.10 To annotate drawings with overlapping graphics, a hybrid bounding box collision detection and reinforcement learning intelligent annotation method can achieve annotated collision-free layout. The results are as follows: Fig.11 As shown, the component detailed design drawings can be generated eventually.
[0070] In summary, it can be seen that by adopting the method provided by the present invention, a digital model based on IFC can be quickly established, and then a reinforcement learning algorithm is used to realize intelligent layout of dimensioning, thereby providing a detailed drawing with good readability.
[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A method for intelligently generating component detailed drawings based on IFC and reinforcement learning, characterized in that: The following steps are involved: S1: Input components, reinforcement and structural information, and build a digital model using the IFC general standard; S2: extracting structural information from the digital model and establishing an OCC model using OCCT (Open CASCADE Technology); S3: using OCCT technology to perform a model transformation operation on the OCC model, and obtaining plane data after the model transformation; S4: Create a drawing template file and set the annotation style, text style and layer style; S5: Draw a plane graphic using the plane data and assign layer information; S6: Using Rtree data structure to implement hybrid bounding box based annotation collision detection; S7: Using reinforcement learning algorithm to realize intelligent layout of dimensioning; S8: Generate component detailed design drawings.
2. The method for intelligently generating component detailed drawings based on IFC and reinforcement learning according to claim 1 is characterized in that: The construction information in the digital model includes information on reserved holes, information on the position and shape of the tongue and groove, and information on roughening requirements. The steel bar information in the digital model includes the actual cutting size and shape of the steel bar.
3. The method for intelligently generating component detailed drawings based on IFC and reinforcement learning according to claim 1 is characterized in that: The model transformation in step S3 includes a rotation operation, a projection operation and a sectioning operation.
4. The method for intelligently generating component detailed drawings based on IFC and reinforcement learning according to claim 1 is characterized in that: In step S4, a DXF drawing template file is created using AutoCAD, and then 1:20 and 1:10 dimensioning styles are added to the drawing template file, and a component outline layer, a structural reinforcement layer, a stress-bearing reinforcement layer, an elevation symbol layer, a structural detail layer, and an embedded part outline layer are selectively added.
5. The method for intelligently generating component detailed drawings based on IFC and reinforcement learning according to claim 1 is characterized in that: In step S5, the plane data transformed by the OCC model is used to draw a plane graphic. The smallest structural unit in the plane data is two points of a line segment, and the largest structural unit is a set of countless adjacent points at the beginning and the end. The smallest line segment composed of adjacent points represents the accuracy of the projection transformation.
6. The method for intelligently generating component detailed drawings based on IFC and reinforcement learning according to any one of claims 1 to 5, characterized in that: In step S6, the Rtree data structure is used to perform label collision detection based on a hybrid bounding box label collision detection algorithm that combines an axis-aligned bounding box with a directed bounding box.
7. The method for intelligently generating component detailed drawings based on IFC and reinforcement learning according to claim 6 is characterized in that: The reinforcement learning algorithm described in step S7 is a Q--learning algorithm, which takes the two-dimensional drawing as the reinforcement learning environment. The environment contains objects to be annotated and other graphics. The annotation text box to be added is used as an intelligent agent. The state of the intelligent agent is the position of the annotation text box to be added. Its state space is the two-dimensional drawing, and the action space of the intelligent agent is: up, down, left, and right.
8. The method for intelligently generating component detailed drawings based on IFC and reinforcement learning according to claim 7 is characterized in that: The reward rules of the agent in the reinforcement learning algorithm include: whether it reaches the unlabeled collision area, the distance from the center point of the object, whether it collides with other graphics, and whether it crosses the graphics boundary. When the agent moves to the unlabeled collision or the maximum adjustment step number, the round ends.
9. The method for intelligently generating component detailed drawings based on IFC and reinforcement learning according to claim 7 or 8, characterized in that: The component detailed design drawing generated in step S8 includes the three views of the component, the reinforcement drawing, the material table and the processing details drawing, the three views are the main view, the top view and the side view, the reinforcement drawing includes the cross-sectional reinforcement drawing and the side reinforcement drawing, the material table includes the steel bar cutting table, the component information table, the embedded accessories list and the prefabricated component material strength table, and the processing details drawing includes the three views of the embedded parts and the connection method drawing.
10. The method for intelligently generating component detailed drawings based on IFC and reinforcement learning according to claim 7 or 8, characterized in that: The reinforcement learning algorithm accumulates experience through continuous learning, and stores the learned experience values in Q-table. When intelligent layout of dimensioning for the same problem is required, the experience values in the Q-table are directly migrated for processing.
