rem P_PL.CDL rem Copy Right by International Technology Transfer Corp. rem revision 1.0-7/30/99 rem Intersection between Line and Plane clear dspflg = 1 acc = 0.0001 :start getent "Select Line", enttype on (@key + 3) goto exit, start, start, if (enttype!=2) goto start x0 = @fltdat[0] y0 = @fltdat[1] z0 = @fltdat[2] f = @fltdat[3] - @fltdat[0] g = @fltdat[4] - @fltdat[1] h = @fltdat[5] - @fltdat[2] getplane "Indicate Plane", dspflg on (@key + 3) goto exit, start, , a = @fltdat[10] b = @fltdat[11] c = @fltdat[12] d = @fltdat[13] bunbo = a * f + b * g + c * h if (abs(bunbo)>acc) goto next pause "Selected Line and Plane Are Parallel (Press Return)" redraw goto start :next t = -(a * x0 + b * y0 + c * z0 + d) / bunbo x = x0 + f * t y = y0 + g * t z = z0 + h * t point x, y, z redraw goto start :exit