@@ -109,12 +109,14 @@ CurveNetwork* SurfaceParameterizationQuantity::createCurveNetworkFromSeams(std::
109109 }
110110
111111 // Populate data on the host
112- coords.ensureHostBufferPopulated ();
113112 parent.triangleCornerInds .ensureHostBufferPopulated ();
114113 parent.triangleVertexInds .ensureHostBufferPopulated ();
115114 parent.edgeIsReal .ensureHostBufferPopulated ();
116115 parent.vertexPositions .ensureHostBufferPopulated ();
117116
117+ // expand out the coords buffer based on how the quantity is indexed
118+ std::vector<glm::vec2> cornerCoords = getCornerCoords ();
119+
118120 // helper to canonicalize edge direction
119121 auto canonicalizeEdge = [](std::pair<int32_t , int32_t >& inds, std::pair<glm::vec2, glm::vec2>& coords)
120122 {
@@ -141,7 +143,7 @@ CurveNetwork* SurfaceParameterizationQuantity::createCurveNetworkFromSeams(std::
141143 int32_t iC_tail = parent.triangleCornerInds .data [3 *iT + (k+0 )%3 ];
142144 int32_t iC_tip = parent.triangleCornerInds .data [3 *iT + (k+1 )%3 ];
143145 std::pair<int32_t , int32_t > eInd (iV_tail, iV_tip);
144- std::pair<glm::vec2, glm::vec2> eC (coords. data [iC_tail], coords. data [iC_tip]);
146+ std::pair<glm::vec2, glm::vec2> eC (cornerCoords [iC_tail], cornerCoords [iC_tip]);
145147 canonicalizeEdge (eInd, eC); // make sure ordering is consistent
146148
147149 // increment the count
@@ -178,7 +180,7 @@ CurveNetwork* SurfaceParameterizationQuantity::createCurveNetworkFromSeams(std::
178180 for (const std::pair<int32_t , int32_t >& edge: seamEdges) {
179181 int32_t vA = edge.first ;
180182 int32_t vB = edge.second ;
181-
183+
182184 // get unique vertices for the edges
183185 if (vertexIndToDense.find (vA) == vertexIndToDense.end ()) {
184186 vertexIndToDense[vA] = seamEdgeNodes.size ();
@@ -196,7 +198,6 @@ CurveNetwork* SurfaceParameterizationQuantity::createCurveNetworkFromSeams(std::
196198 }
197199
198200 // add the curve network
199-
200201 return registerCurveNetwork (structureName, seamEdgeNodes, seamEdgeInds);
201202}
202203
@@ -227,6 +228,11 @@ void SurfaceCornerParameterizationQuantity::fillCoordBuffers(render::ShaderProgr
227228 p.setAttribute (" a_value2" , coords.getIndexedRenderAttributeBuffer (parent.triangleCornerInds ));
228229}
229230
231+
232+ std::vector<glm::vec2> SurfaceCornerParameterizationQuantity::getCornerCoords () {
233+ return coords.getIndexedView (parent.triangleCornerInds );
234+ }
235+
230236void SurfaceCornerParameterizationQuantity::buildCornerInfoGUI (size_t cInd) {
231237
232238 glm::vec2 coord = coords.getValue (cInd);
@@ -254,6 +260,10 @@ void SurfaceVertexParameterizationQuantity::fillCoordBuffers(render::ShaderProgr
254260 p.setAttribute (" a_value2" , coords.getIndexedRenderAttributeBuffer (parent.triangleVertexInds ));
255261}
256262
263+ std::vector<glm::vec2> SurfaceVertexParameterizationQuantity::getCornerCoords () {
264+ return coords.getIndexedView (parent.triangleVertexInds );
265+ }
266+
257267void SurfaceVertexParameterizationQuantity::buildVertexInfoGUI (size_t vInd) {
258268
259269 glm::vec2 coord = coords.getValue (vInd);
0 commit comments