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.

lineAnglePlane

papawopapawo Member, Developers Posts: 206 PRO
need explanation on how to use lineAnglePlane 
Tagged:

Answers

  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    edited March 2018
    It's much simpler to construct a plane in FeatureScript with opPlane than with cPlane.  If you want to make a line-angle plane using cPlane you will need a Query for a linear edge, a Query for another reference entity, and angle at which to offset from the reference entity.  It will require a lot of trial and error to get the directionality of the angle correct, and probably won't work in the generic case.

    What sort of inputs do you have?  It's very easy to make a plane with opPlane as long as you know a point in your plane and the normal of the plane.
    Jake Rosenfeld - Modeling Team
  • papawopapawo Member, Developers Posts: 206 PRO
    edited March 2018
    simple is good!  :)
    I have 1 line, 2 endpts of the line, midpt of the line  and the plane normal to line.
    I would like to create different planes along the line.
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    edited March 2018
    Sounds like you could just do:

    opPlane(context, id + "plane1", { "plane" : plane(endPointPosition1, normalDirection) });
    opPlane(context, id + "plane2", { "plane" : plane(midPointPosition, normalDirection) });
    opPlane(context, id + "plane3", { "plane" : plane(endPointPosition2, normalDirection) });
    
    to create the three planes.

    Not sure if when you say you have a line and its endpoints, you're saying you have a Line and 2 Vectors or if you have Querys for all three of those things.  If they're Querys, you can do the following:

    var endPointPoisition1 = evVertexPoint(context, { "vertex" : endPointQuery1 });
    var normalDirection = evEdgeTangentLine(context, { "edge" : lineQuery, "parameter" : 0.5 }).direction;
    etc...

    Jake Rosenfeld - Modeling Team
  • papawopapawo Member, Developers Posts: 206 PRO
    it doesn't seem to work.
    plane needs origin,normal & x , correct?
  • Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    Plane has a number of interfaces.  For your purpose, the x direction doesn't actually matter, so the `plane(origin is Vector, normal is Vector)` should be sufficient:
    https://cad.onshape.com/FsDoc/library.html#Plane

    Can you post a screenshot of how it's not working?
    Jake Rosenfeld - Modeling Team
Sign In or Register to comment.