372 {
373 double minh = std::min(sind(a1) * D, sind(a4) * C);
374 double h2 = minh / 2;
375 double db = (tand(a1 - 90) - tand(a4 - 90)) * h2 / 2;
376
377 map<int, G4ThreeVector> v;
378 v[5] = G4ThreeVector(-A / 2 + db, -h2, -150);
379 v[6] = v[5] + moveto(D, a1);
380 v[8] = G4ThreeVector(A / 2 + db, -h2, -150);
381 v[7] = v[8] + moveto(C, 180 - a4);
382
383
384 G4ThreeVector vB = v[7] - v[6], va(a, 0, 0), vd = moveto(d, a1), vc = moveto(c, 180 - a4);
385 double delta = vB.cross(va + vc - vd).z() / vB.cross(vc + vd).z();
386
387 vd *= 1 + delta;
388 vc *= 1 - delta;
389
390 v[1] = v[5] + G4ThreeVector((H_aA * cosd(a1) + H_dD) / sind(a1), H_aA, 300);
391 v[2] = v[1] + vd;
392 v[4] = v[1] + va;
393 v[3] = v[4] + vc;
394
395 for (int j = 1; j <= 8; j++) v[j] = G4ThreeVector(v[j].x(), -v[j].y(), -v[j].z());
396
397
398
399
400
401
402 if (wrapthick != 0) {
403 map<int, G4ThreeVector> nv;
404 nv[1] = newvertex(wrapthick, v[1], v[5], v[2], v[4]);
405 nv[2] = newvertex(wrapthick, v[2], v[6], v[3], v[1]);
406 nv[3] = newvertex(wrapthick, v[3], v[7], v[4], v[2]);
407 nv[4] = newvertex(wrapthick, v[4], v[8], v[1], v[3]);
408 nv[5] = newvertex(wrapthick, v[5], v[1], v[8], v[6]);
409 nv[6] = newvertex(wrapthick, v[6], v[2], v[5], v[7]);
410 nv[7] = newvertex(wrapthick, v[7], v[3], v[6], v[8]);
411 nv[8] = newvertex(wrapthick, v[8], v[4], v[7], v[5]);
412 std::swap(nv, v);
413 }
414
415 return v;
416 }