! TITLE: rec_surf_cut.mac (SM_TOOL) ! ! ! OBJECTIVE: ! ! This sub-macro partitions a selected volume, or set of volumes, into a ! rectangular shaped interior region and the remaining volume(s) exterior ! to the rectangle surface. ! ! ! COMMAND SYNTAX: ! ! (1) (2) (3) (4) ! REC_SURF_CUT, opt, actcs, L, H ! ! ! ARGUMENTS: ! ! (1) opt = input options: ! ! 0 (or blank) = position rectangle by center location. ! ! 1 = position rectangle by corner location. The corner ! location is the origin of the active coordinate system ! used in the construction of the rectangular profile, such ! that the rectangle lies within the +X and +Y plane (1st ! quadrant). ! ! (2) actcs = active coordinate system to build rectangular profile ! relative to. ! ! (3) L = length of rectangle parrallel to X axis of active C.S. ! ! (4) H = height of rectangle parrallel to Y axis of active C.S. ! ! ! DESCRIPTION: ! ! This sub-macro creates a rectangular shaped surface that partitions a ! selected volume or set of volumes into 2 distinct regions: ! ! a.) a volume(s) within the rectangle surfaces ! b.) a volume(s) exterior to the rectangle surfaces ! ! The rectangle surfaces essentially act as a "cookie cutter" to the sel- ! ected volumes, cutting out a volume of its shape within the selected ! volume(s). ! ! The rectangular profile is extruded in the -Z direction of the active ! C.S., thereby creating the rectangular surface that penetrates the volume(s) ! and 'cuts' (partitions) the volume(s) into the 2 regions. ! ! ! ! *get,prkey_,active,0,prkey /nopr opt=arg1 actcs1_=arg2 length_=arg3 height_=arg4 ! cm,vset100_,volu aslv,s lsla,s ksll,s cm,kset100_,kp ! *if,opt,eq,0,then length_=length_/2 height_=height_/2 *endif ! csys,actcs1_ ! *get,acs1_,active,,csys ! axis coordinate system (CS) *get,acstyp_,cdsy,acs1_,attr,kcs ! axis CS type ! *if,acstyp_,ne,0,then ! If axis CS is not cartesian, then create_cs,0,'acs1_',0,0,0,0,0,0,0 ! create cartesian CS at same location. *endif ! *if,opt,eq,0,then k,,-length_,-height_,0 k,,length_,-height_,0 k,,length_,height_,0 k,,-length_,height_,0 *elseif,opt,eq,1,then k,,0,0,0 k,,length_,0,0 k,,length_,height_,0 k,,0,height_,0 *endif ! create_lines ! cmsel,s,kset100_ ! max_kp_dist,acs1_,'r' dcut_=2*max_dist ! k,,kx(km),ky(km),-2*max_dist ! init_entity_num ! lstr,km-1,km ! init_entity_num l_drag=lm ! adrag,lm-1,lm-2,lm-3,lm-4,,,lm ! init_entity_num ! isolate_areas ! cm,aset100_,area ! init_entity_num ! vsba,vset100_,aset100_,,delete,delete ldele,l_drag,,,1 ! init_entity_num ! csys,actcs1_ ! lplot ! *set,opt_, *set,l_drag, *set,length_, *set,height_, *set,actcs1_, *set,acstyp_, *set,acs1_, *set,dcut_, *set,max_dist, cmdele,vset100_, cmdele,aset100_, cmdele,kset100_, *if,prkey_,eq,1,then /go *endif