-
Notifications
You must be signed in to change notification settings - Fork 4
/
ObliquePath.hoc
51 lines (36 loc) · 1.17 KB
/
ObliquePath.hoc
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
// This template creates the Basal Path lists, starting from the
// section attached to the trunk and ending with the basal tip section
// written by Terrence Brannon, modified by Yiota Poirazi, July 2001, [email protected]
begintemplate ObliquePath
public dtrunk_to_tip, trunk_section, root_oblique
strdef sexec
objref trunk_section
strdef trunk_section_name
objref root_oblique
strdef root_oblique_name
objref tip_section
strdef tip_section_name
objref oblique_path
proc init () {
sec_count=0
forsec $o1 {
if (sec_count==1) {
root_oblique = new SectionRef()
root_oblique_name=secname()
}
if (!sec_count) {
distance(0,1)
trunk_section = new SectionRef()
trunk_section_name=secname()
}
sec_count=sec_count+1
tip_section = new SectionRef()
tip_section_name=secname()
}
access root_oblique.sec
distance(0,0)
access tip_section.sec
dtrunk_to_tip=distance(1,1)
// printf("ObliquePath trunk_section: %s root_oblique: %s tip_section: %s distance between root_oblique and tip_section: %g\n", trunk_section_name, root_oblique_name, tip_section_name, dtrunk_to_tip)
}
endtemplate ObliquePath