Method, device and equipment for converting three-dimensional model of water valve into two-dimensional plane graph and medium
Through the decision tree algorithm and pre-trained two-dimensional graphics processing type model, the accuracy problem of water valve three-dimensional model is solved when converting two-dimensional graphics, and the automatic generation of two-dimensional planar graphics that meets professional design requirements is realized, reducing development costs and Complexity.
Patent Information
- Application Number
- CN202411118931.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2024-11-22
AI Technical Summary
When the existing BIM software converts the three-dimensional water valve model into a two-dimensional planar figure, it cannot accurately express the water valve body, resulting in manual processing in the future, which increases development costs and complexity, and cannot meet the requirements of professional design drawings for water supply and drainage.
By extracting the characteristic parameter values of the water valve, calling the pre-trained two-dimensional graphics processing type decision tree model, generating two-dimensional graphics processing types that meet the requirements, and performing two-dimensional planar graphics conversion according to the corresponding conversion processing rules .
It realizes automatic generation of two-dimensional planar graphics that meet the professional design requirements of water supply and drainage, reducing manual processing costs and improving conversion efficiency and accuracy.
Smart Images

Figure CN119006271A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer-aided design, and in particular to a method, device, equipment and medium for converting a three-dimensional model of a water valve into a two-dimensional plane graphic. Background Art
[0002] With the rapid development of Building Information Modeling (BIM) technology and the requirements of informatization, the introduction of BIM technology in the architectural design industry can provide more accurate and abundant information for designers, reviewers and construction personnel. Two-dimensional plane drawings, as the main form of display of architectural design results, are also one of the important delivery results of building information modeling forward design.
[0003] At present, BIM software design focuses on improving the portability and accuracy of three-dimensional models. For two-dimensional plane graphics, it is generally expected that BIM software can automatically generate them using three-dimensional models. However, in actual projects, such as the water supply and drainage field, due to the limitations of water valve types, the generated two-dimensional plane graphics often cannot accurately express the water valve body, and subsequent complex manual processing is still required, resulting in high development costs. Summary of the invention
[0004] Based on this, the present invention provides a method, device, equipment and medium for converting a three-dimensional model of a water valve into a two-dimensional plane graphic, so as to solve the problem that the three-dimensional model of the water valve does not meet the requirements of the water supply and drainage professional design drawings after converting the two-dimensional graphic.
[0005] In a first aspect, an embodiment of the present invention provides a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic, the method comprising:
[0006] Acquire three-dimensional model information of a target water valve, and extract target parameter values of the target water valve under multiple characteristic parameters from the three-dimensional model information;
[0007] According to the target parameter values of the target water valve under multiple characteristic parameters, a pre-trained two-dimensional graphic processing type decision tree model is called to generate a target two-dimensional graphic processing type corresponding to the target water valve;
[0008] According to the two-dimensional graphics conversion processing rules matching the target two-dimensional graphics processing type, the three-dimensional model information of the target water valve is converted into a two-dimensional plane graphics.
[0009] In a second aspect, an embodiment of the present invention further provides a device for converting a three-dimensional model of a water valve into a two-dimensional plane graphic, the device comprising:
[0010] A target parameter value extraction module is used to obtain three-dimensional model information of a target water valve, and extract target parameter values of the target water valve under multiple characteristic parameters from the three-dimensional model information;
[0011] A two-dimensional graphics processing type generation module is used to call a pre-trained two-dimensional graphics processing type decision tree model according to target parameter values of the target water valve under multiple characteristic parameters to generate a target two-dimensional graphics processing type corresponding to the target water valve;
[0012] The two-dimensional plane graphics conversion module is used to convert the three-dimensional model information of the target water valve into a two-dimensional plane graphics according to the two-dimensional graphics conversion processing rules that match the target two-dimensional graphics processing type.
[0013] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0014] at least one processor; and
[0015] a memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the method of converting a three-dimensional model of a water valve into a two-dimensional plane graphic described in any embodiment of the present invention.
[0017] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic as described in any embodiment of the present invention when executed.
[0018] The technical solution of the embodiment of the present invention can automatically generate two-dimensional plane graphics that meet the requirements for various types of water valves by introducing a decision tree algorithm, thereby solving the problem that the three-dimensional model of the water valve does not meet the requirements of the water supply and drainage professional design drawings after converting the two-dimensional graphics.
[0019] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1This is a flow chart of a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic according to the first embodiment of the present invention;
[0022] Figure 2 It is a pre-training data reference graph applicable to the embodiment of the present invention;
[0023] Figure 3 is a flow chart of another method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic according to the second embodiment of the present invention;
[0024] Figure 4 It is a conversion processing schematic diagram of a target water valve when the two-dimensional graphic processing type is Null, which is applicable to an embodiment of the present invention;
[0025] Figure 5 It is a schematic diagram of a conversion process of a target water valve when the two-dimensional graphic processing type is ClipNotGripA adjustment, which is applicable to an embodiment of the present invention;
[0026] Figure 6 It is a schematic diagram of a conversion process of a target water valve when the two-dimensional graphic processing type is ClipGripAdjust, which is applicable to an embodiment of the present invention;
[0027] Figure 7 It is a conversion processing schematic diagram of a target water valve when the two-dimensional graphic processing type is OneBlockNotGripAdjust, which is applicable to an embodiment of the present invention;
[0028] Figure 8 It is a schematic diagram of a conversion process of a target water valve when the two-dimensional graphics processing type is OneBlockGrip Adjust, which is applicable to an embodiment of the present invention;
[0029] Fig. 9 It is a conversion processing schematic diagram of a target water valve when the two-dimensional graphic processing type is TwoBlockNotGripAdjust applicable to an embodiment of the present invention;
[0030] Fig.10 It is a structural schematic diagram of a device for converting a three-dimensional model of a water valve into a two-dimensional plane graphic according to a third embodiment of the present invention;
[0031] Fig.11 The present invention is a schematic diagram of the structure of an electronic device for implementing a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic according to an embodiment of the present invention. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] Embodiment 1
[0035] Figure 1 This is a flow chart of a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic provided in the first embodiment of the present invention. This embodiment can be applied to the case of generating accurate two-dimensional plane graphics for a water valve device. The method can be executed by a device for converting a three-dimensional model of a water valve into a two-dimensional plane graphic. The device can be implemented in the form of hardware and / or software. The device can be configured in a platform that can intelligently generate two-dimensional drawings. Figure 1 As shown, the method includes:
[0036] S110 , acquiring three-dimensional model information of a target water valve, and extracting target parameter values of the target water valve under multiple characteristic parameters from the three-dimensional model information.
[0037] In water supply and drainage equipment, water valves are often used in domestic water supply, fire protection systems and industrial water supply systems. Water valves are also divided into different types according to their uses in different application scenarios. The three-dimensional model information mainly includes some basic attribute information such as the geometric information used to describe the target water valve. Among them, the characteristic parameters limit the two-dimensional plane graphics results that are finally output by each three-dimensional model.
[0038] Optionally, the plurality of characteristic parameters include: whether to draw graphics, whether to use projection, the number of associations, and whether to make adjustments.
[0039] Among them, whether to draw graphics refers to whether there is a corresponding two-dimensional plane graphic under the current target three-dimensional model to make a judgment; whether to use projection refers to whether the two-dimensional plane graphic converted by the current target three-dimensional model needs to use three-dimensional geometric projection calculation; the number of associations refers to the number of different types of two-dimensional plane graphics associated under a three-dimensional model; whether there is adjustment refers to whether the graphics need to be adjusted again after the target three-dimensional model is converted into a two-dimensional plane graphic.
[0040] S120. According to the target parameter values of the target water valve under multiple characteristic parameters, a pre-trained two-dimensional graphics processing type decision tree model is called to generate a target two-dimensional graphics processing type corresponding to the target water valve.
[0041] According to each of the above characteristic parameters, the target parameter value corresponding to the characteristic parameter can be "yes" or "no". For example, when the target parameter value under the characteristic parameter "whether to draw a graphic" is "yes", it indicates that the target water valve has a corresponding two-dimensional plane graphic, and the two-dimensional plane graphic can be output at this time. When the parameter value is "no", it indicates that the target water valve does not have a corresponding two-dimensional plane graphic, and the two-dimensional plane graphic is not output at this time. At the same time, the target parameter value corresponding to the characteristic parameter can also be a specific value. For example, the target parameter value under the characteristic parameter "associated quantity" can be one of "0", "1" and "2".
[0042] The model is pre-trained by inputting the parameter value of each characteristic parameter in the target water valve into the two-dimensional graphic processing type decision tree model, wherein each training data is composed of the parameter value of different characteristic parameters and the target two-dimensional graphic processing type. Each target parameter value of the target water valve is input into the trained two-dimensional graphic processing type decision tree model, and the two-dimensional graphic processing type corresponding to the target parameter value can be generated according to the corresponding historical training data.
[0043] Furthermore, before calling the pre-trained two-dimensional graphics processing type decision tree model, the following may also be included:
[0044] Get each optional parameter value of each feature parameter;
[0045] Arrange and combine each optional parameter value of each characteristic parameter to obtain multiple parameter value combinations matching the multiple characteristic parameters, and obtain the two-dimensional graphics processing type corresponding to each parameter value combination;
[0046] Inputting the two-dimensional graphic processing type corresponding to each parameter value combination into the standard decision tree object for data fitting;
[0047] When it is determined that the fitting accuracy satisfies a preset accuracy threshold, it is determined that a two-dimensional graphics processing type decision tree model is obtained through training.
[0048] Optional parameters refer to all possible target parameter values contained in each feature parameter. Each parameter value combination is obtained by selecting an optional parameter value under each feature parameter and combining them. Each parameter value combination corresponds to a two-dimensional graphics processing type, such as Figure 2 As shown, the four columns A, B, C and D represent four characteristic parameters respectively, among which the optional parameter values under the three characteristic parameters of whether to draw graphics, whether to use projection, and whether to adjust are "yes" and "no", and the optional parameter values under the characteristic parameter of the number of associations are 0, 1 and 2. The vertical column E refers to the two-dimensional graphics processing type. Each row of data arranged horizontally is called a training data, including a parameter value combination and a two-dimensional image processing type. It should be noted that in the embodiment of the present invention, there is no restriction on the number of characteristic parameters in the parameter value combination, and the characteristic parameters included for different water supply and drainage equipment are also different.
[0049] In the embodiment of the present invention, the preset accuracy threshold is generally 1. When the fitting accuracy of the data fitting reaches 1, it indicates that the pre-training of the model has been completed.
[0050] S130 , converting the three-dimensional model information of the target water valve into a two-dimensional plane graphic according to a two-dimensional graphic conversion processing rule that matches the target two-dimensional graphic processing type.
[0051] Each two-dimensional graphics processing type corresponds to a fixed two-dimensional graphics conversion processing rule, which specifically determines the type of the two-dimensional graphics output and what adjustments are made to the output two-dimensional graphics.
[0052] In the embodiment of the present invention, the characteristic parameters of the target water valve are extracted to obtain the parameter values under each characteristic parameter, and the pre-trained decision tree model can be used to generate the corresponding processing type for the current water valve according to the characteristic parameters and parameter values, and a two-dimensional plane graphic that meets the requirements is generated for the target water valve according to the corresponding relationship between the processing type and the conversion processing rule. The technical solution of the embodiment of the present invention can automatically generate two-dimensional plane graphics that meet the requirements for various types of water valves by introducing a decision tree algorithm, solving the problem that the three-dimensional model of the water valve does not meet the requirements of the water supply and drainage professional design drawings after converting the two-dimensional graphics.
[0053] Embodiment 2
[0054] Figure 3 This is a flow chart of another method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic provided in the second embodiment of the present invention. This embodiment is based on the first embodiment and is refined. Figure 3 As shown, the method includes:
[0055] S310, acquiring three-dimensional model information of a target water valve, and extracting target parameter values of the target water valve under multiple characteristic parameters from the three-dimensional model information.
[0056] Optionally, while extracting the target parameter value of the target water valve under multiple characteristic parameters from the three-dimensional model information, the following may also be included:
[0057] The size information and three-dimensional shape information of the target water valve are extracted from the three-dimensional model information.
[0058] Among them, in addition to the characteristic parameters, the three-dimensional model information also includes the size information and three-dimensional shape information of the target water valve. The size information includes the length, width, height and other size information of the target water valve, the coordinate information of each vertex, the rotation angle and the transformation matrix; the three-dimensional shape information is a three-dimensional model matching the target water valve.
[0059] S320. According to the target parameter values of the target water valve under multiple characteristic parameters, a pre-trained two-dimensional graphics processing type decision tree model is called to generate a target two-dimensional graphics processing type corresponding to the target water valve.
[0060] It can be seen from the above embodiments that each training data used in pre-training the two-dimensional graphics processing type decision tree model contains multiple feature parameters and a two-dimensional graphics processing type. Therefore, by obtaining the three-dimensional model information of the target water valve, the feature parameters contained in the target water valve and the feature parameter values under the feature parameters can be extracted from the three-dimensional model information. Therefore, the pre-training model can be used to determine a two-dimensional graphics processing type for the current target water valve.
[0061] S330: Obtain a pre-constructed two-dimensional graphic output mapping table, and obtain multiple types of candidate two-dimensional plane graphics corresponding to the three-dimensional shape information of the target water valve according to the two-dimensional graphic output mapping table.
[0062] Furthermore, before obtaining the pre-built two-dimensional graphic output mapping table, the following steps may also be included:
[0063] Acquire standardized three-dimensional shape information of all types of water valves, and generate first-type two-dimensional plane graphics and second-type two-dimensional plane graphics corresponding to each type of water valve according to the standardized three-dimensional shape information;
[0064] A mapping relationship is established between the standard three-dimensional model of each type of water valve, the first type of two-dimensional plane graphics and the second type of two-dimensional plane graphics to form a two-dimensional graphic output mapping table.
[0065] The two-dimensional graphics output mapping table provides multiple types of alternative two-dimensional plane graphics that can be generated under the three-dimensional shape information of each water valve, wherein the alternative two-dimensional plane graphics may include a first type of two-dimensional plane graphics and a second type of two-dimensional plane graphics, wherein the first type of two-dimensional plane graphics may refer to a two-dimensional plane graphics obtained by projecting a three-dimensional model, and the second type of two-dimensional plane graphics is a two-dimensional plane graphics obtained by projecting a non-three-dimensional model, which may specifically be a two-dimensional symbolic graphic.
[0066] In actual application scenarios, due to the need for drawing expression, some special water valve devices, such as water valves arranged on non-riser pipes, need to be expressed in two-dimensional plane graphics using specific two-dimensional symbols. In addition, the symbol sizes of such equipment in the same set of drawings are fixed values, which are different from the sizes of the three-dimensional shapes. The two-dimensional plane graphics obtained in this way are called two-dimensional symbol graphics.
[0067] S340, using a conversion processing rule of a two-dimensional graphic that matches the processing type of the target two-dimensional graphic, selecting a target two-dimensional plane graphic from multiple types of two-dimensional plane graphics, and adjusting the target two-dimensional plane graphic according to size information of the target water valve.
[0068] In the embodiment of the present invention, the two-dimensional graphics processing types may include: Null (no graphics are drawn), OneBlockGripAdjust (one two-dimensional symbol is used and the graphics are additionally adjusted), OneBlockNotGripAdjust (one two-dimensional symbol is used and no additional graphics are adjusted), TwoBlockNotGripAdjust (two two-dimensional symbols are used and the graphics are additionally adjusted), ClipGripAdjust (projection results are used and the graphics are additionally adjusted), and ClipNotGripAdjust (projection results are used and no additional graphics are adjusted), wherein the projection results are used to refer to two-dimensional plane graphics calculated using three-dimensional geometric projection. It should be noted that in the embodiment of the present invention, there is no restriction on the number of two-dimensional graphics processing types, and the types of two-dimensional graphics processing types corresponding to different water supply and drainage equipment are also different. Among them, Figure 4 A schematic diagram of the conversion processing of a target water valve arranged on a horizontal pipe is shown when the processing type is Null, wherein the left side is a three-dimensional shape model of the target water valve, and the right side is a two-dimensional plane graphic output result corresponding to the current conversion processing rule.
[0069] Under each of the above-mentioned two-dimensional graphics processing types, there is a corresponding two-dimensional graphics conversion processing rule. According to the two-dimensional graphics conversion processing rule, the two-dimensional graphics type output by the target water valve can be determined, and then the two-dimensional graphics of this type can be selected to be output in the two-dimensional graphics output mapping table, and further adjustments can be made.
[0070] Optionally, using a conversion processing rule of a two-dimensional graphic that matches the processing type of the target two-dimensional graphic, selecting a target two-dimensional plane graphic from multiple types of two-dimensional plane graphics, and adjusting the target two-dimensional plane graphic according to the size information of the target water valve may include:
[0071] When the conversion processing rules of the two-dimensional graphics are to use the projection result and additionally adjust the graphics and to use the projection result without additionally adjusting the graphics, a first type of two-dimensional plane graphics corresponding to the target water valve three-dimensional model is selected as the target two-dimensional plane graphics, and the target two-dimensional plane graphics is adjusted according to the rotation matrix in the size information.
[0072] Since the first type of two-dimensional plane graphics is a two-dimensional plane graphics obtained by projection calculation using a three-dimensional geometric model, for the two types of two-dimensional graphics processing ClipGripAdjust and ClipNotGripAdjust that use projection results, after selecting the first type of two-dimensional plane graphics corresponding to the target water valve three-dimensional model in the two-dimensional graphics output mapping table, the first type of two-dimensional plane graphics is further adjusted by obtaining the rotation matrix of the size information in the target water valve three-dimensional model information.
[0073] Easy to understand, Figure 5 A schematic diagram of the conversion processing of a target water valve arranged in a horizontal pipe is shown when the processing type is ClipNotGripAdjust, wherein the left side is a three-dimensional shape model of the target water valve, and the right side is a two-dimensional plane graphic output result of the first type corresponding to the current conversion processing rule and without additional adjustment. Figure 6 A schematic diagram of the conversion processing of a target water valve arranged in a horizontal pipe when the processing type is ClipGripAdjust is shown, wherein the left side is a three-dimensional shape model of the target water valve, and the right side is a two-dimensional plane output result after additional adjustment of the first type of two-dimensional plane graphics.
[0074] Further, using a conversion processing rule of a two-dimensional graphic that matches the processing type of the target two-dimensional graphic, selecting a target two-dimensional plane graphic from multiple types of two-dimensional plane graphics, and adjusting the target two-dimensional plane graphic according to the size information of the target water valve, may also include:
[0075] When the conversion processing rules of the two-dimensional graphics are using one two-dimensional symbol and additionally adjusting the graphics, using one two-dimensional symbol without adjusting the graphics, and using two two-dimensional symbols without additionally adjusting the graphics, the second type of two-dimensional plane graphics corresponding to the target water valve three-dimensional model is selected as the target two-dimensional plane graphics, and the target two-dimensional plane graphics are adjusted according to the insertion point, plane rotation angle, length and width in the size information.
[0076] Since the second type of two-dimensional plane graphics are two-dimensional plane graphics generated by using specific two-dimensional symbols, for the OneBlockGripAdjust, OneBlockNotGripAdjust and TwoBlockNotG ripAdjust two-dimensional graphic processing types, after selecting the second type of two-dimensional plane graphics corresponding to the target water valve three-dimensional model in the two-dimensional graphic output mapping table, the first type of two-dimensional plane graphics is further adjusted by obtaining the insertion point, plane rotation angle, length and width of the size information in the three-dimensional model information of the target water valve, wherein the insertion point can be the vertex coordinates of the three-dimensional model.
[0077] Easy to understand, Figure 7 A schematic diagram of the conversion processing of a target water valve arranged on a horizontal pipe when the processing type is OneBlockNotGripAdjust is shown, wherein the left side is a three-dimensional shape model of the target water valve, and the right side is a two-dimensional plane graphic output result of the second type corresponding to the current conversion processing rule and without additional adjustment; Figure 8 The figure shows a conversion process diagram of a target water valve arranged on a horizontal pipe when the processing type is OneBlockGripAdjust, wherein the left side is a three-dimensional shape model of the target water valve, and the right side is a two-dimensional plane output result after additional adjustment of the second type of two-dimensional plane graphics. Fig. 9 As shown, the processing type of TwoBlockNotGripAdjust is mainly aimed at special devices composed of two two-dimensional symbols.
[0078] In the embodiment of the present invention, how to determine the conversion processing rules according to the graphics processing type and what specific adjustments to make after generating the two-dimensional graphics according to the corresponding conversion processing rules are mainly described in detail. At the same time, examples are given for the two-dimensional graphics under each conversion processing rule. Different from the drawbacks of the prior art, the automatic conversion processing of graphics that satisfies both the projection of the three-dimensional model into the two-dimensional plane graphics and the generation of the two-dimensional plane graphics using the two-dimensional symbols is realized. At the same time, the embodiment of the present invention can achieve the output of the two-dimensional plane graphics with the same effect for other types of water supply and drainage equipment by expanding on the basis of the above method, and has strong scalability.
[0079] Embodiment 3
[0080] Fig.10 A schematic diagram of the structure of a three-dimensional model reconstruction device for an object provided in Example 3. Fig.10 , the device comprises:
[0081] A target parameter value extraction module 1010 is used to obtain three-dimensional model information of a target water valve, and extract target parameter values of the target water valve under multiple characteristic parameters from the three-dimensional model information;
[0082] The two-dimensional graphics processing type generation module 1020 calls a pre-trained two-dimensional graphics processing type decision tree model according to the target parameter values of the target water valve under multiple characteristic parameters to generate a target two-dimensional graphics processing type corresponding to the target water valve;
[0083] The two-dimensional plane graphics conversion module 1030 converts the three-dimensional model information of the target water valve into a two-dimensional plane graphics according to the two-dimensional graphics conversion processing rule matching the target two-dimensional graphics processing type.
[0084] In the embodiment of the present invention, the characteristic parameters of the target water valve are extracted to obtain the parameter values under each characteristic parameter, and the pre-trained decision tree model can be used to generate the corresponding processing type for the current water valve according to the characteristic parameters and parameter values, and a two-dimensional plane graphic that meets the requirements is generated for the target water valve according to the corresponding relationship between the processing type and the conversion processing rule. The technical solution of the embodiment of the present invention can automatically generate two-dimensional plane graphics that meet the requirements for various types of water valves by introducing a decision tree algorithm, solving the problem that the three-dimensional model of the water valve does not meet the requirements of the water supply and drainage professional design drawings after converting the two-dimensional graphics.
[0085] Based on the above embodiments, the multiple characteristic parameters include: whether to draw graphics, whether to use projection, the number of associations and whether to adjust.
[0086] On the basis of the above embodiments, it further includes a decision tree model pre-training module, which is used to obtain each optional parameter value of each feature parameter before calling the pre-trained two-dimensional graphics processing type decision tree model;
[0087] Arrange and combine each optional parameter value of each characteristic parameter to obtain multiple parameter value combinations matching the multiple characteristic parameters, and obtain the two-dimensional graphics processing type corresponding to each parameter value combination;
[0088] Inputting the two-dimensional graphic processing type corresponding to each parameter value combination into the standard decision tree object for data fitting;
[0089] When it is determined that the fitting accuracy satisfies a preset accuracy threshold, it is determined that a two-dimensional graphics processing type decision tree model is obtained through training.
[0090] Based on the above embodiments, it also includes an information extraction module for extracting the target parameter values of the target water valve under multiple characteristic parameters in the three-dimensional model information, and extracting the size information and three-dimensional shape information of the target water valve in the three-dimensional model information.
[0091] On the basis of the above embodiments, it further includes a two-dimensional graphic output mapping table construction module, which is used to obtain standardized three-dimensional shape information of all types of water valves before obtaining the pre-constructed two-dimensional graphic output mapping table, and generate a first type of two-dimensional plane graphic and a second type of two-dimensional plane graphic corresponding to each type of water valve according to the standardized three-dimensional shape information;
[0092] A mapping relationship is established between the standard three-dimensional model of each type of water valve, the first type of two-dimensional plane graphics and the second type of two-dimensional plane graphics to form a two-dimensional graphic output mapping table.
[0093] Based on the above embodiments, the two-dimensional plane graphics conversion module 1030 includes:
[0094] A candidate two-dimensional plane graphic acquisition unit, used to acquire a pre-built two-dimensional graphic output mapping table, and acquire multiple types of candidate two-dimensional plane graphics corresponding to the three-dimensional shape information of the target water valve according to the two-dimensional graphic output mapping table;
[0095] The two-dimensional plane graphics adjustment unit is used to select a target two-dimensional plane graphics from multiple types of two-dimensional plane graphics using a two-dimensional graphics conversion processing rule that matches the target two-dimensional graphics processing type, and adjust the target two-dimensional plane graphics according to the size information of the target water valve.
[0096] On the basis of the above embodiments, the two-dimensional plane graphics adjustment unit is specifically used to select a first type of two-dimensional plane graphics corresponding to the target water valve three-dimensional model as the target two-dimensional plane graphics when the conversion processing rules of the two-dimensional graphics are using the projection result and additionally adjusting the graphics and using the projection result without additionally adjusting the graphics, and adjust the target two-dimensional plane graphics according to the rotation matrix in the size information.
[0097] On the basis of the above embodiments, the two-dimensional plane graphic adjustment unit is further specifically used to select a second type of two-dimensional plane graphic corresponding to the target water valve three-dimensional model as the target two-dimensional plane graphic when the conversion processing rule of the two-dimensional graphic is using one two-dimensional symbol and additionally adjusting the graphic, using one two-dimensional symbol and no additionally adjusting the graphic, and using two two-dimensional symbols and no additionally adjusting the graphic, and adjust the target two-dimensional plane graphic according to the insertion point, plane rotation angle, length and width in the size information.
[0098] A device for converting a three-dimensional model of a water valve into a two-dimensional plane graphic provided in an embodiment of the present invention can execute a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic provided in any embodiment of the present invention, and has functional modules and beneficial effects corresponding to the execution method.
[0099] Embodiment 4
[0100] Fig.11 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0101] like Fig.11 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0102] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0103] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic.
[0104] That is: obtaining the three-dimensional model information of the target water valve, and extracting the target parameter values of the target water valve under multiple characteristic parameters from the three-dimensional model information;
[0105] According to the target parameter values of the target water valve under multiple characteristic parameters, a pre-trained two-dimensional graphic processing type decision tree model is called to generate a target two-dimensional graphic processing type corresponding to the target water valve;
[0106] According to the two-dimensional graphics conversion processing rules matching the target two-dimensional graphics processing type, the three-dimensional model information of the target water valve is converted into a two-dimensional plane graphics.
[0107] In some embodiments, a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic by any other appropriate means (for example, by means of firmware).
[0108] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0109] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0110] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0111] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0112] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0113] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS servers.
[0114] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0115] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic, characterized in that: include: Acquire three-dimensional model information of a target water valve, and extract target parameter values of the target water valve under multiple characteristic parameters from the three-dimensional model information; According to the target parameter values of the target water valve under multiple characteristic parameters, a pre-trained two-dimensional graphic processing type decision tree model is called to generate a target two-dimensional graphic processing type corresponding to the target water valve; According to the two-dimensional graphics conversion processing rules matching the target two-dimensional graphics processing type, the three-dimensional model information of the target water valve is converted into a two-dimensional plane graphics.
2. The method according to claim 1, characterized in that: The multiple feature parameters include: whether to draw graphics, whether to use projection, the number of associations, and whether to make adjustments.
3. The method according to claim 1 or 2, characterized in that: Before calling the pre-trained 2D graph processing type decision tree model, also include: Get each optional parameter value of each feature parameter; Arrange and combine each optional parameter value of each characteristic parameter to obtain multiple parameter value combinations matching the multiple characteristic parameters, and obtain the two-dimensional graphics processing type corresponding to each parameter value combination; Inputting the two-dimensional graphic processing type corresponding to each parameter value combination into the standard decision tree object for data fitting; When it is determined that the fitting accuracy satisfies a preset accuracy threshold, it is determined that a two-dimensional graphics processing type decision tree model is obtained through training.
4. The method according to claim 1, characterized in that: While extracting the target parameter values of the target water valve under multiple characteristic parameters from the three-dimensional model information, it also includes: Extracting size information and three-dimensional shape information of the target water valve from the three-dimensional model information; According to the conversion processing rule of the two-dimensional graphics matching the target two-dimensional graphics processing type, the three-dimensional model information of the target water valve is converted into a two-dimensional plane graphics, including: Obtaining a pre-built two-dimensional graphic output mapping table, and obtaining multiple types of candidate two-dimensional plane graphics corresponding to the three-dimensional shape information of the target water valve according to the two-dimensional graphic output mapping table; A target two-dimensional plane graphic is selected from multiple types of two-dimensional plane graphics using a conversion processing rule of the two-dimensional graphics that matches the processing type of the target two-dimensional graphic, and the target two-dimensional plane graphic is adjusted according to the size information of the target water valve.
5. The method according to claim 4, characterized in that Before getting the pre-built 2D graphics output mapping table, also include: Acquire standardized three-dimensional shape information of all types of water valves, and generate first-type two-dimensional plane graphics and second-type two-dimensional plane graphics corresponding to each type of water valve according to the standardized three-dimensional shape information; A mapping relationship is established between the standard three-dimensional model of each type of water valve, the first type of two-dimensional plane graphics and the second type of two-dimensional plane graphics to form a two-dimensional graphic output mapping table.
6. The method according to claim 4 or 5, characterized in that: Using a conversion processing rule of a two-dimensional graphic that matches the processing type of the target two-dimensional graphic, selecting a target two-dimensional plane graphic from multiple types of two-dimensional plane graphics, and adjusting the target two-dimensional plane graphic according to the size information of the target water valve, including: The conversion processing rules of the two-dimensional graphics are to use the projection result and additionally adjust the graphics, and to use the projection result without additionally adjusting the graphics. A two-dimensional plane graphic corresponding to the target water valve three-dimensional model is selected as the target two-dimensional plane graphic, and the target two-dimensional plane graphic is adjusted according to the rotation matrix in the size information.
7. The method according to claim 4 or 5, characterized in that: Using a conversion processing rule of a two-dimensional graphic that matches the processing type of the target two-dimensional graphic, selecting a target two-dimensional plane graphic from multiple types of two-dimensional plane graphics, and adjusting the target two-dimensional plane graphic according to the size information of the target water valve, including: When the conversion processing rules of the two-dimensional graphics are using one two-dimensional symbol and additionally adjusting the graphics, using one two-dimensional symbol and no adjusting the graphics, and using two two-dimensional symbols and no adjusting the graphics, the second type of two-dimensional plane graphics corresponding to the target water valve three-dimensional model are selected as the target two-dimensional plane graphics, and the target two-dimensional plane graphics are adjusted according to the insertion point, plane rotation angle, length and width in the size information.
8. A method and device for converting a three-dimensional model of a water valve into a two-dimensional plane graphic, characterized in that: include: A target parameter value extraction module is used to obtain three-dimensional model information of a target water valve, and extract target parameter values of the target water valve under multiple characteristic parameters from the three-dimensional model information; A two-dimensional graphics processing type generation module is used to call a pre-trained two-dimensional graphics processing type decision tree model according to target parameter values of the target water valve under multiple characteristic parameters to generate a target two-dimensional graphics processing type corresponding to the target water valve; The two-dimensional plane graphics conversion module is used to convert the three-dimensional model information of the target water valve into a two-dimensional plane graphics according to the two-dimensional graphics conversion processing rules that match the target two-dimensional graphics processing type.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement a method for converting a three-dimensional model of a water valve into a two-dimensional plane graphic according to any one of claims 1 to 7 when executed.
