
! script name: parasolids.d/twobodyintersect
! solids: find the curve(s) of intersection between two bodies.

!A
!A NAME:
!A
!A 	Two Body Intersect Curve
!A
!A DESCRIPTION:
!A
!A 	This script calculates curve(s) of intersection between two bodies.
!A
!B INSTRUCTIONS:
!B
!B 	PICK FIRST BODY:  Pick the first of the two bodies.
!B
!B 	PICK SECOND BODY: Pick the second of the two bodies.
!B
!# see also - htdocs/help.d/parasolids.htm

stat=ChangeLabelStr("ScriptNameStatus","Function: two body intersect curve ")

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

ActivateUndo

Stat= GLPlotOn
Body_loop:!

E1=WPKPickEntity("PICK FIRST BODY")
IF (ExitScript(Destination$)) THEN Leave
IF NOT WPKIsEntity(E1) THEN Body_loop

E2=WPKPickEntity("PICK SECOND BODY")
IF (ExitScript(Destination$)) THEN Leave
IF NOT WPKIsEntity(E2) THEN Body_loop

Group= WPKTwoBodyInter(E1,E2)
Stat= PlotEntity(Group)

ActivateUndo
Stat= AdvanceUndoNumber("bodies intersect curve")
Stat= AddGroupToUndo(WsUBCreateMode,Group,0,WsTrue)
Stat= DeleteEntity(group)

GOTO Body_loop

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