
! script name: 3drender.d/explodetmesh
! 3DTOPIC: Explode surface triangulation

!A
!A NAME:
!A
!A 	Explode Surface Triangulation.
!A
!A DESCRIPTION:
!A
!A 	
!A
!B INSTRUCTIONS:
!B
!B 	PICK SURFACE: Pick the surface.
!B
!B
!B

Stat=ChangeLabelStr("ScriptNameStatus","Function: explode triangulation  ")

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


DeActivateUndo
Pick_surface:Stat=SetPickMask(WsPickSurfOnly)
Stat=SetPickMask(WsPickSurfOnly)
Stat=SetInputFormat("n4","")
Surface=PickEntity("PICK SURFACE ")
IF ExitScript(Destination$) THEN Leave
IF NOT ValidGeometry(Surface) THEN Pick_surface

Stat=SetPickMask(WsPickGeometry)

Stat=ExplodeTMesh(Surface)

GOTO Pick_surface

Leave:!
Stat=SetInputFormat("n4","")
Stat=SetPickMask(WsPickGeometry)
IF NOT LEN(Destination$) THEN
	LOAD "typecontrol"
ELSE
	LOAD Destination$
END IF
END
