Method library?
-
So I keep thinking about methods and trying to program mine better so I can re-use them easily. And in my quest to make methods more easy to copy and paste, I keep thinking it might be interesting to somehow try to make them accessible here.
Anyone have any ideas? A big thread full of methods ready to copy and paste. Just list what the method require for input, what it does and what it returns?
Or would starting a new thread for each method we want to post using the [Code] tag make better sense? I like how that works for plugins. And some people are using the [code] tag already.
Does anyone have any thoughts no what would be a good way to go about something like this?
Chris
-
I think a single sticky would be the best idea, with all the methods added to the first post. I think having each new method in it's own thread would get very messy very quickly, i'd imagine it would also be quite confusing for newbies.
From a ruby point of view, I think we'd have to be pretty explicit about getting people to use modules and classes in their scripts, otherwise any slight modification to any of the methods in one script could break other scripts.
-
I was leanin towards something like that too at first, but then when I remembered the [code] tag, I started liking that idea. Maybe a sticky that has a link to all [code] threads so its easzy to sort through them. I'm thinking a single thread might tend to have a method, then some posts and discussions, then another method, and some discussion, and on an one. And it might make it tricky to dig through 20 pages, with only 1 method per page or something. That is my onoly concern with doing a single sticky thread.
I have a bezier method I'd like to post. It requires as input: point1, handle1, point2, handle2, segment_count. Thats it, and it returns an arc object, or with a tweak it just returns an array of Point3d objects. So thats one method I'd like to post.
Another is one that will take any series of connected edge segments and return them in an ordered array of points from the beginning to end.
Chris
Advertisement