Distance between points on curve

Is there a simple way to measure the distance along a curve between two points which are on the curve? My current method is to copy the curve in place, trim the copied curve using the points, and then use Length to measure the length of the trimmed curve. A simple command would be very helpful.

You could try this quickie Python script on for size… Should run on Windows/Mac…

–Mitch

Edit: fixed bug

LengthAlongCrvTwoPts.py (784 Bytes)

i split it, measure it, then undo before the split… not really so bad but can be annoying while in the flow…

i’ll try out mitch’s script a little later… should be better.

out of curiosity, is it possible to make scripts that seem more command like in the sense that they have different options which are trigger_able via keystrokes etc… instead of single purpose scripts which generally require their own alias?

You can put options in in scripts that are the usual click-able command line options - that can also be triggered by typing a single letter or the option name - just like real commands… One limitation is it’s hard to mix types of options on the command line - say strings, numeric values or toggle switches - there are workarounds but they’re somewhat involved.

On Mac, the Boolean (toggle switch) type options don’t work yet. Nor do any of the methods that let you choose from a list box.

–Mitch

i see. thanks for the info.

Ever considered using grasshopper?

In what way would that be an advantage in this situation?

–Mitch

Thanks for the Python script. It would be great if it is converted into a regular Rhino command in V6.

Be interesting as a sub-option of Length I think…

–Mitch

yeah, could sort of work like SubCrv

(though now that i say that, i realize you can use SubCrv to get the length anyway… just have to undo afterwards… or esc out of the command)

but hey mitch…

can you try something real quick… trying to see if this is a rhino ‘problem’ or a mac problem.

use a file which is set to inches with distance display precision set to feet&inches (1’1-1/16 for example)

if i draw a line for example, my feedback will be shown in that display setting… if i use SubCrv though, it shows in decimal inches…

does that happen on windows too?
thanks

Yep, looks like it… --Mitch

ok. thanks

@pascal
can you have a look at this (subCrv not respecting unit display settings) and see what you think of it? thanks.

in grasshopper, you can define points on curves very easily and I think it’s more flexible than what other people describe here…

Why? With a scriipt you set it up once - create an alias, or a toolbar button - and it becomes part of your native Rhino interface. Click the button or type the alias, pick your curve and your points and you’re done - the answer is on the command line.

With GH you need to run Grasshopper (if you don’t have it already running), it needs a separate window, and even supposing you have a pre-set definition, you have to open it, and go into Rhino and reference your points and curve…

Grasshopper is a wonderful tool for doing all sorts of complex operations, but it can’t beat scripting for a lot of things. I have more than a hundred scripted tools stored in one compact custom toolbar that is part of my Rhino workspace - you can’t do that with GH. Simple operations having to do with manipulating existing doc objects are often easier because you don’t have to bake the result; especially if any of the procedures involve layers, colors, or materials. And of course, there is the possibility of directly manipulating the Rhino interface options and file characteristics.

Lastly, for the moment at least, Python scripts will (with some caveats) run on Mac… GH… nope…

–Mitch

Yep, got it, thanks, In fact, I do not know what that number is telling me in the status bar. Anyway, it is buggified.

OK, the number at the status bar is a curve parameter, not a distance…

-Pascal

ah… ok.
i don’t know what that means or how to interpret the info but i’ll be sure not to use subCrv for any length measuring procedures :smile:

Fixed for V6- that is, the readout is now a length of the sub curve, and no longer a parameter value, which has little practical use most of the time…

-Pascal

nice. good move (imo)… much more practical.

just realized subCrv is different now than when this thread originally happened.
subCrv readout is a length and you can also enter the length you’d like the subCrv to be (unless it was already that way?? can’t remember now)

it appears you’ll have to respect the curve direction when viewing the readout.

lots better than before :ok_hand: