
! script name: parasolids.d/imprintonface
! solids: imprint a curve on a face

!A
!A NAME:
!A
!A 	Imprint Curve on Face
!A
!A DESCRIPTION:
!A
!A 	This script imprints a curve on a face. New edges on the face are
!A	created. The original face is then partitioned by the edges
!A 	to form new faces. The face is divided into pieces by the curve.
!A
!A~ image location - images/pkimprintcurve.gif
!A
!B INSTRUCTIONS:
!B
!B 	PICK FACE: Pick the target face.
!B
!B 	PICK CONTOUR: Pick a synergy contour representing
!B 		the curve to be imprinted.
!B
!B NOTES:
!B
!B 	The curve must lie on or very close to the face.
!B
!# see also - htdocs/help.d/parasolids.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: imprint curve on face ")

DIM Destination$[256]
DIM Answer$[256]

ActivateUndo

Stat= GLPlotOn
Face_loop:!
E1=WPKPickEntity("PICK FACE",WsPKPickFace)
IF (ExitScript(Destination$)) THEN Leave
IF NOT WPKIsEntity(E1) THEN Face_loop

Pick_contour:!
Contour=PickGroupEnt("PICK CONTOUR ")
IF (ExitScript(Destination$)) THEN Leave

WPKClearErrorFlag
E3= WPKImprintOnFace(E1,Contour)

ActivateUndo
Stat= AdvanceUndoNumber("imprint curve on face")
Stat= AddItemToUndo(WsUBPKSessionMark)
WPKErrorCheck

GOTO Face_loop

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