Engineering drawing automatic generation method and device, equipment and medium
By analyzing the geometric information of the 3D model and establishing the target coordinate system, engineering drawing views are generated based on the reference plane and symmetry relationship, which solves the problem of low efficiency in engineering drawing annotation and realizes efficient one-click drawing and annotation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHANGHAI MEIJIALIN INFORMATION TECH CO LTD
- Filing Date
- 2025-12-03
- Publication Date
- 2026-05-19
AI Technical Summary
In the process of annotating engineering drawings, the annotation efficiency is low. With the iteration of product versions and the increase in data volume, the workload of annotating engineering drawings is huge, which restricts the improvement of design efficiency.
By acquiring the geometric information and main view of the target 3D model, the surface with the largest area is determined as the target surface. A target coordinate system is established, and an engineering drawing view is created based on the reference plane and symmetry relationship. Dimensioning is performed according to the geometric information and preset logic.
It enables one-click drawing generation and annotation, improving the efficiency of engineering drawing annotation, reducing human error and complex datum conversion, and enhancing the practicality of drawings and communication efficiency.
Smart Images

Figure CN122066899A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of three-dimensional modeling technology, and in particular to a metering method, device, equipment and medium for an electricity meter. Background Technology
[0002] Currently, the 3D structural software MDA has detailed drawing capabilities, requiring accurate manual annotation of 2D engineering drawings. These drawings contain crucial information such as the geometry, dimensions, location, and materials of parts. Dimensions are particularly important for controlling product quality and accuracy; manufacturing personnel can use this information for processing and inspection to ensure the quality of parts and assemblies and reduce errors in the production process. Therefore, the dimensions annotated on engineering drawings are crucial for designers. In actual design processes, with product version iterations, the size of engineering drawings increases exponentially, and the amount of data multiplies. The workload of annotating these drawings is enormous, significantly hindering design efficiency. Therefore, improving annotation efficiency in engineering drawings has become an urgent problem to solve. Summary of the Invention
[0003] In view of this, embodiments of this application provide a method, apparatus, device and medium for automatically generating engineering drawings to solve the problem of low annotation efficiency in the process of annotating engineering drawings.
[0004] In a first aspect, embodiments of this application provide a method for automatically generating engineering drawings, the method comprising: Obtain the target 3D model to be converted, parse the target 3D model, and determine the geometric information, the main viewpoint, and the face information of each face of the target 3D model; Based on the geometric information, the surface with the largest area in the target 3D model is determined as the target surface, and a target coordinate system is established based on the target surface; A reference plane is established based on the coordinate axes of the target coordinate system, and a symmetry reference axis is determined according to the symmetry relationship between the reference plane and the target three-dimensional model. Based on the target 3D model and the main viewpoint, multiple views of the engineering drawing corresponding to the target 3D model are created, and the reference of each view is determined according to the symmetry reference axis. Based on the geometric information, the reference of each view, the surface information, and the preset dimensioning logic, dimensions are added to each view to obtain an annotated engineering drawing.
[0005] Secondly, embodiments of this application provide an automatic engineering drawing generation device, the automatic engineering drawing generation device comprising: The parsing module is used to acquire the target 3D model to be converted, parse the target 3D model, and determine the geometric information, the main viewpoint, and the face information of each face of the target 3D model. A module is established to determine the surface with the largest area in the target 3D model as the target surface based on the geometric information, and to establish a target coordinate system based on the target surface; The determination module is used to establish a reference plane based on the coordinate axes of the target coordinate system, and to determine the symmetry reference axis according to the symmetry relationship between the reference plane and the target three-dimensional model; A creation module is used to create multiple views of the engineering drawing corresponding to the target 3D model based on the target 3D model and the main viewpoint, and to determine the reference of each view according to the symmetry reference axis; The annotation module is used to annotate each view with dimensions based on the geometric information, the reference of each view, the surface information, and the preset dimensioning logic, so as to obtain an annotated engineering drawing.
[0006] Thirdly, embodiments of this application provide a computer device, the computer device including a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the automatic engineering drawing generation method as described above.
[0007] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the automatic engineering drawing generation method described above.
[0008] The advantages of this application compared to the prior art are: In this application, a target 3D model to be converted is obtained, analyzed, and its geometric information, main viewpoint, and surface information of each face are determined. Based on the geometric information, the face with the largest area in the target 3D model is identified as the target face. A target coordinate system is established based on the target face, and a reference plane is established based on the coordinate axes of the target coordinate system. Based on the symmetry relationship between the reference plane and the target 3D model, a symmetry reference axis is determined. Based on the target 3D model and the main viewpoint, multiple views corresponding to the engineering drawing of the target 3D model are created. Based on the symmetry reference axis, the reference of each view is determined. Based on the geometric information, the reference of each view, the surface information, and the preset dimensioning logic, each view is dimensioned to obtain a dimensioned engineering drawing. Based on the surface information in the target 3D model, the geometric relationships of the target 3D model are calculated, and the corresponding geometric relationships are converted into a 2D engineering drawing. The reference axis of the 2D engineering drawing is determined, and each view is dimensioned based on the geometric information, the reference of each view, and the preset dimensioning logic. This achieves one-click drawing output and dimensioning, improving the efficiency of engineering drawing dimensioning. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a flowchart illustrating an embodiment of an engineering drawing automatic generation method provided in this application; Figure 2 This is a schematic diagram of a reference plane provided in an embodiment of this application; Figure 3 This is a schematic diagram of a reference axis provided in one embodiment of this application; Figure 4 This is a schematic diagram of a center line of a circle provided in one embodiment of this application; Figure 5 This is a schematic diagram of the structure of an automatic engineering drawing generation device provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0012] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0013] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0014] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0015] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0016] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0017] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0018] To illustrate the technical solution of this application, specific embodiments are described below.
[0019] See Figure 1 This is a flowchart illustrating an embodiment of an automatic engineering drawing generation method provided in this application, as shown below. Figure 1 As shown, the automatic drawing generation method may include the following steps.
[0020] S101: Obtain the target 3D model to be converted, analyze the target 3D model, and determine the geometric information, the main viewpoint, and the face information of each face of the target 3D model.
[0021] In step S101, the target 3D model is the 3D model to be converted into an engineering drawing. The target 3D model is analyzed to determine its geometric information, the main viewpoint of the target 3D model, and the face information of each face of the target 3D model. Among them, the geometric information is the coordinate information of the endpoints of the target 3D model, the main viewpoint is the frontal viewing direction of the target 3D model, and the face information is the type of each solid face in the target 3D model and the face data of the corresponding face.
[0022] In this embodiment, when acquiring the target 3D model to be converted, it can be obtained by reading the 3D model file stored in the local storage device. The target 3D model is then parsed to determine its geometric information, main viewpoint, and face information of each face. If the model type is a component, the assembly path of all parts in the component also needs to be determined. The geometric information is the coordinate information of the endpoints of the target 3D model. The main viewpoint is the frontal viewing direction of the target 3D model, such as the MGL_FRONT viewpoint. The face type is the type of each solid face in the target 3D model and the corresponding face data. Face types can include planar chamfered faces, conical chamfered faces, cylindrical fillet faces, double-ring fillet faces, etc. Face data can include the basic attributes, relationships, 3D datum associations, geometric parameters, and identification information of the corresponding face.
[0023] It should be noted that the primary viewpoint of the target 3D model is the viewpoint with the largest display area. For example, if the model type is a component, and the largest face type is cylindrical, conical, or toroidal, it is determined to be a solid of revolution. In the case of a solid of revolution, the primary viewpoint direction is adjusted to the MGL_TOP direction; otherwise, the primary viewpoint direction is adjusted to the MGL_FRONT direction, and the geometric center is centered on the screen to create the primary viewpoint MGL_FRONT with the largest display area. If the model type is a part, the largest diameter is calculated from the cylindrical and conical faces of the part. Based on the geometric information, the outline of the target 3D model is determined. If two or more values of the outline's length, width, and height are greater than the largest diameter, it is determined to be a solid of revolution. In the case of a solid of revolution, the primary viewpoint is adjusted to MGL_TOP; otherwise, the viewpoint is adjusted to the direction of the largest plane, and the geometric center is centered to create the primary viewpoint MGL_FRONT.
[0024] It should be noted that when determining the surface type of each face, it can be categorized into planar chamfered surfaces, conical chamfered surfaces, cylindrical fillet surfaces, double-ring fillet surfaces, countersunk hole surfaces, blind hole surfaces, through hole surfaces, planes, and other surfaces. Different identification information is extracted for different surface types. For example, for hole surfaces, the identification and direction of the arc edges are extracted; for chamfer surfaces, the identification and direction of the non-removed sides are extracted; for fillet surfaces, the identification and direction of the straight lines on the sides with the same normal vector as the cylinder are extracted; and for planes, the identification and method of each edge are extracted. After this information is extracted, the data is written into the external data of the target 3D model to provide a reference for subsequent engineering drawing dimension annotations.
[0025] In this embodiment, the target 3D model is analyzed to determine its geometric information, main viewpoint, and face type of each face. This allows core parameters such as the main viewpoint to be determined in advance based on the analysis results, eliminating the need for repeated manual adjustments when generating engineering drawings and improving the efficiency of engineering drawing generation.
[0026] S102: Based on geometric information, determine the surface with the largest area in the target 3D model as the target surface, and establish the target coordinate system based on the target surface.
[0027] In step S102, the target coordinate system is a coordinate system established with the target surface as the coordinate axis plane.
[0028] In this embodiment, the area of each face in the target 3D model is determined based on geometric information. For example, the area of each face in the target 3D model is calculated based on the endpoint coordinates, and the face with the largest area is determined as the target face. A target coordinate system is established based on the target face. After determining the target face, if the model type is a part, it is determined whether there is a straight edge in the target face. If there is a straight edge, the direction of the longest straight edge is obtained. If there is no straight edge or the normal vector, x-direction, and y-direction of the target face are not parallel to any axis of the default coordinate system, the maximum and minimum 3D coordinate values of the target face are obtained, i.e., the maximum and minimum x-coordinate values, and the maximum and minimum y-coordinate values. The x-difference and y-difference are calculated. If the x-difference is greater than the y-difference, the x-direction of the plane is used as the direction of the longest edge; otherwise, the y-direction of the face is used as the direction of the longest edge. The direction of the longest straight edge is taken as the x-axis direction, the direction perpendicular to the x-axis in the target face is determined as the y-axis direction, and the direction perpendicular to the target face is determined as the z-axis direction, thus obtaining the corresponding target coordinate system.
[0029] After determining the target surface, if the model type is a component, obtain the transformation matrix of the assembly path and transform the direction of the longest side to the global coordinate system using the transformation matrix. Collect all the solid edges of the target 3D model, calculate the endpoint coordinates of the edges, and then calculate the average value as the geometric center coordinates. Obtain the first coordinate system, which is the existing basic coordinate system in the model, such as the common reference coordinate system of the component. Based on the first coordinate system and the corresponding default rules (such as being completely consistent with the pose of the first coordinate system), determine the default coordinate system MGL_CSYS. Adjust the X and Y axis directions of MGL_CSYS to align the "longest side of the target surface (X-axis)" and the "target surface normal vector (Y-axis)" in the global coordinate system. Calculate the translation parameters of MGL_CSYS relative to the "first coordinate system", rotate and translate to create the coordinate system MGL_CSYS_DEF, and finally use the coordinate system direction and geometric center coordinates of MGL_CSYS_DEF as the origin to create the target coordinate system.
[0030] In this embodiment, the surface with the largest area is determined as the target surface, and a target coordinate system is established based on the target surface. This allows the reference to fit the geometric features of the part itself. Using this as the reference plane makes the coordinate reference for subsequent feature creation (holes, slots, ribs, etc.) more direct, without the need for complex reference transformation, and reduces coordinate annotation errors in engineering drawings.
[0031] Optionally, a target coordinate system is established based on the target surface, including: Collect all edges of the target surface. If there is a straight edge, take the longest straight edge as the target edge direction. If there is no straight edge, calculate the difference between the maximum and minimum coordinates of each direction based on the three-dimensional coordinates in the target three-dimensional model, and determine the direction with the largest difference as the target edge direction. Establish a target coordinate system with the target edge direction as the horizontal axis, the target surface normal vector direction as the vertical axis, and the geometric center of the target 3D model as the origin.
[0032] In this embodiment, if the model type is a part, it is determined whether there is a straight edge in the target surface. If a straight edge exists, the direction of the longest straight edge is obtained. If there is no straight edge, or the normal vector, x-direction, and y-direction of the target surface are not parallel to any axis of the default coordinate system, the maximum and minimum three-dimensional coordinate values of the target surface are obtained, i.e., the maximum and minimum x-coordinate values, and the maximum and minimum y-coordinate values. The x-difference and y-difference are calculated. If the x-difference is greater than the y-difference, the x-direction of the plane is used as the direction of the longest edge; otherwise, the y-direction of the surface is used as the direction of the longest edge. The default coordinate system is the local Cartesian coordinate system, which is the initial reference for part modeling, independent of the assembly environment, and only applies to the interior of a single part. The origin is located at the geometric center of the part, the design reference point, or the intersection of the three default reference planes (front / top / right), and is the coordinate starting point for all geometric features of the part. The x, y, and z axes are pairwise orthogonal, following the right-hand rule, consistent with the axis direction rules of the assembly coordinate system and the global coordinate system, ensuring subsequent assembly compatibility. If the target surface cannot be obtained, the process terminates. After determining the longest edge of the target surface, collect all the solid edges of the target 3D model, obtain the endpoint coordinates of each solid edge, and then calculate the average of all endpoint coordinates as the geometric center coordinates. Establish the target coordinate system with the direction of the longest edge as the x-axis, the normal vector of the target surface as the y-axis, and the geometric center coordinates as the origin.
[0033] If the model type is a component, obtain the transformation matrix of the assembly path based on the assembly path of each part. This transformation matrix includes rotation and translation. Transform the longest edge direction in the target surface to the global coordinate system using the transformation matrix. The global coordinate system is a system-preset unified reference with a fixed origin and x, y, and z axes, unaffected by part movement, rotation, or coordinate system transformation. Collect all solid edges of the target 3D model, obtain the endpoint coordinates of each solid edge, and then calculate the average value as the geometric center coordinates. Establish an initial coordinate system with the direction of the longest edge in the target surface after transformation to the global coordinate system as the x-axis, the normal vector of the target surface as the y-axis, and the geometric center coordinates as the origin. Rotate and translate the initial coordinate system according to the transformation matrix to obtain the target coordinate system.
[0034] In this embodiment, a coordinate system is established with the normal vector of the largest surface as the vertical axis. This allows the main view to be fully presented along the y-axis when projected, along with the key features perpendicular to the largest surface. This makes the view layout, dimensioning, and tolerance expression more in line with manufacturing and drawing reading needs, significantly improving the practicality of drawings and communication efficiency.
[0035] S103: Establish a reference plane based on the coordinate axes of the target coordinate system, and determine the symmetric reference axis according to the symmetric relationship between the reference plane and the target 3D model.
[0036] In step S103, the reference plane is a plane parallel to each face in the coordinate system. Based on the symmetry relationship between the reference plane and the three-dimensional model, the symmetry reference axis is determined, wherein the symmetry reference axis is the center line where the symmetry reference plane intersects with other reference planes.
[0037] In this embodiment, a reference plane is established based on the coordinate axes of the target coordinate system. The origin, x-axis, y-axis, and z-axis of the target coordinate system are determined. A first reference plane MGL_FRONT, a second reference plane MGL_TOP, and a third reference plane MGL_RIGHT are created based on the target coordinate system. For example... Figure 2 As shown, Figure 2 This is a schematic diagram of a reference plane provided in an embodiment of this application. The three highlighted red reference planes are MGL_FRONT, MGL_TOP, and MGL_RIGHT. The first reference plane, MGL_FRONT, has the x-axis and y-axis as coplanar axes and passes through the origin of the coordinate system. This first reference plane contains the complete x-axis and y-axis, and its normal vector is aligned with the positive z-axis. The second reference plane, MGL_TOP, has the x-axis and z-axis as coplanar axes and passes through the origin of the coordinate system. This reference plane contains the complete x-axis and z-axis, and its normal vector is aligned with the positive y-axis. The third reference plane, MGL_RIGHT, has the y-axis and z-axis as coplanar axes and passes through the origin of the coordinate system. This reference plane contains the complete y-axis and z-axis, and its normal vector is aligned with the positive x-axis.
[0038] In this embodiment, the reference plane is created directly based on the inherent axis of the coordinate system, eliminating external feature errors and human operation errors. The positional accuracy of the reference plane is consistent with the accuracy of the coordinate system axis. There is no need to select external reference features. Three reference planes can be automatically generated simply by calling the coordinate system axis parameters, reducing operational efficiency.
[0039] Based on the reference planes, determine whether the target 3D model is symmetrical about each reference plane. If symmetrical, the corresponding reference plane is designated as the symmetrical reference plane, and the center line where the symmetrical reference plane intersects with other reference planes is designated as the symmetrical reference axis. The maximum number of symmetrical reference axes is three. For example... Figure 3 As shown, Figure 3 This is a schematic diagram of a reference axis provided in one embodiment of this application.
[0040] In this embodiment, a symmetrical reference axis is determined based on the symmetrical relationship between the reference plane and the three-dimensional model, so that the symmetrical reference axis and the original reference plane form a "plane-axis" collaborative reference system. Both are based on the inherent parameters of the target coordinate system, without any additional external feature dependence, thus eliminating manual positioning errors.
[0041] Optionally, the symmetry reference axis is determined based on the symmetry relationship between the reference plane and the three-dimensional model, including: Obtain all endpoints of the target 3D model. If all endpoints are symmetric about the reference plane, then the reference plane is determined as the reference symmetry plane. The center line where the datum symmetry plane intersects with other datum planes is defined as the symmetry datum axis.
[0042] In this embodiment, based on each reference plane, it is determined whether the target 3D model is symmetrical about the reference plane. All endpoints of the target 3D model are obtained, and each endpoint is sequentially determined to be symmetrical about the reference plane. First, the endpoint set of all edges of the target 3D model is collected, and the origin and normal vector of the corresponding reference plane are obtained, where the origin of the reference plane is the center point of the reference plane. Then, for each endpoint, a symmetrical point on the other side of the reference plane is found. The symmetrical point is found in the endpoint set where a point in the same position is found. If a match is found, both points are removed from the endpoint set until all endpoints are matched. If any point cannot find a symmetrical point, the model is not symmetrical about that reference plane; otherwise, it is symmetrical.
[0043] Traverse each datum plane to obtain all corresponding symmetrical datum planes. Determine the center line of the intersection of the symmetrical datum plane with other datum planes as the symmetrical datum axis. The number of symmetrical datum axes can be at most three.
[0044] In this embodiment, all endpoints of the target 3D model are obtained. If all endpoints are symmetrical about the reference plane, the reference plane is determined as the reference symmetry plane. The endpoints are used to determine whether the reference plane is a symmetrical reference plane. Compared with relying on the intermediate contour or visual observation, endpoint measurement can avoid judgment errors when the shape is complex and improve the accuracy of determination.
[0045] S104: Based on the target 3D model and the main view, create multiple views of the engineering drawing corresponding to the target 3D model, and determine the datum of each view according to the surface information of each view.
[0046] In step S104, the engineering drawing is a standardized graphic document that conveys the engineering design intent and guides production, manufacturing, and construction. Multiple views include front views, side views, and sectional views. The datum for each view serves as the reference foundation for determining the view's position, dimensioning, and inspection basis, and determines the view's placement logic and interpretation standards.
[0047] In this embodiment, an engineering drawing is created in Creo by loading a file from the local machine based on a pre-selected drawing frame. The pre-selected drawing frame is determined based on information such as the size, aspect ratio, and number of faces of the target 3D model. The engineering drawing includes multiple views, which can be a front view, side view, and sectional view, etc. The front view is a view based on the main perspective.
[0048] Determine the datum for each view based on the symmetry datum axis. If the direction of the corresponding view is consistent with the direction of the datum plane associated with the symmetry datum axis, then the corresponding symmetry datum is determined as the datum of the corresponding view, and this datum is called the edge datum. A view can find two datums that meet the requirements, one in the horizontal direction and one in the vertical direction. If only one datum is obtained for the corresponding view, find the outermost straight edge of the view that is perpendicular to the datum axis as the other datum. If no datum meets the requirements, try to find the outermost edge in both the horizontal and vertical directions as the datum, and this datum is called the edge datum.
[0049] The baseline result for each view falls into three categories: present in the horizontal direction but absent in the vertical direction; present in the vertical direction but absent in the horizontal direction; and present in both the horizontal and vertical directions.
[0050] In this embodiment, a symmetrical reference axis is determined based on the symmetrical relationship between the reference plane and the target 3D model, unifying the reference standards throughout the process, avoiding contradictions in the dimensional chain, and ensuring that the design of each part conforms to the original concept.
[0051] Optionally, the criterion for determining each view also includes: For any view, if there is a through hole in the view, the through hole with the largest diameter and the same direction as the view direction is determined as the reference of the corresponding view.
[0052] In this embodiment, for any view, if a through hole exists in the view, the reference for the corresponding view is determined based on the through hole. The through hole with the largest diameter and the same direction as the view direction is determined as the reference for the corresponding view. The direction of the through hole can be determined based on the reference axis of the target 3D model. For example, the reference axis of a solid of revolution is the axis of rotation, and the reference axis of the target 3D model can be obtained in advance.
[0053] In this embodiment, the through hole is used as the reference for the corresponding view. The through hole is an inherent feature of the part, and there is no need to create additional reference axes or reference surfaces. This not only simplifies the reference establishment process and improves the positioning accuracy, but also makes the positioning reference more intuitive and accurate when used as a reference, which can reduce the cumulative error caused by reference conversion.
[0054] S105: Based on geometric information, the datum and surface information of each view, and the preset dimensioning logic, dimension each view to obtain a dimensioned engineering drawing.
[0055] In step S105, the dimensioning logic follows the dimensioning rules for engineering drawings.
[0056] In this embodiment, each view is dimensioned based on geometric information, the reference of each view, surface information, and preset dimensioning logic. Specifically, the length of the corresponding side can be calculated based on the geometric information, the reference starting point can be clearly marked based on the reference of each view, the type of each surface can be determined based on the surface information, and the position of the dimensioning can be determined based on the preset dimensioning logic.
[0057] The preset dimensioning logic includes symmetry axis dimensioning logic, hole dimensioning logic, plane dimensioning logic, cylindrical fillet surface dimensioning logic, and plane chamfer surface dimensioning logic.
[0058] If the corresponding view has an axis of symmetry, the surface data of the view is traversed, and dimensions are marked on the view according to the corresponding datum. Each surface data is marked only once. If the corresponding view has two axes of symmetry, if the type is a through hole or a waist-shaped hole, it is determined whether the direction is parallel to the view direction. For other types of data, the direction must be parallel to the view direction and the same. After obtaining the geometric data that can be marked, the number of data with the same content is counted first. When marking, the "quantity × content" method is used to reduce redundancy.
[0059] The hole dimensioning logic includes: obtaining the hole diameter value, determining whether multiplying this value by the view scale is within a reasonable range to filter out meaningless data; obtaining the hole center coordinates, and drawing the center line of the circle, such as... Figure 4 As shown, Figure 4This is a schematic diagram of a center line provided in an embodiment of this application, where the dashed line represents the center line. For identical holes, the hole with the smallest sum of distances from its center to the horizontal and vertical reference datum is selected as the position indication hole. Two dimensions are marked from the center to the horizontal reference and from the center to the vertical reference. Then, for other identical holes, starting from the selected position indication hole, a dimension is recorded between the centers of holes in the same horizontal direction. This dimension is not marked at this time but is only considered as a candidate. Similarly, a dimension candidate is added between the centers of holes in the same vertical direction. A point on the horizontal and vertical reference datum is obtained, and the candidate dimensions are then filtered and merged. If two attachment points of a horizontal dimension coincide with the x-coordinate values of other dimensions, these dimensions are counted, and the one closest to the top or bottom of the view is saved. If a vertical dimension coincides with the y-coordinate values of other dimensions, these dimensions are counted, and the one furthest from the left or right side of the view is saved. If the reference of the view has an axis of symmetry, the position dimension is checked. If the position dimension has a point symmetrical about the axis of symmetry with a dimension between adjacent holes, this position dimension can be canceled. For the remaining candidate dimensions, the dimension value should be between the two attachment points. The dimension value can be smaller than the configured value, or the dimension can be skipped. The dimension should be placed on the side closest to the edge of the view. Finally, the number of identical holes and hole content information (radius, hole depth, etc.) should be marked on the location indicator hole, and the hole dimensioning is complete.
[0060] The planar dimensioning logic includes: determining if the planar direction is the same as and parallel to the view direction, filtering if it does not meet the requirements; determining if the edges of the planar plane are currently occluded (occlusion determination is explained later), filtering if occluded; obtaining the coordinates of the two endpoints of the edge direction; if the edge is parallel to the horizontal or vertical reference, calculating the distance between the edge and the reference, determining the proportion of this distance to the view, filtering if the proportion does not meet the requirements, and adding it to the candidate dimension list if it does meet the requirements; if the edge direction is not parallel to either, determining whether to annotate the angle dimension according to the configuration, adding it to the candidate dimension list if annotation is required; if the view's reference has an axis of symmetry, determining if there is a dimension symmetrical about the axis of symmetry: calculating the distance between the edge and the corresponding parallel axis of symmetry, calculating the distance between other parallel edges and the same axis of symmetry, if the distances are the same and distributed on both sides of the axis of symmetry, merging these two candidate dimensions into one dimension; when the view has an axis of symmetry, judging each candidate dimension pairwise, if the dimension direction matches the corresponding parallel reference axis on the plane of symmetry, removing one of the dimensions from the candidate list. The dimensions in the candidate list are repositioned to avoid intersections: For horizontal dimensions, the maximum, minimum, and y coordinates of the two attached edges are recorded; for vertical dimensions, the maximum, minimum, and x coordinates of the two attached edges are recorded. Then, they are sorted by the minimum x and y values, and if values are equal, by length. Starting from the first dimension in the list, suitable placement is determined sequentially by obtaining the outermost outline edges of the view (top, bottom, left, and right). If dimension n's placement is not yet determined, the horizontal dimensions are judged by their distance from the top and bottom, and the vertical dimensions by their distance from the left and right sides, placing them on the closer side. Then, relative to the position of dimension n, subsequent dimensions n+1 are sequentially judged. If they intersect, the position of n+1 is set to the opposite direction of dimension n; for example, if dimension n is placed at the top, then dimension n+1 is placed at the bottom. After determining the placement of all candidate dimensions, dimension annotation begins.
[0061] The logic for dimensioning the fillet surface of a cylinder includes: determining whether the direction of the cylinder surface is the same as and parallel to the view direction, and filtering if it does not meet the requirements; filtering if it is obscured in the view; obtaining the radius value of the cylinder, and filtering if the radius value multiplied by the view scale is less than a certain configured value, and then dimensioning the fillet size.
[0062] The logic for dimensioning a chamfered surface includes: determining whether the chamfer direction is the same as and parallel to the view direction; filtering if it does not meet the requirements; filtering if it is obscured in the view; obtaining the chamfer value; filtering if the chamfer value multiplied by the view scale is less than a specified value; and creating a chamfer annotation.
[0063] It should be noted that when dimensioning a plane, if there is an edge that is not parallel to the datum and an angular dimension needs to be dimensioned: determine which datum the midpoint of the edge is closer to, and select the side with the acute angle to dimension the angle.
[0064] Optionally, based on geometric information, the datum and surface information of each view, and a preset dimensioning logic, dimensions are added to each view to obtain the dimensioned engineering drawing. The process further includes: Check whether there are any missing annotation edges on the completed engineering drawings. If there are missing annotation edges, determine the cause of the omission. If the reason for the missing label is not due to obstruction, then the missing label edge will be displayed.
[0065] In this embodiment, when detecting whether there are missing annotation edges in the completed engineering drawing, it is to detect whether there are unannotated dimensions in the pre-defined geometric data. If there are unannotated dimensions, it is determined that there are missing annotation edges. If there are missing annotation edges, the reason for the missing annotation is determined. If the reason for the missing annotation is not due to occlusion, the missing annotation edges are displayed, such as by highlighting them, so that designers can quickly and easily identify the unannotated objects.
[0066] It should be noted that if the cause of the missing label is determined to be non-obstruction, the causes of missing labels determined to be obstruction can be excluded. The process for determining the cause to be obstruction is as follows.
[0067] For any missing marker geometric edge in any view, transform the coordinates of the first endpoint, the second endpoint, and the center point to the local coordinate system of the view to obtain the first local endpoint coordinates, the second local endpoint coordinates, and the local center point coordinates of the geometric edge. Obtain the maximum Z-coordinate value of all faces in the view. If the maximum Z-coordinate value is less than the Z-coordinate value of the first and second local endpoint coordinates, obtain the view endpoint coordinates of all faces in the view. Determine whether there are any view endpoint coordinates that are equal to the first or second local endpoint coordinates. If so, when the Z-coordinate value of the view endpoint coordinate is greater than the Z-coordinate value of the first or second local endpoint coordinates, determine that the cause of the missing marker is occlusion.
[0068] Otherwise, continue the judgment. If the Z-coordinate values of the endpoint coordinates of the view are not all greater than the Z-coordinate values of the first local endpoint coordinates and the second local endpoint coordinates, then determine the type of the geometric edge. If the type of the geometric edge is a straight line, then project the x and y coordinate values of the first local endpoint coordinates, the second local endpoint coordinates, and the local center point coordinates onto the edge of the corresponding surface to determine the Z-coordinate values of the first local endpoint coordinates, the second local endpoint coordinates, and the local center point coordinates after projection. If each of the projected Z-coordinate values is greater than the Z-coordinate values of the first local endpoint coordinates, the second local endpoint coordinates, and the local center point coordinates, then the reason for the missing labeling of the geometric edge is occlusion.
[0069] If the geometric edge is a non-linear type, divide the geometric edge into several coordinate points on an equal basis. Then, starting from one side, simulate a straight line with each adjacent point. Take each simulated straight line as a geometric edge. If the geometric edge is a straight line, project the x and y coordinates of the first local endpoint coordinates, the second local endpoint coordinates, and the local center point coordinates onto the edge of the corresponding face. Determine the Z coordinate values of the first local endpoint coordinates, the second local endpoint coordinates, and the local center point coordinates after projection. If each of the projected Z coordinate values is greater than the Z coordinate values of the first local endpoint coordinates, the second local endpoint coordinates, and the local center point coordinates, then the reason for the missing geometric edge is occlusion.
[0070] Otherwise, continue the judgment process, obtain all endpoints of the face, calculate the average Z-coordinate value of all endpoints, and determine whether the average value is greater than the Z-coordinate values of the first local endpoint coordinates, the second local endpoint coordinates, and the local center point coordinates. If the average value is greater than the Z-coordinate values of the first local endpoint coordinates, the second local endpoint coordinates, and the local center point coordinates, then simulate all points into a polygon in sequence, and determine whether the x and y coordinate values of the first local endpoint coordinates and the second local endpoint coordinates are within the polygon area. If they are, then the reason for the missing geometric edge labeling is occlusion.
[0071] In this application, a target 3D model to be converted is obtained, analyzed, and its geometric information, main viewpoint, and surface information of each face are determined. Based on the geometric information, the face with the largest area in the target 3D model is identified as the target face. A target coordinate system is established based on the target face, and a reference plane is established based on the coordinate axes of the target coordinate system. A symmetry reference axis is determined based on the symmetry relationship between the reference plane and the target 3D model. Multiple views corresponding to the engineering drawing of the target 3D model are created based on the target 3D model and the main viewpoint. The reference for each view is determined based on the symmetry reference axis. Dimensions are applied to each view based on the geometric information, the reference for each view, the surface information, and a preset dimensioning logic, resulting in a dimensioned engineering drawing. Alternatively, the geometric relationships of the target 3D model are calculated based on the surface information, and the corresponding geometric relationships are converted to a 2D engineering drawing. The reference axis of the 2D engineering drawing is determined, and dimensions are applied to each view based on the geometric information, the reference for each view, and the preset dimensioning logic. This achieves one-click drawing output and dimensioning, improving the efficiency of engineering drawing dimensioning.
[0072] Please see Figure 5 , Figure 5 This is a schematic diagram of an automatic engineering drawing generation device according to an embodiment of this application. This automatic engineering drawing generation device corresponds one-to-one with the automatic engineering drawing generation method described in the above embodiments. Please refer to [link / reference] for details. Figure 1 as well as Figure 1 The relevant descriptions in the corresponding embodiments are shown below. For ease of explanation, only the parts relevant to this embodiment are shown. See also... Figure 5 The automatic engineering drawing generation device 50 includes: a parsing module 51, a building module 52, a determining module 53, a creation module 54, and a labeling module 55.
[0073] The parsing module 51 is used to obtain the target 3D model to be converted, parse the target 3D model, and determine the geometric information, the main viewpoint, and the face information of each face of the target 3D model.
[0074] Module 52 is established to determine the surface with the largest area in the target 3D model as the target surface based on geometric information, and to establish a target coordinate system based on the target surface.
[0075] The determination module 53 is used to establish a reference plane based on the coordinate axes of the target coordinate system, and to determine the symmetric reference axis according to the symmetric relationship between the reference plane and the target three-dimensional model.
[0076] Module 54 is used to create multiple views of the engineering drawing corresponding to the target 3D model based on the target 3D model and the main viewpoint, and to determine the datum of each view according to the symmetry datum axis.
[0077] The annotation module 55 is used to annotate each view with dimensions based on geometric information, the datum and surface information of each view, and the preset dimensioning logic, so as to obtain an annotated engineering drawing.
[0078] Optionally, the above-mentioned establishment module 52 includes: The collection unit is used to collect all edges of the target surface. If there is a straight edge, the longest straight edge is taken as the target edge direction. If there is no straight edge, the difference between the maximum and minimum coordinates of each direction is calculated based on the three-dimensional coordinates in the target three-dimensional model. The direction with the largest difference is determined as the target edge direction.
[0079] Establish a unit to create a target coordinate system with the target edge direction as the horizontal axis, the target surface normal vector direction as the vertical axis, and the geometric center of the target 3D model as the origin.
[0080] Optionally, the determining module 53 includes: The acquisition unit is used to acquire all endpoints of the target 3D model. If all endpoints are symmetric about the reference plane, the reference plane is determined as the reference symmetry plane.
[0081] The first determining unit is used to determine the center line where the reference symmetry plane intersects with other reference planes as the symmetry reference axis.
[0082] Optionally, the creation module 54 described above includes: The second determining unit is used to determine, for any view, the through hole with the largest diameter and the same direction as the view direction as the reference of the corresponding view if there is a through hole in the view.
[0083] Optionally, the above-mentioned automatic drawing generation device 50 further includes: The detection module is used to detect whether there are missing annotation edges in the completed engineering drawings. If there are missing annotation edges, the cause of the omission is determined.
[0084] The display module is used to display the missing mark edge if the reason for the missing mark is not due to occlusion.
[0085] It should be noted that the information interaction and execution process between the above-mentioned units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0086] Figure 6 This is a schematic diagram of the structure of a computer device provided in one embodiment of this application. For example... Figure 6 As shown, the computer device of this embodiment includes: at least one processor ( Figure 6Only one is shown in the diagram), a memory, and a computer program stored in the memory and executable on at least one processor, wherein the processor executes the computer program to implement the steps in any of the above embodiments of the automatic drawing generation method.
[0087] This computer device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 6 The examples of computer devices are merely examples and do not constitute a limitation on computer devices. Computer devices may include more or fewer components than shown in the illustration, or combinations of certain components, or different components, such as network interfaces, displays, and input devices.
[0088] The processor referred to can be a CPU, but it can also be 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. A general-purpose processor can be a microprocessor or any conventional processor.
[0089] Memory includes readable storage media, internal memory, etc., wherein internal memory can be the RAM of a computer device, providing an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of a computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, memory can include both internal storage units and external storage devices of the computer device. Memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. Memory can also be used to temporarily store data that has been output or will be output.
[0090] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the above method embodiments. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. A computer-readable medium can include at least: any entity or device capable of carrying computer program code, a recording medium, a computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0091] The implementation of all or part of the processes in the methods of the above embodiments can also be accomplished by a computer program product. When the computer program product is run on a computer device, it enables the computer device to execute the steps in the above method embodiments.
[0092] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0093] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0094] In the embodiments provided in this application, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0095] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0096] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application 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. Such 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 this application, and should all be included within the protection scope of this application.
Claims
1. A method for automatically generating engineering drawings, characterized in that, The automatic engineering drawing generation method includes: Obtain the target 3D model to be converted, parse the target 3D model, and determine the geometric information of the target 3D model, the main view of the target 3D model, and the face information of each face of the target 3D model; Based on the geometric information, the surface with the largest area in the target 3D model is determined as the target surface, and a target coordinate system is established based on the target surface; A reference plane is established based on the coordinate axes of the target coordinate system, and a symmetry reference axis is determined according to the symmetry relationship between the reference plane and the target three-dimensional model. Based on the target 3D model and the main viewpoint, multiple views of the engineering drawing corresponding to the target 3D model are created, and the reference of each view is determined according to the symmetry reference axis. Based on the geometric information, the reference of each view, the surface information, and the preset dimensioning logic, dimensions are added to each view to obtain an annotated engineering drawing.
2. The method for automatically generating engineering drawings as described in claim 1, characterized in that, The establishment of a target coordinate system based on the target surface includes: Collect all edges of the target surface. If there is a straight edge, the longest straight edge is taken as the target edge direction. If there is no straight edge, the difference between the maximum and minimum coordinates of each direction is calculated based on the three-dimensional coordinates in the target three-dimensional model. The direction with the largest difference is determined as the target edge direction. A target coordinate system is established with the direction of the target edge as the horizontal axis, the direction of the normal vector of the target surface as the vertical axis, and the geometric center of the target 3D model as the origin.
3. The automatic engineering drawing generation method as described in claim 1, characterized in that, The step of determining the symmetry reference axis based on the symmetry relationship between the reference plane and the three-dimensional model includes: Obtain all endpoints of the target 3D model; if all endpoints are symmetric about the reference plane, then the reference plane is determined as the reference symmetry plane. The center line where the reference symmetry plane intersects with other reference planes is determined as the symmetry reference axis.
4. The method for automatically generating engineering drawings as described in claim 1, characterized in that, The criterion for determining each view also includes: For any view, if there is a through hole in the view, the through hole with the largest diameter and the same direction as the view direction is determined as the reference of the corresponding view.
5. The method for automatically generating engineering drawings as described in claim 1, characterized in that, The preset dimensioning logic includes symmetry axis dimensioning logic, hole dimensioning logic, plane dimensioning logic, cylindrical fillet surface dimensioning logic, and plane chamfer surface dimensioning logic.
6. The method for automatically generating engineering drawings as described in claim 1, characterized in that, After dimensioning each view according to the geometric information, the datum of each view, the surface information, and the preset dimensioning logic to obtain the dimensioned engineering drawing, the process further includes: Check if there are any missing annotation edges in the completed engineering drawing. If there are missing annotation edges, determine the reason for the omission. If the reason for the missing label is not due to obstruction, then the missing label edge will be displayed.
7. An automatic engineering drawing generation device, characterized in that, The automatic engineering drawing generation device includes: The parsing module is used to acquire the target 3D model to be converted, parse the target 3D model, and determine the geometric information, the main viewpoint, and the face information of each face of the target 3D model. A module is established to determine the surface with the largest area in the target 3D model as the target surface based on the geometric information, and to establish a target coordinate system based on the target surface; The determination module is used to establish a reference plane based on the coordinate axes of the target coordinate system, and to determine the symmetry reference axis according to the symmetry relationship between the reference plane and the target three-dimensional model; A creation module is used to create multiple views of the engineering drawing corresponding to the target 3D model based on the target 3D model and the main viewpoint, and to determine the reference of each view according to the symmetry reference axis; The annotation module is used to annotate each view with dimensions based on the geometric information, the reference of each view, the surface information, and the preset dimensioning logic, so as to obtain an annotated engineering drawing.
8. The automatic engineering drawing generation device as described in claim 7, characterized in that, The establishment module includes: The collection unit is used to collect all the edges of the target surface. If there is a straight edge, the longest straight edge is taken as the target edge direction. If there is no straight edge, the difference between the maximum and minimum coordinates of each direction is calculated according to the three-dimensional coordinates in the target three-dimensional model. The direction with the largest difference is determined as the target edge direction. A unit is established to create a target coordinate system with the target edge direction as the horizontal axis, the target surface normal vector direction as the vertical axis, and the geometric center of the target 3D model as the origin.
9. A computer device, characterized in that, The computer device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the automatic drawing generation method as described in any one of claims 1 to 6.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the automatic drawing generation method as described in any one of claims 1 to 6.