Vector drawing generation method and system based on GAI, terminal and medium
By using a GAI-based method to preprocess Revit views and generate dimension positioning lines, the problem of low dimensioning efficiency in existing technologies is solved, enabling intelligent dimensioning and efficient architectural floor plan design.
Patent Information
- Application Number
- CN202511084674.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-04
- Publication Date
- 2025-11-21
AI Technical Summary
Existing technologies are inefficient and prone to errors in dimensioning during architectural floor plan design, and cannot meet the requirements of complex drawing layouts and semantic understanding.
A GAI-based method is used to preprocess the Revit view, export grayscale images, determine the coordinate mapping matrix, generate dimension positioning line images using the GAI model, extract skeleton images, and map them to the Revit view based on straight line features. Component types are then selected for dimensioning.
It significantly improves annotation efficiency, enables intelligent annotation of building component plan views, enhances the accuracy and aesthetics of annotation, and adapts to complex drawing layouts.
Smart Images

Figure CN120997867A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, system, terminal, and medium for generating vector graphics based on GAI. Background Technology
[0002] In architectural floor plan design, dimensioning is not only a supplementary explanation to graphics, but also a core component for realizing the design. Standardized and clear dimensioning effectively connects design and construction, ensuring the efficient, safe, and cost-effective completion of building projects. Dimensioning is a fundamental yet tedious task. Traditional methods relying on manual or semi-automatic tools are inefficient, error-prone, and unable to meet the demands of efficient and precise design. Although some BIM software possesses basic automatic dimensioning functions, their level of intelligence is limited and cannot adapt to complex drawing layouts and semantic understanding requirements.
[0003] Therefore, existing technologies still have shortcomings. Summary of the Invention
[0004] The technical problem to be solved by this invention is to provide a method, system, terminal, and medium for generating vector graphics based on GAI, addressing the aforementioned deficiencies of the prior art. The technical solution adopted by this invention is as follows:
[0005] In a first aspect, the present invention provides a method for generating vector graphics based on GAI, wherein the method includes:
[0006] Preprocess the Revit view to export the grayscale image corresponding to the Revit view, and determine the coordinate mapping matrix based on the Revit view and the grayscale image;
[0007] The grayscale image is inferred based on the GAI model to generate a dimension annotation positioning line image, and a skeleton image is extracted based on the grayscale image and the dimension annotation positioning line image.
[0008] Based on the skeleton image, straight line features are extracted, and based on the coordinate mapping matrix, the straight line features are mapped onto the Revit view to obtain the annotation positioning lines;
[0009] Filter the component types that need to be dimensioned in the Revit view, determine the target dimensioning plane, and perform dimensioning based on the dimensioning positioning lines to obtain vector drawings.
[0010] In one implementation, the preprocessing of the Revit view to export the grayscale image corresponding to the Revit view includes:
[0011] Hide the components in the Revit view that are not related to size;
[0012] Set the fill color and edge color of the remaining components to black or gray, and export the grayscale image of the display area in the Revit view.
[0013] In one implementation, determining the coordinate mapping matrix based on the Revit view and the grayscale image includes:
[0014] Obtain the width of the grayscale image and the width of the display area in the Revit view, and calculate the scaling factor;
[0015] Based on the origin of the Revit view's coordinate system and the scaling factor, a coordinate mapping matrix is established. This coordinate mapping matrix is used to convert Revit view coordinates to image pixel coordinates.
[0016] In one implementation, extracting the skeleton image based on the grayscale image and the dimensioned positioning line image includes:
[0017] Based on the grayscale image and the dimension annotation positioning line image, a difference map is determined;
[0018] The skeleton image is obtained by using an OpenCV extension module to refine the skeleton of the difference map and extract the skeleton structure.
[0019] In one implementation, the method further includes:
[0020] After obtaining the positioning lines, parallel positioning lines with a spacing smaller than the preset value are merged.
[0021] The merging process includes:
[0022] Shift the shorter label positioning line to the straight line containing the longer label positioning line or its extension;
[0023] Extract the four endpoints of the two original annotation positioning lines, and select the two outermost endpoints as the endpoints of the new annotation positioning line to generate a merged annotation positioning line, while removing the original two annotation positioning lines.
[0024] In one implementation, the step of dimensioning based on the positioning lines to obtain vector paper includes:
[0025] When performing row dimensioning for each dimensioning positioning line, identify the room objects that intersect with the dimensioning positioning line, extract the outer contour boundary of each room object, determine the dimensioning component range of each room object, filter out dimensioning components located inside the extended contour or intersecting with the contour, and extract the target dimensioning plane of the dimensioning component;
[0026] From the extracted target annotation planes, filter out the annotation planes that are perpendicular to the current annotation positioning line, classify them into a group of annotation information, and construct an annotation dictionary structure with the annotation positioning line as the key and the annotation plane information list as the value;
[0027] Based on the constructed annotation dictionary structure, the Revit API is called to automatically generate the corresponding dimension annotations;
[0028] For the outer area of the building plan, three standard dimension lines are generated to represent: the maximum spacing of the grid lines in the same direction, the relative spacing between the grid lines, and the actual dimensions of the outer components.
[0029] In one implementation, the method further includes:
[0030] The annotation results in vector graphics are evaluated based on accuracy and aesthetics.
[0031] Secondly, embodiments of the present invention also provide a vector drawing generation system based on GAI, wherein the system is used to implement the steps of the vector drawing generation method based on GAI described in the above solution, and the system includes:
[0032] The view processing and mapping matrix determination module is used to preprocess the Revit view, export the grayscale image corresponding to the Revit view, and determine the coordinate mapping matrix based on the Revit view and the grayscale image.
[0033] The AI inference and skeleton extraction module is used to infer the grayscale image based on the GAI model, generate a dimension annotation positioning line image, and extract a skeleton image based on the grayscale image and the dimension annotation positioning line image.
[0034] The feature extraction and coordinate mapping module is used to extract straight line features based on the skeleton image and map the straight line features to the Revit view based on the coordinate mapping matrix to obtain the annotation positioning line;
[0035] The dimensioning module is used to filter the component types that need to be dimensioned in the Revit view, determine the target dimensioning plane, and perform dimensioning based on the dimensioning positioning lines to obtain vector drawings.
[0036] Thirdly, embodiments of the present invention also provide a terminal, wherein the terminal includes a memory, a processor, and a GAI-based vector paper generation program stored in the memory and executable on the processor. When the processor executes the GAI-based vector paper generation program, it implements the steps of the GAI-based vector paper generation method of any of the above-described solutions.
[0037] Fourthly, embodiments of the present invention also provide a computer-readable storage medium, wherein a GAI-based vector drawing generation program is stored on the computer-readable storage medium, and the GAI-based vector drawing generation program implements the steps of the GAI-based vector drawing generation method described in any of the above schemes on the computer-readable storage medium.
[0038] Beneficial Effects: Compared with existing technologies, this invention provides a vector drawing generation method based on GAI. First, the Revit view is preprocessed to export a grayscale image corresponding to the Revit view. Based on the Revit view and the grayscale image, a coordinate mapping matrix is determined. Then, the grayscale image is inferred based on the GAI model to generate dimension positioning line images. A skeleton image is extracted based on the grayscale image and the dimension positioning line images. Next, straight line features are extracted from the skeleton image, and these features are mapped to the Revit view using the coordinate mapping matrix to obtain the dimension positioning lines. Finally, the component types requiring dimensioning in the Revit view are selected, the target dimensioning plane is determined, and dimensioning is performed based on the dimension positioning lines to obtain the vector drawing. This invention enables intelligent dimensioning of architectural component plan views, significantly improving dimensioning efficiency. It represents a bold and innovative attempt by generative AI in the field of architectural engineering design. Attached Figure Description
[0039] Figure 1 A flowchart illustrating a preferred embodiment of the GAI-based vector paper generation method provided in this invention.
[0040] Figure 2 This is a schematic diagram of the architecture of a vector paper generation system based on GAI provided in an embodiment of the present invention.
[0041] Figure 3 A schematic diagram of a terminal provided in an embodiment of the present invention. Detailed Implementation
[0042] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0043] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content, operations, or steps, nor does it require execution in the described order. For example, some operations or steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0044] It should be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0045] It should be understood that, in order to clearly describe the technical solutions of the embodiments of the present invention, the terms "first" and "second" are used in the embodiments of the present invention to distinguish identical or similar items with essentially the same function and effect. For example, "first control information" and "second control information" are only used to distinguish different control information and do not limit their order.
[0046] Those skilled in the art will understand that the words "first" and "second" do not limit the quantity or the order of execution, and that the words "first" and "second" do not necessarily imply that they are different.
[0047] It should also be understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0048] To address the problems of existing technologies, this invention provides a method for generating vector graphics based on Generative Artificial Intelligence (GAI). First, the Revit view is preprocessed to export a grayscale image corresponding to the Revit view. A coordinate mapping matrix is determined based on the Revit view and the grayscale image. Then, the grayscale image is inferred using a GAI model to generate dimensioning positioning line images. A skeleton image is extracted based on the grayscale image and the dimensioning positioning line images. Next, straight line features are extracted from the skeleton image, and these features are mapped onto the Revit view using the coordinate mapping matrix to obtain the dimensioning positioning lines. Finally, the types of components requiring dimensioning in the Revit view are selected, the target dimensioning plane is determined, and dimensioning is performed based on the dimensioning positioning lines to obtain the vector graphics. This method enables intelligent dimensioning of architectural component plan views, significantly improving dimensioning efficiency. It represents a bold and innovative attempt by generative AI in the field of architectural engineering design.
[0049] The vector graphic generation method based on GAI in this embodiment can be applied to terminals, including intelligent product terminals such as computers, smart TVs, and mobile phones. In this embodiment, as shown... Figure 1 As shown, the GAI-based vector paper generation method includes the following steps:
[0050] Step S100: Preprocess the Revit view, export the grayscale image corresponding to the Revit view, and determine the coordinate mapping matrix based on the Revit view and the grayscale image.
[0051] This invention first obtains the Revit view from the architectural floor plan and preprocesses it. Specifically, this includes hiding components unrelated to size, such as furniture and equipment, to reduce interference with dimension annotations. Next, the fill and border colors of the remaining components are uniformly set to black or gray, and a grayscale image of the display area in the Revit view is exported. The background color is set to white, which increases image contrast and improves the accuracy of subsequent AI recognition. Then, this embodiment obtains the actual display area in the current Revit view and calculates the width and height of the exported grayscale image accordingly. If the width of the display area is greater than the height, the width of the exported image is set to 1024 pixels, and the height is proportionally scaled. Conversely, if the height is greater than the width, the height of the exported image is set to 1024 pixels, and the width is proportionally scaled. This embodiment allows users to select the horizontal or vertical direction based on the aspect ratio in the image export interface through the view interface and set the pixel value of the corresponding direction to 1024, thus completing the preparation for exporting a high-quality grayscale image.
[0052] Further, this embodiment can obtain the width (W) of the grayscale image and the width of the display area in the Revit view, and calculate the scaling factor, i.e., scale = width / W. Next, since the origin of the Revit view's coordinate system is located at the lower left corner of the Revit view, with the X-axis extending to the right and the Y-axis extending upwards; while the origin of the grayscale image's coordinate system is located at the upper left corner of the grayscale image, with the X-axis to the right and the Y-axis downwards, to achieve the conversion between the two coordinate systems, it is first necessary to determine the minimum bounding rectangle of the display area in the Revit view and obtain its upper left corner coordinates (minX, maxY) to obtain the origin of the Revit view's coordinate system, which serves as the reference origin for coordinate transformation. Then, based on the origin of the Revit view's coordinate system and the scaling factor, a coordinate mapping matrix is established. This coordinate mapping matrix is used to convert the Revit view coordinates to image pixel coordinates.
[0053] The specific coordinate mapping matrix can be constructed as follows:
[0054] Transform transform=Transform.Identity;
[0055] transform.Origin = new XYZ(minX, maxY, 0); / / Set the origin to the top left corner of the model region
[0056] transform.BasisX = XYZ.BasisX / 304.8 * scale; / / Scale along the X-axis, in inches.
[0057] transform.BasisY = XYZ.BasisY.Negate() / 304.8 * scale; / / Reverse the Y-axis direction and scale.
[0058] transform.BasisZ = XYZ.BasisZ / 304.8 * scale; / / Keep the Z-axis unchanged, only perform unit transformation.
[0059] Dividing by 304.8 is to convert the millimeter unit to the inch unit (1 inch = 304.8 millimeters) used by Revit views by default, thereby ensuring the consistency and accuracy of the coordinate system.
[0060] When performing coordinate transformation, the coordinate mapping matrix constructed based on this embodiment first inverts the Y coordinate of the grayscale image (i.e., multiplies it by -1) to make its direction consistent with the Y axis of the Revit view; then, it scales the X and Y components by multiplying them by the scaling factor; finally, it moves the origin of the coordinate system to (minX, maxY) through a translation operation to complete the transformation from image pixel coordinates to Revit view coordinates.
[0061] Step S200: Based on the GAI model, infer the grayscale image to generate a dimensioning positioning line image, and extract the skeleton image based on the grayscale image and the dimensioning positioning line image.
[0062] This embodiment first utilizes a GAI (Generative Artificial Intelligence) model to infer the grayscale image, generating a preliminary dimensioning positioning line image. The GAI model in this embodiment can use a trained Pix2Pix generative model. The pix2pix model is an image-to-image transformation model based on the GAI model. The dimensioning positioning line image represents the AI-predicted dimensioning line positions, used for subsequent dimensioning layout and generation. Next, the difference regions between the original grayscale image and the dimensioning positioning line image are extracted using a bitwise AND operation, resulting in a difference map. Subsequently, the ximgproc::thinning algorithm from the OpenCV extension module (a cross-platform computer vision and machine learning software library) is used to refine the skeleton of this difference map, extracting the skeleton structure of polygonal regions and generating a scattered but clear line network, resulting in a skeleton image. This skeleton image effectively improves the accuracy and stability of subsequent line detection, providing a high-quality geometric feature foundation for dimensioning line recognition and optimization.
[0063] Step S300: Extract straight line features based on the skeleton image, and map the straight line features to the Revit view based on the coordinate mapping matrix to obtain the annotation positioning line.
[0064] This embodiment employs the Hough LinesP algorithm to extract straight line features from the skeleton image and combines it with the SnapRounding algorithm from the CGAL (Computational Geometry Algorithms Library) library to perform topological correction on the extracted straight line features. The original skeleton structure consists of numerous fragmented jagged line segments, making it difficult to accurately identify the inflection points of the line segments and affecting the accuracy of subsequent processing. The direct features after topological correction effectively reduce the jaggedness of the lines, making the line segments straighter and the structure clearer, thereby improving the geometric accuracy of the line segments and laying a good foundation for the subsequent identification and merging of parallel line segments.
[0065] Furthermore, in this embodiment, the topology-corrected straight line features can be mapped back to the Revit view through a coordinate mapping matrix, achieving a precise conversion from image pixel coordinates to Revit view coordinates, thus obtaining annotation positioning lines. In this embodiment, the annotation positioning lines are used to reflect the position of dimension annotations. Subsequently, annotation positioning line segments with the same or opposite directions, and which are connected end-to-end or overlap, are merged to eliminate redundancy and optimize the annotation structure.
[0066] Specifically, to further improve the aesthetics and standardization of the annotation results, after obtaining the annotation positioning lines, this embodiment merges parallel annotation positioning lines with a spacing less than a preset value (e.g., 500mm). The specific rule is as follows: the shorter annotation positioning line is shifted to the straight line containing the longer annotation positioning line or its extension. Then, the four endpoints of the two annotation positioning lines are extracted, and the two outermost endpoints are selected as the endpoints of the new annotation positioning line, generating a merged annotation positioning line. Simultaneously, the original two annotation positioning lines are removed. This processing method effectively reduces the number of annotation lines and improves the neatness and readability of the annotation layout.
[0067] Step S400: Filter the component types that need to be dimensioned in the Revit view, determine the target dimensioning plane, and perform dimensioning based on the dimensioning positioning line to obtain vector drawing.
[0068] This embodiment first filters the component types requiring dimensioning in the Revit view, including walls, beams, columns, doors, windows, axes, and general components, and extracts the valid dimensioning planes for each type of component. For example, walls, beams, and columns have their four outer surfaces perpendicular to the horizontal plane extracted; doors and windows have their boundary planes perpendicular to the horizontal plane at both ends extracted; axes have their centerlines extracted; and general components have their two reference planes extracted. Then, these valid dimensioning planes are projected onto the two-dimensional view plane along the current view direction, generating corresponding projection lines. These projection lines represent the projection results of each component's dimensioning surface or positioning line onto the current view plane, providing a geometric basis for subsequent dimensioning positioning.
[0069] Furthermore, this embodiment can further adjust the position of the generated annotation positioning lines after obtaining all valid annotation planes and annotation positioning lines. The specific method is as follows: First, identify the wall, beam, column edge lines, or axis lines parallel to the annotation positioning lines, and determine whether the distance between them and the annotation positioning lines is less than a threshold, such as 500mm. If the distance is less than the threshold, the annotation positioning lines are shifted 500mm away from the line in the vertical direction; then, the system continues to check whether there is still a conflict at the new position until the annotation positioning lines are within a reasonable spatial range. This embodiment can achieve effective avoidance between the annotation positioning lines and building components, preventing the annotation positioning lines from overlapping or being too close to the component graphics, thereby improving the aesthetics and readability of the annotation results and making the annotation information more intuitive and clear.
[0070] When dimensioning each annotation line, room objects intersecting with the annotation line are identified, and the outer contour boundary of each room object is extracted. The outer contour boundary is then extended outward by 50mm to determine the annotation component range for each room object. Next, annotation components located inside or intersecting the extended contour are further filtered out, and the target annotation planes of these components are extracted. Then, annotation planes perpendicular to the current annotation line are selected from the extracted target annotation planes, categorized into a set of annotation information, and a annotation dictionary structure is constructed, with the annotation line as the key and the list of annotation plane information as the value. Specifically, the annotation dictionary structure is a `Dictionary`. <Line,List <diminfo>> where Line represents the annotation positioning line, List <diminfo>The information set of the target annotation plane or the annotation positioning line representing the annotation component associated with the annotation positioning line provides data support for subsequent automatic generation of dimension annotations.
[0071] Further, the embodiment can automatically generate corresponding dimension annotations based on the constructed annotation dictionary structure by calling Revit API. Then, three standard dimension lines are generated for the peripheral area of the architectural plan, representing the maximum spacing of the axis network in the same direction, the relative spacing between the axis networks, and the actual size of the peripheral component, respectively. To ensure the accuracy and applicability of the peripheral dimension annotations, the embodiment can further determine whether the current view is enabled with the clipping function. If clipping is used, the effective display range of the view is obtained through the view CropBox attribute; if clipping is not enabled, the range of the view boundary is calculated through the view Outli ne attribute combined with the current zoom ratio. Then, the direction and distribution range of the axis network in the current view are extracted, and annotation positioning lines for peripheral annotation are automatically created near the view boundary. Finally, three peripheral dimension annotation positioning lines are generated in sequence according to the processing flow of step S400, realizing complete expression of the overall dimension information of the architectural plan.
[0072] In addition, the AI annotation results generated in the vector drawing are evaluated, and specific indicators include accuracy and aesthetics. Specifically, accuracy mainly focuses on the completeness and accuracy of the annotations, such as the component must have a positioning label, the door and window openings need to be annotated to the wall edge, and the wall and axis can be omitted when they coincide; while aesthetics focuses on the neatness and standardization of the annotations, including avoiding repeated annotations, keeping annotations aligned, reducing overlaps, and appropriately omitting non-critical parts. The overall goal is to ensure information integrity while making the drawing clear and easy to read with an attractive layout. The evaluation proportion of accuracy is greater than that of aesthetics in the embodiment, for example, accuracy accounts for 70 points and aesthetics accounts for 30 points.
[0073] In addition, since the embodiment is based on the GAI model to automatically implement dimension annotation, if the amount of annotation data used for model training is insufficient, the trained GAI model has not yet reached the ideal effect, resulting in a low score of the generated annotation results. At this time, the data training amount can be further increased, and the algorithm can be optimized to improve the quality and accuracy of the annotations.
[0074] In summary, this embodiment utilizes a GAI model to automatically understand the semantics of architectural floor plans, enabling intelligent generation of dimension annotation positions. Furthermore, by combining image processing and geometric algorithms, it effectively solves problems such as chaotic and overlapping annotation positioning lines. In addition, this invention supports automatic identification of component types and their annotation planes, improving annotation accuracy. It achieves a closed-loop process from AI inference to BIM platform output, enhancing design efficiency and drawing quality. It is applicable to various combinations of architectural components and complex drawing environments, effectively exploring the feasibility of GAI in the field of architectural engineering design.
[0075] Based on the above embodiments, the present invention also provides a vector paper generation system based on GAI, the system being used to implement the steps of the vector paper generation method based on GAI in the above method embodiments. Specifically, as follows... Figure 2 As shown, the system includes: a view processing and mapping matrix determination module 10, an AI inference and skeleton extraction module 20, a feature extraction and coordinate mapping module 30, and a dimensioning module 40. Specifically, the view processing and mapping matrix determination module 10 preprocesses the Revit view, exports a grayscale image corresponding to the Revit view, and determines a coordinate mapping matrix based on the Revit view and the grayscale image. The AI inference and skeleton extraction module 20 infers from the grayscale image based on a GAI model, generates a dimensioning positioning line image, and extracts a skeleton image based on the grayscale image and the dimensioning positioning line image. The feature extraction and coordinate mapping module 30 extracts straight line features based on the skeleton image, maps the straight line features to the Revit view based on the coordinate mapping matrix, and obtains dimensioning positioning lines. The dimensioning module 30 filters the component types in the Revit view that require dimensioning, determines the target dimensioning plane, and performs dimensioning based on the dimensioning positioning lines to obtain vector drawings.
[0076] The working principle of each module in the GAI-based vector paper generation system of this embodiment is the same as that of each step in the above method embodiment, and will not be repeated here.
[0077] The modules in the aforementioned GAI-based vector paper generation system can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of the terminal in hardware form or independent of it, or stored in the memory of the terminal in software form, so that the processor can call and execute the corresponding operations of each module.
[0078] Based on the above embodiments, the present invention also provides a terminal, the principle block diagram of which can be as follows: Figure 3 As shown. The terminal may include one or more processors 100 ( Figure 3 (Only one is shown in the image), a memory 101, and a computer program 102 stored in the memory 101 and executable on one or more processors 100. For example, a GAI-based vector paper generation program. When one or more processors 100 execute the computer program 102, they can implement the various steps in the GAI-based vector paper generation method embodiment. Alternatively, when one or more processors 100 execute the computer program 102, they can implement the functions of various modules / units in the GAI-based vector paper generation system embodiment, without limitation here.
[0079] In one embodiment, the processor 100 may be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
[0080] In one embodiment, memory 101 may be an internal storage unit of an electronic device, such as a hard drive or RAM. Memory 101 may also be an external storage device of the electronic device, such as a plug-in hard drive, smart media card (SMC), secure digital (SD) card, flash card, etc. Furthermore, memory 101 may include both internal and external storage units. Memory 101 is used to store computer programs and other programs and data required by the terminal. Memory 101 can also be used to temporarily store data that has been output or will be output.
[0081] Those skilled in the art will understand that Figure 3 The block diagram shown is merely a partial structural diagram related to the present invention and does not constitute a limitation on the terminal to which the present invention is applied. A specific terminal may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0082] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the methods described above. Any references to memory, storage, operational databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual operating data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAM bus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.< / diminfo> < / diminfo>
Claims
1. A method for generating vector graphics based on GAI, characterized in that, The method includes: Preprocess the Revit view to export the grayscale image corresponding to the Revit view, and determine the coordinate mapping matrix based on the Revit view and the grayscale image; The grayscale image is inferred based on the GAI model to generate a dimension annotation positioning line image, and a skeleton image is extracted based on the grayscale image and the dimension annotation positioning line image. Based on the skeleton image, straight line features are extracted, and based on the coordinate mapping matrix, the straight line features are mapped onto the Revit view to obtain the annotation positioning lines; Filter the component types that need to be dimensioned in the Revit view, determine the target dimensioning plane, and perform dimensioning based on the dimensioning positioning lines to obtain vector drawings.
2. The vector drawing generation method based on GAI according to claim 1, characterized in that, The preprocessing of the Revit view to export the corresponding grayscale image includes: Hide the components in the Revit view that are not related to size; Set the fill color and edge color of the remaining components to black or gray, and export the grayscale image of the display area in the Revit view.
3. The vector drawing generation method based on GAI according to claim 1, characterized in that, The step of determining the coordinate mapping matrix based on the Revit view and the grayscale image includes: Obtain the width of the grayscale image and the width of the display area in the Revit view, and calculate the scaling factor; Based on the origin of the Revit view's coordinate system and the scaling factor, a coordinate mapping matrix is established. This coordinate mapping matrix is used to convert Revit view coordinates to image pixel coordinates.
4. The vector drawing generation method based on GAI according to claim 1, characterized in that, The step of extracting the skeleton image based on the grayscale image and the dimensioned positioning line image includes: Based on the grayscale image and the dimension annotation positioning line image, a difference map is determined; The skeleton image is obtained by using an OpenCV extension module to refine the skeleton of the difference map and extract the skeleton structure.
5. The vector drawing generation method based on GAI according to claim 1, characterized in that, The method further includes: After obtaining the positioning lines, parallel positioning lines with a spacing smaller than the preset value are merged. The merging process includes: Shift the shorter label positioning line to the straight line containing the longer label positioning line or its extension; Extract the four endpoints of the two original annotation positioning lines, and select the two outermost endpoints as the endpoints of the new annotation positioning line to generate a merged annotation positioning line, while removing the original two annotation positioning lines.
6. The method for generating vector graphics based on GAI according to claim 1, characterized in that, The step of dimensioning based on the marked positioning lines to obtain vector graphics includes: When performing row dimensioning for each dimensioning positioning line, identify the room objects that intersect with the dimensioning positioning line, extract the outer contour boundary of each room object, determine the dimensioning component range of each room object, filter out dimensioning components located inside the extended contour or intersecting with the contour, and extract the target dimensioning plane of the dimensioning component; From the extracted target annotation planes, filter out the annotation planes that are perpendicular to the current annotation positioning line, classify them into a group of annotation information, and construct an annotation dictionary structure with the annotation positioning line as the key and the annotation plane information list as the value; Based on the constructed annotation dictionary structure, the Revit API is called to automatically generate the corresponding dimension annotations; For the outer area of the building plan, three standard dimension lines are generated to represent: the maximum spacing of the grid lines in the same direction, the relative spacing between the grid lines, and the actual dimensions of the outer components.
7. The vector drawing generation method based on GAI according to claim 1, characterized in that, The method further includes: The annotation results in vector graphics are evaluated based on accuracy and aesthetics.
8. A vector drawing generation system based on GAI, characterized in that, The system is used to implement the steps of the vector paper generation method based on GAI according to any one of claims 1-7, and the system includes: The view processing and mapping matrix determination module is used to preprocess the Revit view, export the grayscale image corresponding to the Revit view, and determine the coordinate mapping matrix based on the Revit view and the grayscale image. The AI inference and skeleton extraction module is used to infer the grayscale image based on the GAI model, generate a dimension annotation positioning line image, and extract a skeleton image based on the grayscale image and the dimension annotation positioning line image. The feature extraction and coordinate mapping module is used to extract straight line features based on the skeleton image and map the straight line features to the Revit view based on the coordinate mapping matrix to obtain the annotation positioning line; The dimensioning module is used to filter the component types that need to be dimensioned in the Revit view, determine the target dimensioning plane, and perform dimensioning based on the dimensioning positioning lines to obtain vector drawings.
9. A terminal, characterized in that, The terminal includes a memory, a processor, and a GAI-based vector paper generation program stored in the memory and executable on the processor. When the processor executes the GAI-based vector paper generation program, it implements the steps of the GAI-based vector paper generation method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a GAI-based vector drawing generation program, which implements the steps of the GAI-based vector drawing generation method as described in any one of claims 1-7 on the computer-readable storage medium.
Citation Information
Patent Citations
Building structure surface crack size automatic labeling method
CN110033444A
Method and system for performing multi-channel size marking based on component screening
CN117556487A
Engineering drawing automatic labeling method and device based on feature direction matching and storage medium
CN119358055A
Engineering drawing automatic labeling method and device and medium
CN120340032A
Bottoms with enhanced fit and breathability separating penis and scrotum and securing penis
KR102918102B1