Is it possible to find out the length of the curve?

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
FilosoF
Posts: 4
Joined: Wed Oct 09, 2019 4:10 am

Is it possible to find out the length of the curve?

Post by FilosoF »

If I have a curved curve, is it possible to somehow get another curve equal to the size of my curved curve?
Maybe there is such a script ?
User avatar
jahnocli
Posts: 3471
Joined: Fri Oct 29, 2004 2:13 pm
Location: UK

Re: Is it possible to find out the length of the curve?

Post by jahnocli »

Is a curve ever not curved?
You can't have everything. Where would you put it?
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Is it possible to find out the length of the curve?

Post by Greenlaw »

Only in Moho. :wink:
User avatar
Greenlaw
Posts: 9192
Joined: Mon Jun 19, 2006 5:45 pm
Location: Los Angeles
Contact:

Re: Is it possible to find out the length of the curve?

Post by Greenlaw »

FilosoF wrote: Wed Oct 09, 2019 1:09 pm If I have a curved curve, is it possible to somehow get another curve equal to the size of my curved curve?
Maybe there is such a script ?
Can you illustrate what you mean? It's a bit unclear what you're asking for.
FilosoF
Posts: 4
Joined: Wed Oct 09, 2019 4:10 am

Re: Is it possible to find out the length of the curve?

Post by FilosoF »

Greenlaw wrote: Wed Oct 09, 2019 6:11 pm
FilosoF wrote: Wed Oct 09, 2019 1:09 pm If I have a curved curve, is it possible to somehow get another curve equal to the size of my curved curve?
Maybe there is such a script ?
Can you illustrate what you mean? It's a bit unclear what you're asking for.
There is a closed curve for follow paz
Image
The task is to get a straight line equal to the size of that curve, this is necessary for a smooth distribution of objects by follow paz
FilosoF
Posts: 4
Joined: Wed Oct 09, 2019 4:10 am

Re: Is it possible to find out the length of the curve?

Post by FilosoF »

synthsin75 wrote: Wed Oct 09, 2019 10:32 pm http://mohoscripting.com/methods/796
This is a good function, but I'm not a programmer, unfortunately, and it’s impossible for me to get a solution to this problem
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Is it possible to find out the length of the curve?

Post by hayasidist »

try this:

https://www.mediafire.com/file/7vr3glc3 ... e.lua/file


put the .lua file in your custom folder e.g. C:\Users\{{your custom folder path}}\scripts\menu\Draw

select one or more points on the curve you want "flattened" then run it as a menu script -- you'll get a line (made of just 2 points) from the centre of your screen towards the right -- you can then move it wherever you want

If that's not what you want / some of the above is not clear, just ask....
FilosoF
Posts: 4
Joined: Wed Oct 09, 2019 4:10 am

Re: Is it possible to find out the length of the curve?

Post by FilosoF »

hayasidist wrote: Thu Oct 10, 2019 1:07 pm try this:

https://www.mediafire.com/file/7vr3glc3 ... e.lua/file


put the .lua file in your custom folder e.g. C:\Users\{{your custom folder path}}\scripts\menu\Draw

select one or more points on the curve you want "flattened" then run it as a menu script -- you'll get a line (made of just 2 points) from the centre of your screen towards the right -- you can then move it wherever you want

If that's not what you want / some of the above is not clear, just ask....
Thank. This is what is really needed, it optimizes and reduces a lot of time, thank you!!!
User avatar
Víctor Paredes
Site Admin
Posts: 5646
Joined: Wed Jan 26, 2005 12:18 am
Location: Barcelona/Chile
Contact:

Re: Is it possible to find out the length of the curve?

Post by Víctor Paredes »

Ah, this is interesting. Thanks.
Image Image Image Image
Moho Product Manager

www.mohoanimation.com
Rigged animation supervisor in My father's dragon - Lead Moho artist in Wolfwalkers - Cartoon Saloon - My personal Youtube Channel
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: Is it possible to find out the length of the curve?

Post by hayasidist »

updated to be more resilient to errors and to deal with multiple selected (or partially selected) curves - the "reference line" is now centred on the centre of the curve -- same link
http://www.mediafire.com/file/7vr3glc34 ... e.lua/file
Post Reply