!********************************************************** !* BASIC GEOMETRY MODULE pvalf( REF spine >"ID of spine curve !"; FLOAT pv1:=0.5 >"Fore P-value !"; FLOAT pv2:=0.5 >"Mid P-value !"; FLOAT pv3:=0.5 >"Aft P-value !"; VAR REF pvalf); !* This module creates a P-value function pvalf=#1 used !* to control the shape of the hull. A P-value function !* is a 2D curve that defines the relationship between !* points on the spine and the P-value of the conic !* segment that defines the surface in the point. !* !* 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 !* !********************************************************** FLOAT spine_length; VECTOR p1,p2; BEGINMODULE !* !***A P-value function always starts in X=0 and ends !***in X=the length of the spine. !* p1:=startp(spine); p2:=endp(spine); spine_length:=abs(p2.x-p1.x); !* !***Create the P-value function as a single segment planar curve. !* cur_spline(#1,"PROJ", vec(0,pv1),, vec(spine_length/2,pv2),, vec(spine_length,pv3) :BLANK=1,PEN=6); pvalf:=global_ref(#1); ENDMODULE