*************************************************************** ! SET VARIABLES !*************************************************************** ! ! L = get(LENGTH) ;!GET ROW OF OPENING W = get(PARAM2);!GET DEPTH OF TRIM H = get(PARAM3);!GET HEIGHT OF TRIM ! Brick_Pattern = get(BRICK_PATTERN) ;!GET BRICK PATTERN STYLE 0 = SOLID BRICKS, 1 = ALTERNATING, 2 = STRIPED ! Config = get(PARAM4);!GET KEY STONE ON/OFF Offset_X = get(PARAM5);!GET OFFSET ON SIDES Offset_Z = get(OFFSET_Z) ! L = L + Offset_X;!RECALCUALTE TRIM LENGTH ! splay_angle = get(SPLAY_ANGLE) ;!GET SPLAY ANGLE AT ENDS Theta = 90 - splay_angle ;!CALCULATE INSIDE ANGLE Offset = H / tan(splay_angle) ;!CALCULATE OFFSET AT ENDS FOR TOP ! !*************************************************************** !Keystone Base Height=WZ !*************************************************************** ! WZ = Offset_Z ! !*************************************************************** !CALCUALTE TOTAL LENGTH OF TRIM ACROOS TOP !*************************************************************** ! Width_top = L + Offset_X + (2*Offset) ! !*************************************************************** !Size Check - Width greater then 12" !*************************************************************** ! if L<0.1 then L = 12 ! !*************************************************************** !SET PARAMETERS !*************************************************************** ! linewidth 0.13 ; level 110 ! Pcolor1= lwindex("TRIM.BRICK") pcolor Pcolor1 ! !*************************************************************** !DEFINE PRIMARY POINTS OF TRIM AND CREATE TRIM !*************************************************************** ! point(1) -Offset_X,0,Offset_Z point(2) L,0,zcoord(1) point(3) xcoord(2)+Offset,0,zcoord(1) + H point(4) xcoord(1)-Offset,0,zcoord(1) + H line(1) P1,P2; line(2) P2,P3; line(3) P3,P4; line(4) P4,P1 Plane(1) L1,L2,L3,L4 make_volume(1) "RAISE" S1, -W ! !*************************************************************** !CALCUALTE THE RADIUS OF A CIRLCE NEEDED TO ENCOMPESS TOP !*************************************************************** ! C = Width_top ;!CHORD LENGTH TO USE WHICH IS THE LENGTH OF TRIM ACROSS THE TOP R = (C/2) / sin(Theta) ;!CALCULATE THE RADIUS ! C2 = 4 ;!DEFINE A NEW CHORD LENGTH EQUAL TO A BRICK SIZE D = (C/2) / tan(Theta) ;!CALCULATE THE DISTANCE FROM THE CHORD TO THE CENTER OF THE CIRCLE !THIS WILL DEFINE THE Z HEIGHT OF THE CIRCLE Radius = R Theta2 = asin((C2/2)/R) ;!CALCULATE THE ANGLE NEEDED FOR THE GIVEN CIRCLE TO FIT THE DEFINED BRICK SIZE ! Theta_Dif = Theta - Theta2 ;!CALCULATE THE DIFFERENCE BETWEEN THE ANGLE ACROSS THE TOP AND THE BRICK THETA !THIS WILL DEFINE THE TOTAL ANGLE NEEDED TO DIVIDE INTO BRICKS ! Num_Segments = int_part(Theta_Dif / (Theta2*2)) ;!CALCULATE THE NUMBER OF SEGMENTS Num_Segments = int_part((180 - (splay_angle * 2))/ (Theta2*2)) ;!CALCULATE THE NUMBER OF SEGMENTS ! Theta_Rotate = (180 - (splay_angle * 2)) / Num_Segments ;!CALCULATE THE ANGLE OF ROTATION FOR THE NUMBER OF GIVEN SEGMENTS ! Theta_Current = splay_angle + Theta_Rotate ;!DEFINE BASE ANGLE USED FOR BRICK LINES ! point(999) xcoord(1)+((L+Offset_X)/2), -W*1.01, zcoord(1)-D+H ;!DEFINE POINT OF CIRCLE CENTER ! TopOrBottom = 0 ;!DEFINE IF BRICK PATTER STARTS AT TOP OR BOTTOM IF ALTERNATING PATTERN ! loopCounter = 1 ! loop exitif Theta_Current > (180 - splay_angle) ! !*************************************************************** !DEFINE POINTS FOR BRICK LINE !*************************************************************** ! point(100 + loopCounter) xcoord(999)+ ((D - H) / tan(Theta_Current)), ycoord(999), Offset_Z point(900 + loopCounter) xcoord(100 + loopCounter) + (H / tan(Theta_Current)), ycoord(999), Offset_Z + H ! !*************************************************************** !LINE FOR BRICK !*************************************************************** ! line P(100 + loopCounter), P(900 + loopCounter) ! !*************************************************************** !IF BRICK PATTERN ON DRAW LINE(S) !*************************************************************** ! if Brick_Pattern <> 0 then if Brick_Pattern = 1 then ! !*************************************************************** !LINE AT BOTTOM !*************************************************************** ! if TopOrBottom = 0 then if loopCounter > 1 then point(98) xcoord(100 + loopCounter) + 4 / tan(Theta_Current), ycoord(999), zcoord(1) + 4 point(99) xcoord(100 + (loopCounter-1)) + 4 / tan(Theta_Current-Theta_Rotate), ycoord(999), zcoord(98) else point(98) xcoord(100 + loopCounter) + 4 / tan(Theta_Current), ycoord(999), zcoord(1) + 4 point(99) xcoord(2) + 4 / tan(splay_angle), ycoord(1), zcoord(98) endif ! TopOrBottom = 1 ! !*************************************************************** !LINE AT TOP !*************************************************************** ! else if TopOrBottom <> 0 and H > 8 then if loopCounter > 1 then point(98) xcoord(100 + loopCounter) + 8 / tan(Theta_Current), ycoord(999), zcoord(1) + 8 point(99) xcoord(100 + (loopCounter-1)) + 8 / tan(Theta_Current-Theta_Rotate), ycoord(999), zcoord(98) else point(98) xcoord(100 + loopCounter) + 8 / tan(Theta_Current), ycoord(999), zcoord(1) + 8 point(99) xcoord(2) + 8 / tan(splay_angle), ycoord(1), zcoord(98) endif ! TopOrBottom = 0 else TopOrBottom = 0 endif endif ! line P98,P99 endif !