Math-Arc info

From Vectorlab
Jump to: navigation, search


Returns all relevant geometric data of an arc or round wall. There is a variant on Charles' VSFR under PtOnArc. This also returns the direction of the arc if it's a round wall. By Orso B. Schmid


{ Orso ***************************** }
{ Arc data, including counterclock }
PROCEDURE M_ArcInfo(h: HANDLE; VAR cen_pt: VECTOR; VAR startAng, sweepAng, radius: REAL; VAR isCounterclock: BOOLEAN);
	BEGIN
		Hcenter(h, cen_pt.x, cen_pt.y);
		GetArc(h, startAng, sweepAng);

		CASE GetType(h) OF
		{ arc }
		6: radius := Hperim(h) / Deg2Rad(sweepAng);
		
		{ round wall }
		89:	BEGIN
				radius := (GetPrefReal(152) / 25.4) * GetObjectVariableReal(h, 571); { always mm }
				isCounterclock := GetObjectVariableBoo(h, 570); { counterclock round wall }
			END;
		END;
	END;