MCPcopy Create free account
hub / github.com/ThatOpen/engine_web-ifc / ToObj

Function ToObj

src/cpp/test/io_helpers.cpp:149–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147 }
148
149 std::string ToObj(const webifc::geometry::IfcGeometry &geom, size_t &offset, glm::dmat4 transform, double inputScale)
150 {
151 std::stringstream obj;
152
153 double scale = inputScale;
154
155 for (uint32_t i = 0; i < geom.numPoints; i++)
156 {
157 glm::dvec4 t = transform * glm::dvec4(geom.GetPoint(i), 1);
158 obj << "v " << t.x * scale << " " << t.y * scale << " " << t.z * scale << "\n";
159 }
160
161 for (uint32_t i = 0; i < geom.numFaces; i++)
162 {
163 bimGeometry::Face f = geom.GetFace(i);
164 obj << "f " << (f.i0 + 1 + offset) << "// " << (f.i1 + 1 + offset) << "// " << (f.i2 + 1 + offset) << "//\n";
165 }
166
167 offset += geom.numPoints;
168
169 return obj.str();
170 }
171
172 std::string ToObj(webifc::geometry::IfcComposedMesh &mesh, webifc::geometry::IfcGeometryProcessor &processor, size_t &offset, glm::dmat4 mat)
173 {

Callers 4

DumpIfcGeometryToPathFunction · 0.70
DumpIfcGeometryFunction · 0.70
DumpFlatMeshFunction · 0.70
DumpMeshFunction · 0.70

Calls 3

GetGeometryMethod · 0.80
GetPointMethod · 0.45
GetFaceMethod · 0.45

Tested by

no test coverage detected