×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

SW API curvature method?
2

SW API curvature method?

SW API curvature method?

(OP)
"...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:

http://help.solidworks.com/2011/english/api/sldworksapi/solidworks.interop.sldworks~solidworks.interop.sldworks.isurface~evaluateatpoint.html

example:

http://help.solidworks.com/2011/english/api/sldworksapi/Evaluate_Points_on_Surface_Example_VB.htm

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

RE: SW API curvature method?

2
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)

RE: SW API curvature method?

(OP)
Thanks, it seems just FaceInSurfaceSense is all I need, when does negative curvature occur? I haven't encountered it yet.

RE: SW API curvature method?

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)

RE: SW API curvature method?

(OP)
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.  

RE: SW API curvature method?

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)

RE: SW API curvature method?

(OP)
Thank you.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources