Hi everyone!
I am writing a python script to convert from Moho format to other vector software.
The script is already capable to extract points and convert simple shapes.
But I cannot figure out how Moho interpolates curve between points. Is there any documentation for this algorithm available?
Thanks in advance!
Curve interpolation algorithm
Moderators: Víctor Paredes, Belgarath, slowtiger
-
- Posts: 2
- Joined: Sun May 26, 2024 8:17 am
- synthsin75
- Posts: 10264
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Curve interpolation algorithm
If memory serves, I believe it's cubic beziers, defined by 4 points.
Hayasidist knows all about that. Hopefully he chimes in.
Hayasidist knows all about that. Hopefully he chimes in.
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- hayasidist
- Posts: 3840
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Curve interpolation algorithm
yeah cubic bezier. Assuming you know what that is:
the actual Moho points are P0 and P3. You then need to derive P1 and P2 from the way Moho stores the "curvature" -- see https://mohoscripting.com/snippets/5
the actual Moho points are P0 and P3. You then need to derive P1 and P2 from the way Moho stores the "curvature" -- see https://mohoscripting.com/snippets/5
Re: Curve interpolation algorithm
Also note: If you are reading the Moho JSON data - in some cases you may not get the true position of the points - if they are influenced by Bones, Actions, Smart Actions, Physics, Meshes or Curvers.
Moho 14.3 » Win 11 Pro 64GB » NVIDIA GTX 1080ti 11GB
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
Moho 14.3 » Mac mini 2012 8GB » macOS 10.15 Catalina
Tube: SimplSam
Sam
-
- Posts: 2
- Joined: Sun May 26, 2024 8:17 am
Re: Curve interpolation algorithm
Awesome! Thank you so much for responding, everyone!
The information you provided helps a lot!
The information you provided helps a lot!