# Like AlongCrv, but different

Hello,

It can be done manually with no problems, but shall be automatic.

The goal is to get evenly spaced points on a contour.
_ArrayCrv is the wrong tool, it produces even distance along the curve.
I need the same distance between the points.

Ideas how to manage it?

Thanks,
-C-H-A-R-L-E-S-

You could do it using grasshopper with a couple of clicks - have it even interactive with distance or points amount and circle diameter etcâ€¦

EDIT - hmm or maybe not - what I now see is taht your distance is linear regardless of the curvatureâ€¦ This would need some fiddling withâ€¦

Regards,
Mac

Yes, true unfortunately.

Rough idea:
Get the start point of the curve (= last good point)

Make a circle radius = desired distance, center = last good point
Get intersection point from circle/curve
Test, if the intersection is on the curve (in most cases this will be 2 points)
Add the int point to a collection, only if the point was not already there
If success, make the int point the last good point
Start over until no point could be added to the point collection

I still believe there must be an easier wayâ€¦

-C-H-A-R-L-E-S-

Hello,

use pythonscript:
divideByLength.py (437 Bytes)

import rhinoscriptsyntax as rs

# Get geometrical object

obj = rs.GetObject(â€śSelect a curve to divideâ€ť)

# if obj is curve

if rs.IsCurve(obj):
# divide by length, geet points
# create circles out of pts
for pt in pts:

TomTom,

this doesnâ€™t result in equal distances between the pointsâ€¦
I mean the length of a line point to point.

-C-H-A-R-L-E-S-

I found this script
https://wiki.mcneel.com/developer/scriptsamples/divideequidistance

Wow, thatâ€™s exactly as wanted!
And from what I see similar to my fantasy logicâ€¦

Thank you,
-C-H-A-R-L-E-S-

oh, okay my fault

now its even more simple :
divideEq.py (382 Bytes)

[â€¦]

T-O-M-T-O-M

Doesnâ€™t Rhino have a command for this?

Is there something I am not getting?

Â«Randy

Hi Randy - that divides by arc-length along the curve, Charles was looking for even linear distance.

-Pascal

@pascal I see, just rereading this on my dinner break. That is more difficult.

Yeah - RhinoScript has a method just for that - `DivideCurveEquidistant()`.

-Pascal

1 Like

Thanks TomTom,

I think simpler is not possibleâ€¦
â€¦great

CharlesCharles