@@ -516,14 +516,25 @@ local function layout_process_in (param, pseq)
516
516
local shift
517
517
for i, line in srv:iter() do
518
518
local ext_line = srv[max(1, i-1)]
519
+ local elm = seq[line.eidx]
519
520
shift = vector{ext_line.x, ext_line.y, ext_line.z}
520
- local elm_rot = (line.kind=="sbend" or
521
- line.kind=="rbend" and seq[line.eidx].true_rbend == false)
522
- and matrix(3):roty(-line.angle/2)
523
- or 1
524
- local rot = ext_line.__map * elm_rot
521
+ local rot = ext_line.__map
522
+ local translation = vector(3)
523
+ if elm then
524
+ local kind, e1, e2 in elm
525
+ if kind=="rbend" and not (e1 and e2) then
526
+ if e1 then
527
+ rot:mul(matrix(3):roty(-e1), rot)
528
+ else
529
+ rot:mul(matrix(3):roty(e2 - elm.angle), rot)
530
+ translation[1] = -arc2cord(elm.l, elm.angle)*sin((e2-elm.angle/2))
531
+ end
532
+ elseif kind=="sbend" or kind=="rbend" then
533
+ rot:mul(matrix(3):roty(-line.angle/2), rot)
534
+ end
535
+ end
525
536
526
- data[i] = {rot, shift} -- Save the rotation and shift
537
+ data[i] = {rot, shift + translation } -- Save the rotation and shift
527
538
shift = layproj * shift -- Rotate the shift to x-y plane for the bline
528
539
pseq.xmin, pseq.xmax = min(pseq.xmin, shift[1]), max(pseq.xmax, shift[1])
529
540
pseq.ymin, pseq.ymax = min(pseq.ymin, shift[2]), max(pseq.ymax, shift[2])
0 commit comments