I can't find any good method to insert a point on a spline, please see the code below. I want to insert a point on an existing spline, and after insertion ,the shape of the spline shoud not change much.
if (Acad::eOk != pSpline.openStatus()) return;
if (acedGetPoint(NULL,_T("\nclick:"),pt) != RTNORM)
double dParam = -1;
pSpline->getParamAtPoint(pt3d,dParam);// here , the value of dParam is not what I want.
my purpose is to insert a fit point to the spline. I get get closest point P1 on the spline for the point I click on the screen.
but through the method getParamatPoint, the param I got of P1 has nothing to do with the fit point. I want to use insertFitPointAt. and insertFitPointAt requires the number of fit point. is there an existing method that can return which two fit points P1 is between.
There is no existing method to do that directly. You did not describe your overall goal, so I can't offer any alternative solutions.
oh, if so , I have to calculate the "param" for each fit point, then compare these params with the insert point and determine which fit point is the right one for "insertFitPointAt".
still,thanks a lot.
Access a broad range of knowledge to help get the most out of your products and services.