An automatic modeling method based on OSG and CAD architectural plan
Through the automatic modeling method based on OSG and CAD building plan, the problems of difficult, low efficiency and high cost in the existing technology are solved, and an efficient and low-cost three-dimensional modeling process is realized.
Patent Information
- Application Number
- CN202111332095.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2025-04-29
- Estimated Expiration
- 2041-11-11
AI Technical Summary
In the prior art, three-dimensional modeling is difficult, low efficiency and high cost.
The automatic modeling method based on OSG and CAD building floor plans is adopted. By reading and identifying the preset CAD building floor plans, layer information is obtained and OSG nodes are generated; traversing the OSG nodes, determining the model information and generating a bounding box; data processing of the bounding box information is converted into model information; and the floor model is finally constructed.
It reduces the economic and time cost of data acquisition of three-dimensional model, improves modeling efficiency, and solves the problems of difficult, low efficiency and high cost of three-dimensional modeling.
Smart Images

Figure CN114065344B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer graphics processing, and in particular to an automatic modeling method based on OSG and CAD architectural plan drawings. Background Art
[0002] At present, with the development of society and the advancement of new technologies such as digital twins, 3D modeling and 3D visualization technologies are widely used in various fields such as digital cities, urban planning, traffic management, emergency firefighting, etc. The main 3D modeling technologies at present are: professional 3D modeling software modeling, such as: 3DS Max, Maya, etc., 3D laser scanning, oblique photography modeling, etc., especially oblique photography modeling, which can quickly generate a real 3D city model. Compared with the traditional manual modeling method, it greatly reduces the economic cost and time cost of 3D model data collection. Oblique photography modeling data has gradually become an important part of the urban spatial data framework.
[0003] The oblique photography model can directly and truly reflect the appearance of the object. However, some application areas, such as emergency firefighting, not only focus on the appearance, but also need to intuitively see the indoor structure of the building, so indoor three-dimensional modeling is also indispensable. However, manual modeling is time-consuming and labor-intensive, so automatic modeling technology is particularly important. Summary of the invention
[0004] The present invention provides an automatic modeling method based on OSG and CAD architectural plan drawings to solve the problems of great difficulty, low efficiency and high cost in the prior art of three-dimensional modeling.
[0005] The present invention provides an automatic modeling method based on OSG and CAD architectural plan, which is characterized by comprising:
[0006] Step 1: Read and identify a preset CAD building floor plan, obtain layer information, and generate an OSG node based on the layer information;
[0007] Step 2: traverse the OSG nodes through the preset layer order, determine the model information, and generate the corresponding bounding box according to the model information;
[0008] Step 3: Based on a preset big data processing center, the bounding box information is processed and converted into model information;
[0009] Step 4: Construct a floor model based on the model information.
[0010] As an embodiment of the present technical solution, the step 1 includes:
[0011] Step 10: Read and identify a preset CAD building floor plan, and obtain the first layer information of the building floor plan;
[0012] Step 11: Based on a preset fuzzy query method, the layer information is screened to obtain the second layer information; wherein,
[0013] The second layer information at least includes layer information of axes, walls, columns, doors, windows, stairs, elevators and fire hydrants;
[0014] Step 12: Construct OSG nodes according to the second layer information.
[0015] As an embodiment of the present technical solution, the step 12 includes:
[0016] Step 120: obtaining second layer information, calculating the second layer range and the second layer position, and determining second layer matrix information according to the second layer range and the second layer position;
[0017] Step 121: Generate a layer root node and a layer child node according to the second layer information and the second layer matrix information; wherein,
[0018] The layer subnodes include drawing background, axis, wall, column, door, window, stair, elevator and fire hydrant;
[0019] Step 122: Name the layer root node and layer child nodes according to the preset layer name, and construct an OSG node.
[0020] As an embodiment of the present technical solution, the step 2 includes: step 20: determining a node traversal method through a preset layer order;
[0021] Step 21: Traverse the first node in the OSG node through the node traversal method to obtain the first vertex data; wherein,
[0022] The first node includes at least one or more of a column, a door, a window, a staircase, an elevator and a fire hydrant;
[0023] Step 22: performing primitive drawing based on the first vertex data, determining a first drawing primitive, and determining first model information according to the first drawing primitive;
[0024] Step 23: Traverse the wall nodes in the OSG nodes through the node traversal method to obtain the second vertex data;
[0025] Step 24: Based on the second vertex data, perform primitive drawing, determine the second drawing primitive, and determine the wall line information according to the second drawing primitive;
[0026] Step 25: Superimpose the first model information and the wall line information to generate a corresponding bounding box.
[0027] As an embodiment of the present technical solution, the step 3 includes: step 30: obtaining a bounding box, determining bounding box information according to the bounding box, and generating bounding box data based on the bounding box information;
[0028] Step 31: Based on a preset big data processing center, the bounding box data is received, and the bounding box data is classified according to preset types to determine the bounding box type of the bounding box data;
[0029] Step 32: Based on the two-dimensional coordinate system preset in the CAD, sort the bounding box data along the positive direction of the X axis or the positive direction of the Y axis to determine the sorting order;
[0030] Step 33: According to the sorting order, perform collision detection on the corresponding bounding box to determine the detection result; wherein,
[0031] The detection results include the same bounding box belonging to the same bounding box type and different bounding boxes that do not belong to the same bounding box type;
[0032] Step 34: Based on the detection results, aggregate the same bounding boxes to determine an aggregated bounding box; wherein,
[0033] The aggregated bounding box is used to aggregate bounding boxes belonging to the same type;
[0034] Step 35: Generate an aggregation model matrix through the aggregation bounding box, and collect corresponding aggregation model matrix information according to the aggregation model matrix;
[0035] Step 36: Obtain wall line information, process the wall line information based on a preset processing method, and determine wall data; wherein,
[0036] The processing method at least includes sorting, deduplication, merging, traversal and intersection;
[0037] Step 37: Determine the model information by aggregating the model matrix information and the wall data.
[0038] As an embodiment of the present technical solution, the step 36 includes:
[0039] Obtain wall line information, process the wall line information based on the preset processing method, determine the wall data; sort, remove duplicates, merge, traverse and intersect one or more
[0040] Step 360: Obtain wall line information, and generate a corresponding wall line model according to the wall line information; wherein,
[0041] The wall line model is represented by line segments;
[0042] Step 361: sorting all wall line models along the positive direction of the X axis or the positive direction of the Y axis to determine the wall line sorting result;
[0043] Step 362: traverse the sorted wall line models through the wall line sorting result to determine the sorted wall line model;
[0044] Step 363: removing duplicate wall line models in the sorted wall line models, and deleting line segments whose length is less than 0.01 meters in the sorted wall line models;
[0045] Step 364: acquiring an unsorted wall line model according to the sorted wall line model, and determining an unsorted wall line model according to the unsorted wall line model;
[0046] Step 365: obtaining the collinear wall lines of each unsorted wall line model, judging the collinear wall lines and the wall line model being traversed, and determining the judgment result;
[0047] Step 366: When the judgment result is that the distance between the adjacent endpoints of the collinear wall line and the wall line model being traversed is less than the maximum width of the wall or there is a door, window or column between two adjacent wall lines, the collinear wall line and the wall line being traversed are merged into one wall line to determine the merged wall line.
[0048] As an embodiment of the present technical solution, the step 366 further includes:
[0049] Step A1: Obtaining aggregation model matrix information, and determining the corresponding door and window aggregation bounding box according to the aggregation model matrix information; wherein,
[0050] The door and window aggregate bounding box represents a bounding box generated by the aggregation of the door model and the window model; Step A2: Based on the door and window aggregate bounding box, collision detection is performed on the collinear wall line and the wall line model being traversed to determine the collision detection result;
[0051] Step A3: When the collision detection result is that the collinear wall line and the wall line model being traversed intersect at the same door and window aggregation bounding box at the same time, the collinear wall line and the wall line being traversed are merged into one wall line to determine the merged wall line.
[0052] As an embodiment of the present technical solution, the step 4 includes:
[0053] Step 40: Obtain model matrix information, and construct a basic model based on the model matrix information;
[0054] Step 41: Based on a preset predetermined model, according to a preset model type, the predetermined model is added to the base model to determine a primary model; wherein,
[0055] The predetermined model at least includes models of columns, doors, windows, stairs, elevators and fire hydrants;
[0056] Step 42: Obtain wall data, and generate a wall model according to the wall data;
[0057] Step 43: Construct a floor model using the primary model and the wall model.
[0058] As an embodiment of the present technical solution, the step 42 further includes:
[0059] Step 420: traverse the merged wall lines and obtain the corresponding wall line of each merged wall line; wherein,
[0060] The corresponding wall line is one of the two parallel double solid lines when drawing the wall in CAD;
[0061] The merged wall line is the other of the two parallel double solid lines when drawing the wall in CAD;
[0062] Step 421: determining wall information by merging the wall line and the corresponding wall line, and constructing the wall through the wall information; wherein,
[0063] The wall information includes the wall starting point, the wall end point, the wall thickness and the wall direction;
[0064] Step 422: Obtain the door and window aggregate bounding box, and obtain the relationship information between the wall and the door and window by traversing the door and window aggregate bounding box and the wall to obtain the intersection;
[0065] The relationship information includes the location, size and type of doors and windows on the wall;
[0066] Step 423: Obtain wall data, and generate a wall model using the relationship information and the wall data.
[0067] As an embodiment of the present technical solution, the step 43 further includes:
[0068] Step 430: Obtain a first model ratio of the primary model, and determine first ratio data according to the first model ratio; wherein,
[0069] The first model scale is scale data of a primary model in CAD;
[0070] Step 431: Obtain a second model ratio of the wall model, and determine second ratio data according to the second model ratio; wherein,
[0071] The second model scale is scale data of a wall model in CAD; Step 432: Compare and calculate the first scale data and the second scale data, determine a comparison coefficient, and scale the first scale data or the second scale data by the comparison coefficient to determine a scaling ratio;
[0072] Step 433: Based on the scaling ratio, superimpose the scaled primary model and the wall model to determine a superimposed model;
[0073] Step 434: Filter, remove impurities and enhance contrast of the superposition model to construct a floor model.
[0074] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0075] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0077] In the attached picture:
[0078] Figure 1 A method flow chart of an automatic modeling method based on OSG and CAD architectural plan drawings in an embodiment of the present invention;
[0079] Figure 2 It is a building plan rendering generated by CAD drawing recognition of an automatic modeling method based on OSG and CAD building plan in an embodiment of the present invention;
[0080] Figure 3 This is an automatic modeling effect diagram of an automatic modeling method based on OSG and CAD architectural plan in an embodiment of the present invention. DETAILED DESCRIPTION
[0081] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0082] It should be noted that when a component is referred to as being "fixed to" or "disposed on" another component, it can be directly on the other component or indirectly on the other component. When a component is referred to as being "connected to" another component, it can be directly or indirectly connected to the other component.
[0083] It should be understood that the orientation or position relationship indicated by terms such as "length", "width", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside" and "outside" are based on the orientation or position relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0084] In addition, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations, and "multiple" means two or more, unless otherwise clearly and specifically limited. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0085] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
[0086] Embodiment 1:
[0087] according to Figure 1 and Figure 2 As shown, an embodiment of the present invention provides an automatic modeling method based on OSG and CAD architectural plan, comprising:
[0088] Step 1: Read and identify a preset CAD building floor plan, obtain layer information, and generate an OSG node based on the layer information;
[0089] Step 2: traverse the OSG nodes through the preset layer order, determine the model information, and generate the corresponding bounding box according to the model information;
[0090] Step 3: Based on a preset big data processing center, the bounding box information is processed and converted into model information;
[0091] Step 4: Construct a floor model based on the model information.
[0092] The working principle and beneficial effects of the above technical solution are:
[0093] This technical solution, through CAD drawing recognition, layer information acquisition, data processing and model information acquisition and generation of floor models, is based on automatic modeling of OSG and CAD building floor plans, recognizes preset CAD building floor plans, obtains layer information, and generates OSG nodes based on the layer information; traverses the OSG nodes, determines the model information, and generates corresponding bounding boxes based on the model information; performs data processing on the bounding box information and converts it into model information; and constructs a floor model through the model information. Compared with traditional manual modeling methods, this method greatly reduces the economic and time costs of three-dimensional model data acquisition, and solves the problems of high difficulty, low efficiency, and high cost of three-dimensional modeling in the prior art.
[0094] Embodiment 2:
[0095] The technical solution provides an embodiment, wherein step 1 comprises:
[0096] Step 10: Read and identify a preset CAD building floor plan, and obtain the first layer information of the building floor plan;
[0097] Step 11: Based on a preset fuzzy query method, the layer information is screened to obtain the second layer information; wherein,
[0098] The second layer information at least includes layer information of axes, walls, columns, doors, windows, stairs, elevators and fire hydrants;
[0099] Step 12: Construct OSG nodes according to the second layer information.
[0100] The working principle and beneficial effects of the above technical solution are:
[0101] This technical solution reads the CAD building floor plan, obtains all layer information, reads and identifies the preset CAD building floor plan, obtains the first layer information of the building floor plan; based on the preset fuzzy query method, the layer information is screened to screen out the second layer information, the second layer information at least includes the layer information of the axis, wall, column, door, window, staircase, elevator and fire hydrant; according to the second layer information, the OSG node is constructed, the second layer is obtained, the second layer information is read, and the layer range and layer position of the second layer are calculated through the second layer information; according to the layer range and layer position, the drawing matrix information is generated. Provide original data and original materials for the generation of model matrix information.
[0102] Embodiment 3:
[0103] The technical solution provides an embodiment, wherein step 12 comprises:
[0104] Step 120: obtaining second layer information, calculating the second layer range and the second layer position, and determining second layer matrix information according to the second layer range and the second layer position;
[0105] Step 121: Generate a layer root node and a layer child node according to the second layer information and the second layer matrix information; wherein,
[0106] The layer subnodes include drawing background, axis, wall, column, door, window, stair, elevator and fire hydrant;
[0107] Step 122: Name the layer root node and layer child nodes according to the preset layer name, and construct an OSG node.
[0108] The working principle and beneficial effects of the above technical solution are:
[0109] This technical solution obtains the second layer information, calculates the second layer range and the second layer position, and determines the second layer matrix information according to the second layer range and the second layer position; generates a layer root node and a layer sub-node according to the second layer information and the second layer matrix information; the layer sub-nodes include drawing background, axis, wall, column, door, window, stair, elevator and fire hydrant; the layer root node and the layer sub-node are named according to the preset layer name, and an OSG node is constructed. This technical solution calculates the range and position of the layer according to the obtained layer information, and determines the final drawing matrix information; generates a drawing root node and each layer sub-node of the drawing background, axis, wall, column, door, window, stair, elevator and fire hydrant according to the obtained layer information and the calculated matrix information, and the node name is named according to the layer name, so as to distinguish different nodes, which is convenient for users to identify the layer information therein.
[0110] Embodiment 4:
[0111] The technical solution provides an embodiment, wherein the step 2 comprises: step 20: determining a node traversal method through a preset layer order;
[0112] Step 21: Traverse the first node in the OSG node through the node traversal method to obtain the first vertex data; wherein,
[0113] The first node includes at least one or more of a column, a door, a window, a staircase, an elevator and a fire hydrant;
[0114] Step 22: performing primitive drawing based on the first vertex data, determining a first drawing primitive, and determining first model information according to the first drawing primitive;
[0115] Step 23: Traverse the wall nodes in the OSG nodes through the node traversal method to obtain the second vertex data;
[0116] Step 24: Based on the second vertex data, perform primitive drawing, determine the second drawing primitive, and determine the wall line information according to the second drawing primitive;
[0117] Step 25: Superimpose the first model information and the wall line information to generate a corresponding bounding box.
[0118] The working principle and beneficial effects of the above technical solution are:
[0119] This technical solution is based on a preset node traversal method, traverses the first node in the OSG node, obtains the first vertex data, and determines the first model information based on the first vertex data and the preset primitive drawing method; the first node includes at least one or more of a column, a door, a window, a staircase, an elevator, and a fire hydrant; based on the preset node traversal method, traverses the wall node in the OSG node, obtains the second vertex data, and determines the wall line information based on the second vertex data and the preset primitive drawing method; the model information is determined through the first model information and the wall line information, and the corresponding bounding box is determined according to the model information, and the column, door, window, staircase, elevator, and fire hydrant nodes are traversed to obtain the vertex data and the primitive drawing method to generate all the model information, and the model information is represented by a bounding box and will eventually be replaced with the corresponding model node according to the bounding box information. Traverse the wall node to obtain the wall vertex data and the primitive drawing method, and generate all the wall line data according to the vertex information and the primitive drawing method, and the wall line is represented by a line segment. Therefore, by traversing the root nodes of the drawing, the layer information of walls, columns, doors, windows, stairs, elevators, and fire hydrants can be obtained according to the node names, providing a fast and effective method for node retrieval and information collection.
[0120] Embodiment 5:
[0121] The technical solution provides an embodiment, wherein the step 3 comprises: step 30: obtaining a bounding box, determining bounding box information according to the bounding box, and generating bounding box data based on the bounding box information;
[0122] Step 31: Based on a preset big data processing center, the bounding box data is received, and the bounding box data is classified according to preset types to determine the bounding box type of the bounding box data;
[0123] Step 32: Based on the two-dimensional coordinate system preset in the CAD, sort the bounding box data along the positive direction of the X axis or the positive direction of the Y axis to determine the sorting order;
[0124] Step 33: According to the sorting order, perform collision detection on the corresponding bounding box to determine the detection result; wherein,
[0125] The detection results include the same bounding box belonging to the same bounding box type and different bounding boxes that do not belong to the same bounding box type;
[0126] Step 34: Based on the detection results, aggregate the same bounding boxes to determine an aggregated bounding box; wherein,
[0127] The aggregated bounding box is used to aggregate bounding boxes belonging to the same type;
[0128] Step 35: Generate an aggregation model matrix through the aggregation bounding box, and collect corresponding aggregation model matrix information according to the aggregation model matrix;
[0129] Step 36: Obtain wall line information, process the wall line information based on a preset processing method, and determine wall data; wherein,
[0130] The processing method at least includes sorting, deduplication, merging, traversal and intersection;
[0131] Step 37: Determine the model information by aggregating the model matrix information and the wall data.
[0132] The working principle and beneficial effects of the above technical solution are:
[0133] The technical solution analyzes and processes the bounding box obtained in step 2 by data processing methods such as sorting, deduplication, and aggregation, and finally converts it into model information. By obtaining the bounding box, the bounding box information is determined, and the bounding box data is generated through the bounding box information; the bounding boxes are classified according to the preset types to determine the bounding box types; based on the two-dimensional coordinate system preset in CAD, the bounding boxes are sorted along the positive direction of the X-axis or the positive direction of the Y-axis to determine the sorting order; according to the sorting order, the bounding boxes are subjected to collision detection to determine the detection results; based on the detection results, the bounding boxes belonging to the same bounding box type are aggregated to determine the aggregated bounding box; the corresponding model nodes are determined through the aggregated bounding boxes, and the corresponding aggregated model matrix information is determined through the model nodes; Get the wall line information, process the wall line information based on the preset processing method, and determine the wall data; the processing method includes one or more of sorting, deduplication, merging, traversal and intersection; determine the model information by aggregating the model matrix information and the wall data. The maximum width of the wall is 0.5 meters. According to the "Uniform Specification for Building Architectural Drawing", the wall thickness is generally 120mm, 240mm, 370mm or 490mm, so the maximum wall thickness is usually 500mm; the obtained door and window bounding boxes are subjected to collision detection with the two current adjacent wall lines. If they intersect with the same bounding box at the same time, it means that there were door, window or column models before them, so they belong to the same wall and can be merged, and the common wall itself is distinguished to determine different wall lines and common wall lines.
[0134] Embodiment 6:
[0135] The technical solution provides an embodiment, wherein step 36 includes:
[0136] Obtain wall line information, process the wall line information based on the preset processing method, determine the wall data; sort, remove duplicates, merge, traverse and intersect one or more
[0137] Step 360: Obtain wall line information, and generate a corresponding wall line model according to the wall line information; wherein,
[0138] The wall line model is represented by line segments;
[0139] Step 361: sorting all wall line models along the positive direction of the X axis or the positive direction of the Y axis to determine the wall line sorting result;
[0140] Step 362: traverse the sorted wall line models through the wall line sorting result to determine the sorted wall line model;
[0141] Step 363: removing duplicate wall line models in the sorted wall line models, and deleting line segments whose length is less than 0.01 meters in the sorted wall line models;
[0142] Step 364: acquiring an unsorted wall line model according to the sorted wall line model, and determining an unsorted wall line model according to the unsorted wall line model;
[0143] Step 365: obtaining the collinear wall lines of each unsorted wall line model, judging the collinear wall lines and the wall line model being traversed, and determining the judgment result;
[0144] Step 366: When the judgment result is that the distance between the adjacent endpoints of the collinear wall line and the wall line model being traversed is less than the maximum width of the wall or there is a door, window or column between two adjacent wall lines, the collinear wall line and the wall line being traversed are merged into one wall line to determine the merged wall line.
[0145] The working principle and beneficial effects of the above technical solution are:
[0146] The technical solution obtains wall line information and generates corresponding wall lines according to the wall line information; the wall lines are represented by line segments; all wall lines are sorted along the positive direction of the X-axis or the positive direction of the Y-axis to determine the wall line sorting result; the sorted wall lines are traversed according to the wall line sorting result to determine the sorted wall lines; duplicate wall lines in the sorted wall lines are removed, and line segments with a length of less than 0.01 meters in the sorted wall lines are deleted; unsorted wall lines are obtained to determine the unsorted wall lines; the colinear wall lines of each unsorted wall line are obtained, and the colinear wall lines and the wall lines being traversed are judged to determine the judgment result; when the judgment result is that the distance between the adjacent endpoints of the colinear wall lines and the wall lines being traversed is less than the maximum width of the wall or there are doors, windows, and columns between the two adjacent wall lines, the colinear wall lines and the wall lines being traversed are merged into one wall line to determine the merged wall line.
[0147] Embodiment 7:
[0148] The technical solution provides an embodiment, wherein step 366 further includes:
[0149] Step A1: Obtaining aggregation model matrix information, and determining the corresponding door and window aggregation bounding box according to the aggregation model matrix information; wherein,
[0150] The door and window aggregate bounding box represents a bounding box generated by the aggregation of the door model and the window model; Step A2: Based on the door and window aggregate bounding box, collision detection is performed on the collinear wall line and the wall line model being traversed to determine the collision detection result;
[0151] Step A3: When the collision detection result is that the collinear wall line and the wall line model being traversed intersect at the same door and window aggregation bounding box at the same time, the collinear wall line and the wall line being traversed are merged into one wall line to determine the merged wall line.
[0152] The working principle and beneficial effects of the above technical solution are:
[0153] This technical solution obtains the aggregation model matrix information, and determines the corresponding door and window aggregation bounding box according to the aggregation model matrix information; through the door and window aggregation bounding box, collision detection is performed with the collinear wall line and the wall line being traversed to determine the collision detection result; when the collision detection result is that they intersect in the same bounding box at the same time, the collinear wall line and the wall line being traversed are merged into one wall line to determine the merged wall line.
[0154] Embodiment 8:
[0155] The technical solution provides an embodiment, wherein step 4 comprises:
[0156] Step 40: Obtain model matrix information, and construct a basic model based on the model matrix information;
[0157] Step 41: Based on a preset predetermined model, according to a preset model type, the predetermined model is added to the base model to determine a primary model; wherein,
[0158] The predetermined model at least includes models of columns, doors, windows, stairs, elevators and fire hydrants;
[0159] Step 42: Obtain wall data, and generate a wall model according to the wall data;
[0160] Step 43: Construct a floor model using the primary model and the wall model.
[0161] The working principle and beneficial effects of the above technical solution are:
[0162] The technical solution obtains model matrix information, and constructs a base model through the model matrix information; based on a preset predetermined model, the predetermined model is added to the base model according to the preset model type to determine a primary model; the predetermined model includes at least models of columns, doors, windows, stairs, elevators and fire hydrants; wall data is obtained, and a wall model is generated based on the wall data; a floor model is constructed through the primary model and the wall model.
[0163] Embodiment 9:
[0164] The technical solution provides an embodiment, wherein step 42 further includes:
[0165] Step 420: traverse the merged wall lines and obtain the corresponding wall line of each merged wall line; wherein,
[0166] The corresponding wall line is one of the two parallel double solid lines when drawing the wall in CAD;
[0167] The merged wall line is the other of the two parallel double solid lines when drawing the wall in CAD;
[0168] Step 421: determining wall information by merging the wall line and the corresponding wall line, and constructing the wall through the wall information; wherein,
[0169] The wall information includes the wall starting point, the wall end point, the wall thickness and the wall direction;
[0170] Step 422: Obtain the door and window aggregate bounding box, and obtain the relationship information between the wall and the door and window by traversing the door and window aggregate bounding box and the wall to obtain the intersection;
[0171] The relationship information includes the location, size and type of doors and windows on the wall;
[0172] Step 423: Obtain wall data, and generate a wall model using the relationship information and the wall data.
[0173] The working principle and beneficial effects of the above technical solution are:
[0174] according to Figure 3 As shown, the technical solution adds various types of predetermined models according to the classification based on the model matrix information obtained. The predetermined models are: columns, doors, windows, stairs, elevators, and fire hydrants; the wall model is generated according to the wall data obtained in step (3.2), and the wall height and texture are default values. By traversing and merging wall lines, and obtaining the corresponding wall line of each merged wall line; the corresponding wall line is one of the two parallel double solid lines when drawing the wall in CAD; the merged wall line is the other of the two parallel double solid lines when drawing the wall in CAD; by merging wall lines and corresponding wall lines, the wall information is determined, and the wall is constructed through the wall information; the wall information includes the wall starting point, the wall end point, the wall thickness and the wall direction; the door and window aggregate bounding box is obtained, and the relationship information between the wall and the door and window is obtained by traversing the door and window aggregate bounding box and the wall for intersection; the relationship information includes the position of the door and window on the wall, the size of the door and window, and the type of the door and window; the wall data is obtained, and the wall model is generated through the relationship information and the wall data. It realizes 1:1 building floor plan generation and floor structure generation, and realizes automated modeling.
[0175] Embodiment 10:
[0176] The technical solution provides an embodiment, wherein step 43 further includes:
[0177] Step 430: Obtain a first model ratio of the primary model, and determine first ratio data according to the first model ratio; wherein,
[0178] The first model scale is scale data of a primary model in CAD;
[0179] Step 431: Obtain a second model ratio of the wall model, and determine second ratio data according to the second model ratio; wherein,
[0180] The second model scale is scale data of a wall model in CAD; Step 432: Compare and calculate the first scale data and the second scale data, determine a comparison coefficient, and scale the first scale data or the second scale data by the comparison coefficient to determine a scaling ratio;
[0181] Step 433: Based on the scaling ratio, superimpose the scaled primary model and the wall model to determine a superimposed model;
[0182] Step 434: Filter, remove impurities and enhance contrast of the superposition model to construct a floor model.
[0183] The working principle and beneficial effects of the above technical solution are:
[0184] The technical solution also includes obtaining a first model ratio of the primary model, and determining first ratio data according to the first model ratio; obtaining a second model ratio of the wall model, and determining second ratio data according to the second model ratio; comparing the first ratio data with the second ratio data, determining a contrast coefficient, and scaling either the first ratio data or the second ratio data by the contrast coefficient to determine a scaling result; superimposing the primary model and the wall model based on the scaling result to determine a superimposed model; collecting pixel data of the superimposed model, filtering, removing impurities and enhancing contrast processing on the pixel data, constructing a floor model, and automatically achieving 1:1 correction of the model, such as Figure 3 As shown, it avoids the situation where the contrast coefficients are unequal, which leads to model distortion.
[0185] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0186] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0187] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0188] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0189] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. An automatic modeling method based on OSG and CAD architectural plan, characterized in that: include: Step 1: Read and identify a preset CAD building floor plan, obtain layer information, and generate an OSG node based on the layer information; Step 2: traverse the OSG nodes through the preset layer order, determine the model information, and generate the corresponding bounding box according to the model information; Step 3: Based on a preset big data processing center, the information of the bounding box is processed and converted into model information; Step 4: constructing a floor model based on the model information; The step 1 comprises: Step 10: Read and identify a preset CAD building floor plan, and obtain the first layer information of the building floor plan; Step 11: Based on a preset fuzzy query method, the layer information is screened to obtain the second layer information; wherein, The second layer information at least includes layer information of axes, walls, columns, doors, windows, stairs, elevators and fire hydrants; Step 12: Construct OSG nodes according to the second layer information; The step 2 includes: step 20: determining a node traversal method through a preset layer order; Step 21: Traverse the first node in the OSG node through the node traversal method to obtain the first vertex data; wherein, The first node includes at least one or more of a column, a door, a window, a staircase, an elevator and a fire hydrant; Step 22: performing primitive drawing based on the first vertex data, determining a first drawing primitive, and determining first model information according to the first drawing primitive; Step 23: traverse the wall nodes in the OSG node through the node traversal method to obtain the second vertex data; Step 24: Based on the second vertex data, perform primitive drawing, determine the second drawing primitive, and determine the wall line information according to the second drawing primitive; Step 25: Superimpose the first model information and the wall line information to generate a corresponding bounding box.
2. The automatic modeling method based on OSG and CAD architectural plan as claimed in claim 1, characterized in that: The step 12 comprises: Step 120: obtaining second layer information, calculating the second layer range and the second layer position, and determining second layer matrix information according to the second layer range and the second layer position; Step 121: Generate a layer root node and a layer child node according to the second layer information and the second layer matrix information; wherein, The layer subnodes include drawing background, axis, wall, column, door, window, stair, elevator and fire hydrant; Step 122: Name the layer root node and layer child nodes according to the preset layer name, and construct an OSG node.
3. The automatic modeling method based on OSG and CAD architectural plan as claimed in claim 1, characterized in that: The step 3 comprises: step 30: obtaining a bounding box, determining bounding box information according to the bounding box, and generating bounding box data based on the bounding box information; Step 31: Based on a preset big data processing center, the bounding box data is received, and the bounding box data is classified according to preset types to determine the bounding box type of the bounding box data; Step 32: Based on the two-dimensional coordinate system preset in the CAD, sort the bounding box data along the positive direction of the X axis or the positive direction of the Y axis to determine the sorting order; Step 33: According to the sorting order, perform collision detection on the corresponding bounding box to determine the detection result; wherein, The detection results include the same bounding box belonging to the same bounding box type and different bounding boxes that do not belong to the same bounding box type; Step 34: Based on the detection results, aggregate the same bounding boxes to determine an aggregated bounding box; wherein, The aggregated bounding box is used to aggregate bounding boxes belonging to the same type; Step 35: Generate an aggregation model matrix through the aggregation bounding box, and collect corresponding aggregation model matrix information according to the aggregation model matrix; Step 36: Obtain wall line information, process the wall line information based on a preset processing method, and determine wall data; wherein, The processing method at least includes sorting, deduplication, merging, traversal and intersection; Step 37: Determine the model information by aggregating the model matrix information and the wall data.
4. The automatic modeling method based on OSG and CAD architectural plan as claimed in claim 3, characterized in that: The step 36 comprises: Obtain wall line information, process the wall line information based on the preset processing method, determine the wall data; sort, remove duplicates, merge, traverse and intersect one or more Step 360: Obtain wall line information, and generate a corresponding wall line model according to the wall line information; wherein, The wall line model is represented by line segments; Step 361: sorting all wall line models along the positive direction of the X axis or the positive direction of the Y axis to determine the wall line sorting result; Step 362: traverse the sorted wall line models through the wall line sorting result to determine the sorted wall line model; Step 363: removing duplicate wall line models in the sorted wall line models, and deleting line segments whose length is less than 0.01 meters in the sorted wall line models; Step 364: acquiring an unsorted wall line model according to the sorted wall line model, and determining an unsorted wall line model according to the unsorted wall line model; Step 365: obtaining the collinear wall lines of each unsorted wall line model, judging the collinear wall lines and the wall line model being traversed, and determining the judgment result; Step 366: When the judgment result is that the distance between the adjacent endpoints of the collinear wall line and the wall line model being traversed is less than the maximum width of the wall or there is a door, window or column between two adjacent wall lines, the collinear wall line and the wall line being traversed are merged into one wall line to determine the merged wall line.
5. The automatic modeling method based on OSG and CAD architectural plan as claimed in claim 4, characterized in that: The step 366 further includes: Step A1: Obtaining aggregation model matrix information, and determining the corresponding door and window aggregation bounding box according to the aggregation model matrix information; wherein, The door and window aggregate bounding box represents a bounding box generated by the aggregation of the door model and the window model; Step A2: Based on the door and window aggregate bounding box, collision detection is performed on the collinear wall line and the wall line model being traversed to determine the collision detection result; Step A3: When the collision detection result is that the collinear wall line and the wall line model being traversed intersect at the same door and window aggregation bounding box at the same time, the collinear wall line and the wall line being traversed are merged into one wall line to determine the merged wall line.
6. The automatic modeling method based on OSG and CAD architectural plan as claimed in claim 1, characterized in that: The step 4 comprises: Step 40: Obtain model matrix information, and construct a basic model based on the model matrix information; Step 41: Based on a preset predetermined model, according to a preset model type, the predetermined model is added to the base model to determine a primary model; wherein, The predetermined model at least includes models of columns, doors, windows, stairs, elevators and fire hydrants; Step 42: Obtain wall data, and generate a wall model according to the wall data; Step 43: Construct a floor model using the primary model and the wall model.
7. The automatic modeling method based on OSG and CAD architectural plan as claimed in claim 6, characterized in that: The step 42 further includes: Step 420: traverse the merged wall lines and obtain the corresponding wall line of each merged wall line; wherein, The corresponding wall line is one of the two parallel double solid lines when drawing the wall in CAD; The merged wall line is the other of the two parallel double solid lines when drawing the wall in CAD; Step 421: Determine wall information by merging the wall line and the corresponding wall line, and construct the wall through the wall information; wherein, The wall information includes the wall starting point, the wall end point, the wall thickness and the wall direction; Step 422: Obtain the door and window aggregate bounding box, and obtain the relationship information between the wall and the door and window by traversing the door and window aggregate bounding box and the wall to obtain the intersection; The relationship information includes the location, size and type of doors and windows on the wall; Step 423: Obtain wall data, and generate a wall model using the relationship information and the wall data.
8. The automatic modeling method based on OSG and CAD architectural plan as claimed in claim 6, characterized in that: The step 43 further includes: Step 430: Obtain a first model ratio of the primary model, and determine first ratio data according to the first model ratio; wherein, The first model scale is scale data of a primary model in CAD; Step 431: Obtain a second model ratio of the wall model, and determine second ratio data according to the second model ratio; wherein, The second model scale is scale data of a wall model in CAD; Step 432: Compare and calculate the first scale data and the second scale data, determine a comparison coefficient, and scale the first scale data or the second scale data by the comparison coefficient to determine a scaling ratio; Step 433: Based on the scaling ratio, superimpose the scaled primary model and the wall model to determine a superimposed model; Step 434: Filter, remove impurities and enhance contrast of the superposition model to construct a floor model.
Citation Information
Patent Citations
Three-dimensional building model contour feature line extraction method based on oblique photogrammetry
CN110838129A