
! script name: cams.d/dwell
! topic: dwell cam curve

!A
!A NAME:
!A
!A 	DWELL CAM
!A
!A DESCRIPTION:
!A
!A 	This script constructs a dwell curve (arc of circle) with known
!A 	start point, end point, and radius.
!A

stat=ChangeLabelStr("ScriptNameStatus","Function: dwell cam ")

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

Partial=0
Full=1
Angle_start=0
Rise=0

Xcen=NamedVarVal("x center pt",WsCamVars,0.0)
Ycen=NamedVarVal("y center pt",WsCamVars,0.0)
Zcen=0
Center=PointXYZ(Xcen,Ycen,Zcen)

Stat=SetPolarCenter(Center)

Rise_angle=NamedVarVal("angular extent",WsCamVars,10.0)
Radius=NamedVarVal("radius",WsCamVars,3.0)
Astart=NamedVarVal("start angle",WsCamVars,0.0)

C1=RadiusCenter(Radius,Center,Astart,Rise_angle)
Pt= ParameterPt(C1,1.0)
Stat= SetLastPoint(Pt)

Stat=DeleteEntity(Pt)

ActivateUndo
Stat= AdvanceUndoNumber("dwell cam curve")
Stat= AddItemToUndo(WsUBCreateMode,C1)

Leave:!
Stat=DeleteEntity(Center)
Stat=SetXyzInput(WsXyzInput)
PlotAll
IF NOT LEN(Destination$) THEN
	 LOAD "cams.d/camcontrol"
ELSE
	 LOAD Destination$
END IF
END

