The only non-parametric surface is the planar surface, and its normal is constant for all surface points
you can ask for example:
set infosurface [GiD_Info list_entities surfaces $surface_id]
and get from this information the part you want, for example with regexp (read any Tcl manual for regexp syntax)
regexp {Normal: ([^\n]*)} $infosurface dummy normal
(the variable named “normal” is filled with the normal components)
I also tried the parametric surface normal command, and it can be used also for non parametric planar surfaces,
in this case you can use any u,v values (between 0 and 1), because this normal is constant.
Then for this case you can simply use
set normal [GiD_Info parametric surface $surface_id normal 0 0]
Enrique
----- Original Message -----
From: CALAON Andrea Dalmine R&D
To: gidlist at gatxan.cimne.upc.edu
Sent: Wednesday, May 16, 2007 2:01 PM
Subject: RE: [GiDlist] Surface normals at any point
Yes, for parametric surfaces I would use somethig like this code:
set surface_id 10 …
set node_number 6 …
set xyz [lindex [GiD_Info Coordinates $node_number geometry] 0]
set uv [GiD_Info parametric surface $surface_id uv_fromcoord $xyz]
puts $fout “normal: [GiD_Info parametric surface $surface_id normal $uv]”
But for NON PARAMETRIC surfaces, is there any way to get the normal form Tcl?
Thanks
Andrea
\
From: gidlist-admin at gatxan.cimne.upc.edu [mailto:gidlist-admin at gatxan.cimne.upc.edu] On Behalf Of PUB: Enrique Escolano
Sent: mercoledì 16 maggio 2007 6.19
To: gidlist at gatxan.cimne.upc.edu
Subject: Re: [GiDlist] Surface normals at any point
Hello Andrea,
From Tcl, to know the normal of the surface surface_id at parametric coordinates [u]v, must use
set normal [GiD_Info parametric surface surface_id normal v]
To know the u,v parameters of a point with coordinates x y z (located on the surface), must use
set uv [GiD_Info parametric surface surface_id uv_fromcoord x y z]
Read GiD help about Cutomization-Tcl/Tk extension-Control functions-Info function
As user, you can also know the normal of the surface on a point from the menu
Utilities-Id
then click the righ mouse button ,and select in the contextual menu “Normal in surface”
and click the desired point on a surface. The normal x y z will be shown in the lower message bar
Regards
Enrique
----- Original Message -----
From: “CALAON Andrea Dalmine R&D” acalaon at dalmine.it
To: gidlist at gatxan.cimne.upc.edu
Sent: Tuesday, May 15, 2007 9:21 PM
Subject: [GiDlist] Surface normals at any point
Dear GiD Team,
I need the normal to a surface (NURBS in general), at a point that
clearly is on the surface itself (the point is obtained as an
intersection between the surface and a line). Is there any way to obtain
from the GiD database through Tcl such information? I have seent that
for parametric surfaces this has been implemented.
Best regards
Andrea
\
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
-------------- next part --------------
An HTML attachment was scrubbed…
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20070516/59a79fa5/attachment.htm[/u]