Hi
I am trying to divide a polycurve using the Curve.PointAtChordLength but it doesn’t work. I just get ‘parameter at chord length Not Implemented’.
I have also tried ‘Curve.ParameterAtChordLength’ (even though I don’t know the parameter) and that too doesn’t work with polycurves. The only command that seems to work with polycurves as opposed to curves is Curve.PointAtParameter but I don’t know the parameter, I need distance.
As a work around I have even tried to manually work out the point and then to use Curve.SplitByPoints but this explodes the polycurve and returns just one curve before splitting it.
Previous posts have discussed how to do a subdivision on a polycurve using parameters but I need a single points at a fixed chord distance. Any suggestions?
That’s going to be tricky, probably a bug - even converting to nurbs isn’t implemented (reported on github here )
Here are your options:
Simple solution:
Create a point at the start parameter using the Curve.PointAtParameter method
Create a circle with a radius the same as the length you need
Intersect it with your polycurve to generate the point
Complicated solution (if your only curve is made of nurbs curves, arcs, etc)
In this situation the circle intersection could easily intersect twice or more generating more points than needed which in turn creates the problem of establishing which one is needed. Since we know its the point which is ‘first’ traveling along the length of the line, the following should work:
Follow steps 1 and 3 above
Create ‘sample’ points along the length of the curve closely spaced
(requires coding) Create a loop and iterate through the list of sample points testing the distance to the intersection points
The intersection point needed is the one closest to the sample point with the lowest index number
The above suggestion isn’t bullet proof - for example if your polycurve overlaps where there is an intersection, or of the spacing of the sample points is too great, the test above could return unpredicable/incorrect results. If however thats unlikely, it should work
I know that this works with curves but my question was if it was possible to work with polycurves. Are you saying the ONLY way to do this is to explode the polycurve and then use Curve.PointAtChordLength?
@Vikram_Subbaiah this won’t work because the polycurve contains lines and arcs. Surely there must be a Dynamo command that allows you to create a point on a polycurve…
@Paul_Wintour if you’re only getting one curve when you split then your only option left is to reconstruct it (not to be confused with ‘rebuilding with tolerance’). This isn’t trivial as you’ll need to establish any curves that preceded the one being split, and join them back together again to return a new polycurve - once again, will require a bit of coding.
We are holistically looking into improving PolyCurves around the board right now so that they will play better with all other geometry types. This will mean things like splitting a PolyCurve into smaller pieces will behave as expected. Currently we have a few cases where that doesn’t work appropriately
Likely would not be too hard to write some code which takes the start point of the curve, intersects that with a circle, takes the point with the lower parameter and appends that to the output, splits the curve at that parameter and tosses the first segment. Then loops that process until there are no more segments left.
conversion to nurbs is now supported - so I think thats the simplest way to do this today if those distance methods are still not supported for poly curves.
Hi, do you think it is possible to use only nodes without design script or python with for loops, for many points at many chord legths, where each subsequent point is based on the previous one. Here’s a thread where someone already asked about it. Loop - points at different chord lengths