×
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

The normal vector of an area

The normal vector of an area

The normal vector of an area

(OP)
I want to get the normal vector of an area selected. In the *get command, three vectors are given, Principal orientation X,Y and Z vectors. But I think that those are related to inertia. So, please tell me how to get the normal vector of an area (plane ofcourse), defined previosly.
Thank you very much.

RE: The normal vector of an area

You must know three non linear key points of that area, say k1, k2 and k3.

Then you get the three coordinates of a unit normal vector by:

x=normkx(k1,k2,k3)
y=normky(k1,k2,k3)
z=normkz(k1,k2,k3)

Regards
Alex

RE: The normal vector of an area

(OP)
Yes, that is how to calculate the normal vector. But, it will be a  bit lengthy to do(first find three points and then do the calculation). Isn't there any direct method, by which ansys gives the normal vector. Thanks!!

RE: The normal vector of an area

I don't think so... At least I don't know a more direct method. Otherwise I would have first written it...

On the other hand, It's not so complicated to write a small macro to just that what you want. The following code should give you an example:

CODE


! arg1 = Area Number

/nopr
! Remember previously selected geometry
cm,prevarea,area
cm,prevline,line
cm,prevkpts,area
! Select KP's on area arg1
asel,s,,,arg1
lsla
ksll
! Search for 3 non linear KP's
*get,kcount,kp,,count
k1=kpnext(0)
k2=kpnext(k1)
k3=kpnext(k2)
testang=nint(anglek(k1,k2,k3))
*do,jj,1,kcount-3
  *if,testang,eq,180,or,testang,eq,0,then
     k3=kpnext(k3)
  *else
     *exit
  *endif
*enddo
! output of the Normal Vector of area arg1
/go
normx=normkx(k1,k2,k3)
normy=normky(k1,k2,k3)
normz=normkz(k1,k2,k3)
/nopr
! Restore previously selected geometry
ksel,s,,,prevkpts
lsel,s,,,prevline
asel,s,,,prevarea
/go

You can copy this code into a file areanormal.mac and call it by

areanormal,<areanumber>

Regards,
Alex


RE: The normal vector of an area

(OP)
Thank you so much for the help. Just some more questions :P
The functions you used like nint, anglek, mormkx etc. are not given in the manual. Where to know about them?

And if I want to know the normal out of the volume (I mean, if I am interested in the sign of the normal, it should be out of the volume), is there any way to ensure that?

Thanks once again.

RE: The normal vector of an area

The functions are very well described in the manual. See

Appendix B. GET Function Summary

This functions are just abbreviations of the more general command *get.

To the second question: I would first check if the normal of an area of a volume is already pointing outwards of the volume.

RE: The normal vector of an area

(OP)
Sorry, I did not get answer to the second question. How to check that?

Sorry to bother you so much. I really appreciate your help.

RE: The normal vector of an area

You can model a block for example. Then run the areanormal.mac macro for each of the areas of the block and check how the normals of each area are pointing: outward or inward.

If the each area normal is pointing outward then there is a big probability that this is the case for all volumes in ansys.

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