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.
How does "face" parameter in evEdgeTangentLine work
johannes_w
Member Posts: 33 PRO
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!
0
Best Answer
-
Hi @johannes_w !
Sorry for the confusion here. I'll attempt to explain the documentation in a more human-centric way. When you supply a face to evEdgeTangentLines, imagine that you are standing on that face, at the midpoint of the edge you care about. Because you are standing on that face, "up" (from your point of view) is the face normal. Now turn around in a circle until the face is on your left, and a large cliff is on your right. The way you are facing ("forward" from your point of view) will be the positive direction of evEdgeTangentLines.
Here are a couple examples:

Notice that selecting a different face changes the edge direction of the top-right edge, because keeping this face to the "left" (in relation to the selected face normal being "up"), requires a different "forward".
If this is just completely confusing and didn't help, you can also just use the right-hand rule. Using your thumb as the face normal of the selected face, the edge directions will curl around in the direction of the curl of your fingers.Jake Rosenfeld - Modeling Team5
Answers
-
Hi @johannes_w !
Sorry for the confusion here. I'll attempt to explain the documentation in a more human-centric way. When you supply a face to evEdgeTangentLines, imagine that you are standing on that face, at the midpoint of the edge you care about. Because you are standing on that face, "up" (from your point of view) is the face normal. Now turn around in a circle until the face is on your left, and a large cliff is on your right. The way you are facing ("forward" from your point of view) will be the positive direction of evEdgeTangentLines.
Here are a couple examples:

Notice that selecting a different face changes the edge direction of the top-right edge, because keeping this face to the "left" (in relation to the selected face normal being "up"), requires a different "forward".
If this is just completely confusing and didn't help, you can also just use the right-hand rule. Using your thumb as the face normal of the selected face, the edge directions will curl around in the direction of the curl of your fingers.Jake Rosenfeld - Modeling Team5 -
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.0
-
@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 Team0 -
@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, EMEA2 -
@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 Team0 -
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!0 -
Jake_Rosenfeld said:@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
3 -


