Curve divide equally parts

Hi all I have one line or curve. It has some length. How to divide the curve in equal parts without giving the no divisions or no of parts or spacing ?

It should automatically divide the curve based on the length of curve by trial and error. My maximum spacing in between the points should be 1600 not more than that. (that is tolerance)

If the spacing between the equally divided parts is less than 1600 then it should be accepted. please let me know how to do it ?

image

Use the node Curve.PointAtParameter and feed in a range from 0 to 1 and then how many divisions you want.

Nope @Alien you are giving 10 equal divisions. I dont want to give it. It should automatically calculate the number of parts or divisions based on its length of curve. But the no of divisions or spacing should not exceed 1600.

1600 is the tolerance.

1 Like

If the distance along the curve matters …

0..lgt..~max;

2 Likes

Correct me if I’m wrong @Vikram_Subbaiah, but I think this method will still round up if it’s closer, so you do have to be careful of that.

1 Like

Very interesting @Vikram_Subbaiah ,

Is there somewhere I can read more about the ~ you used?

1 Like

Hello you have information in designscriptguide

Cordially
Christian.stan

3 Likes

Yes, this could produce intervals that exceed the specified tolerance
div1

Might be safer to specify a tolerance lesser than the maximum desired

or something like this …

0..lgt..#(Math.Ceiling(lgt / max) + 1);

4 Likes

@Vikram_Subbaiah Thanks alot it worked for me

I really appreciate that

1 Like

@Vikram_Subbaiah if I use ~ then it might affect my result. But the solution given by you will work fine.

Thanks man !! Today I learn something new about ~ usage in dynamo from you.

1 Like