GfsSurface

From Gerris

(Difference between revisions)
Jump to: navigation, search
Revision as of 06:59, 23 April 2007
Popinet (Talk | contribs)

← Previous diff
Revision as of 08:32, 24 April 2007
Popinet (Talk | contribs)

Next diff →
Line 20: Line 20:
tx = 0.1 ty = -0.2 tz = 0.4 tx = 0.1 ty = -0.2 tz = 0.4
sx = 2. sy = 1.5 sz = -1 sx = 2. sy = 1.5 sz = -1
- rx = 0.5 ry = -0.1 rz = -0.3+ rx = -45 ry = -5.5 rz = 25
- angle = -45+ scale = 3.
flip = 1 flip = 1
twod = 1 twod = 1
} }
-where <code>(tx,ty,tz)</code> is a translation vector and <code>(sx,sy,sz)</code> is a scaling vector. The vector <code>(rx,ry,rz)</code> defines a rotation axis and <code>angle</code> the associated rotation angle (in degrees). Note that the translation is always performed after rotation and scaling.+where <code>(tx,ty,tz)</code> is a translation vector, <code>(sx,sy,sz)</code> is a scaling vector and <code>(rx,ry,rz)</code> is a rotation vector (angles in degrees around each principal direction). Note that the translation is always performed after rotation and scaling.
 + 
 +If the <code>scale</code> parameter is specified, uniform scaling is applied along the three axis.
The <code>flip</code> parameter can be used to flip the surface orientation. The <code>flip</code> parameter can be used to flip the surface orientation.

Revision as of 08:32, 24 April 2007

A GfsSurface is an oriented surface (in 3D) or an oriented curve (in 2D).

The surface can be defined implicitly using for example:

(x*x + y*y + z*z - 0.1*0.1)

which defines the surface as the set of points of coordinates (x,y,z) such that x*x + y*y + z*z - 0.1*0.1 = 0 (i.e. a sphere of radius 0.1 centered on the origin).

The sign of the implicit function defines the surface orientation.

Surfaces can also be defined explicitly using GTS files. For example:

sphere.gts

When using GTS surfaces in two dimensions, the oriented curve is defined as the intersection of the GTS surface with the z = 0 plane.

The surface definition can be followed by an optional parameter block with the following syntax:

{
  tx = 0.1 ty = -0.2 tz = 0.4
  sx = 2.  sy = 1.5  sz = -1
  rx = -45 ry = -5.5 rz = 25
  scale = 3.
  flip = 1
  twod = 1
}

where (tx,ty,tz) is a translation vector, (sx,sy,sz) is a scaling vector and (rx,ry,rz) is a rotation vector (angles in degrees around each principal direction). Note that the translation is always performed after rotation and scaling.

If the scale parameter is specified, uniform scaling is applied along the three axis.

The flip parameter can be used to flip the surface orientation.

If set to one the twod parameter "flattens" the surface on the z = 0 plane (this is used in 3D by the GfsRefineSurface object).

Several simple implicit surfaces are pre-defined:

ellipse(x,y,a,b)
an ellipse centered on (x,y) and with semimajor axis a and semiminor axis b.
sphere(x,y,z,r)
a sphere centered on (x,y,z) and of radius r.
Personal tools
communication