[Plugin] Simple Loft alpha 0.1b -- UPDATED May-15-09
-
His original post is here:
http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=19327&start=0&st=0&sk=t&sd=a
I've responded (well, just asking for clarification).
Thanks everyone else for the comments.
Chris
-
@chris fullmer said:
With just 2 splines, I take the centerpoint of each collective spline. Then get the vector between those 2 centerpoints. That is the vector I use on each vertex to find the handle point - just follow the vector 1/2 the distance to the other point that the curve will connect to.
Hmm. First, terminology: The splines are the starting curves and the Beziers are the curves that connect the vertexes of those starting curves. Right?
(An aside, what is a "loft"? Is that a standard term? Where does it come from? Is is meant to convey an image of a sail filled with wind or a bedsheet settling down after you've fluffed it in the air? If so, then fabric metaphors rule and the bamboo-mat, reversed pleats glitch.)
So, you find the centerpoint of each collective spline. One point for the top spline and one point for the bottom spline. I'm assuming not the center vertex but the geometrical center of the extents of the spline, right?
A vector between them. A line from the geometrical center of one spline to the geometrical center of the other, then half that distance to create top and bottom vectors. Then those half-vectors are applied to each point on each of the splines and a Bezier generated between them, with those half-vectors determining the angle at which the Bezier curves connect to that splines, top an bottom.
OK, that was one question, the attachment angles.
That explains why the half circles don't generate edges that will join with other half circles. The centerpoint of each half-circle spline is not the center of the arc, it it offset, so the Beziers at the ends of each spline start at each end with an inward tilt, even if all four endpoints of the splines are coplanar. Knowing that should also give the solution to the half-circle joining problem. Extend the ends of arcs with lines until the center of the arc-plus-lines spline lands at the center of the arc.
@unknownuser said:
I probably will have to do a video to show the workings of it.
Not needed for me. But, like with the "bug" about not being able to join half-circle lofts, knowing what it is doing internally can help solve problems.
@chris fullmer said:
I'm sure that doesn't answer all the questions. ... Do you just want to understand how the curves are working?
I'm looking for explanations of the behaviors that don't match my expectations. The half circles not generating edges that could join is one. I think I've got that one, including a work-around.
The other is the three-spline example with all the pleats in the top spline. The pleats "transmit" from the top half to the bottom half while being exactly gone when the surface passes through the middle spline. That is really counter intuitive to me, from the perspective of what you appear to be trying to do. So it falls in the category of a "bug" to me. Not one that stops the tool from performing, but one that generates slightly undesirable results.
The fact that the pleats are gone at the middle spline and reappear, reversed, in the bottom half is indeed explained. You are generating Beziers that run from the top through the middle to the bottom, and each Bezier has four vectors, top, two in the middle, and bottom, that all have identical angles. The path of each Bezier as it passes through the middle is affected by the offset of the pleats and thus transmits that pleating to the bottom half.
All explained, it is indeed doing what you told it to do. No bugs there. But is that the result you actually desired, or did you stop there because the results were pretty?
What I'm getting at is that I think the reversed pleats are somehow wrong. One alternative would be to have no pleats in the bottom half, with the center spline essentially forcing an end to the pleats, but I think that's not right either.
Personally, in the pleats example, I would rather have the center spline modify the path but not force the surface to go exactly through it because that forces the pleats to disappear and reappear reversed, which just looks wrong to me. And I assume it is not an effect that people will be actually trying for very often. The tool generates pretty results and I think people would not encounter that "bug" very often and would ignore it when they do, but it still strikes me as somehow wrong.
I think where I'm leading to is to have the top and bottom be absolutes and have middle splines be guides, not necessarily exact matches. If the middle spline modified the path of what you would get without it, but without forcing an absolute match at that place, I think the feel of using the tool would be more "organic" and the results more like what I think people would expect. I think my desired result in that example would be to have the pleats continue through the middle spline without going to zero and without reversing, but with that spline having an influence on the flow of the pleats.
Maybe I'm looking for the vertexes of the middle spline to act more like Bezier control points rather than absolute vertexes.
Maybe you find the Bezier curve center (inflection point?) between the top and the bottom and then deflect that toward the corresponding point in the middle control spline. Where there is only one control spline, you deflect it half way between? When there are two control curves, you deflect each Bezier inflection point by 1/3 from the control spline point towards the no-controls Bezier point? Or maybe a slider could adjust the influence of the intermediate control splines from zero to absolute. At zero, it would be as if there were no intermediate curves and at 100 you would get the current effect, including the forced alignment to the curve and the pleat flipping.
Personally, since I asked the question that you were suggesting you answer with a video, I'd rather you spend the time trying my slider idea than making a video. But it's your project.
I hope this helps,
August -
hi Chris,
it's blitzing the mac, was ok for three or four hours, giving some extremely curious versions of what I'm trying to achieve.
basically it's an accurate thread-form (basic ring), something I've never found a SU solution for
on one attempt it did a lovely job set on 2, but the decided to try 6 instead of the 4 bezier splines to add extra detail and improve the stack ability and end finishing.....
so I deleted that one, built a new spline jig and loft started crashing out SU, I checked everything else, and it's fine now loft is removed so I used skin in 6 separate goes to show what I'm trying to do and attach the skp with the spline set, the spline jig, and the skinned version if any one want's to see if it works on there set-up (a mac maybe...)
the over lap gap is very close, so it's best to select splines well clear of them...
UPDATE.. I found I had save the Setting 2 loft in another drawing, but it locks out any new or old drawing I try to open it in, so a screen shot has it buried in a tube...
the reason I'm trying to do this is the follow me tool twists the thread shape even on a single quadrant.
machine threads, springs and candi-stripes are are good test if of accuracy of lathe type tools..
I do like your stuff, keep up the good work.... please
john
-
Hi, I'm not sure which of these is the real problem, but I think that its not set up to work with groups/components. So explode the splines first. Then probably also erase the construction points and construction lines. That solved it all for me. It splatted otherwise.
Chris
-
@driven said:
the reason I'm trying to do this is the follow me tool twists the thread shape even on a single quadrant.
Hi John,
The problem you are trying to solve has been addressed with other plugins. Chris' Loft plugin is about generating fluffy, billowy, organic, drapey shapes and is probably not the right tool for your job. Your task is out at outer reaches of what you might be able to force the Loft plugin to do.
I wish I could point you to the non-twisting Follow-Me plugins, but I've only seen discussions of them, I have not tried them myself yet, so it would take some research to give you a suggestion.
I'm pretty sure that someone else following this thread knows what to tell you.
I hope this helps,
August -
I know I have not explained the inner workings of the script very well yet, but its partly because the next version changes some things, or exposes a a little more of how it works. So its not quite worth going into detail yet when its about to change (a little).
But....the loft might exactly the right tool for something like what he wants. Especially the next version. It has the ability to control the strength of the curvy-ness that is being given to each bezier connection. So instead of really trying to be curvy, you can minimize that a little and make it mostly flat, but rounding just the areas closest to the splines.
This is why the script is designed to actually run through every given spline, and not use the splines as "handles". It gives more accuracy this way because you CAN control where it runs - directly through each spline. And with the next addition of being able to control the strength of the beziers, its pretty handy.
All that being said, I don't prefer to use lofting tools that much. I'd probably just use my bend script or one of the follow me and keeps. They are all good alternatives, especially while this script is still so difficult to use.
Chris
(I've been debugging my next version of the script most of today with limited success )
-
cheers Chris and thanks for the comments August,
it works, exploded the curves and it's a one click job, fantastic
@august said:
I wish I could point you to the non-twisting Follow-Me plugins
I've been searching, but the advantages of this is I have a lot of control over the bezier profile and path (thanks to Fredo) and a simple rig made with xformclone.rb, so skinning between only distorts the additional sections I add at both ends, which trim square with an intersect with a plane, then it's just 'movecopy' X times...
A good tool is a good tool regardless of it's original perceived use...
thanks again chris
john
ADDED: it did this in one go, not just for drapes.... took 10 mins but no crash, this time.
Added More: Spoke to soon, this is in the components window, it seems to have locked while writing the thumbs, having completed the drawing, I'm in and out at moment so will give it time and see if it recovers, out of curiosity..
-
@driven, there is a very good plugin to screw profile or shape named "screw1_5.rb or screw_21.rb I prefer the first one".
However @ Chris I can say I enjoy your plugins as much I enjoy Fredo's, but this doesn't want to run on my mac.
@unknownuser said:
undefined method
select_tool' for nil:NilClassError Loading File clf_simple_loft_loader.rb undefined method
select_tool' for nil:NilClass -
fun little tool. Thanks again Chris.
-
Just to let you know, this plugin creates an empty group in every model, it may seem small, but SketchyPhysics (By Chris Phillips) Simply refuses to work with it.
-
Oh really? Oops. I'll try to make sure to get that fixed on the next round. I must be forgetting to delete a group somewhere in the mix. Thanks for pointing it out!
Chris
-
wow that's exactly what I need
-
Chris, I've been playing with your Loft plugin and Driven's screw thread file. When I first opened his file I was able to create his threads by selecting two curves at a time and using 1 for the number of segments. I tried it by selecting all six curves and got a Bug Splat. I reopened the file and cut the curves down to a quarter turn thinking I'd give it fewer faces to create. Here's the results. In the background you can see a test loft with two 12-segment arcs and five loft segments.
The guidepoints are interesting but not quite what I expected.
-
That means it is crashing for some reason. Normally to do with the selection including a non-edge item, or also if the segment counts don't match. I'm not sure which. You can upload the model immediately before that point and show me which lines to click on and I'll figure out what it is.
Hopefully the next version wll clean some of that up.
Chris
-
-
wow thanks a million...
-
Hey Chris, I just started having some trouble with this plugin. Maybe you can decipher what I'm doing wrong; I know the plugin works so it must be something that I'm doing. Here's the console output:
Error; #<NoMethodError; undefined method `all_connected' for nil;NilClass> L;/Modeling/Sketchup Google/Plugins/clf_simple_loft/clf_simple_loft.rb;61;in `onLButtonUp' L;/Modeling/Sketchup Google/Plugins/clf_simple_loft/clf_simple_loft.rb;186 Error; #<ArgumentError; Cannot convert argument to Sketchup;;Point3d> L;/Modeling/Sketchup Google/Plugins/clf_simple_loft/clf_simple_loft.rb;189;in `add_cpoint' L;/Modeling/Sketchup Google/Plugins/clf_simple_loft/clf_simple_loft.rb;189;in `end_handles' L;/Modeling/Sketchup Google/Plugins/clf_simple_loft/clf_simple_loft.rb;186;in `each_index' L;/Modeling/Sketchup Google/Plugins/clf_simple_loft/clf_simple_loft.rb;186;in `end_handles' L;/Modeling/Sketchup Google/Plugins/clf_simple_loft/clf_simple_loft.rb;94;in `onReturn' L;/Modeling/Sketchup Google/Plugins/clf_simple_loft/clf_simple_loft.rb;61
I'm applying the plugin to 3 bezier curves, the plugin generates construction points and then stops.
-
EscapeArtist
...onLButtonUp... line=60 best = ph.best_picked line=61 all_best = best.all_connected line=62 @shapes_edges << best.all_connected
It's failing to find anything you have selected when you release the mouse-button... Are you picking anything ? It falls over since 'best' = 'nil' and nil can't have connected edges...
Chris: before 'all_best = ' you could test for 'best' and re-run the main functions if it's nil, e.g.if not best ### run me again ### return nil end#if
...
-
Yep, absolutely picking something. I know the plugin works because I drew two other curves and tested it, the loft worked just fine; so it must be a problem with the curve set I was initially using. Maybe it doesn't work on curves that were part of a face. I had to draw faces to get the curves to lay flat on specific axes and then deleted the faces, leaving the curves behind. I'm probably missing knowledge about a change that happens to edges that were part of a face and how it affects the plugin.
edit:
Solved:
That was the problem, edges/curves that were part of a face will not loft. I worked around the problem by grouping the planes, exiting the group, and then drawing the curves on the faces. The lines went where I wanted and the integrity of the curve was preserved in order for loft to work.
-
Chris,
a smart substitute of the old curve stitcher! they spare my time. thank you!
Advertisement