Trying to get BrepEdge vector pointing towards surface

Hello!

I’m trying to get the vector at the edge of a surface pointing towards the surface, similarly to the arrows you see when you Ctrl+Shift click on 2 edges where separate 2 surfaces meet:


I couldn’t find anything directly usable in the BrepEdge Class. Is there something I can use in the BrepFace class? Or is there a lot of in between steps involved in getting these vectors?

For this, you can evaluate the surface curvature at positions on the edge. You could for example divide the curve, get closest points on the face, which gives you uv values that you feed into:

1 Like

A vector perpendicular to the edge and pointing into the surface is the cross product of the surface normal and the edge’s tangent. If the trim that goes with the surface is reversed, then you will have to negate the result. As Gijs said, you’ll have to get the surface uvs that go with the edge points. Another way to get them is by using the BrepTrim.GetTrimParameter method and evaluating the trim at the trim parameters.

2 Likes

Thanks guys. After @chuck s reply I remembered I’ve been asking and dealing with this before :man_facepalming:

1 Like