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

Function ToObjThree

src/cpp/test/dumpToThree.h:525–541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

523 }
524
525 inline std::string ToObjThree(const webifc::geometry::IfcGeometry& geom, size_t& offset, const glm::dmat4& transform, double inputScale = 1.0)
526 {
527 std::stringstream obj;
528 double scale = inputScale;
529 for (uint32_t i = 0; i < geom.numPoints; i++)
530 {
531 glm::dvec4 t = transform * glm::dvec4(geom.GetPoint(i), 1);
532 obj << "v " << t.x * scale << " " << t.y * scale << " " << t.z * scale << "\n";
533 }
534 for (uint32_t i = 0; i < geom.numFaces; i++)
535 {
536 bimGeometry::Face f = geom.GetFace(i);
537 obj << "f " << (f.i0 + 1 + offset) << "// " << (f.i1 + 1 + offset) << "// " << (f.i2 + 1 + offset) << "//\n";
538 }
539 offset += geom.numPoints;
540 return obj.str();
541 }
542
543 inline std::string ToObjThree(webifc::geometry::IfcComposedMesh& mesh, webifc::geometry::IfcGeometryProcessor& processor, size_t& offset, glm::dmat4 mat = glm::dmat4(1))
544 {

Callers 3

makeThreeJSViewerFunction · 0.85
DumpFlatMeshThreeFunction · 0.85

Calls 3

GetGeometryMethod · 0.80
GetPointMethod · 0.45
GetFaceMethod · 0.45

Tested by

no test coverage detected