!****h* Main/Waterline ! NAME ! Waterline -- Develop the 'lines' for 1 1/2" interval ! (1.5,3.0,4.5,&6.0) waterlines intersection and mold station at ! an interval of 16" o.c. [Waterline.MBS] ! ! DESCRIPTION ! Use coordinate system planes & hull surface intersects ! to develop the water, ! buttock, and mold (cross-section) station lines. ! ! The steps in the module are: ! * Generate vertical csys to intersect hull mold cross-sections ! * Generate the Mold Station lines ! * Generate horizontal csys to intersect waterlines ! * Generate intersect waterlines ! * Generate Buttock lines for both sides of the hull ! * Generate the intersect lines for the valve support ! ! SOURCE GLOBAL GEOMETRY MODULE Waterline( VAR REF HullSurface(12); !Array containing hull-surfaces VAR STRING LevelStat(100,2)*24); !Layer name control array !*** !*********************************************************************** ! ! Copyright 2006, John J. Hughes (email: n4yvt@arrl.net) ! ! 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. !----------------------------------------------------------------------- INT i; FLOAT Offset,tmp1,tmp2,SF; REF WaterArr(8); VECTOR tmpP; BEGINMODULE !*********************************************************************** ! ~ Centerline and Transom Coordinate systems !----------------------------------------------------------------------- csys_1p(#10,"centerline",vec(0,0,0),0,-90); csys_3p(#12,"Transom",vec(0.0,-2.5,2.0), vec(8.0,-2.5,2.0),vec(0.0,22.0,0.0)); SF:=2; ! Use scale factor to decrease line weight !*********************************************************************** ! ~ Generate vertical xy_planes to intersect hull ! ~ mold cross-sections !----------------------------------------------------------------------- Offset:=16; FOR i:=1 TO 11 DO csys_1p(#20,"molds",vec(0,0,i*Offset)); ENDFOR; !*********************************************************************** ! ~ Generate the Mold Station lines !----------------------------------------------------------------------- part(#1000,pce("AftLines",LevelStat,SF)); FOR i:=1 TO 6 DO cur_int(#22, HullSurface(1),refc(20,i)); cur_int(#23, HullSurface(3),refc(20,i)); ENDFOR; part(#1022,pce("ForeLines",LevelStat,SF)); FOR i:=6 TO 11 DO cur_int(#26, HullSurface(1),refc(20,i)); cur_int(#27, HullSurface(3),refc(20,i)); ENDFOR; part(#1010,cns("ConstLines",LevelStat,SF)); !*********************************************************************** ! ~ Generate horizontal coordinate planes to intersect !----------------------------------------------------------------------- csys_1p(#29,"1.5 in WL",vec(0,-1,0),90); csys_1p(#30,"3 in WL",vec(0,0.5,0),90); csys_1p(#40,"4.5 in WL",vec(0,2.0,0),90); csys_1p(#45,"6 in WL",vec(0,3.5,0),90); csys_1p(#50,"8 in WL",vec(0,5.5,0),90); csys_1p(#60,"10.5 in WL",vec(0,8.0,0),90); csys_1p(#70,"13 in WL",vec(0,10.5,0),90); csys_1p(#80,"15.5 in WL",vec(0,13,0),90); !*********************************************************************** ! ~ Generate intersect waterlines !----------------------------------------------------------------------- FOR i:=1 TO 4 DO IF i=2 THEN part(#1020,pce("AftLines",LevelStat,SF)); ENDIF; IF i=4 THEN part(#1030,pce("AftLines",LevelStat,SF)); ENDIF; cur_int(#100, HullSurface(i), #29, 1); cur_int(#110, HullSurface(i), #30, 1); cur_int(#120, HullSurface(i), #40, 1); cur_int(#130, HullSurface(i), #45, 1); cur_int(#140, HullSurface(i), #50, 1); cur_int(#150, HullSurface(i), #60, 1); cur_int(#160, HullSurface(i), #70, 1); cur_int(#170, HullSurface(i), #80, 1); part(#1034,cns("ConstLines",LevelStat,SF)); ENDFOR; !*********************************************************************** ! ~ Trim waterlines @ bow curve and transom !----------------------------------------------------------------------- part(#1040,pce("CmnLines",LevelStat,SF)); FOR i:=0 TO 7 DO tmpP:=intersect(refc(100+10*i,1),#12); tmp1:=inv_on(refc(100+10*i,1),tmpP); !Transom trim parameter tmpP:=intersect(refc(100+10*i,1),#10); tmp2:=inv_on(refc(100+10*i,1),tmpP); !Bow trim parameter cur_trim(#220,refc(100+10*i,1),tmp1,tmp2); ENDFOR; FOR i:=0 TO 7 DO tmpP:=intersect(refc(100+10*i,3),#12); tmp1:=inv_on(refc(100+10*i,3),tmpP); !Transom trim parameter tmpP:=intersect(refc(100+10*i,3),#10); tmp2:=inv_on(refc(100+10*i,3),tmpP); !Bow trim parameter cur_trim(#230,refc(100+10*i,3),tmp1,tmp2); ENDFOR; part(#1050,cns("ConstLines",LevelStat,SF)); !*********************************************************************** ! ~ Generate Buttock lines for both sides of the hull !----------------------------------------------------------------------- Offset:=6; FOR i:=1 TO 3 DO csys_1p(#250,"pos_Buttock",vec(i*Offset,0,0),,-90); csys_1p(#260,"neg_Buttock",vec(i*Offset*(-1),0,0),,-90); ENDFOR; part(#1060,pce("CmnLines",LevelStat,SF)); FOR i:=1 TO 3 DO cur_int(#280, HullSurface(1),refc(250,i)); cur_int(#290, HullSurface(3),refc(260,i)); ENDFOR; !*********************************************************************** ! ~ Generate vertical xy_planes to intersect the valve support ! ~ fore and aft surfaces w/ coordinate planes and surface ! ~ intersect lines !----------------------------------------------------------------------- csys_1p(#310,"Fore valve suppt",vec(0,0,10.7643)); csys_1p(#320,"Aft valve suppt",vec(0,0,9.5143)); part(#1070,pce("AftLines",LevelStat,SF)); part(#322,DshLn(SF)); cur_int(#330, HullSurface(1),#310); cur_int(#332, HullSurface(1),#320); cur_int(#340, HullSurface(3),#310); cur_int(#342, HullSurface(3),#320); part(#1080,cns("ConstLines",LevelStat,SF)); ENDMODULE