qSubtraction part edges vs sketch edges?
MichaelPascoe
Member Posts: 2,965 PRO
I'm trying to preform a qSubtraction by subtracting the edges of a face and desired excluded edges. The subtraction works when both selections are on a part, but it doesn't work when the selection is a sketch face and a sketch edge belonging to the sketch face.
How would I preform a qSubtraction between the edges of a selected sketch face, and one of the edges selected on the same face?
Here is the code for the edges:
Part selection results:

Sketch selection results:

How would I preform a qSubtraction between the edges of a selected sketch face, and one of the edges selected on the same face?
Here is the code for the edges:
annotation { "Name" : "Path faces", "Filter" : EntityType.FACE }
definition.face is Query;
annotation { "Name" : "Exclude edges" }
definition.excludeEdges is boolean;
if (definition.excludeEdges == true)
{
annotation { "Name" : "Edges of path to exclude", "Filter" : EntityType.EDGE }
definition.excludedEdges is Query;
}
var loopedEdges =
qSubtraction(
qAdjacent(pathFaces[count], AdjacencyType.EDGE, EntityType.EDGE),
definition.excludedEdges
);
debug(context, loopedEdges, DebugColor.GREEN);Part selection results:

Sketch selection results:

▚▞▚▞▚▞▚▞▚
Tagged:
0
Best Answer
-
The sketch edges rendered on the screen are not adjacent to the sketch face. They belong to different bodies. You could use
var trackingQs = []; for (var edge in evaluateQuery(context, definition.excludedEdges)) { const edgeTracking = startTracking(context, {"subquery" : edge, "lastOperationId": lastModifyingOperationId(context, edge)}); trackingQs = append(trackingQs, edgeTracking); } const remainingFaceEdges = qSubtraction(qAdjacent..., qUnion(trackingQs));1
Answers
-
The sketch edges rendered on the screen are not adjacent to the sketch face. They belong to different bodies. You could use
var trackingQs = []; for (var edge in evaluateQuery(context, definition.excludedEdges)) { const edgeTracking = startTracking(context, {"subquery" : edge, "lastOperationId": lastModifyingOperationId(context, edge)}); trackingQs = append(trackingQs, edgeTracking); } const remainingFaceEdges = qSubtraction(qAdjacent..., qUnion(trackingQs));1 -
-
-
@MichaelPascoe
It is unfortunately rather obscure, very much informed by how we handle sketch geometry. startTracking is a useful mechanism for linking input geometry with results of operations.2

