This has nothing to do with meshes.
The script works on the selected/active Curve
and produces a new simplified version. (also a curve).
If you convert a curve to a mesh you can control the intermediary points with the curve’s resolution setting.
Hello, thanks for this script, I guess I will try to make a similar one for animation curves, since the cleaning function which is there default is quite silly…
It should be fairly easy to convert this to use on fCurves.
The simplification functions should work right out of the box, more or less i think.
Because it shouldn’t matter if the points are only 2D.
Hello, this is the updated script, the functions work great, however I am not able to do it so that the operator can be re-run, and the precision is set by default to a too low level. Thanks again for the implementation of the functions…
but as it is, it will help me a lot anyway. http://www.pasteall.org/13422
Ricky blender - just select a curve, run the op and see the ‘last operator’ area…?
If it’s ok with you i put your stuff in the script that is already in contrib.
You have added a test for 3 points on a line in the altitude function?
and i believe it has to be radians, not degrees. But i am not sure now. Haven’t tested, and if it works,…
who am i to complain
ah! you are so quick to reply.
and there was a bad bug in the op
now it works as it should - with distance and curvature mode, with correct precision
great!
and yes, you are the right person to complain, your coding style is much cleaner than mine this pasteall version doesn’t have the radians there yet. And of course, use the script anyhow, I just hacked over your script http://www.pasteall.org/13424
great script again,
it works really well & is very useful.
Basically the script smooths the original curve so it’s nicer to view & work with.
some steps,
Activate the script in addons.
Create a Curve.
In Edit Mode, add some more points to the curve.
(hold Ctrl & Left Click to add more points)
Make it messy.
Go back to Object Mode.
In the Toolbar Menu,
Search for ‘Simplify’ ( you get it after ‘sim’ )
Press the Simplify Curves Button.
The script creates a duplicate of your curve & creates a menu with some settings.
The new curve object is a better, smoother, more consistent curve.
Cool.
pildanovak: i thought about what you did in the altitude function.
And i am sorry to report that it makes no sense.
Your edglelength test is true if and only if all three points have exactly the same
coordinates.
In case of fcurves i believe this can never happen?
For 3d curves this may be true and i must confess that i am not sure what happens then,
but my guess is that it returns simply an altitude of 0 in that case, which would be fine.
testscreenings - actually the angle function returns error if any of the 2 vectors is 0, so it cancels the script and makes it not work in such cases. Something like remove doubles would work too I suppose.
For the f-curves it actually can happen, if automerge of keyframes is off.
if edge1.length>0 and edge2.length>0: # this means if both of the vectors are non 0 it runs the angle function, so also for only 2 points on same location it goes to the else statement. But It was just a quick hack to make it work, I had an example curve where that happened(from greasepencil, there it can happen I gues quite often), and the script worked ok after that, although it probably didn’t remove those conflicting points correctly, because of ridiculous value for the angle - 180. This value I did put in because I supposed that in the case of a flat angle, one of the points gets removed.
by the way, I still wonder how well such short script works with the curves(both types), and it’s a really great feature I did some animating overnight, using the recording feature, and the resulting curves behaved well after the simplification.
like you select some points in a mesh in line and want to reduce it to a lower qty of points
but that would have to be in edit mode and not certain how you deal with faces here !
or you don’t do the faces and let it to the user to do it manually afterward may be !
i like the way it works when you increase the distance factor and see in viewport the results
of reducing the qty of points on curve
that’s really a great script. It is what I was looking for.
In particular, I am using it successfully with GreasePencil.
GreasePencil on Surface > Convert to Bezier Curve > SimplifyCurve > ConvertToMesh > Make Surface (with F).
soneone ask if it was possible to limit the resol per segment or portion of curve!
anyway that you can add an option to your script so that you can select the min max vertices on an existing curve then apply this algo to a portion of a curve only?
drosah: I tried a little bit and it works for me. So please explain in which circumstance it doesn’t work exactly. The video is nice but as far as bug reports go not that helpful.