-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
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`
Metadata
Metadata
Assignees
Labels
No labels