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

Function CrossSectionToObjThree

src/cpp/test/dumpToThree.h:496–523  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

494 }
495
496 inline std::string CrossSectionToObjThree(const std::vector<webifc::geometry::IfcCrossSections>& geom)
497 {
498 std::stringstream obj;
499 for (uint32_t ia = 0; ia < geom.size(); ia++)
500 {
501 for (uint32_t ic = 0; ic < geom[ia].curves.size(); ic++)
502 {
503 for (uint32_t ip = 0; ip < geom[ia].curves[ic].points.size(); ip++)
504 {
505 glm::dvec3 t = glm::dvec4(geom[ia].curves[ic].points[ip].x, geom[ia].curves[ic].points[ip].y, 0, 1);
506 obj << "v " << t.x << " " << t.y << " " << t.z << "\n";
507 }
508 }
509 }
510 uint32_t idx = 0;
511 for (uint32_t ia = 0; ia < geom.size(); ia++)
512 {
513 for (uint32_t ic = 0; ic < geom[ia].curves.size(); ic++)
514 {
515 for (uint32_t ip = 0; ip < geom[ia].curves[ic].points.size() - 1; ip++)
516 {
517 obj << "l " << (idx) << " " << (idx + 1) << "\n";
518 idx++;
519 }
520 }
521 }
522 return obj.str();
523 }
524
525 inline std::string ToObjThree(const webifc::geometry::IfcGeometry& geom, size_t& offset, const glm::dmat4& transform, double inputScale = 1.0)
526 {

Callers 1

DumpCrossSectionsThreeFunction · 0.85

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected