-
Notifications
You must be signed in to change notification settings - Fork 0
/
Tet.m
77 lines (56 loc) · 1.86 KB
/
Tet.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
% Code implementing the paper "Injective and Bounded Mappings in 3D".
% Disclaimer: The code is provided as-is and without any guarantees. Please contact the author to report any bugs.
% Written by Noam Aigerman, http://www.wisdom.weizmann.ac.il/~noamaig/
classdef Tet<handle
%Class for the basic primitive (tri\tet)
properties
inds;
sframe;
tframe;
scoords;
tcoords;
gscoords;
gtcoords;
A;
target_matrix=[];
delta;
sv;
left_coef_mat=[];
global_left_coef_mat=[];
initial_A=[];
last_global_A=[];
B=[];
volume=-inf;
closest_BD;
normal=[];
normal_vote=[];
centroid;
end
methods
function obj = Tet(coords,SD,TD,inds,tframe,sframe,sv)
obj.A=diag(sv);
if TD~=SD
obj.A=[obj.A;0 0];
end
obj.target_matrix=obj.A;
obj.last_global_A=tframe*obj.A*sframe';
obj.scoords=zeros(SD,size(inds,2));
obj.tcoords=zeros(TD,size(inds,2));
obj.tframe=tframe;
obj.sframe=sframe;
obj.initial_A=tframe*obj.A*sframe';
obj.delta=zeros(TD,1);
obj.sv=sv;
obj.gscoords=coords;
obj.volume=primitive_volume(obj.gscoords,SD);
obj.gtcoords=zeros(TD,length(inds));
obj.inds=inds;
assert(min(size(obj.gscoords))==SD);
A=[obj.gscoords;ones(1,size(obj.gscoords,2))];
A=inv(A);
A=A(:,1:end-1);
obj.global_left_coef_mat=A;
set_left_coef_matrix(obj);
end
end
end