A point cloud data cutting method based on Python language

Through the point cloud data cutting method based on Python language, automated cutting and independent data storage are realized, solving the problem of inefficiency caused by relying on CAD plug-ins in the existing technology, improving cutting efficiency and suitable for a variety of pile foundation construction.

CN118733533BActive Publication Date: 2024-12-20THREE GORGES NEW ENERGY OFFSHORE WIND POWER OPERATION & MAINTENANCE JIANGSU CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410811056.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-21
Publication Date
2024-12-20
Estimated Expiration
2044-06-21

AI Technical Summary

Technical Problem

In the prior art, point cloud data cutting needs to rely on CAD plug-in, which is time-consuming and labor-intensive and inefficient.

Method used

Design a point cloud data cutting method based on Python language, which can automatically select the cutting pile foundation range according to needs, and independently save the cut data to their respective named files, so as to realize automatic data cutting through Python programs.

Benefits of technology

It greatly improves cutting efficiency, reduces manual intervention, and is suitable for a variety of different types of pile foundation construction operations, solving the problem of inefficiency caused by relying on CAD plug-in cutting in the prior art.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733533B_ABST
    Figure CN118733533B_ABST
Patent Text Reader

Abstract

The invention discloses a point cloud data cutting method based on Python language, including S1, data file preparation, data preparation including pile foundation data file preparation and point cloud data file preparation; S2, data screening and cleaning; setting data statistical range, screening out data not meeting the statistical range; the statistical range is that no negative value appears; S3, first reading the point cloud data information to be processed, and dividing it into a specified number of copies num according to the size of the point cloud data information; cutting and processing each point cloud data information; the method solves the problem that the point cloud data cutting in the prior art needs to rely on CAD plug-ins for cutting, which is time-consuming, labor-intensive and inefficient; the method has the characteristics of being able to independently select the required cutting pile foundation range according to the needs, and independently save the cut data to files named after the respective pile foundations, which is convenient for subsequent processing and greatly improves the cutting efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of point cloud data processing, in particular to a point cloud data cutting method based on Python language. Background Art

[0002] According to relevant standards, offshore wind farm pile foundations must be regularly tested for underwater scour according to different marine environments. The current mainstream method is to use multi-beam equipment to detect pile foundation scour. After data collection is completed, the point cloud data needs to be cut, and point cloud data within a certain range of the pile foundation needs to be selected for analysis. The cutting method currently uses CAD internal plug-ins to manually cut one by one, which is time-consuming, labor-intensive and inefficient. Therefore, it is necessary to design a point cloud data cutting method based on the python language to solve the above problems. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a point cloud data cutting method based on Python language, aiming to solve the problem that the point cloud data cutting in the prior art needs to rely on CAD plug-ins for cutting, which is time-consuming, labor-intensive and inefficient; it has the characteristics of being able to independently select the required cutting pile foundation range according to needs, and independently save the cut data to files named after each pile foundation, which is convenient for subsequent processing and greatly improves the cutting efficiency.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0005] A point cloud data cutting method based on Python language, comprising:

[0006] S1, data file preparation:

[0007] Including pile foundation data file preparation and point cloud data file preparation;

[0008] S2, data screening and cleaning;

[0009] Set the data statistical range and filter out the data that does not meet the statistical range; the statistical range is to prevent negative values;

[0010] S3, first read the point cloud data information to be processed, divide it into a specified number num according to the size of the point cloud data information; and cut each point cloud data information.

[0011] Preferably, in step S1, the pile foundation data file preparation includes:

[0012] The file is converted to xlsx format, including the pile name and plane coordinates;

[0013] The preparation of the point cloud data file to be cut includes:

[0014] The file is converted into xyz format, which contains plane coordinates and elevation information;

[0015] The above files are placed in the program folder according to the specified format.

[0016] Preferably, in step S3, the cutting process of each point cloud data information includes:

[0017] S301, read the pile foundation coordinate information and obtain all rows of the information;

[0018] S302, creating a loop statement 1, traversing the point cloud data to be processed row by row, and separating the plane coordinates 1 and the elevation information of the data by spaces;

[0019] S303, embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places;

[0020] S304, obtaining the target pile foundation name and creating a character string based on it;

[0021] S305, creating an if-1 statement in loop statement 2, comparing whether the absolute value of the difference between plane coordinate 1 and plane coordinate 2 is within the pile foundation range L, and if so, executing the embedded if-2 statement;

[0022] S306, in the if-2 statement, a distance formula is used to determine whether the distance between the plane coordinate 1 and the plane coordinate 2 is less than L. The distance formula is as follows:

[0023] ;

[0024] Where (x1, y1) and (x2, y2) are the coordinate positions of plane coordinate 1 and plane coordinate 2;

[0025] If so, it is written in an appended manner into the xyz named file named with the pile foundation.

[0026] Preferably, a point cloud data cutting program based on Python language includes a data reading module for reading the pile foundation coordinate information and obtaining all rows of information;

[0027] The point cloud data loop traversal execution module is used to create a loop statement 1, traverse the point cloud data to be processed row by row, and separate the plane coordinates 1 and elevation information of the data by spaces;

[0028] The pile foundation information loop traversal execution module is used to embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain the pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places;

[0029] The string creation module is used to obtain the target pile name and create a string based on it;

[0030] The judgment execution module is used to create an if-1 statement in loop statement 2, compare whether the absolute value of the difference between plane coordinate 1 and plane coordinate 2 is within the pile foundation range L, and if so, execute the embedded if-2 statement; and use the distance formula in the if-2 statement to determine whether the distance between plane coordinate 1 and plane coordinate 2 is less than L.

[0031] Preferably, a computer device comprises a memory and a processor, the memory and the processor are communicatively connected to each other, a computer program is stored in the memory, and the processor executes the point cloud data cutting method based on Python language by executing the computer program.

[0032] Preferably, a computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute the point cloud data cutting method based on Python language.

[0033] The beneficial effects of the present invention are as follows:

[0034] The present invention provides a point cloud data cutting method based on Python language, which can be integrated into a computer program for automatic execution. The computer automatically cuts without manual cutting, which greatly improves the working efficiency; and the cutting range can be independently selected, which is suitable for various types of pile foundation construction operations; it solves the problem that the point cloud data cutting in the prior art needs to rely on CAD plug-ins for cutting, which is time-consuming, labor-intensive and inefficient; it has the characteristics of being able to independently select the required cutting pile foundation range according to needs, and independently save the cut data to files named after the respective pile foundations, which is convenient for subsequent processing and greatly improves the cutting efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The present invention will be further described below in conjunction with the accompanying drawings and embodiments:

[0036] Figure 1 is a flow chart of the present invention;

[0037] Figure 2 This is a flow chart of the present invention for cutting each point cloud data information;

[0038] Figure 3 It is a schematic diagram of the program execution operation process of the present invention. DETAILED DESCRIPTION

[0039] Embodiment 1:

[0040] like Figure 1As shown, a point cloud data cutting method based on Python language includes:

[0041] S1, data file preparation:

[0042] Including pile foundation data file preparation and point cloud data file preparation;

[0043] S2, data screening and cleaning;

[0044] Set the data statistical range and filter out the data that does not meet the statistical range; the statistical range is to prevent negative values;

[0045] S3, first read the point cloud data information to be processed, divide it into a specified number num according to the size of the point cloud data information; and cut each point cloud data information.

[0046] Preferably, in step S1, the pile foundation data file preparation includes:

[0047] The file is converted to xlsx format, including the pile name and plane coordinates;

[0048] The preparation of the point cloud data file to be cut includes:

[0049] The file is converted into xyz format, which contains plane coordinates and elevation information;

[0050] The above files are placed in the program folder according to the specified format.

[0051] like Figure 2 As shown, in step S3, the cutting process of each point cloud data information includes:

[0052] S301, read the pile foundation coordinate information and obtain all rows of the information;

[0053] S302, creating a loop statement 1, traversing the point cloud data to be processed row by row, and separating the plane coordinates 1 and the elevation information of the data by spaces;

[0054] S303, embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places;

[0055] S304, obtaining the target pile foundation name and creating a character string based on it;

[0056] S305, create an if-1 statement in loop statement 2, compare the absolute value of the difference between plane coordinate 1 and plane coordinate 2 to see if it is within the pile foundation range of 80m, and if so, execute the embedded if-2 statement;

[0057] S306, in the if-2 statement, a distance formula is used to determine whether the distance between plane coordinate 1 and plane coordinate 2 is less than 80m. The distance formula is as follows:

[0058] ;

[0059] Where (x1, y1) and (x2, y2) are the coordinate positions of plane coordinate 1 and plane coordinate 2;

[0060] If so, it is written in an appended manner into the xyz named file named with the pile foundation.

[0061] Embodiment 2:

[0062] like Figure 3 As shown, the present invention also provides a point cloud data cutting program based on Python language, the program includes a data reading module, which is used to read the pile foundation coordinate information and obtain all rows of information;

[0063] The point cloud data loop traversal execution module is used to create a loop statement 1, traverse the point cloud data to be processed row by row, and separate the plane coordinates 1 and elevation information of the data by spaces;

[0064] The pile foundation information loop traversal execution module is used to embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain the pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places;

[0065] The string creation module is used to obtain the target pile name and create a string based on it;

[0066] The judgment execution module is used to create an if-1 statement in loop statement 2 to compare whether the absolute value of the difference between plane coordinate 1 and plane coordinate 2 is within the pile foundation range of 80m. If so, the embedded if-2 statement is executed; and the distance formula is used in the if-2 statement to determine whether the distance between plane coordinate 1 and plane coordinate 2 is less than 80m.

[0067] Furthermore, this program is based on Python language, configures Python3.8 environment, imports PyQt6, sys, pandas, and math libraries, and uses PyCharm editing software for design.

[0068] Furthermore, the pile foundation coordinate information is in xlsx format.

[0069] Furthermore, the temporary list is in list format.

[0070] Furthermore, the string is in str format.

[0071] Embodiment three:

[0072] Preferably, a computer device comprises a memory and a processor, the memory and the processor are communicatively connected to each other, a computer program is stored in the memory, and the processor executes the point cloud data cutting method based on Python language by executing the computer program.

[0073] Preferably, a computer-readable storage medium stores a computer program, and the computer program is used to enable a computer to execute the point cloud data cutting method based on Python language.

[0074] The above embodiments are only preferred technical solutions of the present invention and should not be regarded as limiting the present invention. The protection scope of the present invention shall be the technical solutions recorded in the claims, including equivalent replacement solutions of the technical features in the technical solutions recorded in the claims. That is, equivalent replacement improvements within this scope are also within the protection scope of the present invention.

Claims

1. A point cloud data cutting method based on Python language, characterized in that: include: S1, data file preparation: Including pile foundation data file preparation and point cloud data file preparation; S2, data screening and cleaning; Set the data statistical range and filter out the data that does not meet the statistical range; the statistical range is to prevent negative values; S3, first read the point cloud data information to be processed, and divide it into a specified number of parts num according to the size of the point cloud data information; Cut each point cloud data information; In step S1, the pile foundation data file preparation includes: The file is converted to xlsx format, including the pile name and plane coordinates; The preparation of the point cloud data file to be cut includes: The file is converted into xyz format, which contains plane coordinates and elevation information; The above files are placed in the program folder according to the specified format; In step S3, the cutting process of each point cloud data information includes: S301, read the pile foundation coordinate information and obtain all rows of the information; S302, creating a loop statement 1, traversing the point cloud data to be processed row by row, and separating the plane coordinates 1 and the elevation information of the data by spaces; S303, embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places; S304, obtaining the target pile foundation name and creating a character string based on it; S305, creating an if-1 statement in loop statement 2, comparing whether the absolute value of the difference between plane coordinate 1 and plane coordinate 2 is within the pile foundation range L, and if so, executing the embedded if-2 statement; S306, in the if-2 statement, a distance formula is used to determine whether the distance between the plane coordinate 1 and the plane coordinate 2 is less than L. The distance formula is as follows: ; Where (x1, y1) and (x2, y2) are the coordinate positions of plane coordinate 1 and plane coordinate 2; If so, it is written in an appended manner into the xyz named file named with the pile foundation.

2. A device using a point cloud data cutting method based on Python language as claimed in claim 1, characterized in that: It includes a data reading module, which is used to read the pile foundation coordinate information and obtain all rows of information; The point cloud data loop traversal execution module is used to create a loop statement 1, traverse the point cloud data to be processed row by row, and separate the plane coordinates 1 and elevation information of the data by spaces; The pile foundation information loop traversal execution module is used to embed loop statement 2 in loop statement 1, traverse the target pile foundation information row by row in loop statement 2, obtain the pile foundation plane coordinate 2, and store the data in a temporary list with two decimal places; The string creation module is used to obtain the target pile name and create a string based on it; The judgment execution module is used to create an if-1 statement in loop statement 2, compare whether the absolute value of the difference between plane coordinate 1 and plane coordinate 2 is within the pile foundation range L, and if so, execute the embedded if-2 statement; and use the distance formula in the if-2 statement to determine whether the distance between plane coordinate 1 and plane coordinate 2 is less than L.

3. A computer device, characterized in that: The invention comprises a memory and a processor, the memory and the processor are connected to communicate with each other, a computer program is stored in the memory, and the processor executes the point cloud data cutting method based on Python language as described in claim 1 by executing the computer program.

4. A computer-readable storage medium, characterized in that: A computer program is stored on a computer-readable storage medium, and the computer program is used to enable a computer to execute the point cloud data cutting method based on Python language described in claim 1.