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.
Finding Concave Faces
Manfred_S
Member Posts: 3 EDU
Hello All,
I am just a beginner with featurescript and I am having trouble finding concave connected faces of a solid part, using featurescript. When I tried using the code shown below the debug showed all the faces of the selected solid part not just the concave connected faces.
The aim is to find the concave edges using these faces but there may be an easier way than way I am trying to do it currently. I will also want to find all the convex edges of the part eventually.
Could someone help me out please?
Thanks,
Manfred
Here is the code i was trying to use:
I am just a beginner with featurescript and I am having trouble finding concave connected faces of a solid part, using featurescript. When I tried using the code shown below the debug showed all the faces of the selected solid part not just the concave connected faces.
The aim is to find the concave edges using these faces but there may be an easier way than way I am trying to do it currently. I will also want to find all the convex edges of the part eventually.
Could someone help me out please?
Thanks,
Manfred
Here is the code i was trying to use:
FeatureScript 1188;
import(path : "onshape/std/geometry.fs", version : "1188.0");
export const LENGTH_BOUND =
{
(millimeter) : [0, 2.5, 1e10]
} as LengthBoundSpec;
export const LENGTH_BOUND2 =
{
(millimeter) : [0, 2.5, 1e10]
} as LengthBoundSpec;
annotation { "Feature Type Name" : "Fillet Plus" }
export const myFillet = defineFeature(function(context is Context, id is Id, definition is map)
precondition
{
annotation { "Name" : "Parts to Fillet", "Filter" : EntityType.BODY && BodyType.SOLID, "MaxNumberOfPicks" : 1e10 }
definition.part is Query;
annotation { "Name" : "Edges to Exclude", "Filter" : EntityType.EDGE, "MaxNumberOfPicks" : 1e10 }
definition.edgesExcl is Query;
annotation { "Name" : "Faces to Exclude", "Filter" : EntityType.FACE, "MaxNumberOfPicks" : 1e10 }
definition.facesExcl is Query;
annotation { "Name" : "Convex Radius" }
isLength(definition.convexR, LENGTH_BOUND);
annotation { "Name" : "Concave Radius" }
isLength(definition.concaveR, LENGTH_BOUND2);
}
{
var allEdges = qOwnedByBody(definition.part, EntityType.EDGE);
var edgesExclEdge = qSubtraction(allEdges, definition.edgesExcl);
var faceEdges = qEdgeAdjacent(definition.facesExcl, EntityType.EDGE);
var edgesExclFaceEdge = qSubtraction(edgesExclEdge, faceEdges);
var partFaces = qOwnedByBody(definition.part, EntityType.FACE);
var concaveFaces = qConcaveConnectedFaces(partFaces);
debug(context, concaveFaces);
});
Tagged:
0
Comments
Thanks for your help.
Here is the simple block that I am using to test the script.