Open cwsmith opened 2 years ago
Here is something closer to the final form inputs: dimi (dimension of entity), tagi (tag of entity), gf (model face whose closure is to be checked) output: ff is -1 if not in closure or the counted closure match (not tag though that could be added).
269 gmi_ent* gf;
270 gmi_ent* gt;
271 int dimi,ff,tagi,k;
279 ff=-1;
284 if(dimi ==2 && gf==gt) ff=ifaceS;
285 else if(dimi < 2) { // check this face's edges and those edges vertices
286 gmi_ent* ge=gmi_find(model,dimi,tagi);
287 gmi_set* Edges = gmi_adjacent(model,gf,1);
288 k=0;
289 while(k<((Edges->n)) && ff==-1){ // check all edges until one found
290 if(dimi==1) {
291 if(ge==Edges->e[k]) ff=k; // edges must be checked.
292 } else {
293 gmi_set* Verts = gmi_adjacent(model,Edges->e[k],0);
294 for (int j = 0; j < Verts->n; j++)
295 if(ge==Verts->e[j]) ff=j;
296 }
297 k++;
298 }
Thanks to @KennethEJansen for providing an initiail implementation of the topo model's function for
gmi_is_in_closure_of
. I think it could be added togmi_base.c
. test/inClosureOf_test.cc should then be supported by Simmetrix SimModSuite models anddmg
models (it currently crashes when a.dmg
model is loaded).