A method, device, and medium for generating engineering drawings based on a discrete mesh model.
By processing the discrete grid model, engineering views are generated, which solves the problem that the discrete grid model cannot directly generate engineering drawings, simplifies the drawing process, and improves the user experience.
Patent Information
- Application Number
- CN202410931178.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2044-07-12
AI Technical Summary
In the existing technology, discrete grid models cannot directly generate engineering drawings, resulting in cumbersome drawing operations for engineers and poor user experience.
By determining the discrete mesh model to be drawn obtained by user operation, based on the preset projection direction and the normal vector of the mesh, determine the set of unoccluded meshes, perform area filling and boundary fitting curve processing, and generate engineering views.
It achieves simplified processing of discrete grid models and directly generates engineering drawings, reducing tedious drawing operations and improving user experience.
Smart Images

Figure CN118468373B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electrical digital data processing, and in particular to a method, device and medium for generating engineering drawings based on a discrete grid model. Background Art
[0002] Discrete grid model is an important form of model representation. Engineers usually make discrete grid models for data processing and application. Engineering drawings are referred to as drawings. They express the projection surface of an object based on the projection method. According to the different projection methods, they can be divided into orthographic projection and oblique projection. Drawings are indispensable in mechanical design, manufacturing and construction. Designers express design ideas through drawings, manufacturers process, manufacture, inspect and debug according to drawings, and users use drawings to understand structural performance.
[0003] At present, when engineering drawings are generated using software, they are usually produced through precise geometric models. It is difficult to directly produce engineering drawings using discrete mesh models. Once engineers have produced discrete mesh models, they cannot simply reverse the operation to obtain precise geometric models and then produce engineering drawings. This brings great inconvenience to engineers, and the drawing operation is cumbersome and the experience is not good. Summary of the invention
[0004] The embodiments of the present application provide a method, device and medium for generating engineering drawings based on a discrete grid model, which are used to solve the technical problems that the current discrete grid model cannot directly produce engineering drawings, causing inconvenience to engineers, cumbersome drawing operations, and affecting user experience.
[0005] On the one hand, an embodiment of the present application provides a method for generating an engineering drawing based on a discrete grid model, the method comprising:
[0006] Determine the discrete grid model to be mapped obtained by user operation;
[0007] Based on the preset projection direction to be mapped and the normal vectors of each subdivided grid, a corresponding unobstructed subdivided grid set is determined;
[0008] Based on a preset seed filling algorithm, each of the subdivided grids in the unobstructed subdivided grid set is region-filled to obtain corresponding simply connected regions; wherein the subdivided grids between the simply connected regions are in a separated relationship; and the simply connected region includes one or more of the subdivided grids;
[0009] Based on a preset boundary processing rule, determining the region boundary corresponding to each of the simply connected regions and performing boundary fitting curve processing on the region boundary to obtain a corresponding connected region boundary line;
[0010] According to the connected area boundary line, the discrete grid model is projected in the preset projection direction to be mapped to obtain a corresponding engineering view, and the engineering view is sent to a corresponding user terminal.
[0011] In one implementation of the present application, after determining the discrete grid model to be mapped obtained by the user operation, the method further includes:
[0012] Determine the edge vectors corresponding to each of the subdivided grids according to the vertex coordinates corresponding to each of the subdivided grids;
[0013] Determining a surface normal vector of the mesh according to each of the edge vectors;
[0014] According to each of the surface normal vectors and a preset vector correction rule, normal vector correction is performed on each of the subdivided grids to unify the surface normal vectors corresponding to the discrete grid model.
[0015] In one implementation of the present application, based on a preset projection direction to be mapped and normal vectors of each subdivided grid, a corresponding unobstructed subdivided grid set is determined, specifically including:
[0016] Performing point multiplication calculations on the projection vector corresponding to the preset projection direction to be mapped and the normal vectors of each subdivided grid, respectively, to obtain corresponding point products;
[0017] Determine a corresponding projection angle according to each of the dot products, so as to determine each corresponding first occlusion subdivision grid according to the projection angle;
[0018] Based on each of the first occluded subdivided grids and each of the subdivided grids, a corresponding set of unoccluded subdivided grids is determined.
[0019] In an implementation of the present application, based on each of the first occluded subdivided grids and each of the subdivided grids, determining the corresponding unoccluded subdivided grid set specifically includes:
[0020] Draw a ray from the centroid of each of the subdivided grids in the opposite direction of the preset projection direction to be mapped, and generate corresponding occlusion determination rays;
[0021] Determining whether each of the occlusion determination rays intersects with other subdivided grids according to the position coordinates corresponding to each of the subdivided grids and each of the occlusion determination rays;
[0022] If so, determining the subdivision grid corresponding to the starting point of the occlusion determination ray as a second occlusion subdivision grid;
[0023] Each of the first occluded subdivision grids and each of the second occluded subdivision grids are eliminated from each of the subdivision grids to obtain each unoccluded subdivision grid, and the unoccluded subdivision grid set is generated.
[0024] In one implementation of the present application, based on a preset seed filling algorithm, each of the subdivided grids in the unobstructed subdivided grid set is region filled to obtain corresponding single-connected regions, specifically including:
[0025] Using the preset seed filling algorithm, any of the subdivided grids in the unobstructed subdivided grid set is used as a starting grid, and each of the subdivided grids connected to each grid edge of the starting grid is determined as a connected region seed;
[0026] The connected region seeds are diffused to determine the subdivided grids connected to the subdivided grids of the connected region seeds, and the corresponding simply connected regions are determined, and any subdivided grid that is not in the simply connected region is used as the starting grid until the divided simply connected regions are obtained.
[0027] In one implementation of the present application, based on a preset boundary processing rule, determining the region boundary corresponding to each of the simply connected regions specifically includes:
[0028] Determine the number of used meshes for each mesh edge of the mesh in the simply connected region;
[0029] When the number of subdivided grids is a predetermined value, the corresponding grid edge is determined to be an edge of the region boundary, and the region boundary is generated.
[0030] In one implementation of the present application, performing boundary fitting curve processing on the region boundary to obtain the corresponding connected region boundary line specifically includes:
[0031] Determine three continuous mesh vertices according to each boundary subdivision mesh corresponding to the region boundary, and determine an adjacent boundary vector group according to the three continuous mesh vertices; the adjacent boundary vector group includes two adjacent boundary vectors;
[0032] Determining the vector tangent relationship corresponding to each of the adjacent boundary vector groups;
[0033] According to the vector tangential relationship and the corresponding preset fitting rule table, the boundary type corresponding to the adjacent boundary vector group is determined, so as to perform boundary fitting curve processing on the region boundary according to the boundary type to generate the connected region boundary line.
[0034] In one implementation of the present application, the vector tangential relationship includes: the same tangent, opposite tangent, and different tangent.
[0035] On the other hand, the embodiment of the present application also provides an engineering drawing generation device based on a discrete grid model, the device comprising
[0036] at least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to:
[0037] Determine the discrete grid model to be mapped obtained by user operation;
[0038] Based on the preset projection direction to be mapped and the normal vectors of each subdivided grid, a corresponding unobstructed subdivided grid set is determined;
[0039] Based on a preset seed filling algorithm, each of the subdivided grids in the unobstructed subdivided grid set is region-filled to obtain corresponding simply connected regions; wherein the subdivided grids between the simply connected regions are in a separated relationship; and the simply connected region includes one or more of the subdivided grids;
[0040] Based on a preset boundary processing rule, determining the region boundary corresponding to each of the simply connected regions and performing boundary fitting curve processing on the region boundary to obtain a corresponding connected region boundary line;
[0041] According to the connected area boundary line, the discrete grid model is projected in the preset projection direction to be mapped to obtain a corresponding engineering view, and the engineering view is sent to a corresponding user terminal.
[0042] On the other hand, the embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0043] Determine the discrete grid model to be mapped obtained by user operation;
[0044] Based on the preset projection direction to be mapped and the normal vectors of each subdivided grid, a corresponding unobstructed subdivided grid set is determined;
[0045] Based on a preset seed filling algorithm, each of the subdivided grids in the unobstructed subdivided grid set is region-filled to obtain corresponding simply connected regions; wherein the subdivided grids between the simply connected regions are in a separated relationship; and the simply connected region includes one or more of the subdivided grids;
[0046] Based on a preset boundary processing rule, determining the region boundary corresponding to each of the simply connected regions and performing boundary fitting curve processing on the region boundary to obtain a corresponding connected region boundary line;
[0047] According to the connected area boundary line, the discrete grid model is projected in the preset projection direction to be mapped to obtain a corresponding engineering view, and the engineering view is sent to a corresponding user terminal.
[0048] Compared with the prior art, the present invention has the following significant effects:
[0049] Through the above solution, the present application can directly process the discrete grid model, accurately extract the subdivided grid in the projection direction from the discrete grid model, and accurately curve fit its boundary for engineering drawing projection, thereby simplifying the discrete grid model and using the discrete grid model to generate engineering drawings. Engineers can use the technical solution of the present application to directly produce engineering drawings when making discrete grid models, which provides convenience for engineers, reduces the cumbersome operations caused by irreversible operations during drawing, and improves user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0051] Figure 1 A schematic diagram of a process of a method for generating an engineering drawing based on a discrete grid model in an embodiment of the present application;
[0052] Figure 2 A schematic diagram of a discrete grid model in a method for generating an engineering drawing based on a discrete grid model in an embodiment of the present application;
[0053] Figure 3 A schematic diagram of a discrete grid model for dividing a simply connected region in a method for generating an engineering drawing based on a discrete grid model in an embodiment of the present application;
[0054] Figure 4 A schematic diagram of a region boundary of a discrete grid model in a method for generating an engineering drawing based on a discrete grid model in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of a boundary fitting curve of a discrete grid model in a method for generating an engineering drawing based on a discrete grid model in an embodiment of the present application;
[0056] Figure 6 A schematic diagram of a connected region boundary line of a discrete grid model in a method for generating an engineering drawing based on a discrete grid model in an embodiment of the present application;
[0057] Figure 7A schematic diagram of an engineering view of a discrete grid model in an engineering drawing generation method based on a discrete grid model in an embodiment of the present application;
[0058] Figure 8 It is a structural schematic diagram of an engineering drawing generation device based on a discrete grid model in an embodiment of the present application. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0060] The embodiments of the present application provide a method, device and medium for generating engineering drawings based on a discrete grid model, which are used to solve the technical problems that the discrete grid model cannot directly produce engineering drawings, causing inconvenience to engineers, making drawing operations cumbersome, and affecting user experience.
[0061] The following describes in detail various embodiments of the present application in conjunction with the accompanying drawings.
[0062] The present application embodiment provides a method for generating an engineering drawing based on a discrete grid model, such as Figure 1 As shown, the method may include steps S101-S105:
[0063] S101, the server determines a discrete grid model to be mapped obtained by a user operation.
[0064] It should be noted that the server, as the executor of the engineering drawing generation method based on the discrete grid model, exists only for exemplary purposes. The executor is not limited to the server, and this application does not make any specific limitations on this.
[0065] In the embodiment of the present application, the discrete grid model is usually made by an engineer (ie, a user) for an object to be mapped. The discrete grid model can be composed of subdivided grids, such as triangular grids. Figure 2 As shown, Figure 2 It is a discrete grid model.
[0066] The user can generate a discrete grid model through his user terminal. The user terminal can be a desktop computer, laptop computer or other device of the user, and this application does not make any specific limitation on this.
[0067] In one embodiment of the present application, after determining the discrete grid model to be mapped obtained by the user operation, the method further includes:
[0068] The server determines the edge vectors corresponding to each mesh according to the vertex coordinates corresponding to each mesh. The surface normal vectors of the mesh are determined according to each edge vector. The normal vectors of each mesh are corrected according to each surface normal vector and the preset vector correction rule so that the surface normal vectors corresponding to the discrete mesh model are unified.
[0069] In other words, the server can correct the normal vector of the subdivided mesh to make the normal consistent, so as to facilitate the calculation of whether it is blocked. Specifically, this application takes the shape of the subdivided mesh as a triangle as an example, and obtains three edge vectors from the vertices of the triangle. The edge vector can be calculated by the difference between adjacent vertices. For each triangle, calculate the cross product of two edge vectors to obtain the normal vector. Use the right-hand rule of the cross product to determine the direction of the normal vector. For each triangle, calculate the normal vectors of adjacent triangles. The normal vectors of two triangles on a shared edge should be opposite. If a triangle with inconsistent normal vectors is found, it can be made consistent by taking the average normal vector. For triangles that share a vertex, add their normal vectors and normalize them. For the entire triangular mesh, ensure that the normal vectors of all triangles are in the same direction. The average normal vector can be calculated separately in each area of the entire mesh as needed.
[0070] S102: The server determines a corresponding set of unobstructed subdivided grids based on a preset projection direction to be mapped and normal vectors of each subdivided grid.
[0071] In the embodiment of the present application, based on the preset projection direction to be mapped and the normal vectors of each subdivided grid, the corresponding unobstructed subdivided grid set is determined, specifically including:
[0072] The server performs dot multiplication calculations on the projection vector corresponding to the preset projection direction to be mapped and the normal vector of each mesh to obtain the corresponding dot products. According to the dot products, the corresponding projection angle is determined, and the corresponding first occluded meshes are determined according to the projection angle. Based on each first occluded mesh and each mesh, the corresponding unoccluded mesh set is determined.
[0073] In other words, the server can calculate the angle between the normal of the mesh and the projection direction through the above embodiment. For example, if the above dot product is greater than zero and the angle is less than 90 degrees, it is considered that the triangular mesh is on the back of the preset projection direction to be mapped, and the triangular mesh is blocked. The server will remove the blocked mesh and finally display only the unblocked mesh in the projection direction to be mapped.
[0074] In one embodiment of the present application, based on each first occluded subdivision grid and each subdivision grid, determining a corresponding unoccluded subdivision grid set specifically includes:
[0075] The server draws rays from the centroid of each subdivided grid to the opposite direction of the preset projection direction to be mapped, and generates corresponding occlusion determination rays. According to the position coordinates corresponding to each subdivided grid and each occlusion determination ray, it is determined whether each occlusion determination ray intersects with other subdivided grids. In the case where it is determined that each occlusion determination ray intersects with other subdivided grids, the subdivided grid corresponding to the starting point of the occlusion determination ray is determined to be the second occluded subdivided grid. In the case where it is determined that the occlusion determination ray does not intersect with other subdivided grids, the corresponding subdivided grid is determined to be an unoccluded subdivided grid. The first occluded subdivided grids and the second occluded subdivided grids are removed from each subdivided grid to obtain each unoccluded subdivided grid, and a set of unoccluded subdivided grids is generated.
[0076] In other words, the server makes a ray from the centroid of the triangular mesh to the direction opposite to the preset projection direction to be mapped. According to the ray intersection method, if the ray intersects with any other triangular mesh, the triangular mesh corresponding to the ray is considered to be blocked. The server can remove the first blocked mesh and the second blocked mesh from all meshes, and then retain the unblocked meshes, and add all the unblocked meshes to the unblocked mesh set.
[0077] S103: The server performs region filling on each subdivided grid in the unobstructed subdivided grid set based on a preset seed filling algorithm to obtain corresponding simply connected regions.
[0078] The meshes between the simply connected regions are separated. A simply connected region includes one or more meshes.
[0079] In the embodiment of the present application, based on a preset seed filling algorithm, each subdivided grid in the unobstructed subdivided grid set is region filled to obtain corresponding single-connected regions, specifically including:
[0080] Through the preset seed filling algorithm, any subdivided grid in the unobstructed subdivided grid set is used as the starting grid, and each subdivided grid connected to each grid edge of the starting grid is determined as the connected region seed. The connected region seeds are diffused to determine the subdivided grids connected to each subdivided grid of the connected region seeds, determine the corresponding simply connected region, and use any subdivided grid that is not in the simply connected region as the starting grid until each simply connected region is divided.
[0081] That is to say, the server can use the preset seed filling algorithm to divide all the subdivided grids into corresponding simply connected regions. The subdivided grids with common edges are interconnected, and the connected region seeds are diffused according to the connection relationship to obtain each subdivided grid in the same simply connected region as the connected region seed. At the same time, if there is a subdivided grid that is not in the obtained simply connected region, then the connected region seed will be generated with the subdivided grid to generate another simply connected region. Until all the subdivided grids are divided into corresponding simply connected regions. The discrete grid model after dividing the simply connected region is as follows: Figure 3 As shown, it includes simply connected regions 301, 302, and 303.
[0082] S104: The server determines the region boundaries corresponding to each simply connected region based on a preset boundary processing rule and performs boundary fitting curve processing on the region boundaries to obtain corresponding connected region boundary lines.
[0083] In the embodiment of the present application, based on the preset boundary processing rules, the region boundaries corresponding to each simply connected region are determined, specifically including:
[0084] The server determines the number of used meshes for each mesh edge of the mesh in the simply connected region, and when the number of used meshes is a predetermined value, determines the corresponding mesh edge as an edge of the region boundary, and generates the region boundary.
[0085] That is to say, the server can determine the mesh edges at the region boundary in the simply connected region according to the preset boundary processing rules. For example, if the mesh is a triangular mesh, a mesh edge is shared by two triangular meshes, that is, the number of meshes used is 2, and this mesh edge is an internal edge; if a mesh edge is only used by one triangular mesh, that is, the number of meshes used is 1, this mesh edge is the region boundary edge. According to the above scheme, the server finds all the region boundary edges and then forms the region boundary. Figure 4 shown.
[0086] In one embodiment of the present application, performing boundary fitting curve processing on the region boundary to obtain the corresponding connected region boundary line specifically includes:
[0087] The server divides the grid according to each boundary corresponding to the region boundary, determines three continuous grid vertices, and determines an adjacent boundary vector group according to the three continuous grid vertices. The adjacent boundary vector group includes two adjacent boundary vectors. The vector tangent relationship corresponding to each adjacent boundary vector group is determined. According to the vector tangent relationship and the corresponding preset fitting rule table, the boundary type corresponding to the adjacent boundary vector group is determined, so as to perform boundary fitting curve processing on the region boundary according to the boundary type and generate a connected region boundary line.
[0088] That is to say, the server can take the difference of three continuous mesh vertices in the region boundary, and take the difference with the spatial position coordinates (a, b, c) of the mesh vertices to obtain the vector between adjacent mesh vertices, thereby generating an adjacent boundary vector group. The server matches the corresponding fitting rule from the preset fitting rule table through the vector tangent relationship satisfied by two adjacent boundary vectors in the adjacent boundary vector group, thereby obtaining the corresponding boundary type, so as to perform boundary fitting curve on the region boundary and generate the connected region boundary line.
[0089] The vector tangent relationship includes: same tangent, opposite tangent, different tangent. The boundary type includes straight line and curve.
[0090] Specifically, Figure 5 As shown, in the embodiment of the present application, when the tangent relationship of the vectors is the same tangent or opposite tangent, the fitting rule is the first fitting rule, and the boundary type is judged as a straight line; when the tangent relationship of the vectors is different tangent (the tangent vector is a space vector, and the different tangent is a tangent vector relationship other than opposite tangent and the same tangent), the fitting rule is the second fitting rule, and arc fitting is performed for three consecutive mesh vertices, and the perimeter difference of the fitted arc is calculated at the same time. The formula is as follows:
[0091]
[0092] in, Based on three consecutive mesh vertices , , The circumference difference obtained by fitting the arc; To fit the arc length, express , The distance between express , The distance between.
[0093] The server compares the circumference difference with the preset comparison threshold according to the second fitting rule, and uses the circumference difference to express the closeness or approximation degree of the two polyline segments formed by the three points to the arc. If the circumference difference is greater than the comparison threshold, it is considered to be dissimilar to the arc, and if the circumference difference is less than the comparison threshold, it is considered to be similar. The comparison threshold is actually an error, which is related to the radius and curvature of the arc. For example, the larger the radius or the smaller the arc angle, the larger the error can be, so as to fit the arc as much as possible. The comparison threshold formula can be as follows:
[0094]
[0095] in, To compare the threshold, is the arc of the above fitting arc, The arc radius of the fitted arc.
[0096] In one embodiment of the present application, the comparison threshold may also be set by the user based on experience, and the present application does not make any specific limitation on this.
[0097] In the embodiment of the present application, the arc fitting can specifically adopt the following technical solutions: three points , , Determine the plane (the direction of the cross product of the three points into two vectors is used as the plane normal, so as to ensure that it is viewed from the opposite direction of the plane normal , , is counterclockwise, and the created arc is also counterclockwise). , The perpendicular bisector on the plane (calculate the midpoint, using the normal and The intersection of the two perpendicular lines is the center of the circle ArcCenter. The length of the vector from the center of the circle to P0 is the radius of the arc. The arc is counterclockwise. The rotation angle of the vector formed by ArcCenter and P0 and the vector formed by ArcCenter and P1 can be used to get the arc's radian. According to the above scheme, three points are selected to fit the boundary curve until all mesh vertices on the boundary are traversed.
[0098] In addition, the present application may also perform curve fitting for the vector tangential relationship through other methods such as curvature analysis, fitting error analysis, feature detection, etc., so as to fit the boundary into a straight line, arc, etc., and the present application does not make specific limitations on this.
[0099] S105, the server projects the discrete grid model according to the connected area boundary line in a preset projection direction to be mapped to obtain a corresponding engineering view, and sends the engineering view to the corresponding user terminal.
[0100] Based on the above steps S101-S104, the connected region boundary lines that can be accurately mapped can be obtained conveniently, such as Figure 6 The server can project it to get Figure 7 The server displays the engineering view shown on the user terminal.
[0101] Through the above solution, the present application can directly process the discrete grid model, accurately extract the subdivided grid in the projection direction from the discrete grid model, and accurately curve fit its boundary for engineering drawing projection, thereby simplifying the discrete grid model and using the discrete grid model to generate engineering drawings. Engineers can use the technical solution of the present application to directly produce engineering drawings when making discrete grid models, which provides convenience for engineers, reduces the cumbersome operations caused by irreversible operations during drawing, and improves user experience.
[0102] Figure 8 An engineering drawing generation device based on a discrete grid model is provided in an embodiment of the present application, such as Figure 7 As shown, the equipment includes
[0103] At least one processor; and a memory in communication with the at least one processor. The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to:
[0104] Determine the discrete grid model to be mapped obtained by user operation. Based on the preset projection direction to be mapped and the normal vectors of each subdivided grid, determine the corresponding unobstructed subdivided grid set. Based on the preset seed filling algorithm, fill the region of each subdivided grid in the unobstructed subdivided grid set to obtain the corresponding simply connected regions. Among them, the subdivided grids between each simply connected region are in a separated relationship. A simply connected region includes one or more subdivided grids. Based on the preset boundary processing rules, determine the region boundaries corresponding to each simply connected region and perform boundary fitting curve processing on the region boundaries to obtain the corresponding connected region boundary lines. According to the connected region boundary lines, the discrete grid model is projected in the preset projection direction to be mapped to obtain the corresponding engineering view, and the engineering view is sent to the corresponding user terminal.
[0105] The embodiment of the present application further provides a non-volatile computer storage medium storing computer executable instructions, wherein the computer executable instructions are configured as follows:
[0106] Determine the discrete grid model to be mapped obtained by user operation. Based on the preset projection direction to be mapped and the normal vectors of each subdivided grid, determine the corresponding unobstructed subdivided grid set. Based on the preset seed filling algorithm, fill the region of each subdivided grid in the unobstructed subdivided grid set to obtain the corresponding simply connected regions. Among them, the subdivided grids between each simply connected region are in a separated relationship. A simply connected region includes one or more subdivided grids. Based on the preset boundary processing rules, determine the region boundaries corresponding to each simply connected region and perform boundary fitting curve processing on the region boundaries to obtain the corresponding connected region boundary lines. According to the connected region boundary lines, the discrete grid model is projected in the preset projection direction to be mapped to obtain the corresponding engineering view, and the engineering view is sent to the corresponding user terminal.
[0107] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0108] This specification is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0109] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0110] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0111] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0112] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0113] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0114] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0115] This specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0116] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, equipment, and non-volatile computer storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0117] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0118] The above description is only one or more embodiments of this specification and is not intended to limit this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of one or more embodiments of this specification shall be included in the scope of the claims of this specification.
Claims
1. A method for generating engineering drawings based on a discrete grid model, characterized in that: The method comprises: Determine the discrete grid model to be mapped obtained by user operation; Based on the preset projection direction to be mapped and the normal vectors of each subdivided grid, a corresponding unobstructed subdivided grid set is determined; Based on a preset seed filling algorithm, each of the subdivided grids in the unobstructed subdivided grid set is region-filled to obtain corresponding simply connected regions; wherein the subdivided grids between the simply connected regions are in a separated relationship; and the simply connected region includes one or more of the subdivided grids; Based on a preset boundary processing rule, determining the region boundary corresponding to each of the simply connected regions and performing boundary fitting curve processing on the region boundary to obtain a corresponding connected region boundary line; According to the connected area boundary line, the discrete grid model is projected in the preset projection direction to be mapped to obtain a corresponding engineering view, and the engineering view is sent to a corresponding user terminal; Wherein, based on the preset projection direction to be mapped and the normal vectors of each mesh, the corresponding unobstructed mesh set is determined, specifically including: Performing point multiplication calculations on the projection vector corresponding to the preset projection direction to be mapped and the normal vectors of each subdivided grid, respectively, to obtain corresponding point products; Determine a corresponding projection angle according to each of the dot products, so as to determine each corresponding first occlusion subdivision grid according to the projection angle; Determine the corresponding unobstructed subdivided grid set based on each of the first obstructed subdivided grids and each of the subdivided grids; Wherein, based on each of the first blocked subdivided grids and each of the subdivided grids, determining the corresponding unblocked subdivided grid set specifically includes: Draw a ray from the centroid of each of the subdivided grids in the opposite direction of the preset projection direction to be mapped, and generate corresponding occlusion determination rays; Determining whether each of the occlusion determination rays intersects with other subdivided grids according to the position coordinates corresponding to each of the subdivided grids and each of the occlusion determination rays; If so, determining the subdivision grid corresponding to the starting point of the occlusion determination ray as a second occlusion subdivision grid; Each of the first occluded subdivision grids and each of the second occluded subdivision grids are eliminated from each of the subdivision grids to obtain each unoccluded subdivision grid, and the unoccluded subdivision grid set is generated.
2. The method for generating an engineering drawing based on a discrete grid model according to claim 1, characterized in that: After determining the discrete grid model to be mapped obtained by the user operation, the method further includes: Determine the edge vectors corresponding to each of the subdivided grids according to the vertex coordinates corresponding to each of the subdivided grids; Determining a surface normal vector of the mesh according to each of the edge vectors; According to each of the surface normal vectors and a preset vector correction rule, normal vector correction is performed on each of the subdivided grids to unify the surface normal vectors corresponding to the discrete grid model.
3. The method for generating an engineering drawing based on a discrete grid model according to claim 1, characterized in that: Based on a preset seed filling algorithm, each of the subdivided grids in the unobstructed subdivided grid set is region filled to obtain corresponding simply connected regions, specifically including: Using the preset seed filling algorithm, any of the subdivided grids in the unobstructed subdivided grid set is used as a starting grid, and each of the subdivided grids connected to each grid edge of the starting grid is determined as a connected region seed; The connected region seeds are diffused to determine the subdivided grids connected to the subdivided grids of the connected region seeds, and the corresponding simply connected regions are determined, and any subdivided grid that is not in the simply connected region is used as the starting grid until the divided simply connected regions are obtained.
4. The method for generating an engineering drawing based on a discrete grid model according to claim 1, characterized in that: Determining the region boundaries corresponding to each of the simply connected regions based on a preset boundary processing rule specifically includes: Determine the number of used meshes for each mesh edge of the mesh in the simply connected region; When the number of subdivided grids is a predetermined value, the corresponding grid edge is determined to be an edge of the region boundary, and the region boundary is generated.
5. The method for generating an engineering drawing based on a discrete grid model according to claim 4, characterized in that: Performing boundary fitting curve processing on the region boundary to obtain the corresponding connected region boundary line specifically includes: Determine three continuous mesh vertices according to each boundary subdivision mesh corresponding to the region boundary, and determine an adjacent boundary vector group according to the three continuous mesh vertices; the adjacent boundary vector group includes two adjacent boundary vectors; Determining the vector tangent relationship corresponding to each of the adjacent boundary vector groups; According to the vector tangential relationship and the corresponding preset fitting rule table, the boundary type corresponding to the adjacent boundary vector group is determined, so as to perform boundary fitting curve processing on the region boundary according to the boundary type to generate the connected region boundary line.
6. The method for generating an engineering drawing based on a discrete grid model according to claim 5, characterized in that: The vector tangential relationship includes: same tangent, opposite tangent, and different tangent.
7. An engineering drawing generation device based on a discrete grid model, characterized in that: The device comprises at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute an engineering drawing generation method based on a discrete grid model as described in any one of claims 1 to 6.
8. A non-volatile computer storage medium storing computer executable instructions, characterized in that: The computer executable instructions can execute an engineering drawing generation method based on a discrete grid model as described in any one of claims 1 to 6 above.
