Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. 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.

planeToWorld is off

skywinner26skywinner26 Member Posts: 5
edited April 2022 in Community Support
I'm using planeToWorld in my feature script to get the coordinates of a 2d point in 3d space but what the function returns is off from what it should be.
please help.

i'm trying to generate a bevel gear using only feature script(a bit like the official spur gear feature scipt) and i have 2 planes ,one the generate the cone and shape of the gear and an other plane to generate the gear tooth.I'm trying to use a point of the tooth plane in my cone plane but when changing a point coordinates to world coordinates the values given by planeToWorld are off.
document link(scripted bevel gear wip is the document with the problem): https://cad.onshape.com/documents/216704f1329f78fdec9132f2/w/3fee40f22fb2ff02f5a58658/e/66402d8518f150a673a6e1f1?renderMode=0&uiState=6251ee5004c9be7dde60bd86

Answers

  • Toshimichi_OdaToshimichi_Oda OS Professional Posts: 53 PRO
    I have not understood your whole script and its aim, but it may be good to change the following.

    Your part studio outputs warning in Feature Script notices.
    Please click {レ} and click Monitoring.

    The following warning is outputted.
    Typecheck canBePlane failed ...

    Changing variable-define
             var line4_3D=vector(
                sketchPlane.origin[0]-point3_3D[0],
                sketchPlane.origin[1]-point3_3D[1],
                sketchPlane.origin[2]-point3_3D[2]);

     to
            var line4_3D=vector(
                    point2_3D[0]-point3_3D[0],
                    point2_3D[1]-point3_3D[1],
                    point2_3D[2]-point3_3D[2]);

    The warning will not be outputted.

    I am surprised  typecheck-mismatch is not an error but a warning.

    I wish it threw exception and stopped regeneration.

  • skywinner26skywinner26 Member Posts: 5
    I reported my original problem as a bug,the onshape team figured out that it was because i created a plane without having my normal and x direction normal to each other.They are working on implementing an exception to prevent this from happening to other users.

    If you want to look at the original problem you should look at the v3 of the document.

    Thank you Toshimichi_Oda for your feedback,you were on the updated version of the script(i fixed the original problem on that one),the problem you reported was me copy-pasting things to quickly.


    To summarize,if planeToWorld is off just check if your plane has his axis normal to one another.
Sign In or Register to comment.