How do you get faces cut out by opSplitFace
dave_cowden
Member, Developers Posts: 484 ✭✭✭
Suppose I start with a face, like definition.someFace. I have found that if I do this:
opSplitFace(context, splitFaceId, {
"faceTargets" : definition.someFace,
"edgeTools": edgeTools,
"direction": surfaceTangentPlane.normal
});
debug(context, qCreatedBy(splitFaceId, EntityType.FACE) );qCreatedBy(splitFaceId) does not return any results.
What I expected to get was the faces that were stamped out by the cutting tool.
Instead, after opSplitFace, I find that definition.someFace now returns all of the faces. qNthElement(definition.someFace,0) returns indeterministic results.
What I want to get is a reference to the faces that were 'cut out' by the edges. But I cannot find out a good way to do that.
Any suggestions?
0
Answers
-
Would taking the edges of definition.someFace before the split, and subtracting the faces edge-adjacent to those edges after the split from the set of all faces do the right thing? Something like (untested code, beware):
var edges = qUnion(evaluateQuery(context, qEdgeAdjacent(definition.someFace, EntityType.EDGE)));
// Now do the split here
var stampedFaces = qSubtraction(qCreatedBy(splitFaceId, EntityType.FACE), qEdgeAdjacent(edges, EntityType.FACE));Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc0 -
Thanks thats a good direction I'll try something along those lines.
I also tried qDependency hoping that the stamped out faces woudl be a dependency of the original edges, but that did not work.
0 -
Oh, wait-- that doesn't work, because qCreatedBy(splitFaceId, EntityType.FACE) does not return any results.... It appears to be one of those operations like opTransform that just modifies the original queries, rather than populating its own results.
0 -
You are right, I think -- then using definition.someFace after the split instead of qCreatedBy(splitFaceId, EntityType.FACE) should work.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc0

