Archive

Posts Tagged ‘splines’

Model A: Creating the grille

December 6th, 2008 No comments

grilleOne of the little secrets about creating complex shapes in SolidWorks is that they aren’t all as complicated as they look. The grille is one example of this. Once you know what you’re doing, something like this is actually very easy to create.

First, we have to select a feature type to use. This is going to have to have curves in both directions, so it could be a boundary. The profile needs to change, and doing guide curves to change the profile would be too difficult. So it will be either a loft or boundary. In this case it really doesn’t matter, so I selected boundary, just because it’s the future direction of development, and clinging to the past is oh, so gauche (he says as he models an antique car).

The first thing I’d do to model the grille is realize that the thing is symmetrical, and that there is a sharp edge at the plane of symmetry. This makes things much easier.

34_ford_roadsterOf course something else you want to do is to get a picture of one you like and work from that. Realize that this is a cartoon Model A, so I’m not really trying to recreate this 100%. It’s gonna be a little exaggerated in some ways. This image of the 34 coupe captures the flowing shape between the front fenders and the grille together. This grille is taller and more narrow than what I’m looking to create, but it has the overall form that I want.

You can start to model this part in one of two ways: draw the curve that becomes the “direction 2″ 3D curve or path for the boundary, or draw the 2D sections for “direction 1″. Direction 1 and 2 are completely arbitrary in real application, but I’m pretty entrenched with the old way of doing things, so I think of Dir1 as “loft/sweep profiles” and Dir2 as “paths/guide curves”. It doesn’t matter how you use the two directions, which is part of the point of the boundary feature to begin with – both directions are treated equally.

Ok, so I select to make the 3d curve path first. The 3d curve is essentially a C shape, angled back and curved in both directions. You can do 3d curves in a couple of ways, but the most important are the 3d spline, and the projected curve. In this example, I’ll use the projected curve. A commenter suggested having a look at 3D sketches, and I will get to that in my next post on this Model A where I look at creating the exhaust pipes and the sparkplug wires.

Projected curves tend to be confusing for people. Not sure why. Some people get it immediately, and some just don’t. Anyway, there are 2 ways to “project” the projected curve. The curve can be projected onto model faces, or onto another sketch. Projecting one sketch onto another is where most people who are going to get lost usually get lost. The sketches that you project are usually on planes that are perpendicular to one another. Sometimes you have options to pick different combinations of planes, such as front and top or front and side. In this case, front and top will be the easiest. Sketch onto Sketch projected curves essentially extrude both sketches through space, and where they intersect, it creates a curve. You can think of this like extruding one sketch as a surface and making a sketch onto face projection with the other sketch. You could also think of the projected curve function as being like a reverse drawing. A drawing takes a 3D something and creates 2D views of it. Projected curve takes 2D views and creates a 3D shape.

34coupe2

Actually, the grille in the image of the 34 coupe is slightly angled back in addition to being angled to the side, but I didn’t model it this way. I just took the easy route, but I’ll also explain the more complex operation as well.

So here are the two sketches. The arc with the dimensions was sketched on the top plane, and the spline was sketched on the front. Notice that the spline has 2 endpoints and a midpoint. The shape is controlled by the handles. 

When you make a projected sketch from these, the grille will be essentially straight up and down because the arc is placed on the top plane. To get the grille to angle 

34coupe1

the way it is on the image of the 34 coupe, you would need to put the arc on a slightly angled plane. Anyway, this results in a 3D curve.

3D curves are not as flexible as 3D sketch splines, but they are far easier to control. There is a lot of overlap between curves and 3d sketches, and a future post on 3D sketches will talk about a lot of this. SolidWorks has not put much development into curve features in the last many releases (variable pitch helix was I think the last change of significance). But they have poured massive development into 3D sketches in general. Even the new Equation driven Curve is actually a sketch element. I keep wishing they could dig themselves out of the terminology quagmire they’re in but it just gets deeper and deeper with each new feature.

Anyway. So with a 3D curve in place, now it is time to draw the sections. On the side plane, I drew the section of the grille at the top, and then in the same sketch I drew the section of the grille at the bottom. You couldn’t get away with this in days gone by in SW, but you can now. I still don’t think it’s a great idea, but this was just a model to create an image. Too many things can go wrong when you combine sketches with separate functions into a single sketch.

 

34coupe3

 

This image shows the top and bottom in a closed sketch, and an intermediate profile in an open sketch referencing the curve created earlier. 

When making models for renders, remember that sharp edges don’t render well. Usually you want to have a small fillet on a sharp edge. In reality most edges that we characterize as dead sharp actually have a visible round. 

The next step is to create the boundary feature. Remember that boundary uses some of the same rules as loft. The one I’m thinking of here is that if you want a loft to not twist, select the profiles from the ends that you want to connect. Same applies here. It is nice that with the boundary, you can RMB on a profile in the propertymanager and select Flip Connectors. 

In this case we don’t need any end conditions unless you want to add some shape around the plane of symmetry. 

34coupe4In the end, the result looks like this. Remember to apply a shiny appearance. Just doesn’t look the same without it.

The next part to worry about is the mesh inside the grille. No, I’m not going to actually model it. This is a “looks like” model, not a production model, so shortcuts like this are permissible.

The easy way to do this is to make a surface of the shape desired and then apply a texture, ahem, I mean an appearance to make it look like slats.

This surface is easier to create than you might think. On the side plane, I drew an arc with a suitable radius to add some curvature to the grille. The arc went between the open corners of the boundary feature on the side plane. Then I used a Fill feature to fill between the sketch and the inside edge of the boundary. And that’s it. It will look better if you turn off  ”optimize”.

Finally, add an appearance. The vertical slats probably look better than the horizontal ones.

34coupe5Big headlights, baby. Don’t be shy. Mirror and you’re done.

By the way, if you are impatient with how little information is here on this surfacing stuff, just go and buy the Surfacing Bible. I’ve re-read it recently, and, well, I’m biased, but I think it’s a really nice book.

Spline Schmline, part 3

November 19th, 2008 5 comments

I’m a little surprised by the interest in splines. I can keep pumping it out. I need to get to the surfacing stuff eventually. I promised a few examples around that Model A. It turns out that splines and curvy surfaces use some of the same concepts. The main word I’d like to see in circulation is “interpolated”. To me, it’s just a word that demonstrates that splines and lofts are in some ways approximations.

Dimensioning Splines

Ok, I’ve held out long enough. There are ways to dimension splines, or drive splines from dimensioned sketch geometry. The obvious way to start is by just dimensioning the spline points.

I used the Fully Dimension Sketch function to apply dimensions and relations, but it didn’t add all the dims to fully define the sketch, but almost. I want to call your attention to 4 dimensions. Notice the two angle dimensions. These go between the spline handle and a construction line I added. Also notice the blue dimensions. These are created by clicking the spline handle with the dimension tool, and placing the dimension. The number is just the magnitude or stiffness of the handle. An important aspect of the dimensions for the handles is that you can use link values to drive them. The reason this is important is because symmetric sketch relations only work on these if you mirror an entire spline, you cannot make handles symmetrical within a single spline. Making a single spline symmetrical is difficult, and even moreso if you use handles.

Don’t get your hopes up for this kind of thing when it comes to drawings. If you put the image shown above on a manufacturing drawing, you’ll become unpopular with the shop. Nobody can really recreate anything from the dimensions on this view. It might be used to check stuff, but… I wouldn’t even go there. Use computer controlled manufacturing processes running directly from your 3D data to make parts with shapes like this. If you really need the shape, you need it enough to work with a different vendor who doesn’t have all manually programmed or operated machines. Really, come on, people, this is the 21st century.

Asymmetrical interior spline handles

One commenter asked what is the advantage of asymmetrical spline handles. The advantage is that sometimes you only want to affect the shape of a spline on one side of the handle, and not on the other.

The angle of the handle on one side of the spline point affects the angle on the other, but the magnitude can be different. Once you drag one side of the handle without the Alt key, you have broken the symmetry. If you do this, make sure you use the Maintain Internal Continuity option.

Controlling splines with lines and arcs

I’ve been holding out on you a little bit. There is actually a great way to control splines with lines and arcs which can be driven by dimensions.

In this sketch, the lines and arcs are used as construction geometry, and the splines are fit over the top, but make smooth transitions in the corners. Notice that you get the best of both worlds when you do things this way. You can fully dimension your sketch, plus, you get spline smoothing in the corners.

This is achieved with the Fit Spline tool, which you can find in Tools, Spline Tools.

Fit Spline requires that you input a tolerance value that represents how far the spline approximation is allowed to miss the selected elements by. The larger the tolerance, the less recognizable shape the spline will create. As you might expect, this function has all sorts of uses. Of course you have to be careful of any geometry created by software. Always check a spline of this sort with a curvature comb to make sure it does not have unacceptable undulations in the corners. This tool can be used on 2D and 3D sketches. We could have yet another long blog post talking about the possible applications and implications of this tool. It’s really cool, but it’s not a magic wand. You do have to be careful, because it can produce stuff you don’t want.

Using splines to approximate arcs

As I was preparing to write this piece on splines, I read in the SolidWorks forums that some fellow used a spline to approximate an arc because the arc had a radius too large to represent in SolidWorks. SolidWorks has a cubic envelope of 1000 meters per side. This arc was for a bridge. Honestly, a bridge shape should probably be a parabola anyway, and not an arc or a spline. See my post on Antoni Gaudi’s use of naturally occurring parabolas to design the support structure for arches and spires…

Spline Schmline, part 1

November 17th, 2008 8 comments

Splines make some people squeamishly uncomfortable. You can’t put dimensions on them, so how do you manufacture it? How do you make parts fit together if you use splines? How do you run QC to check your parts?

There are a lot of misconceptions about splines. The first is that you can’t put dimensions on them. And the second is that if you put dimensions on them that they become fully defined. The Third turns out to be that if you fully define all the points on a spline, that you can’t drag the points around anymore. Each busted misconception in its own time…

I have good answers for each of these misgivings and misconceptions, but I’ll get to those later. I want to start by addressing why splines are so important, infact indispensible.

Great curvature, baby!

Ok, this is going to sound sexist. That’s because it is. So sue me. If you’re male, there is no way to pretend you don’t notice this kind of stuff. Some types of curvature just draw your eye. That’s all there is to it. Just to keep it kind of cartoony and not too explicit, let’s use Jessica Rabbit from the movie Who Framed Roger Rabbit as an example, because she’s a great example.

Splines are sexy. Jessica just wouldn’t be the same if she were just straight and round, drawn with lines and arcs. Jessica, and just about everything else that we think of as “products”, needs curvature, and in particular, changes in curvature.

The reason why splines are so necessary is that they are the one way we have to make shapes that look organic. Organic shapes are never perfectly straight or perfectly round, they are constantly changing curvature. We as humans are programmed to react to organic shape. Jessica Rabbit’s organic shape provokes a reaction, and product design tries to evoke the same kind of reaction. It’s not a coincidence that they both cry out “empty your wallet”, and we dutifully obey.

If Jessica has an equivalent in the automobile world, it is probably something like a 1960 Corvette. Yow. They both look great in red. Nice headlights! Love those rear fenders. How does it look with the top down? It’s no coincidence that product design is so sexual. It’s no coincidence either that they are both beautifully curvaceous.

Splines or lines and arcs?

Cool shapes in product design is all about curvature that changes smoothly from one radius to another rather than simply a series of tangent arcs that change from one discreet radius immediately to another

discreet radius. Look at these two surfaces below. Which one looks better to you? The one on the right is less lumpy. I think most people would say the one on the right looks better. Of course the one on the right is made with splines. You can almost see the lines and arcs in the one on the left.

Of course it is possible to make splines look very bad if you are trying to do that or are very inexperienced. I think a lot of people make the mistake of thinking that a spline with more spline points is more controllable, and thus a better spline. The truth is that you DON’T want to try to force a spline. The thing about organic curvature that makes it so appealing is that it looks natural. The natural materials are bending or being formed in a natural way. Splines have a very natural way of bending. I’ve been told that the math governing how splines interpolate shapes between points is very much like the natural bending equations for elastic materials.

Interpolated shapes

I classifify shapes into two camps: analytical and interpolated. Analytical shapes have a specific equation that can be written, for example a line or circle each has a familiar equation that you may have learned in high school geometry. A spline I believe is a series of 2nd or 3rd order polynomials. With an analytical shape, you know exactly where every point along that shape is going to be even before you draw the line or the arc. With a spline, you just put down the control points, and SolidWorks interpolates the curve between the points. This concept follows through to features such as the boundary, loft, fill and sweep. You put down the profile curves, and SolidWorks uses the Boundary feature to interpolate the surface between the curves. The difference between analytical and interpolated curves and surfaces is very important. They are not interchangeable.

Arguments against splines

People who don’t trust splines typically talk about dimensions or repeatability. When I create splines in SolidWorks, I never fully dimension them. Its useless to dimension splines. Different CAD packages evaluate splines differently, even if the spline points are all in the same place. Even SolidWorks between releases evaluates splines differently. Even if you were to use a spline on a drawing and fully dimension all of the spline points, the spline could never be exactly recreated based on those dimensions.

The only way to transfer spline based manufacturing data is to send a completed 3D model, and for the manufacturer to use a computer controlled method. Paper drawings may be useful for notes, and reference dimensions but typically not as a way to specify a complex surface or curve. This is most of my business. I don’t remember the last real drawing I gave to a molder, I just hand off 3D data.

Practice with splines

See the spline here with a lot of points looks lumpy. When I first started working with splines, I thought this was the best way to get great control on a shape, but it turns out that the more you try to control the shape, the lumpier it gets. Notice that the second spline is much smoother. This is because you just let the spline math do the work for you. My general rule of thumb is that you add a spline point for every change in convexity (convex up changes to convex down). So you have the two endpoints, which would make a straight spline, a middle spline point, which would make a convex or concave spline, and then a third point which gives the undulating S shape.

In the second set of images, I have applied a curvature comb to the splines. This is a way to visually evaluate the spline. The curvature comb represents the instantaneous curvature at that point along the spline. If the curvature comb changes sides of the spline, that means the spline has changed convexity. Notice that the comb on the top spline confirms that it is lumpy and the changes in curvature are too abrupt. The changes in curvature in the lower spline are much more gradual. Changes in curvature are represented by the change in the height of the comb.

Just for reference, curvature is the inverse of radius, or c=1/r. If you have a large radius, it means small curvature. Small radius (tight corner) has large curvature. Notice that the curvature comb is taller in kinks of the top spline. Notice that in flat areas of the spline (almost linear) the curvature comb is almost zero height.

More to come…

We’ll talk more about this topic later. There is a lot to know about splines.

20 visitors online now
10 guests, 10 bots, 0 members
Max visitors today: 36 at 09:16 am EDT
This month: 48 at 09-02-2010 01:16 pm EDT
This year: 64 at 05-16-2010 10:32 pm EDT
All time: 64 at 05-16-2010 10:32 pm EDT