! ******************* profile1 ****************************** ! +++ ! ! Definition of a profile ! ! --- ! ! ! 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 a profile !sdescs Definition av en profil GLOBAL GEOMETRY MODULE profile1 ( VECTOR p_1 := VEC(0.0, 1000.0000, 0.2100 ) >"@ Point 1 = Default values"; FLOAT pv1 := 0.4 >"@ P value 1"; VECTOR p_2 := VEC(0.0, 812.2301, 9.47991 ) >"@ Point 2"; VECTOR p_3 := VEC(0.0, 691.1125, 19.28705 ) >"@ Point 3"; FLOAT pv3 := 0.5 >"@ P value 3"; VECTOR p_4 := VEC(0.0, 463.5880, 37.7100 ) >"@ Point 4"; VECTOR p_5 := VEC(0.0, 350.6500, 37.7100 ) >"@ Point 5"; FLOAT pv5 := 0.6 >"@ P value 5"; VECTOR p_6 := VEC(0.0, 0.0000, 0.0000 ) >"@ Point 6"; FLOAT pv6 := 0.7 >"@ P value 7"; VECTOR p_7 := VEC(0.0, 399.5500, -62.47000 ) >"@ Point 7"; FLOAT pv7 := 0.4 >"@ P value 7"; VECTOR p_8 := VEC(0.0, 700.6200, -12.27000 ) >"@ Point 8"; VECTOR p_9 := VEC(0.0, 585.9870, -62.4700 ) >"@ Point 9"; VECTOR p_10 := VEC(0.0,1000.0000, -0.2100 ) >"@ Point 10"; !QVECTOR p_1 := VEC(0.0, 0.2100,1000.0000 ) !Q >"@ Point 1 = Default values"; !QFLOAT pv1 := 0.4 >"@ P value 1"; !QVECTOR p_2 := VEC(0.0, 9.4799, 812.2301 ) >"@ Point 2"; !QVECTOR p_3 := VEC(0.0, 19.2870, 691.1125 ) >"@ Point 3"; !QFLOAT pv3 := 0.5 >"@ P value 3"; !QVECTOR p_4 := VEC(0.0, 37.7100, 463.5880 ) >"@ Point 4"; !QVECTOR p_5 := VEC(0.0, 37.7100, 350.6500 ) >"@ Point 5"; !QFLOAT pv5 := 0.6 >"@ P value 5"; !QVECTOR p_6 := VEC(0.0, 0.0000, 0.0000 ) >"@ Point 6"; !QFLOAT pv6 := 0.7 >"@ P value 7"; !QVECTOR p_7 := VEC(0.0,-62.4700, 399.5500 ) >"@ Point 7"; !QFLOAT pv7 := 0.4 >"@ P value 7"; !QVECTOR p_8 := VEC(0.0,-12.2700, 700.6200 ) >"@ Point 8"; !QVECTOR p_9 := VEC(0.0,-62.4700, 585.9870 ) >"@ Point 9"; !QVECTOR p_10 := VEC(0.0, -0.2100,1000.0000 ) >"@ Point 10"; STRING s_d*30 := "Pro_11" >"Name / description"; INT graphic:= 1 >"=0: Show nothing =1: Profile =2: All"); ! Internal variables 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 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(#51, inp_err (VEC(1000,-1000,0))); EXIT("profile1 graphic is not 0, 1 or 2"); ENDIF; ! +++ ! 2. Create profile curve ! --- ! +++ ! Transformation of the curve to X/Y coordinates ! with a local coordinate system ! --- CSYS_3P(#3, "X/Ztransf", VEC(0,0,0), VEC(0,0,-1), VEC(1,0,0) :BLANK=b_val_a); MODE_LOCAL(GLOBAL_REF(#3)); CUR_CONIC(#1, "FREE", p_1 , p_2 , pv1, p_3 , p_4 , pv3, p_5 , p_5-VEC(0,1,0) , pv5, p_6 , p_6-VEC(0,0,1) , pv3, p_7 , p_7+VEC(0,1,0) , pv3, p_10, p_9 , p_8 :BLANK=b_val_a); MODE_GLOBAL(); ! +++ ! 3. Registration of profile curve with GROUP name Profile ! --- GROUP(#2, "Profile", GLOBAL_REF(#1)); ! +++ ! 4. Graphical representation of the curve ! --- TFORM_MOVE(#4, VEC(0,0,0), VEC(0,-4000,0), 5.0, 10, 1); TCOPY(#5, GLOBAL_REF(#1), GLOBAL_REF(#4), 1:BLANK=b_val_c,PEN=2); ENDMODULE