Is a child section's 0 end xyz always the same as its parent's 1 end xyz?
Good question. Looks like you (and probably a lot of other people) have some reading, or maybe re-reading, to do in the Programmer's Reference.
The answer is no, and for two reasons.
Reason 1.
Read the Programmer's Reference documentation of
connect
to discover that the 0 or 1 end of a child section can be connected to any node of the parent section. "Node" means a location along a section at which membrane potential is computed. A section's nodes are discrete locations at which membrane potential is computed, either by numerical integration of an ODE (the internal nodes i.e. segment centers) or algebraically by resolution of boundary conditions (the nodes at 0 and 1). In most cases it is best to connect the 0 end of a child section to the 1 end of its parent, but there are exceptions. One exception is when the parent section is the root section of a cell (the section that has no parent).
For example, consider a pyramidal cell which has a soma to which the following are attached:
an axon
basilar dendrites
an apical trunk
It would make sense attach the proximal (i.e. 0) end of the axon to the 0 end of the soma, the proximal (i.e. 0) ends of the basilar dendrites to the middle (0.5 node) of the soma, and the proximal (i.e. 0) end of the apical trunk to the 1 end of the soma.
For another example, consider how to represent spines attached along the length of a dendrite. The proximal ends of spine neck sections will be attached to the internal nodes of the section that represents the dendrite.
I have never seen a situation in which it is useful to connect the 1 end of a child section to any node of a parent section.
Reason 2.
The pt3d statements that specify the shape of a section set up a table of xyzdiam data ("pt3d info") that governs the shape of that section and where that section will be rendered in a shape plot. However, that section can be connected to any parent section, regardless of whether any node of the parent and child have the same xyz coordinates. If define_shape() is now called--or if a shape plot is created, which has the side-effect of calling define_shape()--the child's pt3d info will be translated so that its first point is at the same location as the parent. So if you created two sections foo and bah whose pt3d info were
0,0,0,1
10,0,0,1
and
0,0,0,1
0,10,0,1
respectively, and they weren't connected to each other, in a shape plot they would look like an L, or the lower left corner of a square. But if you then did
foo.connect(bah,1)
you'd get something that looks like an upper case gamma, or the upper left corner of a square.
In some cases this translation would make the shape plot of a model cell look different from the biological original. A typical example is branches that are physically attached to various locations at the soma's surface. In terms of electrical signaling, they are attached to the middle or the 0 or 1 ends of the soma, but a rendering of the resulting model would look strange. pt3dstyle() can be used to prevent such translation.
Make sure that you read the Programmer's Reference entries about
3-D specification of geometry, including
define_shape() and
pt3dstyle().