MCPcopy Create free account
hub / github.com/IfcOpenShell/IfcOpenShell / emit_polyhedral_surface

Function emit_polyhedral_surface

src/serializers/TtlWktSerializer.cpp:52–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 const char* const POLYGON = "POLYGON";
51
52 void emit_polyhedral_surface(
53 std::ostream& os,
54 const std::vector<double>& vertices,
55 const std::vector<std::vector<std::vector<int>>>& faces)
56 {
57 os << "POLYHEDRALSURFACE Z(";
58
59 for (size_t i = 0; i < faces.size(); ++i) {
60 const auto& face = faces[i];
61 os << "(";
62 for (size_t j = 0; j < face.size(); ++j) {
63 const auto& loop = face[j];
64 os << "(";
65 for (size_t k = 0; k < loop.size(); ++k) {
66 int index = loop[k];
67 for (size_t l = 0; l < 3; ++l) {
68 os << vertices[index * 3 + l];
69 if (l != 2) {
70 os << " ";
71 }
72 }
73 if (k < loop.size() - 1) {
74 os << ", ";
75 }
76 }
77 os << ")";
78 if (j < face.size() - 1) {
79 os << ", ";
80 }
81 }
82 os << ")";
83 if (i < faces.size() - 1) {
84 os << ",";
85 }
86 }
87 os << ")";
88 }
89
90 void emit_line_component(
91 std::ostream& os,

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected