Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IAH public
DeProj
Commits
2633fda0
Commit
2633fda0
authored
Jun 30, 2020
by
Jean-Yves TINEVEZ
Browse files
Refactor center point into a function.
parent
7ba91408
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/area3d.m
View file @
2633fda0
...
...
@@ -3,15 +3,11 @@ function [ area, uncorr_area ] = area3d( o )
%% Deprojected 3D version.
p
=
o
.
boundary
;
% Put all vertex coordinates with respect to center.
p
=
centered_points
(
o
);
n_vertices
=
size
(
p
,
1
);
% Put all vertex coordinates with respect to center.
center
=
mean
(
p
);
center
=
repmat
(
center
,
[
n_vertices
,
1
]
);
p
=
p
-
center
;
% Build small triangles.
index
=
[
2
:
n_vertices
1
];
p1
=
p
;
...
...
src/centered_points.m
0 → 100644
View file @
2633fda0
function
p
=
centered_points
(
o
)
%CENTERED_POINTS Returns the 3D coordinates of the object bounds, with
%respect to its center.
p
=
o
.
boundary
;
n_vertices
=
size
(
p
,
1
);
center
=
mean
(
p
);
center
=
repmat
(
center
,
[
n_vertices
,
1
]
);
p
=
p
-
center
;
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment