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 find extent planes for a solid in a specific direction

I have created a feature script feature. The user can select
Before:

After:


Any ideas how to do this?
- S is Solid
- P is Plane
Before:

After:


Any ideas how to do this?
Tagged:
0
Comments
tight
option will give you 2 vectors and the direction of plane P will give you the normal, so you can construct 2 planes.in the arbitary case you may requare to construct local CS to pass into evBox3d, as X axis could be used normal of plane P, Z vector can be obtained by perpendicularVector(xVector)
The test result is
I would prefer the the planes are vertically aligned correctly but the result is not incorrect.
p = coordSystem(p);
b = evBox3d(context, {
b.minCorner = toWorld(p,b.minCorner);
b.maxCorner = toWorld(p,b.maxCorner);
opPlane(context, id+"minPlane",{
"plane": plane(b.minCorner, p.zAxis),
.....
});
opPlane(context, id+"maxPlane",{
"plane": plane(b.maxCorner, p.zAxis),
.....
});