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.
Thank you very much.





RE: The normal vector of an area
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
RE: The normal vector of an area
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
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
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
Sorry to bother you so much. I really appreciate your help.
RE: The normal vector of an area
If the each area normal is pointing outward then there is a big probability that this is the case for all volumes in ansys.