!****h* Main/CubicCrv ! NAME ! CubicCrv -- Module to produces a cubic curve w/o specifing tangents. ! [CubicCrv.MBS] ! DESCRIPTION ! This module generates all the data required to produce ! a bicubic curve from 13 or fewer intersction points. No tangent ! points are provided to this module since they are interpolated inside ! the module using a spline curve generated using cur_splarr(). A 'P' ! array is required to control the 'fullness' of the curve. ! ! The steps followed are: ! * Generate a simple spline curve using cur_splarr() using the 13 ! points input via the CrvPts array. ! * The 'PValues' and 'CrvPts' arrays must be declared and initialized ! prior to calling this function. The 'PValues' array may be ! initialized to a single value using the PValInit() function. ! After PValInit() initializes the 'PValues' array ! selected points (e.g. at ends) may be set just prior to ! calling this function. ! * Initialize all of arrays except 'CrvPts' and P-Values. ! P-Values passed to this module must be between 0.0 and 0.85. ! * Generate tangents vector needed to generate cur_conic curves ! * A bicubic curve in then formed using cur_conarr(). ! ! SOURCE GLOBAL GEOMETRY MODULE CubicCrv( INT NoPts; ! Number of curve points VAR FLOAT PValues(13); ! 'P' value array VAR VECTOR CrvPts(13)); ! Points on curve !*** ! ! Copyright 2006, John J. Hughes ! ! This source code file is part of the 'NGBproject' files which ! execute interactively under the 'VARKON' program, which is ! distributed under the terms of the GNU General Public License. ! ! The 'NGBproject' files are also distributed under the terms of ! the GNU GeneralPublic License. See the GNU General Public License n ! included ithe file name "COPYING.txt" in the Varkon ./app/NGB/doc ! directory for more details. ! ! NGB is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 2 of the License, or ! (at your option) any later version. ! ! NGB is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License included in the file name "COPYING.txt". ! ! You should have received a copy of the GNU General Public License ! along with NGB; if not, write to the Free Software Foundation, ! Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA INT i; VECTOR Tgts(13); STRING PStg(13)*1; VECTOR MidPts(13); BEGINMODULE ! ~ Generate a simple spline curve cur_splarr(#10,"FERGUSON",NoPts,CrvPts:BLANK=1); ! ~ Initialize all of arrays except 'CrvPts' and ! ~ P-Values. P-Values passed to this module must be between ! ~ 0.0 and 0.85 FOR i:=1 TO 13 DO PStg(i):="P"; Tgts(i):=vec(0,0,0); MidPts(i):=vec(0,0,0); ENDFOR; ! ~ Generate tangents vector needed to generate cur_conic curves FOR i:=1 TO NoPts DO Tgts(i):=on(#10,i-0.9); ! Get tangents from the spline curve ENDFOR; ! ~ A bicubic curve can now be formed cur_conarr(#20,"FREE",NoPts,CrvPts,Tgts,PStg,Pvalues,MidPts); ENDMODULE