! ******************* plashape ****************************** ! +++ ! ! Definition of the aircraft planar, projected shape ! ! --- ! ! ! Revision history ! _______________ ! ! Copyright 1997-05-06 Gunnar Liden, All Rights Reserved ! ! Released under the MIT License: ! ! Permission is hereby granted, free of charge, to any person ! obtaining a copy of this software and associated documentation ! files (the "Software"), to deal in the Software without ! restriction, including without limitation the rights to use, ! copy, modify, merge, publish, distribute, sublicense, and/or sell ! copies of the Software, and to permit persons to whom the ! Software is furnished to do so, subject to the following ! conditions: ! ! The above copyright notice and this permission notice shall be ! included in all copies or substantial portions of the Software. ! ! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ! EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES ! OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND ! NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT ! HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, ! WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ! FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ! OTHER DEALINGS IN THE SOFTWARE. ! ! ************************************************************ !sdesce Definition of the aircraft planar, projected shape !sdescs Definition av planets projicerade form GLOBAL GEOMETRY MODULE plashape ( FLOAT x_1 := 500.0 >"Forward fuselage nose point X"; FLOAT pv1 := 0.6 >"P-value forward fuselage"; FLOAT x_2 := 2143.12 >"Forward fuselage end point X"; FLOAT y_2 := 900.0 >"Forward fuselage end point Y"; FLOAT x_3 := 8850.0 >"Wing leading edge start point X"; FLOAT y_3 := 2200.0 >"Wing Start station value Y"; FLOAT x_4 := 12800.0 >"Wing leading edge outer point X"; FLOAT y_4 := 4750.0 >"Wing end station value Y"; FLOAT x_5 := 14350.0 >"Wing trailing edge outer point X"; FLOAT x_6 := 14350.0 >"Wing trailing edge inner point X"; FLOAT x_7 := 15500.0 >"Rear fuselage end point X"; FLOAT y_7 := 900.0 >"Rear fuselage end point Y"; FLOAT z_c := 3000.0 >"Z value for the plane shape"; STRING s_d*132 := "FUTT35" >"Name / description"; INT graphic := 1 >"=0: Show nothing =1: Curves =2: All"); ! Internal variables VECTOR p_1; ! Forward fuselage nose point VECTOR p_2; ! Forward fuselage end point VECTOR p_3; ! Wing leading edge start point VECTOR p_4; ! Wing leading edge outer point VECTOR p_5; ! Wing trailing edge outer point VECTOR p_6; ! Wing trailing edge inner point VECTOR p_7; ! Rear fuselage outer end point VECTOR p_8; ! Rear fuselage inner end point FLOAT eps; ! Epsilon for intersects in other modules INT b_val_c; ! Blank value for output curves INT b_val_a; ! Blank value all other entities BEGINMODULE ! +++ ! Algorithm ! _________ ! --- ! +++ ! 1. Checks and initializations ! --- ! +++ ! Check input X values ! --- IF x_1 < 0 THEN PART(#51, inp_err (VEC(0,0,0))); EXIT("plashape Error x_1 < 0 "); ENDIF; IF x_1 >= x_2 THEN PART(#52, inp_err (VEC(0,0,0))); EXIT("plashape Error x_1 >= x_2"); ENDIF; IF x_2 >= x_3 THEN PART(#53, inp_err (VEC(0,0,0))); EXIT("plashape Error x_2 >= x_3"); ENDIF; IF x_6 >= x_7 THEN PART(#54, inp_err (VEC(0,0,0))); EXIT("plashape Error x_6 >= x_7"); ENDIF; ! +++ ! Check input Y values ! --- IF y_2 <= 0 THEN PART(#55, inp_err (VEC(0,0,0))); EXIT("plashape Error y_2 <= 0"); ENDIF; IF y_2 >= y_3 THEN PART(#56, inp_err (VEC(0,0,0))); EXIT("plashape Error y_2 >= y_3"); ENDIF; IF y_3 >= y_4 THEN PART(#57, inp_err (VEC(0,0,0))); EXIT("plashape Error y_3 >= y_4"); ENDIF; IF y_7 >= y_3 THEN PART(#58, inp_err (VEC(0,0,0))); EXIT("plashape Error y_7 >= y_3"); ENDIF; IF y_7 <= 0 THEN PART(#59, inp_err (VEC(0,0,0))); EXIT("plashape Error y_7 <= 0"); ENDIF; ! +++ ! Check graphic variable ! --- IF graphic = 0 THEN b_val_c := 1; b_val_a := 1; ELIF graphic = 1 THEN b_val_c := 0; b_val_a := 1; ELIF graphic = 2 THEN b_val_c := 0; b_val_a := 0; ELSE PART(#60, inp_err (VEC(0,0,0))); EXIT("plashape graphic is not 0, 1 or 2"); ENDIF; ! +++ ! Input data to local points (type VECTOR) ! --- eps := -0.01; p_1 := VEC(x_1, eps, z_c); p_2 := VEC(x_2, y_2, z_c); p_3 := VEC(x_3, y_3, z_c); p_4 := VEC(x_4, y_4, z_c); p_5 := VEC(x_5, y_4, z_c); p_6 := VEC(x_6, y_3, z_c); p_7 := VEC(x_7, y_7, z_c); p_8 := VEC(x_7, eps, z_c); ! +++ ! 2. Create leading and trailing edge composite curves ! --- CUR_CONIC(#3, "FREE", p_1, p_1 + VEC(0,100,0), pv1, p_2, p_3, 0.5, p_3, p_2:BLANK=b_val_a,PEN=3); LIN_FREE(#4, p_3, p_4:BLANK=b_val_a,PEN=3); LIN_FREE(#5, p_4, p_5:BLANK=b_val_a,PEN=3); LIN_FREE(#6, p_5, p_6:BLANK=b_val_a,PEN=3); LIN_FREE(#7, p_6, p_7:BLANK=b_val_a,PEN=3); LIN_FREE(#8, p_7, p_8:BLANK=b_val_a,PEN=3); LIN_FREE(#9, p_8, p_1:BLANK=b_val_a,PEN=3); CUR_COMP(#1, GLOBAL_REF(#3), GLOBAL_REF(#4), GLOBAL_REF(#5) :BLANK=b_val_c); CUR_COMP(#2, GLOBAL_REF(#6), GLOBAL_REF(#7), GLOBAL_REF(#8) :BLANK=b_val_c); ! +++ ! 3. Registration of curves with GROUP names L_E and T_E ! --- GROUP(#11, "L_E", GLOBAL_REF(#1)); GROUP(#12, "T_E", GLOBAL_REF(#2)); ENDMODULE