
! script name: parasolids.d/imprintshadowcurves
! solids: imprint shadow curves on a body

!A
!A NAME:
!A
!A 	Imprint shadow curves on a body.
!A
!A DESCRIPTION:
!A
!A	This script will create shadow curves on a body. It will also
!A	color the visible faces with the current color.
!A 	
!A
!B~ image location - images/pkshadowcurves.gif
!B INSTRUCTIONS:
!B
!B
!B	PICK BODY: Pick the body.
!B
!B OPTIONS:
!B
!B
!# see also - htdocs/help.d/parasolids.htm


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

OPTION BASE 1
DIM Destination$[256]
DIM Answer$[256]

ActivateUndo
Stat= GLPlotOn
Start:!


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= WPKShadowCurves(Pkbody)

ActivateUndo
Stat= AdvanceUndoNumber("body shadow curves")
Stat= AddItemToUndo(WsUBPKSessionMark)
WPKErrorCheck


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