
! script name: parasolids.d/bodyisoclines
! solids: imprint isocline curves on faces.

!A
!A NAME:
!A
!A 	Imprint isocline curves on a body.
!A
!A DESCRIPTION:
!A
!A	This script will create isocline curves on a body. The isocline
!A	curves are the curves which correspond to the place on a face
!A	where tapered draft should start. 
!A 	
!A
!B INSTRUCTIONS:
!B
!B	ANGLE: Enter the draft angle. Measured from the vertical.
!B
!B	PICK BODY: Pick the body.
!B
!B OPTIONS:
!B
!B	The isocline curves are used when draft is to be put on a 
!B	solid for a mold or casting. Faces which are curved in z 
!B	need the isocline curves installed before tapered draft
!B	can be applied. The face is split in two by the isocline
!B	curve, taper is applied to the lower face with the isocline
!B	curve edge as the reference entity.
!B
!# see also - htdocs/help.d/parasolids.htm


stat=ChangeLabelStr("ScriptNameStatus","Function: body isocline curves ")

OPTION BASE 1
DIM Destination$[256]
DIM Answer$[256]
REAL Face_array(100)

ActivateUndo
Stat= GLPlotOn
Start:!

Stat= SetAngleEquals(Angle)
Angle=InputAngle("ANGLE")
IF ExitScript(Destination$) THEN Leave

Pick_loop:!
Pkbody= WPKCurrentBody
IF NOT WPKIsEntity(Pkbody) THEN
        Stat=SetInputFormat("n4","")
        E1=WPKPickEntity("PICK BODY")
        IF (ExitScript(Destination$)) THEN Leave
        IF NOT WPKIsEntity(E1) THEN Pick_loop
        Pkbody= WPKParentBody(E1)
END IF

WPKClearErrorFlag
E2= WPKBodyIsoclines(Pkbody,Angle)

ActivateUndo
Stat= AdvanceUndoNumber("body isocline curves")
Stat= AddItemToUndo(WsUBPKSessionMark)
WPKErrorCheck
GOTO Start


Leave:!
IF (NOT LEN(Destination$)) THEN
	 LOAD "typecontrol"
ELSE
	 LOAD Destination$
END IF
END
