! TITLE: cut_tool.mac (SM_TOOL) ! ! ! OBJECTIVE: ! ! This sub-macro cuts a selected set of volumes by creating a cutting tool ! from a keypoint set, aclosed line loop or a set of areas. ! ! ! COMMAND SYNTAX: ! ! OPTION 1: ! (1) (2) (3) (4) (5) ! CUT_TOOL, ext_dis, rev_dir, cacs, del_cut, btol ! ! ! OPTION 2: ! (1) (2) (3) (4) (5) (6) ! CUT_TOOL, ext_dis, vol, rev_dir, cacs, del_cut, btol ! ! ! ARGUMENTS: ! ! (1) ext_dis = the distance of extrusion of the area or line loop ! ! (2) vol = selected volume to be cut ***(OPTION 2 only)*** ! ! (2,3) rev_dir = reverse extrusion direction parameter: ! ! 0 (or blank) = negative extrusion direction ! ! -1 = reverse extrusion direction ! ! (3,4) cacs = boolean operator to create lines in active coordinate ! system: ! ! 0 (or blank) = creates straight lines between KP's, ! regardless of active c.s. ! ! 1 = creates lines in active c.s. ! ! (4,5) del_cut = delete cutting tool parameter: ! ! 0 (or blank) = delete cutting tool ! ! 1 = keep cutting tool ! ! (5,6) btol = boolean operation tolerance level: ! ! LEVEL BOOLEAN TOLERANCE ! ----- ----------------- ! 0 (or blank) 0.00001 (default) ! 1 0.000025 ! 2 0.00005 ! 3 0.000075 ! 4 0.0001 ! 5 0.00025 ! 6 0.0005 ! 7 0.00075 ! 8 0.001 ! 9 0.0025 ! 10 0.005 ! 11 0.0075 ! 12 0.01 ! 13 0.1 ! ! 0 < btol < 1 = value of btol is directly assigned ! ! * NOTE: This argument only needs to be specified in the event ! of normal (default) boolean solid model failures. ! ! ! DESCRIPTION: ! ! This macro cuts a volume shape from a selected volume by creating a cutting ! tool volume from: ! ! a.) a loop-ordered keypoint set not attached to any lines or areas ! ! AND / OR ! ! b.) a connected, closed line loop profile that does not bound (attach) ! an area ! ! AND / OR ! ! c.) an area, or set of areas, which are not attached to any volumes ! ! The resulting cutting tool(s) will cut out the selected set of volumes ! that intersect the volume space of the cutting tool. There must exist ! either a closed-loop line set that is not attached to an area, or a set of ! areas unattached to any volumes, or both. The algorithm will determine ! which set of entities exists and perform the proper operations. The only ! restriction in any of the above cases is that there can only exist one un- ! attached closed-loop line set. The algorithm will fail if their are more ! than one closed loop. ! ! The direction of area extrusion is into a volume or set of volumes. There- ! fore, the default extrusion direction is negative for an area whose posi- ! tive outward normal is assumed in a direction out of the volume. If the ! required direction of extrusion of the cutting tool is incorrect, then ! simply placing a 1 in argument 2 will reverse the direction of extrusion. ! If the cutting tool is desired to be kept instead of deleted, then place a ! 1 in argument 3. ! ! For the case of unattached keypoints (a), the keypoints must be the last ! entities created prior to running this command, otherwise the algorithm will ! fail to create an area from them. ! ! OPTION 1: ! ! If the selected volume to be cut is a volume, or set of volumes, that is/are ! currently selected; or if the selected volume(s) to be cut is a subset of a ! currently selected set of volumes, then that volume, or set of volumes, needs ! to be selected prior to execution of this command. In either case, the arg- ! ument structure in OPTION 1 outlined above is used. ! ! OPTION 2: ! ! If the selected volume to be cut is a single volume from a set of currently ! selected volumes, then placing that specific volume number in argument 2 ! and following the argument structure in OPTION 2 above will suffice. ! ! ! *get,prkey_,active,0,prkey /nopr ! extd_=arg1 ! *if,arg2,le,0,then extdir_=arg2 cacs__=arg3 delcut_=arg4 btol_=arg5 *else vol__=arg2 extdir_=arg3 cacs__=arg4 delcut_=arg5 btol_=arg6 ! vsel,s,volu,,vol__ *endif ! *if,btol_,eq,0,then btol,defa *else *if,btol_,eq,1,then btol,0.000025 *elseif,btol_,eq,2,then btol,0.00005 *elseif,btol_,eq,3,then btol,0.000075 *elseif,btol_,eq,4,then btol,0.0001 *elseif,btol_,eq,5,then btol,0.00025 *elseif,btol_,eq,6,then btol,0.0005 *elseif,btol_,eq,7,then btol,0.00075 *elseif,btol_,eq,8,then btol,0.001 *elseif,btol_,eq,9,then btol,0.0025 *elseif,btol_,eq,10,then btol,0.005 *elseif,btol_,eq,11,then btol,0.0075 *elseif,btol_,eq,12,then btol,0.01 *elseif,btol_,eq,13,then btol,0.1 *elseif,btol_,gt,0,and,btol_,lt,1,then btol,btol_ *endif *endif ! cm,vset1__,volu ! execute_=0 extd_=-extd_ ! *if,extdir_,eq,-1,then extd_=-extd_ *endif ! create_area,cacs__ ! isolate_areas *get,acount__,area,,count ! isolate_lines *get,lcount__,line,,count ! *if,acount__,gt,0,then *if,lcount__,gt,0,then create_area-lines isolate_areas *get,acount__,area,,count *endif *endif ! *if,acount__,gt,0,then execute_=1 isolate_areas extrude_aset,extd_ ! *do,abc__,1,acount__,1 *if,abc__,eq,1,then vsel,s,volu,,vm-(acount__-abc__) *else vsel,a,volu,,vm-(acount__-abc__) *endif *enddo *else *if,lcount__,gt,0,then execute_=1 create_area-lines voffst,am,extd_ init_entity_num ! vsel,s,volu,,vm *endif *endif ! *if,execute_,eq,1,then cm,vcut__,volu ! init_entity_num ! *if,delcut_,eq,0,then vsbv,vset1__,vcut__,,delete,delete *elseif,delcut_,eq,1,then vsbv,vset1__,vcut__,,delete,keep *endif ! cmdele,vcut__ *endif ! btol,defa ! init_entity_num ! lplot ! *set,extd_, *set,extdir_, *set,delcut_, *set,abc__, *set,acount__, *set,lcount__, *set,execute_, *set,cacs__, cmdele,vset1__ ! *if,prkey_,eq,1,then /go *endif