CAD drawing method, device, storage medium and computer equipment

By decomposing and parsing CAD data and using the Metal graphics interface to draw CAD drawings, it solves the problem of inability to interact with CAD drawing elements in the existing technology, achieves multi-platform support and online preview, and improves user experience and efficiency.

CN114692241BActive Publication Date: 2024-09-03JIULING (JIANGSU) DIGITAL INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011606249.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-30
Publication Date
2024-09-03
Estimated Expiration
2040-12-30

AI Technical Summary

Technical Problem

Existing CAD drawings cannot interact with elements, and the transmission efficiency of opening CAD drawings is low, and elements cannot express inclusion relationships.

Method used

By obtaining CAD data, grouping it into multiple components, parsing the elements in each component, and using the Metal graphics interface to call the drawing engine to draw CAD drawings, the data is compiled into an application that can run on the target platform, supporting macOS, iOS and iPadOS. .

Benefits of technology

It realizes the interactive operation of CAD drawing elements, improves the user experience, supports online preview and multi-platform applications, and enhances the interactivity and efficiency of drawing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114692241B
    Figure CN114692241B
Patent Text Reader

Abstract

The present invention discloses a CAD drawing drawing method, device, storage medium and computer equipment. The present invention analyzes all elements contained in each component and generates an analysis result; based on the analysis result, a drawing engine with a graphical interface is called to draw a CAD drawing. Since the elements contained in the component are analyzed into corresponding line segments, it is more convenient for users to click on the components in the CAD drawing to enhance interactivity. In addition, the CAD data is in a vector data exchange format, which can facilitate users to preview the CAD drawings online. In addition, the data corresponding to the CAD drawing is compiled into an application that can be run in the macOS operating system, the iOS operating system and the iPadOS operating system through the Metal graphical interface, so that the drawn CAD drawing can be applied to applications in multiple systems.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to computer technology, and in particular to a CAD drawing drawing method, device, storage medium and computer equipment. Background Art

[0002] Computer Aided Design (CAD) uses computers and their graphics equipment to help designers perform design work and is widely used in the construction industry.

[0003] With the miniaturization of computers, running 3D CAD software on personal desktops and laptops has become an important means to help the rapid growth of industry. In order to improve production efficiency, enhance product competitiveness, and reduce product R&D and trial production cycles, factories use a large number of 3D CAD software for simulation.

[0004] Currently, if CAD data is to be opened by an application, it must be in DWG format and must be downloaded to a local device before it can be opened. In addition, this method of transmission has low efficiency.

[0005] All elements (such as lines) in CAD drawings are a whole, so it is impossible to interact with the elements, and it is also impossible to express the inclusion relationship between the elements. Summary of the invention

[0006] The embodiment of the present application provides a CAD drawing drawing method, device, storage medium and computer equipment, which effectively solves the problem that elements in CAD drawings cannot be interactively operated at present. In addition, it also solves the problem that opening CAD drawings is easily restricted.

[0007] According to one aspect of the present application, an embodiment of the present application provides a CAD drawing drawing method, the method comprising the steps of: acquiring CAD data; grouping the CAD data into multiple components so that each of the components contains at least one element, and the at least one element includes at least one of a line and text; parsing all elements contained in each of the components and generating parsing results corresponding to the elements; drawing a CAD drawing based on the parsing results and calling a drawing engine with a graphics interface; and compiling the data corresponding to the CAD drawing into an application that can be run on a target platform, wherein the target platform corresponds to a graphics interface, and wherein the graphics interface is a Metal graphics interface.

[0008] Furthermore, the line includes a line segment, a circle and an arc.

[0009] Furthermore, the target platform includes at least one of a macOS operating system, an iOS operating system, and an iPadOS operating system.

[0010] Furthermore, the CAD data is in a vector data exchange format and is obtained by converting CAD data in a DWG format, and the CAD data in the vector data exchange format has the number, color, shape and layer information of elements in the CAD data in the DWG format.

[0011] Furthermore, in the step of parsing all elements contained in each of the components and generating parsing results corresponding to the elements, it includes: when the element is a line segment, obtaining the starting point coordinates and the end point coordinates of the line segment; and determining the position of the line segment after parsing according to the starting point coordinates and the end point coordinates.

[0012] Furthermore, in the step of parsing all elements contained in each of the components and generating parsing results corresponding to the elements, it also includes: when the element is a circle, dividing the edge of the circle into multiple arcs of the same size through a preset number of points; connecting adjacent points with straight lines to obtain a target circle composed of multiple line segments; obtaining the center coordinates and radius of the circle; and determining the position of each of the line segments in the target circle composed after parsing based on the center coordinates, radius and a preset number of points of the circle.

[0013] Furthermore, in the step of parsing all elements contained in each of the components and generating parsing results corresponding to the elements, it also includes: when the element is an arc, dividing the side of the arc into multiple arcs of the same size through a preset number of points; connecting adjacent points with straight lines to obtain a target arc composed of multiple line segments; obtaining the center coordinates and radius of the arc; and determining the position of each line segment in the target arc composed after analysis based on the center, radius and a preset number of points of the arc.

[0014] According to another aspect of the present application, an embodiment of the present application provides a CAD drawing drawing device, the device comprising: a data acquisition unit, used to acquire CAD data; a data grouping unit, used to group the CAD data into multiple components so that each of the components contains at least one element, and the at least one element includes at least one of a line and text; an element parsing unit, used to parse all elements contained in each of the components and generate parsing results corresponding to the elements; a drawing drawing unit, used to draw a CAD drawing based on the parsing results and calling a drawing engine with a graphical interface; and a data compilation unit, used to compile the data corresponding to the CAD drawing into an application that can be run on a target platform, wherein the target platform corresponds to the graphical interface.

[0015] According to another aspect of the present application, an embodiment of the present application provides a storage medium, in which a plurality of instructions are stored, and the instructions are suitable for being loaded by a processor to execute a CAD drawing method as provided in any embodiment of the present application.

[0016] According to another aspect of the present application, an embodiment of the present application provides a mobile terminal, including a processor and a memory, the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used to execute the steps in the CAD drawing method provided in any embodiment of the present application.

[0017] The advantage of the present invention is that all elements contained in each of the components are parsed and parsing results are generated; based on the parsing results, a drawing engine with a graphical interface is called to draw a CAD drawing. Since the elements contained in the component are parsed into corresponding line segments, it is more convenient for users to click on the components in the CAD drawing to enhance interactivity. In addition, the CAD data is in a vector data exchange format, which allows users to preview the CAD drawings online. In addition, the data corresponding to the CAD drawings are compiled into applications that can run in the macOS operating system, the iOS operating system, and the iPadOS operating system through the Metal graphical interface, so that the drawn CAD drawings can be applied to applications in multiple systems. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The technical solution and other beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.

[0019] Figure 1 A flowchart of the steps of a CAD drawing drawing method provided by one embodiment of the present invention.

[0020] Figure 2 for Figure 1 A flowchart of an embodiment of the sub-steps of step S130 is shown.

[0021] Figure 3 for Figure 1 FIG. 1 is a flow chart of another embodiment of the sub-steps of step S130 .

[0022] Figure 4 for Figure 3 The illustrated embodiment provides a plane coordinate system diagram established when analyzing a circle.

[0023] Figure 5 for Figure 1 FIG. 1 is a flow chart of another embodiment of the sub-steps of step S130 .

[0024] Figure 6 A schematic diagram of the structure of a CAD drawing drawing device provided in one embodiment of the present invention.

[0025] Figure 7 An internal structural diagram of a computer device provided for one embodiment of the present invention. DETAILED DESCRIPTION

[0026] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0027] In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection, an electrical connection, or can communicate with each other; it can be a direct connection, or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances. In this embodiment, the simulated display screen touch unit is connected to the head tracking unit to obtain the movement path of the sensing cursor in the display device.

[0028] like Figure 1 The figure is a flowchart of the steps of the drawing method provided in the first embodiment of the present application. The method comprises the steps of:

[0029] Step S110: Obtain CAD data.

[0030] The CAD data is a vector data exchange format, for example, it can be a JSON (JavaScript Object Notation) format. Specifically, CAD data in JSON format is usually obtained by converting CAD data in DWG format (a drawing storage format created by AutoCAD) by a server. The DWG format is a proprietary file format used by the auxiliary design software AutoCAD and software based on AutoCAD to save design data. When the server converts the CAD data in DWG format, the generated CAD data in JSON format has the number, color, shape and layer information of the elements in the CAD data in DWG format. After the server converts the CAD data in DWG format into JSON format, users can preview the CAD drawings online without downloading the data corresponding to the CAD drawings, thereby facilitating users to quickly view the CAD drawings.

[0031] Step S120: Grouping the CAD data into a plurality of components, so that each of the components includes at least one element.

[0032] The component is generally a basic graphic, and the CAD drawing can be composed of multiple basic graphics. For example, in a CAD drawing of a building model, the basic graphic can be a staircase, etc. Each of the elements includes at least one of a line and text. Usually, in order to facilitate the parsing operation in the subsequent steps, each of the elements only includes text or lines. Among them, the line can be divided into line segments, circles and arcs according to different shapes.

[0033] Step S130: parsing all elements contained in each of the components, and generating parsing results corresponding to the elements.

[0034] With respect to different lines and texts contained in an element, how to parse different lines and texts will be described in detail below.

[0035] like Figure 2 As shown, Figure 2 FIG. 1 is a flowchart of an embodiment of the sub-steps of step S130 .

[0036] Step S210: When the element is a line segment, obtain the starting point coordinates and the ending point coordinates of the line segment.

[0037] Step S220: determining the position of the line segment after analysis according to the starting point coordinates and the end point coordinates.

[0038] In this embodiment, when the element is a line segment, since the line segment is the most basic shape among the elements of the CAD drawing, when parsing the line segment, it is only necessary to obtain the starting point coordinates and the end point coordinates of the line segment to determine the position of the line segment.

[0039] In addition, if the line segment has a certain width, when analyzing the line segment with a certain width, the line segment needs to be regarded as a quadrilateral. For example, assuming that the coordinates of the two endpoints of the line segment are (x, y) and (a, b), and the widths of the two sides are m and n, then the coordinates of the four points of the quadrilateral are (x, y+m / 2), (x, yw / 2), (a, bn / 2), (a, b+n / 2). The position of the quadrilateral can be determined by these four points.

[0040] like Figure 3 and Figure 4 As shown, Figure 3 FIG. 4 is a flow chart of another embodiment of step S130 . Figure 4 for Figure 3 The illustrated embodiment provides a plane coordinate system diagram established when analyzing a circle.

[0041] Step S310: When the element is a circle, the edge of the circle is divided into a plurality of arcs of the same size using a preset number of points.

[0042] Step S320: Connect adjacent points with straight lines to obtain a target circle composed of multiple line segments.

[0043] Step S330: Obtain the center coordinates and radius of the circle.

[0044] Step S340: determining the position of each line segment in the target circle formed after analysis according to the center coordinates, radius and a preset number of points of the circle.

[0045] In this embodiment, when the element is a circle, it is assumed that the center of the circle is P, the coordinates of P are (x, y), the radius of the circle is R, and a plane rectangular coordinate system is established with P as the origin. The preset number of points is N, and in one embodiment N=30 (N is an integer, indicating the number of points on the circle). First, the coordinates of 30 points on the unit circle (the unit circle, i.e., the coordinates of the center P are (0,0) at the origin of the coordinate system, and the radius R is 1) are obtained. Assuming that the first point is on the x-axis of the coordinate system, i.e., the coordinates of the first point A are (1,0), since the edge of the circle is divided into multiple arcs of the same size by a preset number of points, the angle between each point and the line from the origin in counterclockwise order and the x-axis is an arithmetic progression. Specifically, if each point is sorted counterclockwise, the angle between each point in counterclockwise order and the x-axis is 12 degrees greater than the previous point (360 divided by 30), that is, the tolerance of the arithmetic progression is 12 degrees. The coordinates of each point can be obtained through trigonometric functions. For example, the coordinates of the second point B are (R*Cosine(12)+x, R*Sine(12)+y).

[0046] In addition, during the analysis process, a circle is approximately composed of multiple line segments. The higher the accuracy of the circle, the more line segments are required and the shorter the length of each line segment. Therefore, the larger the N value, the higher the accuracy of the circle.

[0047] In addition, the circle formed by analyzing lines with a certain width can be considered as a ring composed of an inner circle and an outer circle. The coordinates of each point on the inner circle and the outer circle can also be obtained by the method in the above embodiment, and then two adjacent points on the inner circle and the outer circle are used to form a quadrilateral, and the positions of all the quadrilaterals are obtained in turn.

[0048] like Figure 5 As shown, Figure 5 FIG. 4 is a flowchart of another embodiment of the sub-steps of step S130 .

[0049] Step S410: When the element is an arc, the side of the arc is divided into a plurality of arcs of the same size using a preset number of points.

[0050] Step S420: Connect adjacent points with straight lines to obtain a target arc composed of multiple line segments.

[0051] Step S430: Obtain the center coordinates and radius of the arc.

[0052] Step S440: determining the position of each line segment in the target arc formed after analysis according to the center, radius and a preset number of points of the arc.

[0053] In this embodiment, when the element is an arc, the arc can be considered as a portion intercepted from a circle, which is the same as the method for parsing a circle in the above embodiment. Therefore, it will not be repeated here, by parsing the arc to the positions of all line segments on the arc.

[0054] In addition, the method for analyzing the arc formed by the lines with a certain width is the same as the method for analyzing the circle formed by the lines with a certain width in the above embodiment. Therefore, it will not be repeated here. The positions of all quadrilaterals on the arc are obtained by analyzing the arc formed by the lines with a certain width.

[0055] In addition, when the element is text, the attributes of each piece of text can be directly obtained from the CAD data, and the attributes include information such as content, size, color, rotation angle and position.

[0056] Continue reading Figure 1 , step S140: based on the analysis result and calling a drawing engine with a graphic interface to draw a CAD drawing.

[0057] The parsing results include the position of the line segment, text attributes and the position of the quadrilateral. Specifically, when drawing CAD, the Metal graphics interface is called for drawing. For line segments (i.e., without line width), the color of the line segment and the coordinates of the two endpoints of the line segment are passed in each time. For line segments with line width (i.e., quadrilaterals), the color of the line segment and the coordinates of the four vertices are passed in each time. As for text, the interface design (i.e., UI design) is used directly for drawing, and the displayed text content, size, color, rotation angle and position are set. The drawing engine can use the Unity engine. It supports the Metal graphics interface, and the Metal graphics interface supports 3D scenes.

[0058] Step S150: compile the data corresponding to the CAD drawing into an application program that can be run on a target platform.

[0059] In order to make the drawn CAD drawings applicable to applications in multiple systems, the data corresponding to the CAD drawings are compiled into an application through the Metal graphics interface, and the application can run on any operating system among the macOS operating system, the iOS operating system and the iPadOS operating system.

[0060] In actual operation (i.e., interacting with CAD drawings), for example, when performing a point-to-point operation, for line segments (i.e., without line width, such as a circle without line width), the shortest distance between the point clicked on the screen and the line segments contained in the component is calculated. When the distance is less than a certain threshold, the component is determined to be currently selected, and the color of all line segments of the component is changed and the line segments are widened to highlight the component. For line segments with line width (i.e., quadrilaterals such as circles with line width), it is determined whether the point clicked on the screen is within the area of ​​the quadrilateral contained in the component to determine whether the component is selected. If selected, the color of all line segments of the component is directly changed.

[0061] The advantage of the present invention is that all elements contained in each of the components are parsed and parsing results are generated; based on the parsing results, a drawing engine with a graphical interface is called to draw a CAD drawing. Since the elements contained in the component are parsed into corresponding line segments, it is more convenient for users to click on the components in the CAD drawing to enhance interactivity. In addition, the CAD data is in a vector data exchange format, which can facilitate users to preview the CAD drawings online. In addition, the data corresponding to the CAD drawings are compiled into applications that can run in MacOS operating systems, IOS operating systems, and iPadOS operating systems through the Vulkan graphics interface, so that the drawn CAD drawings can be applied to applications in multiple systems.

[0062] like Figure 6 As shown, it is a schematic diagram of the structure of a CAD drawing drawing device provided in an embodiment of the present application, and the device includes: a data acquisition unit 10, a data grouping unit 20, an element parsing unit 30, a drawing drawing unit 40 and a data compilation unit 50.

[0063] The data acquisition unit 10 is used to acquire CAD data. The CAD data is in a vector data exchange format, for example, it can be in JSON format. Specifically, CAD data in JSON format is usually obtained by converting CAD data in DWG format by a server. The DWG format is a proprietary file format used by the auxiliary design software AutoCAD and software based on AutoCAD to save design data. When the server converts the CAD data in DWG format, the generated CAD data in JSON format has the number, color, shape and layer information of the elements in the CAD data in DWG format. After the server converts the CAD data in DWG format into JSON format, the user can preview the CAD drawing online without downloading the data corresponding to the CAD drawing, thereby facilitating the user to quickly view the CAD drawing.

[0064] The data grouping unit 20 is used to group the CAD data according to a plurality of components so that each of the components contains at least one element, and the at least one element includes at least one of a line and a text. The component is generally a basic graphic, and the CAD drawing can be composed of a plurality of basic graphics. For example, in a CAD drawing of a building model, the basic graphic can be a staircase, etc. Each of the elements includes at least one of a line and a text. Usually, in order to facilitate the parsing operation in the subsequent steps, each of the elements only includes text or a line. Among them, the line can be divided into a line segment, a circle and an arc according to different shapes.

[0065] The element parsing unit 30 is used to parse all the elements contained in each of the components and generate the parsing results corresponding to the elements. In one embodiment, when the element is a line segment, since the line segment is the most basic shape among the elements of the CAD drawing, when parsing the line segment, it is only necessary to obtain the starting point coordinates and the end point coordinates of the line segment to determine the position of the line segment. In addition, if the line segment has a certain width, when parsing the line segment with a certain width, the line segment needs to be regarded as a quadrilateral. For example, assuming that the coordinates of the two endpoints of the line segment are (x, y), (a, b), and the widths of the two sides are m and n, respectively, then the coordinates of the four points of the quadrilateral are (x, y+m / 2), (x, yw / 2), (a, bn / 2), (a, b+n / 2). The position of the quadrilateral can be determined by these four points.

[0066] like Figure 4 As shown, in one embodiment, when the element is a circle, it is assumed that the center of the circle is P, the coordinates of P are (x, y), the radius of the circle is R, and a plane rectangular coordinate system is established with P as the origin. The preset number of points is N, and in one embodiment N=30 (N is an integer, indicating the number of points on the circle). First, the coordinates of 30 points on the unit circle (the unit circle, i.e., the coordinates of the center P are (0,0) at the origin of the coordinate system, and the radius R is 1) are obtained. Assuming that the first point is on the x-axis of the coordinate system, i.e., the coordinates of the first point A are (1,0), since the edge of the circle is divided into multiple arcs of the same size by a preset number of points, the angle between the line connecting each point in counterclockwise order to the origin and the x-axis is an arithmetic progression. Specifically, if each point is sorted counterclockwise, the angle between each point in counterclockwise order and the x-axis is 12 degrees greater than the previous point (360 divided by 30), that is, the tolerance of the arithmetic progression is 12 degrees. The coordinates of each point can be obtained through trigonometric functions. For example, the coordinates of the second point B are (R*Cosine(12)+x, R*Sine(12)+y).

[0067] In addition, during the analysis process, a circle is approximately composed of multiple line segments. The higher the accuracy of the circle, the more line segments are required and the shorter the length of each line segment. Therefore, the larger the N value, the higher the accuracy of the circle.

[0068] In addition, the circle formed by analyzing lines with a certain width can be considered as a ring composed of an inner circle and an outer circle. The coordinates of each point on the inner circle and the outer circle can also be obtained by the method in the above embodiment, and then two adjacent points on the inner circle and the outer circle are used to form a quadrilateral, and the positions of all the quadrilaterals are obtained in turn.

[0069] In this embodiment, when the element is an arc, the arc can be considered as a portion intercepted from a circle, which is the same as the method for parsing a circle in the above embodiment. Therefore, it will not be repeated here, by parsing the arc to the positions of all line segments on the arc.

[0070] In addition, the method for analyzing the arc formed by the lines with a certain width is the same as the method for analyzing the circle formed by the lines with a certain width in the above embodiment. Therefore, it will not be repeated here. The positions of all quadrilaterals on the arc are obtained by analyzing the arc formed by the lines with a certain width.

[0071] In addition, when the element is text, the attributes of each piece of text can be directly obtained from the CAD data, and the attributes include information such as content, size, color, rotation angle and position.

[0072] The drawing drawing unit 40 is used to draw a CAD drawing based on the analysis result and calling a drawing engine with a graphical interface. The analysis result includes the position of the line segment, the text attributes and the position of the quadrilateral. Specifically, when drawing CAD, the Metal graphical interface is called for drawing. For line segments (i.e., no line width, such as a circle without line width), the color of the line segment and the coordinates of the two endpoints of the line segment are passed in each time. For line segments with line width (i.e., quadrilaterals, such as circles with line width), the color of the line segment and the coordinates of the four vertices are passed in each time. For text, the interface design (i.e., UI design) is used directly for drawing, and the displayed text content, size, color, rotation angle and position are set.

[0073] The data compiling unit 50 is used to compile the data corresponding to the CAD drawing into an application program that can be run on a target platform, wherein the target platform corresponds to a graphical interface. In order to enable the drawn CAD drawing to be applied to applications in multiple systems. The data corresponding to the CAD drawing is compiled into an application program that can be run in a MacOS operating system, an IOS operating system, and an iPadOS operating system through a Metal graphical interface.

[0074] In actual operation (i.e., interacting with CAD drawings), for example, when performing a point-to-point operation, for line segments (i.e., without line width, such as a circle without line width), the shortest distance between the point clicked on the screen and the line segments contained in the component is calculated. When the distance is less than a certain threshold, the component is determined to be currently selected, and the color of all line segments of the component is changed and the line segments are widened to highlight the component. For line segments with line width (i.e., quadrilaterals such as circles with line width), it is determined whether the point clicked on the screen is within the area of ​​the quadrilateral contained in the component to determine whether the component is selected. If selected, the color of all line segments of the component is directly changed.

[0075] The advantage of the present invention is that all elements contained in each of the components are parsed and parsing results are generated; based on the parsing results, a drawing engine with a graphical interface is called to draw a CAD drawing. Since the elements contained in the component are parsed into corresponding line segments, it is more convenient for users to click on the components in the CAD drawing to enhance interactivity. In addition, the CAD data is in a vector data exchange format, which allows users to preview the CAD drawings online. In addition, the data corresponding to the CAD drawings are compiled into applications that can run in MacOS operating systems, IOS operating systems, and iPadOS operating systems through the Metal graphical interface, so that the drawn CAD drawings can be applied to applications in multiple systems.

[0076] In one embodiment, a computer device 400 is provided, and its internal structure diagram can be as follows: Figure 7 As shown. The computer device 400 includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device 400 is used to provide computing and control capabilities. The memory of the computer device 400 includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external computer device through a network connection. When the computer program is executed by the processor, a CAD drawing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0077] Those skilled in the art will understand that Figure 7The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0078] In one embodiment, a computer device 400 is provided, which includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0079] Get CAD data;

[0080] Grouping the CAD data into a plurality of components so that each of the components includes at least one element, wherein the at least one element includes at least one of a line and a text;

[0081] Parsing all elements contained in each of the components and generating parsing results corresponding to the elements;

[0082] Based on the analysis result, a drawing engine with a graphic interface is called to draw a CAD drawing; and

[0083] The data corresponding to the CAD drawing is compiled into an application program that can be run on a target platform, wherein the target platform corresponds to a graphic interface.

[0084] In another embodiment, a storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0085] Get CAD data;

[0086] Grouping the CAD data into a plurality of components so that each of the components includes at least one element, wherein the at least one element includes at least one of a line and a text;

[0087] Parsing all elements contained in each of the components and generating parsing results corresponding to the elements;

[0088] Based on the analysis result, a drawing engine with a graphic interface is called to draw a CAD drawing; and

[0089] The data corresponding to the CAD drawing is compiled into an application program that can be run on a target platform, wherein the target platform corresponds to a graphic interface.

[0090] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0091] Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A CAD drawing drawing method, characterized in that: Includes steps: Get CAD data; Grouping the CAD data into a plurality of components so that each of the components includes at least one element, wherein the at least one element includes at least one of a line and a text; Parsing all elements contained in each of the components and generating parsing results corresponding to the elements; Based on the analysis result, a drawing engine with a graphic interface is called to draw a CAD drawing; as well as Compiling the data corresponding to the CAD drawing into an application program that can be run on a target platform, wherein the target platform corresponds to a graphics interface, wherein the graphics interface is a Metal graphics interface; The parsing of all elements contained in each of the components and generating parsing results corresponding to the elements include: When the element is a line segment, obtaining the starting point coordinates and the ending point coordinates of the line segment; and Determine the position of the line segment after analysis according to the starting point coordinates and the end point coordinates; When the element is a circle, the edge of the circle is divided into a plurality of arcs of the same size by a preset number of points; Connect adjacent points with straight lines to obtain a target circle composed of multiple line segments; Get the center coordinates and radius of the circle; and Determine the position of each line segment in the target circle formed after analysis according to the center coordinates, radius and a preset number of points of the circle; When the element is an arc, the side of the arc is divided into a plurality of arcs of the same size by a preset number of points; Connect adjacent points with straight lines to obtain a target arc composed of multiple line segments; Get the center coordinates and radius of the arc; and The position of each line segment in the target arc formed after analysis is determined according to the center, radius and a preset number of points of the arc.

2. The CAD drawing method according to claim 1, characterized in that: The line includes a line segment, a circle, and an arc.

3. The CAD drawing method according to claim 1, characterized in that: The target platform includes at least one of a macOS operating system, an iOS operating system, and an iPadOS operating system.

4. The CAD drawing method according to claim 1, characterized in that: The CAD data is in a vector data exchange format and is obtained by converting CAD data in a DWG format; the CAD data in the vector data exchange format has the quantity, color, shape and layer information of the elements in the CAD data in the DWG format.

5. A CAD drawing drawing device, characterized in that: include: A data acquisition unit, used for acquiring CAD data; A data grouping unit, configured to group the CAD data into a plurality of components so that each of the components includes at least one element, wherein the at least one element includes at least one of a line and a text; An element parsing unit is used to parse all elements contained in each of the components and generate parsing results corresponding to the elements, including: when the element is a line segment, obtaining the starting point coordinates and the end point coordinates of the line segment; and determining the position of the line segment after parsing according to the starting point coordinates and the end point coordinates; when the element is a circle, dividing the edge of the circle into multiple arcs of the same size through a preset number of points; connecting adjacent points with straight lines to obtain a target circle composed of multiple line segments; obtaining the center coordinates and radius of the circle; and determining the position of each line segment in the target circle composed after parsing according to the center coordinates, radius and a preset number of points of the circle; when the element is an arc, dividing the edge of the arc into multiple arcs of the same size through a preset number of points; connecting adjacent points with straight lines to obtain a target arc composed of multiple line segments; obtaining the center coordinates and radius of the arc; and determining the position of each line segment in the target arc composed after parsing according to the center, radius and a preset number of points of the arc; A drawing drawing unit, used for drawing a CAD drawing based on the analysis result and calling a drawing engine with a graphic interface; and The data compiling unit is used to compile the data corresponding to the CAD drawing into an application program that can be run on a target platform, wherein the target platform corresponds to a graphics interface, and wherein the graphics interface is a Metal graphics interface.

6. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the CAD drawing drawing method described in any one of claims 1-4.

7. A computer device, characterized in that: It includes a processor and a memory, the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used to execute the steps in the CAD drawing drawing method described in any one of claims 1-4.