
! script name: nurbs.d/bsplinegroup
! topic: construct bspline curve between existing group of points

!A
!A NAME:
!A
!A 	NURBS: Control points group
!A
!A DESCRIPTION:
!A
!A 	This script constructs a bspline curve using a group of points
!A	as control points.
!A 	A bspline is a rational function of fixed degree and it offers the
!A 	option of non-uniform parameterization.
!A
!A~ image location - images/NurbCurve.jpg
!B INSTRUCTIONS:
!B
!B 	PICK GROUP OF POINTS: Pick the group of points. The spline curve
!B 		will use the points in the order they appear in the group.
!B

stat=ChangeLabelStr("ScriptNameStatus","Function: nurbs: control points group")

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

ActivateUndo
Group_loop:!

Group= PickGroupEnt("PICK GROUP OF POINTS")
IF (ExitScript(Destination$)) THEN Leave

Group1=PtsInGroup(Group,WsPickPoints)


Sp=BSplinePtGrp(Group1,3,3)
Stat=DeleteEntity(Group1)

ActivateUndo
Stat= AdvanceUndoNumber("nurb points")
Stat= AddItemToUndo(WsUBCreateMode,Sp)
GOTO Group_loop


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

