// 3to4points.ls by Felipe Esquivel // // This simple script creates a point based in the position of other 3 points, // the 4 points are co-planar (all are in the same plane). // // Use: Select 3 points and run the script. The first point is the tail // of the vectors, the 4th vector is the result of the sum of both vectors // (trust me, it works). @version 2.4 @warnings @script modeler main { loc1 = <0,0,0>; loc2 = <0,0,0>; loc3 = <0,0,0>; loc4 = <0,0,0>; selmode(USER); editbegin(); // check if 3 and only 3 points are selected numPts = pointcount(); if(numPts != 3) { error("You must have 3 points selected to perform this operation"); return; } if(numPts == 3) { loc1 = pointinfo(points[1]); loc2 = pointinfo(points[2]); loc3 = pointinfo(points[3]); // calculate the fourth point with vectors loc4 = loc2 - loc1 + loc3; addpoint(loc4); } editend(); }