Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

SW API curvature method? 2

Status
Not open for further replies.

DesignModeler

Mechanical
May 17, 2011
23
"...A positive curvature by convention implies a centre of curvature on the side pointed away from by the surface normal (convex)..." - what does that mean in terms of this method:


example:


so then...

vEval = swSurf.EvaluateAtPoint(vClosePt(0), vClosePt(1), vClosePt(2))

vEval(9) or vEval(10) should be positive or negative depending on direction?? I dont understand
 
Replies continue below

Recommended for you

Did you figure this out yet?

EvaluateAtPoint is a method of the Surface. Surfaces are different from Faces. Solid Bodies are made up of Faces, and Faces are made of Surfaces. The convention for a Face is that the normal points outward, away from the solid body. A surface is not part of a solid body, so there is no convention on which direction the normal points. As mentioned in the help, the FaceInSurfaceSense method of the Face2 tells you whether or not the normal of the face (with points away from the body) is in the same direction as the normal of the surface that defines the shape of the face.

So, in order to determine if a face is concave or convex with respect to its body, you need to know both the curvature (vEval(9) and vEval(10)) and the status of FaceInSurfaceSense to tell you whether the face normal and surface normal point in the same direction. Please note (as stated in the help) that the result of FaceInSurfaceSense is opposite of what you would expect... It returns "True" if the normal vector of the face points in the opposite direction of the surface.


Code:
Curvature   FaceInSurfaceSense    Cave/Vex
Positive    True                    Cave
Negative    True                    Vex
Positive    False                   Vex
Negative    False                   Cave

-handleman, CSWP (The new, easy test)
 
Thanks, it seems just FaceInSurfaceSense is all I need, when does negative curvature occur? I haven't encountered it yet.
 
No, you need both. The face normal always points outward from the solid. I am not sure how SolidWorks decides which direction the Surface normal will be. You could easily have a single surface that is concave in one place and convex in another. The surface normal points toward the same side of the surface everywhere on the surface.

-handleman, CSWP (The new, easy test)
 
In my situation, the faces/surfaces are only cylindrical. Always. But one face's curvature (from vEval(9) or vEval(10)), who's normal points TOWARD the origin axis of that cylinder, is positive - and one face's curvature(from vEval(9) or vEval(10)), who's normal points AWAY from the origin axis of that cylinder, is also positive. But the FaceInSurfaceSense returns false/true respectively.
 
Let's try again...

A face's normal vector will always point away from the "inside" of the body.

The shape of a face is defined by a Surface.

A Surface doesn't have an inside or outside. The normal vector of a surface will point toward one side or the other, but always points to the same side across the whole surface.

There is no way to "predict" which side of a surface the normal will point to. If the surface is a cylinder, the surface normal could point toward the center of the cylinder or it could point to the outside of the cylinder. Just because all the cylinders you have seen so far have their underlying surface normal pointing in one way or the other doesn't mean jack.

You must have both the curvature value and FaceInSurfaceSense to know for certain whether the solid body is concave or convex at that point.

Oh, and think about this... Just food for thought. A surface can be concave in one direction and convex in the other. That's why you get two values for the curvature. Think about a point on the inside of a torus (donut).

Saying that you can find out concave/convex by just using FaceInSurfaceSense because it matches up with what you have seen so far is like saying that all pets are dogs because you've never seen a cat.

-handleman, CSWP (The new, easy test)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor