!********************************************************** !* BASIC GEOMETRY MODULE spine( REF sl >"Sheerline !"; REF bl >"Bottomline !"; VAR REF sp); !* This module creates a curve sp=#1 to be used !* as a spine for the SUR_CONIC used to !* model the shape of the hull. !* !* The spine is used as input to SUR_CONIC. !* It controls the parametrisation of the surface !* in the U-direction. !* !* This program 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. !* !* This program 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 for more details. !* !* You should have received a copy of the GNU General Public License !* along with this program; if not, write to the Free Software !* Foundation, Inc., 59 Temple Place - Suite 330, Boston, !* MA 02111-1307, USA. !* !* (C)Microform AB 2000, J.Kjellander !* !********************************************************** VECTOR sl_start,sl_end,bl_start,bl_end,p1,p2; BEGINMODULE !* !***Start and end of sheerline. !* sl_start:=startp(sl); sl_end:=endp(sl); !* !***Start and end of bottomline. !* bl_start:=startp(bl); bl_end:=endp(bl); !* !***Where to start ? !* if sl_start.x > bl_start.x then p1:=sl_start; else p1:=bl_start; endif; !* !***Where to end ? Select the longest. !* if sl_end.x < bl_end.x then p2:=sl_end; else p2:=bl_end; endif; !* !***Project the points into Y,Z = 0 and make a little !***shorter to assure that the SUR_CONIC is well defined. !* p1.x:=p1.x; p1.y:=0; p1.z:=0; p2.x:=p2.x; p2.y:=0; p2.z:=0; !* !***Make spine just a little shorter to ensure !***good geometry, specially at the bow. !* if p1.x > p2.x then p1.x:=p1.x - 15; p2.x:=p2.x + 1; else p1.x:=p1.x + 15; p2.x:=p2.x - 1; endif; !* !***Create the line. !* lin_free(#2,p1,p2:BLANK=1); !* !***Make it a curve entity and show it in green. !* cur_comp(#1,#2:BLANK=1,PEN=4); sp:=global_ref(#1); ENDMODULE