patmo141 / cut_mesh

Tools for mesh trimming and cutting in Blender
64 stars 18 forks source link

replace versioned code with fn call! #45

Open vxlcoder opened 6 years ago

vxlcoder commented 6 years ago

replace stuff like below with a standard function call

if bversion() < '002.077.000':
    loc, no, face_ind = self.cut_ob.ray_cast(imx * ray_origin, imx * ray_target)
else:
    res, loc, no, face_ind = self.cut_ob.ray_cast(imx * ray_origin, imx * ray_target - imx * ray_origin)
patmo141 commented 6 years ago

There is some great ray casting code in RF, that handles some of the issues that used to be associated with negative Z direction in perspective vs orthographic mode. May I suggest a ray_cast.py which has demo usage of ob.ray_cast, scene.ray_cast, bvh.ray_cast along with the helper functions you created that assess the bounding box etc.