-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterface.m
More file actions
49 lines (36 loc) · 1.29 KB
/
Interface.m
File metadata and controls
49 lines (36 loc) · 1.29 KB
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
function Interfac = Interface(type, xloc, fn,radius)
%INTERFACE define the different interfaces
% % TYPE
% type= 1 flat or Inclined depending on fn
% xloc= location of the interface, fn= the normal at the interface,
% radius=0 (NO RADIUS!)
% fn=normal to the interface
%
% type= 2 cylinder
% xloc= struct cointaing x and y of the center of the cylinder, fn= the inclination of the cylinder,
% radius= radius of the cylinder
% fn= bone inclination
switch(type)
case 1 %flat or inclined plane
Interfac.type=1;
Interfac.xi= xloc;
%Interfac.normal=[1;0;0]; %normal to the plane
% Interfac.normal=Find_normal_plane_inclined( bet, gamm);
Interfac.normal= fn;
Interfac.point=[xloc;0;0]; %point belonging to the plane
% Interfac.xf=[xend;0;0];
% ... other cases
case 2 % cylinder
BoneIncl=fn;
sinI=sin(BoneIncl/180*pi);
cosI=cos(BoneIncl/180*pi);
xcenter=xloc.x;
ycenter=xloc.y;
Interfac.type=2;
Interfac.center=[xcenter; ycenter; 0];
Interfac.dir=[sinI; 0;cosI];% Direction of the cylinder
Interfac.radius=radius;%radius
Interfac.xi= xcenter-radius; % I need that to order the interfaces!
% ..
end
end