Skip to content

Commit

Permalink
3Dfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
tknopp committed Oct 21, 2022
1 parent 11919e6 commit a9d2229
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/Vessel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ function vesselPath(N::NTuple{3,Int};
if all( 1 .<= route[end] .< N) # check whether image boundaries are reached
if i<=length(step_angle_xy) && i<=length(step_angle_xz) # both angles are still changing
push!(route, route[end] .+
stepsize .* (cos(angle_xy+step_angle_xy[i]), sin(angle_xy+step_angle_xy[i]), sin(angle_xz + step_angle_xz[i])) )
stepsize .* (cos(angle_xy + step_angle_xy[i])*cos(angle_xz + step_angle_xz[i]),
sin(angle_xy + step_angle_xy[i])*cos(angle_xz + step_angle_xz[i]),
sin(angle_xz + step_angle_xz[i])) )
elseif i>length(step_angle_xy) && i<=length(step_angle_xz) # only xz-angle changes
push!(route, route[end] .+
stepsize .* (cos(angle_xy+change_angle_xy), sin(angle_xy+change_angle_xy), sin(angle_xz + step_angle_xz[i])) )
stepsize .* (cos(angle_xy + change_angle_xy)*cos(angle_xz + step_angle_xz[i]),
sin(angle_xy + change_angle_xy)*cos(angle_xz + step_angle_xz[i]),
sin(angle_xz + step_angle_xz[i])) )
elseif i<=length(step_angle_xy) && i>length(step_angle_xz) # only xy-angle changes
push!(route, route[end] .+
stepsize .* (cos(angle_xy+step_angle_xy[i]), sin(angle_xy+step_angle_xy[i]), sin(angle_xz + change_angle_xz)) )
stepsize .* (cos(angle_xy+step_angle_xy[i])*cos(angle_xz + change_angle_xz),
sin(angle_xy+step_angle_xy[i])*cos(angle_xz + change_angle_xz),
sin(angle_xz + change_angle_xz)) )
end
end
end
Expand All @@ -64,7 +70,9 @@ function vesselPath(N::NTuple{3,Int};
angle_xz = angle_xz + change_angle_xz
else
# if no directional change
push!(route, route[end] .+ stepsize .* (cos(angle_xy), sin(angle_xy), sin(angle_xz))) # use old angle
push!(route, route[end] .+ stepsize .* (cos(angle_xy)*cos(angle_xz),
sin(angle_xy)*cos(angle_xz),
sin(angle_xz))) # use old angle
end


Expand Down

0 comments on commit a9d2229

Please sign in to comment.