Daniel Posted July 7, 2007 Share Posted July 7, 2007 I'm trying to determine if 2 points are part of the same connected mesh, looks like the GEO_PointConnector class is what I want.. just can't figure out how to use it. Anyone know how to use this mysterious class? Or another away to achieve the same thing? This class has a method: bool arePointsConnected (GEO_Point &pt0, GEO_Point &pt1) Sounds Perfect!.. if I can just get it to work Looks like you need to prime it with a point and it then builds some sort of point tree from that before you can test connectivity, but I just can't get anything working. Thanks for any help. I've mailed support at sidefx as well, so I'll post the answer if they mail me first.. though late on a Friday, I'm guessing I'll hear on Monday. Daniel Quote Link to comment Share on other sites More sharing options...
sibarrick Posted July 7, 2007 Share Posted July 7, 2007 Looks to me like you just prime it with a gdp, and then feed it 2 points to test if they are connected GEO_PointConnector connections(gdp); bool areConnected = connections.arePointsConnected(pt0, pt1); is this what you already tried? Quote Link to comment Share on other sites More sharing options...
Daniel Posted July 7, 2007 Author Share Posted July 7, 2007 Looks to me like you just prime it with a gdp, and then feed it 2 points to test if they are connectedGEO_PointConnector connections(gdp); bool areConnected = connections.arePointsConnected(pt0, pt1); is this what you already tried? Hey Simon, yes that's the first thing I tried. It appeared to tell me that the pts were connected even when I knew they weren't. I'm dyamically breaking meshes apart in pops (a softbody pop where edges can be cut based on strain). So during the sim points that are connected on one frame may not be on another. Maybe since I'm doing it in pops and all points are part of the same particle prim it always returns true. Sort of doubt it, I'm guessing I'm not using it correctly there are those "build" methods that make me think more needs to be done to get it working Daniel Quote Link to comment Share on other sites More sharing options...
sibarrick Posted July 8, 2007 Share Posted July 8, 2007 You may well be right about the single particle prim, I really can't see it working any other way than you tried. Anyway I guess Sesi will know. Quote Link to comment Share on other sites More sharing options...
Daniel Posted July 10, 2007 Author Share Posted July 10, 2007 You may well be right about the single particle prim, I really can't see it working any other way than you tried. Anyway I guess Sesi will know. Hey Simon, Yes, turns out the particle prim was an issue. I got very good support info back from Silvina at Sesi and he pointed me to another class as well as how to exclude the particle prim in the test, worked like a charm. Here's my func (the edgeCache is my own class for storing edge constraints): void POP_SoftBody::deleteBadAngleConstraints( float time, POP_ContextData* data) { edgeCache *e; GEO_Primitive *partprim; GEO_PointClassifier fclass; GB_PrimitiveGroup *partgrp = data->getDetail()->newPrimitiveGroup("__particle__", 1); FOR_MASK_PRIMITIVES(data->getDetail(), partprim, GEOPRIMPART) { partgrp->add(partprim); } fclass.classifyPoints(*data->getDetail(), partgrp); for(int i = 0; i < allEdges.size(); i++) { e=allEdges[i]; if(e->active && e->type == ANGLE) if (fclass.getClass(e->p0->getNum()) != fclass.getClass(e->p1->getNum())) e->active = 0; } data->getDetail()->destroyPrimitiveGroup(partgrp); } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.