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.
Plane rotation

Hi,
I'm drawing sketch profiles onto faces of parts.
All parts but the last have the sketches drawn on their front faces.
The last part has the sketch drawn on the rear face.
I have use cases where I need the box profiles to be drawn tangential to the sketch line direction as in the image below - this works fine:
And use cases where I need the box profiles to be drawn tangential to the part edges as in the image below - this is where the problem lies:
The box profiles on the front faces rotate clockwise.
The box profile on the rear face rotates anti clockwise but I need it to rotate clockwise.
Which make sense but I'm not sure how to correct it.
My code for setting up the sketch planes is as below:
profilePlane = plane(config.intersectingPoints[formerIndex - 1], normal, config.isTangential ? lines.tangentLines[0].direction : cross(normal, config.sketchLineDirection));
I need to modify:
config.isTangential ? lines.tangentLines[0].direction
where lines.tangentLines represents the straight reference sketch lines
Any help appreciated.
Thank you.
Best Answer
-
EvanReese Member, Mentor Posts: 2,329 ✭✭✭✭✭
Ah I see better now what you're up do. You could maybe just make a new plane by taking the first plane and moving the origin of the last one. That way you don't need to know how the other planes are oriented. You just know they'll match.
const orientedLastPlane = plane(lastPlane.origin, firstPlane.normal, firstPlane.x);
Evan Reese
Independent Onshape Consultant | Industrial Designer0
Answers
I'm not sure I follow exactly, but can you flip the normal of the rear face plane to get the right behavior?
profilePlane.normal = -profilePlane.normal;
Independent Onshape Consultant | Industrial Designer
Thank you.
Flipping the normal doesn't work unfortunately.
The green arrow represents the normal direction of the front faces, the red arrow represents the flipped normal direction of the last part:
If not flipped then all normal directions are the same.
@graham_lock What is your question?
Learn more about the Gospel of Christ ( Here )
CADSharp - We make custom features and integrated Onshape apps! Learn How to FeatureScript Here 🔴
Ah I see better now what you're up do. You could maybe just make a new plane by taking the first plane and moving the origin of the last one. That way you don't need to know how the other planes are oriented. You just know they'll match.
const orientedLastPlane = plane(lastPlane.origin, firstPlane.normal, firstPlane.x);
Independent Onshape Consultant | Industrial Designer
Thank you @EvanReese this seems to work well!
More of an update than a question thanks @MichaelPascoe