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.
3D and 2D points not matching
Lee_Hesketh
Member, Developers Posts: 148 ✭✭✭
Hi all, hope you had a good Christmas and Happy New Year! I have encountered a problem yet again with my mortise and tenon script. I used the worldToPlane() function to use as a reference point for skRectangle(). I debugged the 3D point and added vectors to get the correct width between the two points and that works. The problem is that when I convert the 3D coordinates to use on the plane, draw the rectangle and then extrude, it doesn't extrude where I want it to and I don't know why.

Here is the file:https://cad.onshape.com/documents/580b256ade95e210af0261d8/w/1d22e17d9b07548059b7b311/e/119330903d9f0efa384481b9
Thanks
Lee Hesketh

Here is the file:https://cad.onshape.com/documents/580b256ade95e210af0261d8/w/1d22e17d9b07548059b7b311/e/119330903d9f0efa384481b9
Thanks
Lee Hesketh
There are 10 types of people in the world. Those who know binary, those who don't and those who didn't expect base 3!
Tagged:
0
Comments
Also could you explain what you are suggesting please?
I think it is just an error in the sign of your maths and where the origins of the face are (if you still can't work it out, post back)
if (tolerantEquals(centrePoint1[0], vertexPoint[0])) { if (centrePoint1[1] - vertexPoint[1] < 0) { h *= -1; width *= -1; } } if (tolerantEquals(centrePoint1[1], vertexPoint[1])) { if (centrePoint1[0] - vertexPoint[0] < 0) { h *= -1; width *= -1; } }https://cad.onshape.com/documents/57ebf15e06acf910d5ac1b09/w/5ad1d8c8be840c2c6f8f02b6/e/242e3449f5f40725d9f585ab