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.
opExtrude UP_TO_FACE Issue
aaron_skidmore
Member Posts: 34 ✭✭
Hi there, when I opExtrude as per below if the regionToExtrude is within the boundaries of the bottomface, it works ok, but if the regionToExtrude is outside the boundaries of the bottomface it doesnt work, is this expected behavior?
opExtrude(context, id + "extrude1",
{ "entities" : regionToExtrude,
"direction" : zDirection *-1,
"endBound" : BoundingType.UP_TO_FACE,
"endBoundEntity" : qNthElement(bottomface, 0),
"operationType" : NewBodyOperationType.NEW,
{ "entities" : regionToExtrude,
"direction" : zDirection *-1,
"endBound" : BoundingType.UP_TO_FACE,
"endBoundEntity" : qNthElement(bottomface, 0),
"operationType" : NewBodyOperationType.NEW,
"defaultScope" : true
});
Tagged:
0
Comments
-
Yes it is. If in doubt, try to replicate your use case using the regular modelling tools.Senior Director, Technical Services, EMEA0
-
Thanks Neil, so would I need to create a plane on the bottomface, then set endBoundEntity to that plane?0
-
Is bottomface planar? If so, that would work. If bottomface is parallel to your sketch plane, measure the distance and use blind.
Senior Director, Technical Services, EMEA0 -
Thanks Neil, I will go with measuring the distance and blind0
-
@aaron_skidmore
UP_TO_FACE is a deprecated option. Please use UP_TO_SURFACE instead, which will expand the given face to its infinite boundary, if possible. See: https://cad.onshape.com/FsDoc/library.html#BoundingType
Internally, when selecting the "Up to face" option in the extrude feature, you are actually selecting UP_TO_SURFACE enum. See the implementation here:
https://cad.onshape.com/documents/12312312345abcabcabcdeff/w/a855e4161c814f2e9ab3698a/e/0ef5bec0909d4235a5ca1ebb
Jake Rosenfeld - Modeling Team0 -
Thanks I have that all running now.

I am now struggling to find a way to get a solid bodies that intersection another solid body, via evCollision ? Or qIntersection ?0 -
evCollision tells you if the bodies collide. If you want to find the resultant body created by the intersection of two bodies use opBoolean. qIntersection is the intersection of two queries (not what you want here).Senior Director, Technical Services, EMEA0
-
Ni Neil, I am not after the intersection between the 2 bodies, I need given bodyA, what other bodies are intersecting bodyA, do I need to get all bodies and recursively run evCollision to test which ones intersect bodyA?0
-
evCollision will return an array of all collisions.Senior Director, Technical Services, EMEA0
-
So I could try to cycle through bodies 1 at a time testing evCollision against the selected body - if there is any collision arrays then that body intersects? Could the same thing be done with multiple qIntersextion?0
-
@aaron_skidmore
qIntersection is not a geometric concept. It is just a simple set intersection. For example if I had two queries that represented:
[face1, face3, face5] and [face1, face2, face3]
The intersection of those two queries is [face1, face3]
Similar to qUnion and qSubtraction, it is just a way to combine, find the overlap, or remove queries from each other. See: https://cad.onshape.com/FsDoc/library.html#qIntersection-array
evCollision ( https://cad.onshape.com/FsDoc/library.html#evCollision-Context-map ) will happily collide with multiple bodies at once.const collisions = evCollision(context, { "tools" : bodyA, "targets" : qEverything(EntityType.BODY) -> qBodyType(BodyType.SOLID) }); var targetBodyArray = []; for (var collision in collisions) { targetBodyArray = append(targetBodyArray, collision.targetBody) } // To de-duplicate, since collisions are per-face/edge const allTargetBodies = qUnion(targetBodyArray); debug(context, allTargetBodies);
Jake Rosenfeld - Modeling Team0 -
The weird -> thing is supposed to just be "->". Not sure what's going on there...Jake Rosenfeld - Modeling Team0
-
Thanks for you help guys - I will try and get that to work - i think I have bitten off more than I can chew for my first go at a FeatureScript!0


