I am trying to use ghpythonlib.components with a data tree, but always getting flattened lists as a result. I have tried to follow this example but ghpythonlib.tree.function() returns that tree is not part of ghpythonlib. In the example below I want to order find the closest point from multiple curves for a grafted list of points. The following does not work;
import ghpythonlib.components as ghcomp import ghpythonlib.treehelpers as th #pts = a list of points #crvs = a list of two or more crvs closest_pts = ghcomp.CurveClosestPoint(th.list_to_tree([[p] for p in pts]),crvs)) sorted_pts = ghcomp.SortList(closest_pts) closest_pt = ghcomp.ListItem(sorted_pts, 0, False)
Also how can this example be made to leverage ghpythonlib.parallel ?
Can parallel computation be harnessed within the script when it runs only once as a component but has a host of parallel enabled functions within it? or does ghpythonlib.parallel require the component to run multiple times in order to take effect?