Skip to content

Commit

Permalink
update user manual
Browse files Browse the repository at this point in the history
  • Loading branch information
dlegland committed Dec 20, 2023
1 parent cae5485 commit beed918
Show file tree
Hide file tree
Showing 8 changed files with 540 additions and 128 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
%DEMO_DISTANCEPOINTMESH_DODECAHEDRON One-line description here, please.
%
% output = demo_distancePointMesh_dodecahedron(input)
%
% Example
% demo_distancePointMesh_dodecahedron
%
% See also
%

% ------
% Author: David Legland
% e-mail: [email protected]
% INRAE - BIA Research Unit - BIBS Platform (Nantes)
% Created: 2023-12-20, using Matlab 23.2.0.2409890 (R2023b) Update 3
% Copyright 2023 INRAE.

mesh = createDodecahedron;
mesh.vertices = mesh.vertices * 30 + 50;

hf1 = figure; hold on; axis equal; axis([0 100 0 100 0 100]); view(3);
drawMesh(mesh, 'faceAlpha', 0.5, 'faceColor', [.5 .5 .5]);
print(gcf, 'distancePointMesh_dodecahedron_init.png', '-dpng');

[x, y] = meshgrid(1:100, 1:100);
z = ones(size(x)) * 50;

pts = [x(:) y(:) z(:)];
distMap = reshape(distancePointMesh(pts, mesh), size(x));
figure; imshow(distMap, [0 max(distMap(:))]); colormap('parula');

figure(hf1);
surf(x, y, z, distMap, 'linestyle', 'none');
print(gcf, 'distancePointMesh_dodecahedron_view3d.png', '-dpng');

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
%DEMO_POLYGONSIGNATURE_RECTANGLE One-line description here, please.
%
% output = demo_polygonSignature_rectangle(input)
%
% Example
% demo_polygonSignature_rectangle
%
% See also
%

% ------
% Author: David Legland
% e-mail: [email protected]
% INRAE - BIA Research Unit - BIBS Platform (Nantes)
% Created: 2023-12-20, using Matlab 23.2.0.2409890 (R2023b) Update 3
% Copyright 2023 INRAE.


%% Input data

rect = [20 30 60 40];
poly = rectToPolygon(rect);
refPoint = [50 50];

figure; hold on; axis equal; axis([0 100 0 100]);
drawPolygon(poly, 'k');
drawPoint(refPoint, 'bo');

print(gcf, 'polygonSignature_rectangle_init.png', '-dpng');

%% compute signature

angles = 0:360;
signature = polygonSignature(poly, angles, refPoint);

figure; set(gca, 'fontsize', 14);
plot(angles, signature);
xlim(angles([1 end]));
set(gca, 'XTick', 0:45:360);
ylim([0 40]);
xlabel('Ray angle');
ylabel('Distance to reference point');
title('Polygon signature of rectangle')

print(gcf, 'polygonSignature_rectangle_signature.png', '-dpng');
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit beed918

Please sign in to comment.