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.
easy way to find the end of a chain of edges?
adamohern
Member, OS Professional Posts: 216 PRO
I have an edge query that accepts multiple edges, and I make the assumption that those edges are contiguous.
What's the easiest way to create a sketch plane normal to this selection at one end or the other? I can think of ways to solve the problem by brute force, but I wonder if there is some built-in solution to make this easier?
What's the easiest way to create a sketch plane normal to this selection at one end or the other? I can think of ways to solve the problem by brute force, but I wonder if there is some built-in solution to make this easier?
0
Best Answer
-
ilya_baran Onshape Employees, Developers, HDM Posts: 1,211That depends on whether the edges are topologically contiguous (edges in the same body) or just geometrically contiguous (the vertices just happen to be in the same position, but the edges are different sketch entities or something else). In the latter case, it is brute force. In the former case, the following query will I think give you what you want:
const adjacentEdges = qSubtraction(qVertexAdjacent(inputEdges, EntityType.EDGE), inputEdges);
const endPoints = qIntersection([qVertexAdjacent(inputEdges, EntityType.VERTEX), qVertexAdjacent(adjacentEdges, EntityType.VERTEX)]);
In semi-English, adjacentEdges are those that touch one of the inputEdges at a vertex, but are not in inputEdges. endPoints are then vertices that are shared by both inputEdges and adjacentEdges.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc5
Answers
In semi-English, adjacentEdges are those that touch one of the inputEdges at a vertex, but are not in inputEdges. endPoints are then vertices that are shared by both inputEdges and adjacentEdges.