[Plugin] BezierSpline - v2.2a - 22 Apr 21
-
I think I have found a calculation bug in the the Polyline Segmentor. The last segment seems to come out the wrong length for no apparent reason.
Fredo6's BezierSpline has been used by so many people for so long that I am hesitant to call what I am seeing a bug. But I suspect that it has been there all along. In exploring the manual, tutorials, etc. I have found phrases that take it for granted that this happens when I cannot see the reason for it.
I see descriptions of using the Polyline Divider that say the last segment will not be the same length as the others. That makes sense. The overall length is arbitrary and the segment length is fixed; of course there will be remainder.
But I see phrases that apply that same caveat to the Polyline Segmentor and that does not make sense. You are dividing a curve into a whole number of segments. There should be no remainder. If there is some calculation round off, it should be minuscule, down in the 9th or 10th decimal place. But what I am seeing is an error of nearly FIVE PERCENT.
I draw a Classic Bezier curve and I use Convert to Polyline Segmentor and I specify 32 segments. I would think those would be all the same length, or nearly, and so they are, except the imprecision of the last segment has me baffled about why it would be so different. 31 of the segments are 2.099221" in length and the final segment is 2.005871". That is a 4.65% difference.
Certainly SU Ruby is capable of more precise calculations than seem to be in use here.
That difference is barely noticeable in the curve, but these points will be the reference points for attaching more complicated structures that will come close to each other and I am afraid that when the final construction is done, there will be an aesthetic glitch, at the same level as bad kerning between typeset characters in a title. What is a 5% difference initially could become a much larger difference down the road. And 5% is itself a big enough a difference to see without measuring.
My design calls for repeating the same curve, attaching it to the previous copy, then attaching repeating elements at each curve point. I don't want the spacing of the larger elements to be visibly too tight at each and every inflection point. It will just look wrong.
I tried scaling everything up 10x before I used the Polyline Segmentor and the new numbers were 20.992211 and 20.058708, merely another decimal point of precision in my display. It's not the "too tiny" SU bug or the numbers would have changed a bit. I'm sure the underlying numbers are consistently inconsistent.
So is this a bug in Polyline Segmentor, or is this a necessity? And either way, is there a workaround? Any suggestions welcome.
Thanks,
AugustP.S. I am using the very latest BezierSpline, downloaded two days ago, running on Windows 7, SU 8.0.14346, also the latest version.
-
August,
Your remark is stamped with good sense: there is no metaphysical reasons why the last segment should not be equal to the other ones.
Here is a revised algorithm that ensures better accuracy.
I'll published the release soon.
Thanks very much for signaling the problem.
Fredo
-
Wow. Thank you for such a quick response.
The more I thought about it, the more I began to think that the error could have come from measuring the original, default 20-segment length, dividing that, and applying that new length to the new segments. Going from 20 segments to 32 segments could indeed introduce just that order of magnitude error.
But before I could experiment with that theory, here you are with the problem fixed. Wow.
No point now in my trying to figure out what the issue used to be.
Thanks again,
August -
@the.pjt said:
we want a toolbar with one Icon that runs commands on the screen like your toolsonsurface, curvy loft ,etc
+1
actually the only downside in one of the best plugin ever! -
-
Hello.
Jack here, new to Sketchup8, plugins, etc. I am designing a guitar and I would really appreciate your help with this and future questions, which are going to be my contribution since at the moment I don't have any answers.
I just downloaded the BezierSpline and installed it to the plugins folder on the macintosh HD so, my question is where is the location of the controls when I am in Sketchup8. Thanks. -
@jack camino said:
Hello.
Jack here, new to Sketchup8, plugins, etc. I am designing a guitar and I would really appreciate your help with this and future questions, which are going to be my contribution since at the moment I don't have any answers.
I just downloaded the BezierSpline and installed it to the plugins folder on the macintosh HD so, my question is where is the location of the controls when I am in Sketchup8. Thanks. -
Thanks Thomas.
Let me show you what I have in my computer, see the attached pictures. Also, I don't understand what do you mean when you say remove the icon files in (BZ dir 14 ....images cad father). I guess that is the reason menu draw doesn't show bezier curves and I don't have a BesierSpline toolbar. Can you see the pictures and help me? Thanks.
-
You haven't followed the footprint as laid out in the first post.
You've got one too many folder levels. Move the contents of the one indicated into the Plugins folder and get rid of that folder.
Also go to the SketchUp menu (to the left of File) and click on Preferences>Extensions and tick any and all boxes you find there.
-
OSX wraps all extracted ZIPs into a folder with the same name as the ZIP. It is the content of that folder that should be in the Plugins folder. So you want to extract to a temp location, then move the correct files.
You can use this utility to make it easier to install correctly:
http://forums.sketchucation.com/viewtopic.php?t=42315Also, here's an article on installing plugins:
http://www.thomthom.net/thoughts/2012/01/installing-plugins-for-google-sketchup/(Dave beat me to it.)
-
-
Thanks, hopefully responding allows me to download this tool!
-
Thanks Fredo. I love yours plugins.
-
In using the Classic Bezier Curve, I tried to change segments from 20s to 6s but doesn't seem to want do that and pressing tab doesn't seem to bring up anything obviously I'm missing something here I'm sure maybe someone can help. Thanks
-
@mwm5053 said:
In using the Classic Bezier Curve, I tried to change segments from 20s to 6s but doesn't seem to want do that and pressing tab doesn't seem to bring up anything obviously I'm missing something here I'm sure maybe someone can help. Thanks
i'm not 100% sure of the # with classic bezier but i do know that if you're using a uniform B-spline, the lowest acceptable amount of segments is 15s (and if you enter something lower, it will still be 15 segments)
[EDIT]-- with classic bezier curves, the lowest acceptable # is 7
-
Thanks Jeff will try that
-
Thank you Fredo, a most excellent plugin and easy to use!
-
THANK YOU SOOOOO MUCH
-
Is anybody using this plug in on Mac Sketch Up Pro2013? My plugin crashes after a few seconds....
-
Have you got the latest files and the latest LibFredo...
Which was recast for v2013 compatibility.Also do you have any other know problem tools loading like Vray-beta ??
Advertisement