15 const Acts::Vector3&
vertex,
16 const std::string& vtntype,
25 }
else if (vtntype ==
"t") {
28 }
else if (vtntype ==
"n") {
36 <<
" " << scalor *
vertex.z() <<
'\n';
45 const std::vector<unsigned int>& vsides)
48 size_t nsides = vsides.size();
49 unsigned int sstart =
start;
50 for (
auto vside : vsides) {
54 if (
start - sstart < nsides - 1) {
72 const std::vector<Acts::Vector3>& vertices,
74 const std::vector<unsigned int>& vsides)
77 if (vertices.size() < 3)
return;
79 unsigned int fvertex = vtnCounter.
vcounter + 1;
81 Acts::Vector3 sideOne = vertices[1] - vertices[0];
82 Acts::Vector3 sideTwo = vertices[2] - vertices[1];
83 Acts::Vector3 nvector(sideTwo.cross(sideOne).normalized());
87 std::vector<int>
sides = {1};
88 if (thickness != 0.)
sides = {-1, 1};
92 unsigned int cvc = vtnCounter.
vcounter;
94 for (
auto v : vertices)
98 v + (0.5 *
side * thickness) * nvector,
106 for (
size_t i=0;
i<vertices.size();++
i)
stream << ++cvc << vtphr << ntphr <<
" ";
117 unsigned int nSegments,
124 std::vector<int> flip = {-1, 1};
125 std::vector<int> vfaces = {1, 2, 4, 3};
127 double phistep = 2 *
M_PI / nSegments;
129 std::vector<double> roffsets = {0.};
130 if (thickness != 0.) roffsets = {-0.5 * thickness, 0.5 * thickness};
132 unsigned int cvc = vtnCounter.
vcounter;
134 for (
auto t : roffsets) {
137 for (; iphi < nSegments; ++iphi) {
139 double phi = -
M_PI + iphi * phistep;
140 for (
auto iflip : flip) {
152 unsigned int soff = 2 * iside * nSegments;
153 for (; iphi < nSegments - 1; ++iphi) {
156 for (
auto face : vfaces)
stream << soff + cvc + (2 * iphi) + face <<
" ";
160 stream <<
"f " << soff + cvc + (2 * iphi) + 1 <<
" "
161 << soff + cvc + (2 * iphi) + 2 <<
" " << soff + cvc + 2 <<
" "
162 << soff + cvc + 1 <<
'\n';
169 Acts::Vector3 nvectorSide =
transform.rotation().col(2);
174 if (thickness != 0.) {
176 for (iside = 0; iside < 2; ++iside) {
179 for (; iphi < nSegments - 1; ++iphi) {
181 unsigned int base = cvc + (2 * iphi) + 1;
184 stream << iside +
base + (2 * nSegments) + 2 << ntphr <<
" ";
185 stream << iside +
base + (2 * nSegments) << ntphr <<
'\n';
189 stream << iside + cvc + (2 * iphi) + 1 << ntphr <<
" ";
190 stream << iside + cvc + 1 << ntphr <<
" ";
191 stream << iside + cvc + 1 + (2 * nSegments) << ntphr <<
" ";
192 stream << iside + cvc + (2 * iphi) + 1 + (2 * nSegments) << ntphr <<
'\n';