Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
query strategy
EvanReese
Member, Mentor Posts: 2,144 ✭✭✭✭✭
I'm adding a new Slot Circle mode to my Speaker Pattern feature that makes something like this:
I want to fillet the internal corners of the cross-brace member. I'm able to query all of the edges produced by that cut, like this:
I think I should be able to qIntersection that with a query for all of the edges parallel with the normal direction, but I'm not sure how to do that or if that's the best way. Any ideas?
I want to fillet the internal corners of the cross-brace member. I'm able to query all of the edges produced by that cut, like this:
I think I should be able to qIntersection that with a query for all of the edges parallel with the normal direction, but I'm not sure how to do that or if that's the best way. Any ideas?
Evan Reese
0
Best Answers
-
kevin_o_toole_1 Onshape Employees, Developers, HDM Posts: 565You're right – Given those edges are on all different bodies, the interface for qParallelEdges doesn't fit your situation well.
Since you're using the query right away, it's perfectly okay to evaluate and filter the edges manually, which is what I would do here:var verticalEdges = []; for (var edge in evaluateQuery(context, cutBraceEdges)) { const edgeDef = evCurveDefinition(context, { "edge" : edge }); if (edgeDef is Line && parallelVectors(edgeDef.direction, Z_DIRECTION)) { verticalEdges = append(verticalEdges, edge); } } const edgesToFillet = qUnion(verticalEdges);
Note that the edge queries returned by evaluateQuery are transient queries, which means they won't be valid after an operation that could split, delete, extend those edges. So, I would only recommend this approach if you're looking to only use the query immediately (which looks like the case here).
That caveat and the verbosity of this solution are both good indications we should make a more general qParallelEdges on our end5 -
NeilCooke Moderator, Onshape Employees Posts: 5,688or
const edgesToFillet = qSubtraction(qCreatedBy(id + "boolean2", EntityType.EDGE), qAdjacent(qCapEntity(id + "extrude1", CapType.EITHER, EntityType.FACE), AdjacencyType.EDGE, EntityType.EDGE));
Senior Director, Technical Services, EMEAI6
Answers
Since you're using the query right away, it's perfectly okay to evaluate and filter the edges manually, which is what I would do here:
Note that the edge queries returned by evaluateQuery are transient queries, which means they won't be valid after an operation that could split, delete, extend those edges. So, I would only recommend this approach if you're looking to only use the query immediately (which looks like the case here).
That caveat and the verbosity of this solution are both good indications we should make a more general qParallelEdges on our end