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: Fahim, Distinct Sun, Víctor Paredes, erey, 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 » 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 ?
User avatar
jahnocli
Posts: 3342
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 » Wed Oct 09, 2019 5:44 pm

Is a curve ever not curved?
You can't have everything. Where would you put it?
User avatar
Greenlaw
Posts: 4410
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 » Wed Oct 09, 2019 6:09 pm

Only in Moho. :wink:
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2019 Edtion
Lead Digital Animator, Dreamworks Animation

Image
User avatar
Greenlaw
Posts: 4410
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 » 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.
D.R. Greenlaw
Artist/Partner - Little Green Dog | Little Green Dog Channel on Vimeo | Greenlaw's Demo Reel 2019 Edtion
Lead Digital Animator, Dreamworks Animation

Image
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 » Thu Oct 10, 2019 10:22 am

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 » Thu Oct 10, 2019 10:23 am

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
hayasidist
Posts: 2130
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 » 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....
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 » Fri Oct 11, 2019 9:56 am

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
Posts: 4873
Joined: Wed Jan 26, 2005 12:18 am
Location: Ireland/Chile
Contact:

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

Post by Víctor Paredes » Fri Oct 11, 2019 11:35 am

Ah, this is interesting. Thanks.
Víctor Paredes
Former Moho Product Manager
Animator in Cartoon Saloon
My Youtube Channel - My webinars
hayasidist
Posts: 2130
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 » Mon Oct 14, 2019 10:24 pm

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