Previous Next Up Title Contents Index Functions Index Top Library

3D ARC

tcircle_arc3


CALL SEQUENCE

void tcircle_arc3 (strid, arc, open_close)

INPUT PARAMETERS

Pint	strid;
Tcircle_arc3	*arc;
Tarc_close	open_close;

ARGUMENTS

strid
Identifier of the arc structure.
arc
3D arc geometry description.
open_close
Flag indicating whether the arc is open or closed.

TYPE

typedef struct {
Tcircle_arc_type3	type;
union {
	struct {
		Ppoint3	c;	/* Circle center	*/
		Ppoint3	i;	/* Initial point of the arc	*/
		Pfloat	a;	/* Arc angle	*/
		Pvec3	n;	/* vector orthogonal to the plane of the circle	*/
	} cian;

	struct {
		Ppoint3	c;	/* Circle center	*/
		Ppoint3	i;	/* Initial point of the arc	*/
		Ppoint3	f;	/* Final point of the arc	*/
	} cif;

	struct {
		Ppoint3	i;	/* Initial point of the arc	*/
		Ppoint3	m;	/* Middle point of the arc	*/
		Ppoint3	f;	/* Final point of the arc	*/
	} imf;
} geometry
} Tcircle_arc3;
typedef enum {
	TCENTER_PINIT_ANGLE_NORMAL,
	TCENTER_PINIT_PFINAL3,
	TPINIT_PMIDDLE_PFINAL3,
} Tcircle_arc_type3

EFFECT

This function generates a structure representing an 3D arc defined either

-by the center of the circle, an endpoint of the arc, its angle and the vector orthogonal to the plane of the circle.

-by the center of the circle, a starting point of the arc and an endpoint of the arc.

-by a starting point, a middle point and an endpoint of the arc.

The arc is defined by a certain number of points. The distribution of points can be controlled by first calling the tset_step_angle function to set the angle between two points.

Depending on the value of the open_close flag, the arc is represented by the PHIGS primitive polyline 3 (TOPENED_ARC), or by a fill area set 3 primitive (TEND_CLOSE_ARC or TCENTER_CLOSE_ARC).

arc->type = TCENTER_PINIT_ANGLE_NORMAL,

The arc is defined by the center of the circle (c ), the starting point of the arc (i ), the arc angle (a ), and the vector orthogonal to the plane of the circle (n ). The angle is given in trigonometric way and according to the direction of orthogonal vector (n ).

arc->type = TCENTER_PINIT_PFINAL3

Arc defined by the geometrical center of the circle (c ), the starting point of the arc (i ) and an endpoint of the arc (f ). If the two given points are not the same distance from the center, the radius chosen will be equal to the distance from the center to the starting point, but the angle of the arc shall remain equal to the angle formed by the three given points. There are 2 mathematical solution, but the smallest angle is always chosen.

arc->type = TPINIT_PMIDDLE_PFINAL3

Arc defined by three given points (i f and m).. The arc begins at the starting point (i ), goes through the middle point (m ) and ends at the endpoint (f ).


Previous Next Up Title Contents Index Functions Index Top Library