You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cost() function doesn't output the correct number of points.
Here is an example : res should countain 21 elements whose type isn't "None", but instead there are 23 of them
`from cereals.src.openalea.cereals.simplification import cost
import openalea.plantgl.all as pgl
During the simplification, I can not remove extremal points (first and last point).
nb_point expresses only the nuber of internal point we want to keep in the polyline.
Ok thanks, I understand for this example.
But the problem is that for a same value of nb_point (21), the number of points I obtained is not always the same : for some polylines I obtain 23 points (like in my code example), but sometimes I also obtain 22 or 21 points.
cost() function doesn't output the correct number of points.
Here is an example : res should countain 21 elements whose type isn't "None", but instead there are 23 of them
`from cereals.src.openalea.cereals.simplification import cost
import openalea.plantgl.all as pgl
xn, yn, sn, rn = (np.linspace(0, 0.7, 155),
np.linspace(0, 0.4, 155),
np.linspace(0, 1, 155),
np.ones(155))
nb_points = 21
points = [pgl.Vector3(*pt) for pt in zip(xn, rn, yn)]
res = cost(polyline=points, nb_points=nb_points)
print(len(res)) # 155, OK
print(len([r for r in res if r])) # 23, instead of 21`
The text was updated successfully, but these errors were encountered: