diff --git a/stim/visualization/fiber.h b/stim/visualization/fiber.h index 337b0a4..0bd67a8 100644 --- a/stim/visualization/fiber.h +++ b/stim/visualization/fiber.h @@ -274,6 +274,39 @@ public: T radius(int idx){ return r[idx]; } + /// get index of a node on a fiber + // by matching the node on fiber to already set vertices (both strings) + // used in obj file conversion + int + getIndexes(std::string* input, std::string searched, int sizeV) + { + int result = 0; + for (int i = 0; i < sizeV; i++) + { + if (input[i] == searched) + { + result = i + 1; + } + } + return result; + } + // strObj returns a string of fiber indices corresponding to vectors of positions in the fiber including intermediate nodes + std::string + strObj(std::string* strArray, int sizeV) + { + std::stringstream ss; + std::stringstream oss; + for(unsigned int i = 0; i < N; i++) + { + ss.str(std::string()); + for(unsigned int d = 0; d < 3; d++) + { + ss<