15 const std::string& vtntype,
bool point) {
22 }
else if (vtntype ==
"t") {
25 }
else if (vtntype ==
"vn") {
32 stream << vtntype <<
" " << scalor * vertex.x() <<
" " << scalor * vertex.y()
33 <<
" " << scalor * vertex.z() <<
'\n';
40 const std::vector<unsigned int>& vsides) {
42 size_t nsides = vsides.size();
43 unsigned int sstart =
start;
44 for (
auto vside : vsides) {
48 if (start - sstart < nsides - 1) {
49 stream <<
"f " << start <<
" " << start + 1 <<
" ";
50 stream << start + nsides + 1 <<
" " << start + nsides;
52 stream <<
"f " << start <<
" " << sstart <<
" ";
53 stream << sstart + nsides <<
" " << start + nsides;
64 const std::vector<Acts::Vector3D>& vertices,
66 const std::vector<unsigned int>& vsides) {
68 if (vertices.size() < 3)
71 unsigned int fvertex = vtnCounter.
vcounter + 1;
77 std::vector<int> sides = {0};
81 for (
auto side : sides) {
83 unsigned int cvc = vtnCounter.
vcounter;
85 for (
auto v : vertices)
87 v + (0.5 * side * thickness) * nvector,
"v");
91 for (
auto n = vertices.size(); 0 <
n; --
n)
92 stream << ++cvc <<
" ";
100 double scalor,
unsigned int nSegments,
104 std::vector<int> flip = {-1, 1};
105 std::vector<int> vfaces = {1, 2, 4, 3};
107 double phistep = 2 *
M_PI / nSegments;
109 std::vector<double> roffsets = {0.};
111 roffsets = {-0.5 *
thickness, 0.5 * thickness};
113 unsigned int cvc = vtnCounter.
vcounter;
115 for (
auto t : roffsets) {
118 for (; iphi < nSegments; ++iphi) {
120 double phi = -
M_PI + iphi * phistep;
121 for (
auto iflip : flip) {
127 writeVTN(stream, vtnCounter, scalor, point,
"v");
133 unsigned int soff = 2 * iside * nSegments;
134 for (; iphi < nSegments - 1; ++iphi) {
137 for (
auto face : vfaces)
138 stream << soff + cvc + (2 * iphi) + face <<
" ";
142 stream <<
"f " << soff + cvc + (2 * iphi) + 1 <<
" "
143 << soff + cvc + (2 * iphi) + 2 <<
" " << soff + cvc + 2 <<
" "
144 << soff + cvc + 1 <<
'\n';
152 if (thickness != 0.) {
154 for (iside = 0; iside < 2; ++iside) {
157 for (; iphi < nSegments - 1; ++iphi) {
159 unsigned int base = cvc + (2 * iphi) + 1;
160 stream << iside + base <<
" ";
161 stream << iside + base + 2 <<
" ";
162 stream << iside + base + (2 * nSegments) + 2 <<
" ";
163 stream << iside + base + (2 * nSegments) <<
'\n';
167 stream << iside + cvc + (2 * iphi) + 1 <<
" ";
168 stream << iside + cvc + 1 <<
" ";
169 stream << iside + cvc + 1 + (2 * nSegments) <<
" ";
170 stream << iside + cvc + (2 * iphi) + 1 + (2 * nSegments) <<
'\n';
187 p += 3 * uu * t * p1;
188 p += 3 * u * tt * p2;