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.

Options

How does "face" parameter in evEdgeTangentLine work

johannes_wjohannes_w Member Posts: 25 PRO
edited December 2018 in FeatureScript
I wrote a script which divides a curve into single sections and returns the point vectors next to each other. I try to transform a body along the curve.

Now I ran into the problem that evEdgeTangentLine lists my vectors from the wrong side. As I've understood this, the face parameter is used to define the direction. But I can't quite understand how to use it. And the documentation description about this parameter is a little riddle in my opinion.

If anyone could give me a hint, I'd be very thankful!

Best Answer

Answers

  • Options
    johannes_wjohannes_w Member Posts: 25 PRO
    Thank you very much for this detailed explanation! But unfortunately, this definition of the direction is very case sensitive. Meaning that you only can use edges of bodys but not sketch components. In my case, I use a sketch line/arc/spline whatever to guide my body transformation.

    As for the docs, right hand rule is more clear if you add the fact, that only body edges are possible in combination with this parameter.
  • Options
    Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    @johannes_w

    This is what the documentation means when it says the face "Must be adjacent to edge".  I can see how this is confusing, because adjacent may be interpreted as just "touching", but throughout the documentation, when we say "adjacent", we mean "topologically connected".

    An example of what we mean by adjacency:
    https://cad.onshape.com/FsDoc/library.html#qVertexAdjacent-Query-EntityType
    Jake Rosenfeld - Modeling Team
  • Options
    NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,372
    @johannes_w - it can seem random which end of a curve is the start (and it probably is). Another option would be to use a Path and evPathTangentLines instead. With a Path you can set the start point.

    https://cad.onshape.com/FsDoc/library.html#constructPath-Context-Query-
    Senior Director, Technical Services, EMEAI
  • Options
    Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    @johannes_w

    Are you taking sketch edges as input to your function, or creating sketches within your function to then use?  If you are taking them as input, you may just want to provide your user with a flipper to flip the interpretation of the edge (like we do for linear pattern).  If you can give more detail about your inputs/outputs and what you are trying to do, I can try to give some suggestions of solutions.
    Jake Rosenfeld - Modeling Team
  • Options
    johannes_wjohannes_w Member Posts: 25 PRO
    NeilCooke said:
    @johannes_w - it can seem random which end of a curve is the start (and it probably is). Another option would be to use a Path and evPathTangentLines instead. With a Path you can set the start point.

    https://cad.onshape.com/FsDoc/library.html#constructPath-Context-Query-
    That absolutely makes sense. I will try that out right now. The path function also allows me, to combine several sketch components like a line with a tangent arc for example!

    Thanks for the Tip!
  • Options
    johannes_wjohannes_w Member Posts: 25 PRO
    @johannes_w

    Are you taking sketch edges as input to your function, or creating sketches within your function to then use?  If you are taking them as input, you may just want to provide your user with a flipper to flip the interpretation of the edge (like we do for linear pattern).  If you can give more detail about your inputs/outputs and what you are trying to do, I can try to give some suggestions of solutions.


    That would be another possibility! Both are very convenient ways to define the direction of a path.
    Thank you for this offer but I have to try this on my own. I like to use small hints that bring me a step further, but the actual script should have my own handwriting in my opinion.
    I don't like it when people just want a solution without having to grapple with the matter and ask questions like: "How to program a sweep with twist function". Just an example. Such things belong to the improvement request category :)
  • Options
    Jake_RosenfeldJake_Rosenfeld Moderator, Onshape Employees, Developers Posts: 1,646
    @johannes_w

    Sounds great! Let us know if you need any more hints!
    Jake Rosenfeld - Modeling Team
Sign In or Register to comment.