Previous Next Up Title Contents Index Functions Index Top Library

10
Cut-Planes and
Modelling-Clipping


This chapter discusses all PHIGURE functions used to define cut-planes used to generate isolines on the plane or to visualize only those parts of the primitives which are in the half-space delimited by the plane. This last aspect is called modelling clipping by the PHIGS standard. Refer to GPHIGS documentation for more details.

A cut-plane can be defined in 6 different ways using the following C structure:

typedef struct {

	Tplane_type	type;
	Tref_type		ref;
	Pfloat			distance;
	Ppoint3			reference_point;

	union {

		struct {
			Pvec3	vector;
		} orthogonal;

		struct {
			Pvec3	v1;
			Pvec3	v2;
		} vector;

		struct {
			Ppoint3	p1;
			Ppoint3	p2;
		} point;

		struct {
			Pfloat	teta;
			Pfloat	phi;
		} angle;

	} geometry;
}Tplane;

where type represents one of the six plane definition methods :
typedef enum {
	TPLANE_ORTHOGONAL_VECTOR,
	TPLANE_2_VECTORS,
	TPLANE_3_POINTS,
	TPLANE_ANGLE_Y,
	TPLANE_ANGLE_X,
	TPLANE_ANGLE_Z
}Tplane_type;


where ref indicates if the definition is relative to user space or to the space  [0-1][0-1][0-1] (see tdomain 3) :
typedef enum {
	TRELATIVE_WC,
	TRELATIVE_01
} Tref_type;

where Pvec is the 2D PHIGURE vector type :
typedef struct {
	Pfloat	delta_x;
	Pfloat	delta_y;
} Pvec;

where Pvec3 is the 3D PHIGURE vector type :
typedef struct {
	Pfloat	delta_x;
	Pfloat	delta_y;
	Pfloat	delta_z;
} Pvec3;

where Ppoint3 is the 3D PHIGURE point type :
typedef struct {
	Pfloat x;
	Pfloat y;
	Pfloat z;
}Ppoint3;


If type = TPLANE_ORTHOGONAL_VECTOR

The plane is defined by a vector N (vector) orthogonal to the plane, by a point O (reference_point) on the axis orthogonal to the plane, and by the distance D (distance) from the plane to the point O. D is the curvilinear abscissa, on the axis orthogonal to the plane, of the intersection point between the plane and the axis. The origin of the abscissas is the point O and the axis is oriented positively by the vector N (if D is zero, the point O is in the plane).

If plane is a variable of type Tplane then

plane->geometry.orthogonal.vector vector N

plane->geometry.reference_point point O

plane->geometry.distance distance D

Also

if plane->ref == TRELATIVE_WC then D, O and N relative to user space

if plane->ref == TRELATIVE_01 then D, O and N are relative to the space [0-1][0-1][0-1]

If type = TPLANE_2_VECTORS

The plane is defined by two vectors v1 v2 defining a parallel plane, by a point O (reference_point), and by the distance D (distance) from the plane to the point O. The vectorial product of v1 and v2 defines the direction and orientation of the axis orthogonal to the plane (v1 and v2 must not be colinear). As was defined in the first plane definition, O is a point on the axis, and D is the curvilinear abscissa, on the axis orthogonal to the plane, of the intersection point between the plane and the axis. The origin of the abscissas is the point O and the axis is oriented positively by the vector v1^v2 (if D is zero, the point O is in the plane).

If plane is a variable of type Tplane then

plane->geometry.vector.v1 vector V1

plane->geometry.vector.v2 vector V2

plane->geometry.reference_point point O

plane->geometry.distance distance D

Also

if plane->ref == TRELATIVE_WC then D, O and V1 and V2 relative to user space

if plane->ref == TRELATIVE_01 then D, O and V1 and V2 are relative to the space [0-1][0-1][0-1]

If type = TPLANE_3_POINTS

The plane is defined by three points 0 (reference_point) p1 p2 p3 describing a parallel plane and by the distance D (distance) from the plane to the point O. If V1 is the vector OP1 and V2 the vector OP2 then the vectorial product of V1 and V2 defines the direction and orientation of the axis orthogonal to the plane (V1 and V2 must not be colinear). This axis passes through the point O. This point is the origin of the abscissas along the axis that has a oriented positively by the vector V1^V2 (if D is zero, the points O,P1 and P2 are in the plane).

If plane is a variable of type Tplane then

plane->geometry.point.p1 point P1

plane->geometry.point.p2 point P2

plane->geometry.reference_point point O

plane->geometry.distance distance D

Also

if plane->ref == TRELATIVE_WC then D, O and P1 and P2 relative to user space

if plane->ref == TRELATIVE_01 then D, O and P1 and P2 are relative to the space [0-1][0-1][0-1]

If type = TPLANE_ANGLE_X

The plane is defined by an orthogonal axis oriented by the two angles [theta] (teta) et [phi] (phi), by a point o (referecence_point) on the orthogonal axis, and by the distance D(distance) from the plane to the point o.

[theta] is the angle between the YZ plane and the axis orthogonal to the plane, -[pi]/2<=[theta]<=+[pi]/2. If [theta] = ± [pi]/2 then the defined plane is parallel to the YZ plane.

[phi] is the angle between the Y axis and the projection of the orthogonal axis on the plane YZ, 0<=[phi]< 2[pi]

D is the curvilinear abscissa, on the axis orthogonal to the plane, of the intersection point between the plane and the axis. The origin of the abscissas is the point o and the axis is oriented positively by a reference having spherical coordinates (1, [theta], [phi]). (if d is zero, the point o is in the plane).

If plane is a variable of type Tplane then

plane->geometry.angle.teta angles [theta]

plane->geometry.angle.phi angles [phi]

plane->geometry.reference_point point O

plane->geometry.distance distance D

Also

If plane->ref == TRELATIVE_WC then D, O, [theta] and [phi] relative to user space

If plane->ref == TRELATIVE_01 then D, O, [theta] and [phi] are relative to the space [0-1][0-1][0-1]

If type = TPLANE_ANGLE_Y

The plane is defined by an orthogonal axis oriented by the two angles [theta] and [phi] (teta and phi), by a point O (reference_point) on the orthogonal axis, and by the distance D (distance) from the plane to the point O.

[theta] is the angle between the ZX plane and the axis orthogonal to the plane, -[pi]/2 <=0<=+[pi]/2. If [theta] = ± [pi]/2 then the defined plane is parallel to the ZX plane.

[phi] is the angle between the Z axis and the projection of the orthogonal axis on the plane ZX, 0<=[phi]< 2[pi]

D is the curvilinear abcissa, on the axis orthogonal to the plane, of the intersection point between the plane and the axis. The origin of the abscissas is the point O and the axis is oriented positively by a reference having spherical coordinates (1, [theta], [phi]). (if D is zero, the point O is in the plane).

If plane is a variable of type Tplane then

plane->geometry.angle.teta angles [theta]

plane->geometry.angle.phi angles [phi]

plane->geometry.reference_point point O

plane->geometry.distance distance D

Also

If plane->ref == TRELATIVE_WC then D, O, [theta] and [phi] relative to user space

If plane->ref == TRELATIVE_01 then D, O, [theta] and [phi] are relative to the space [0-1][0-1][0-1]

If type = TPLANE_ANGLE_Z

The plane is defined by an orthogonal axis oriented by the two angles [theta] (teta) and [phi](phi) , by a point O (reference_point) on the orthogonal axis, and by the distance D (distance) from the plane to the point O.

[theta] is the angle between the XY plane and the axis orthogonal to the plane -[pi]/2 <=0<=+[pi]/2. If [theta] = ± [pi]/2 then the defined plane is parallel to the XY plane.

[phi] is the angle between the X axis and the projection of the orthogonal axis on the plane XY, 0<=[phi]< 2[pi]

D is the curvilinear abcissa, on the axis orthogonal to the plane, of the intersection point between the plane and the axis. The origin of the abscissas is the point O and the axis is oriented positively by a reference having spherical coordinates (1, [theta], [phi]). (if D is zero, the point O is in the plane).

If plane is a variable of type Tplane then

plane->geometry.angle.teta angle [theta]

plane->geometry.angle.phi angle [phi]

plane->geometry.reference_point point O

plane->geometry.distance distance D

Also

If plane->ref == TRELATIVE_WC then D, O, [theta] and [phi] relative to user space

If plane->ref == TRELATIVE_01 then D, O, [theta] and [phi] are relative to the space [0-1][0-1][0-1]


Previous Next Up Title Contents Index Functions Index Top Library