Rhino 4.0 running on Windows 7.
I'm doing a lot of work mathematically outside of Rhino, and then moving stuff into Rhino. Here's what I get in Rhino, in the surface.3dm file:
There are two curves in the "edge" layer in the xy plane which are mirror images of each other.
And a large number of cross sections and two end points in the "cross curves" layer. The cross curves end on the edge curves. The whole thing is about 350 mm long, and the cross sections are spaced 2 mm apart.
I am also enclosing a file "pickScript.txt" which picks the cross curves in order from bottom to top. Use it by control-C copying it and then control-V dumping it in the command area at the right time.
This works properly if
(a) only the cross curves are visible, and
(b) The view is rotated 90 degrees and the image is maximized, so that the cross curves are far enough apart.
QUESTION: pickScript uses SelCrossing. This is awkward. It would be nice if there was a commandlike SelClick, which took the arguments of a point (either 2D or 3D) and did a Select just as if I were clicking at that point. Is there anything like that?
(1) If I Loft, pick the bottom point, then the cross-curves in order, then the top point, I get a very screwed up surface. it looks like it thinks that the bottom point comes _after_ the last cross curve, and the top point comes _before_ the first cross curve.
(2) If I Loft, pick the _top_ point, then the cross curve in order from bottom to top, and then the _bottom_ point, I get a very nice surface.
COMMENT: Weirdness in the order of points and cross curves.
MINOR PROBLEM: the edge of the surface is a bit far away from the edge curves. I can probably deal with this.
(3) If I do a sweep-two-rails (pick one edge curve, then the other, then the bottom point, then the cross curves, then the top point), I get a surface which is about right, but bumpy, with bumps every 2 mm. (Look at the intersection of the surface with the x=0 plane, to see the bumps very clearly.) (I'm leaving this surface, and the intersection curve, in the file.) I've tried various parameters in sweep-two-rails, and can't get rid of these bumps.
QUESTION: Is there any way to get rid of these bumps. Loft does just fine. Why not sweep?
Well maybe the 'maintain height' option in Sweep2 would help, or there's just something about the logic of how it builds the surfaces between sections that's not quite what you're expecting. Loft is more straightforward, it just makes a surface pass through the curves.
You also should reduce your input curves by 90, 95% to get a nicer, smoother result, and trying to just loft or sweep a shape like this is really not what I would recommend with NURBS.
Here's a curvature graph of your x=0 spinal curve. As you can see the intersection of the cross curves is not creating a point set that gives a smooth curve when connected. This is what is causing the bumpyness on the sweep 2 surface.For the loft surface I split the process up. I lofted all of the cross curves except for four at each end. I selected these with a simple crossing box section. Then I lofted the remaining end curves and the respective point in two separate operations. Finally I joined the three surfaces to make one polysurface. You might want to check the settings in the Properties Dialogue>Mesh and Properties Dialogue>Render and set the Render Mesh Quality to 'Smooth & Slower' and the Anti aliasing to 'Best & slowest'. It then appears that the loft does reach the edge curves. I believe that there's a certain amount of smoothing that goes on in Loft >Normal that doesn't occur in Sweep2 and this is why the Loft gives a better result.
The surface I designed is smooth. Its intersection with the x=0 plane is smooth. (It is a order-8 Bezier curve.)
If you look closely at the curve of the intersection of the Sweep2 surface which Rhino produces, you will see the smoothness of the points of intersection of the cross curves which I defined, and you will see that the Rhino curve has a wiggle up and then down between each of the cross-curves. Zoom in to see it.
The process of Lofting in three pieces which you describe produces the same gap (about .16 mm maximum) between the the edge of the Lofted surface and my edge curve. (Near the top. Zoom in to see it.) Of course there is no reason for them to coincide, since the edge curve is not part of the Lofting process. But the three-part process produces the same gap. No improvement.
I would be surprised if adjusting Render parameters had anything to do with the situation, since Render has to to do with _displaying_ what is there, while the problem is not with _displaying_ what is there, but with what _is_ _really_ there. But since you suggested it, I tried it. Same .16 mm gap.
You'll get the bill for my time in the mail.
"MINOR PROBLEM: the edge of the surface is a bit far away from the edge curves. I can probably deal with this."
Use MatchSrf, Match by closest points set, to suck the loft surface edge over to the outline curves- they are about .12 units away near the end points.
Just curious - why are you using this giant macro to select the curves?
All in all it seems to me you probably would gain a lot by looking into Python or RhinoScript .