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.

Creating Plane through 3 Points in featureScript

shane_pooleshane_poole Member Posts: 7
Does anyone have any tips for creating a new plane through 3 points. Have not had any luck with all test attempts of cPlane, opPlane, etc.

var b = vector(32, 56, 0) * millimeter;
var a = vector(88, 0, 0) * millimeter;
var c = vector(88,56,50) * millimeter;
var _origin = (a+b+c)/3;
var _normal = cross((c-a), (b-a));
var newplane = plane(_origin, _normal);

This at least creates a plane just not the correct one...
Any tips appreciated!

Answers

  • shane_pooleshane_poole Member Posts: 7
    Points relative to origin (0, 0, 0)
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,173
    Really?  That looks correct.  Posting a link to a version of a shared document would help debug this, if indeed it's the wrong plane.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • shane_pooleshane_poole Member Posts: 7

    Attempting to create plane ABC
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,173
    It looks like the plane is correctly going through a b and c and the points themselves are in the wrong place.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • shane_pooleshane_poole Member Posts: 7
    Alright, I will try and rework the points. Thanks for taking a look!
  • shane_pooleshane_poole Member Posts: 7
    Looks like I got some of the y and z coordinates mixed up, correct plane would be:
    a = (32, 0, 56)
    b = (88, 50, 56)
    c = (88, 0 ,0)
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    edited July 2019
    Would be nice to have world origin & coord.

    Y is into page.



  • shane_pooleshane_poole Member Posts: 7
    Yes my original coordinates were with respect to the front plane (my error), basing them relative to the top plane fixed the issue.
  • billy2billy2 Member, OS Professional, Mentor, Developers, User Group Leader Posts: 2,014 PRO
    edited July 2019
    I was having a hard time keeping it straight and getting the coordinates correct. Looking at the triad helped me follow along.

    Added triad as a visual guide.

    Welcome to Onshape.


Sign In or Register to comment.