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.
How to tell if an edge is open or closed?
traveler_hauptman
Member, OS Professional, Mentor, Developers Posts: 419 PRO
What is the best way to tell if a single edge is open or closed? It seems like something an edge would know about itself?
Right now I have a big query to do the job:
Any better way?
Right now I have a big query to do the job:
and I worry that I'm missing some corner-case.
function isClosed(context is Context, edge is Query) returns boolean
{
var owner = qOwnerBody(edge);
var potential_vertices = qOwnedByBody(owner, EntityType.VERTEX);
var edge_vertices = qVertexAdjacent(edge,EntityType.VERTEX);
var result = size(evaluateQuery(context, qIntersection([potential_vertices,edge_vertices])));
if (result > 0){
return false;
}
return true;
}
Any better way?
0
Comments
So let's forget about the b-rep. To define a closed edge purely geometrically, how about:
If you don't want to allow noncontinuous endpoints, you can drop the
.origin
s.