Gear Metrology. Requesting help in processing raw XYZ, PLY or STL data from a point cloud files in order to obtain gear geometry in the form of a gear report.
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have measured gears via the optical focus variation method with a confocal microscope, and I have collected point clouds. I can provide the data in either STL, PLY or simple XYZ coordinates (as well as a drawing and possible CAD model). Normally, on a coordinate measuring machine (CMM) the gear report would be created automatically from the collected XYX coordinates via standard gear software. Gear software is not available for the microscope, so I am hoping that this can be done in Matlab. I am now looking for someone who has knowledge or experience in creating a gear report from raw data. I am a basic MATLAB user, but I believe that this should be possible (can anyone advise please?).
2 Commenti
Udit06
il 26 Ago 2024
Hi Denis,
MATLAB offers several functions for reading and preprocessing 3D data. To assist community members in providing better support, it would be beneficial if you could share a sample data file along with the expected format of the gear report.
Thanks
Risposte (1)
Ayush
il 11 Ott 2024
I understand you want to create a gear report using MATLAB.
As the link for the sample data is not accessible, I am using a sample data which I generated using the following script. This is an example demonstration to use MATLAB for 3D data processing.
% Generate sample gear-like point cloud data
theta = linspace(0, 2*pi, 100); % Angle for full circle
radius = 10;
tooth_height = 2; % Tooth height
tooth_width = 2; % Tooth width
% Generate points for the gear body
x_body = radius * cos(theta);
y_body = radius * sin(theta);
z_body = zeros(size(x_body));
% Generate points for teeth
num_teeth = 10;
for i = 1:num_teeth
angle = (i-1) * (2*pi/num_teeth);
x_tooth = [0, tooth_width, tooth_width, 0] + radius * cos(angle);
y_tooth = [0, 0, tooth_height, tooth_height] + radius * sin(angle);
z_tooth = [0, 0, 0, 0];
hold on;
plot3(x_tooth, y_tooth, z_tooth, 'k'); % Plot teeth
end
% Save the points to an XYZ file
xyz_data = [x_body', y_body', z_body'];
writematrix(xyz_data, 'sample_gear.csv’);
Now, using this sample data, you can create the gear report using the pseudo code given below:
% Load the sample data
data = readmatrix('sample_gear.csv');
% Extracting x, y, z coordinates
x = data(:, 1);
y = data(:, 2);
z = data(:, 3);
% Create a point cloud
ptCloud = pointCloud([x, y, z]);
% Visualize the point cloud
figure;
pcshow(ptCloud);
title('Point Cloud of Sample Gear');
xlabel('X'); ylabel('Y'); zlabel('Z');
% example: Try to Fit a plane to find the base of the gear
model = pcfitplane(ptCloud, 0.01);
fprintf('Plane Model:\n');
disp(model.Parameters); % Displaying plane parameters
% Calculating pitch diameter (example calculation)
pitch_diameter = 2 * (radius + tooth_height);
fprintf('Estimated Pitch Diameter: %.2f\n', pitch_diameter);
% Create a report
reportData = table();
reportData.Parameter = {'Pitch Diameter'; 'Number of Teeth'};
reportData.Value = {pitch_diameter; num_teeth};
% Save the report to CSV
writetable(reportData, 'gear_report.csv');
Here are the required documentation links which you can access to get more information:
- “pcfitplane” function: https://www.mathworks.com/help/vision/ref/pcfitplane.html
- Point cloud: https://www.mathworks.com/help/vision/ref/pointcloud.html
- “pcShow” function: https://www.mathworks.com/help/vision/ref/pcshow.html
Hope this helps!
Vedere anche
Categorie
Scopri di più su Point Cloud Processing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!