Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Inputting surface/spline functions? (SW 2007) 2

Status
Not open for further replies.

Nabla1

Electrical
Dec 26, 2007
32
0
0
GB
I have recently acquired access to Solidworks 2007, and through a growing interest in fluid dynamics, I have realized that in aerospace engineering it can often be necessary to design fairly complex 3D surfaces, for example in designing airfoils and compressor blades.

CFD aside, suppose I were to crunch some numbers, and arrive at a mathematical function, f(x,y), describing a surface in 3D space. This surface would have been derived to be the most optimal surface to use for a compressor blade, under a certain set of fluid flow conditions.

Is it possible to input such mathematical functions into Solidworks (specifying the range of the function) to produce certain 'function-specific' surfaces or splines, for use with construction?

e.g. something like f(x,y) = sinx cosy (0<x<5,0<y<3), specifying a temporary axis, which the inequalities would refer to.

Thank you.
 
Replies continue below

Recommended for you

Not directly, but if you can create a .txt format file, you can import that into SW. Check the SW Help-Index file for curves, through XYZ points.

You may also be able to use the point import macro to get the points into SW.
You would then need to use Insert > Curve > Through Reference Points with manually selected points to create profiles which in turn can be used to create a surface.


[cheers]
 
Thanks alot, thats a great help!

According to the help file, you can import .txt files, as you say, and it also mentions the fact that you can create 3D curves in Microsoft Excel, save them as .txt files, and import them to Soldiworks.

So in Excel, I could have one column for x, another for y, and another for z. The y and x columns could increase at set increments (size depending on accuracy), and the z column would be given by, z=f(x,y), some function of x and y, whatever it be? Seems fairly straightforward, just have to make sure I get the format right when I save to excel.

Cheers!

 
I managed to import some data from Excel. The function I used was z = x^2 + y^2, and when I imported it under 'insert>curve>curve through XYZ points', it gave me a 3D spline. From mathematics, I know that the function f(x,y) = x^2 + y^2 is actually a surface in 3D space, not just a simple spline.

I think the reason is because in maths the graph of the function is drawn using ALL values of x and y, but of course, in solidworks it only uses those exact [x,y] co-ordinates I'm giving it.

Since Solidworks does not incorporate a direct function input, then it won't be possible to input functions directly for surfaces in 3D space. This means what I will have to do is to create two profiles on perpendicular planes, and compile them into a surface, where I can import data for each profile.

So, my next question is: how exactly do I create a surface out of two (perpendicular) planar profiles?

For example if one profile was in the top plane, and another in the front plane, then if you were to project each one into the screen, then the points where they coincide would make up the surface.

would I have to draw two sketches first, navigate to some 'surfaces' option, and select the two sketches to be used?

Cheers again!
 
See thread559-184959 for some similar info.

Were the calculated points supposed to describe a 3D surface?

Can you post an image (a hand drawn sketch would be fine) of what you are expecting the surface to look like?

Also, can you post either the .txt file or the SW file (or both) you created with the XYZ points?

[cheers]
 
The function of z=x^2+y^2 is actually a 'paraboloid' in 3D space, which is a surface that looks something like this:

image


This graph is drawn for ALL values of x and y, (between -10 and 10, for each). The data I used is attached to this post. You can see that the x and y values increase by the same increment, and hence the spline I ended up with was actually the curve where the y=x plane intersects the paraboloid.

At the moment, I'm trying to import this surface into solidworks, mainly to get use to the method of importing functions (So that I can use it later on for more complex surfaces). It looks like the guy from the other thread managed to create the surfaces pretty well in his attempt.

I tried creating two separate profiles from this data. I put one on the XZ plane (setting y values to 0), and one on the YZ plane (setting x values to 0). I didn't have a clue what to do from there though.

The guy from the other thread seemed to do it fairly successfully, but it seems he used 3 different profiles for his blades. This makes me think I might need to make a third profile to create this surface too, but even then, I'm not sure what the next step is in compiling them together into a surface.

Thanks



 
Thanks alot thats just what i was trying to do. In the case of the function z=x^2+y^2, the intersection of an x-y plane, at any z, with the paraboloid is actually a circle, meaning it is possible to revolve the 2D profile into the surface of the paraboloid. I did think about using such a method, but didn't really look into it much.

The reason being is that some surfaces will be much more complex, such as compressor blades, where a simple circular revolve wouldn't work. In the other thread, he seemed to have three profiles, one on a top view, one on a side view, and one on a front view, and then used the 'boundary layer' function to make a surface between them.

Surely within that function, you would have to select the curves between which the surface is made, but actually the options are for 'direction 1', and 'direction 2'. I've had a mess around with it, and it seems If you create two 2d profiles on adjacent planes, then it will create a surface between them, as if the curves are mirrored on the opposite side of a parallelogram. So what if you wanted to create a triangular profile for example?

Also, when you thicken the surface, is there any options to add a differential to the thickness?...as opposed to having a constant thickness all along it.

Thanks
 
"when you thicken the surface, is there any options to add a differential to the thickness?"
No. The simplest way to create a varied thickness is to create another spline in the profile sketch which describes the thickness.

[cheers]
 
Thanks, I figured that might be the case. I thought about creating a 'level set' of the surface, which is basically a set of 2D cross-sectional profiles, each belonging to a plane, which are unit distance apart. Then I could use the boundary surface feature to make the surface.

How would I go about creating such a set of parallel, equidistant planes, and select the distance between them? (I actually managed to do this before by accident, but undid it at the time, and now I can't remember how)

Also, once I have created a boundary surface, how would I go about filling it, to make it a solid entity? Can this still be done without being a completely closed volume?...I mean will it just create a simple boundary where there is none, before it fills?

Thanks again.

 
Thanks 'takedownca', looks like you just beat me to the mark with that reply. Anyway, thanks for the macro, I'll give it a whirl at some point.

So basically I can input a parametric equation to it, and it will create the text file for me?...or do you just import straight from the macro? Also what about specifying bounds? What about non-parameterized curves of the form z=f(x,y)?

Cheers!
 
I opened the SWP file with sldworks, started a new part, went to insert>curves>curve through XYZ points, and The menu is still the same. Other than that what am I supposed to do with the file? Thanks
 
Copy the SWP file to where your other macros are located. If you don't have a location already, then put it in C:\Program Files\SolidWorks\macros. Then run the macro using Tools>Macro>Run. Select the macro and just follow the directions in the GUI. You don't have to use the Insert Curve function. The macro does it for you.

It follows the equation format used by ProE. Each curve is entered with separate equations for each coordinate in Cartesion, cylindrical, or spherical coordinates. You can use any Excel function, and you will have to use T as a parameter in at least one coordinate equation.
 
OK, thanks I got it working. So you have to express each dimension, X,Y,Z, in terms of a parameter T? And the functions are all Excel functions? For example POWER(base,power) ? I'm not familiar with ProE.

Is there no way to enter z=x^2+y^2 directly, or does it all have to be done with the parameter T?

It looks pretty handy though, especially with the three co-ordinate systems. How can I get the button for it?

Thanks alot!
 
Yes, enter the equations exactly as you would in Excel. So POWER(base,power) should work. Although I would just use base^power. Also, any trig functions use radians (because Excel uses radians). Just look at the example equations that come up when you first start the macro.

Entering z = x^2 + y^2 is a surface function. The macro just plots curves. Your best bet for that particular function would be the plot a parabola using the equations below and then use the parabola to create a revolved surface rotated about the z axis.

X = 0
Y = A*%T (A is whatever the limit is for Y)
Z = %Y^2
 
I just reread the thread and realized you won't always be using a simple rotationally symmetrical surface. For a more generalized case, you can create cross-sections at various plane offsets by plugging in different constants for X & Y that correspond to the cutting plane. For example,

to get a crossection at the plane given by X = B
X = B
Y = A*%T
Z = %X^2 + %Y^2

Then just repeat at different values of B.
 
One more thing. You can change the Y equation to read Y = A*(%T - .5). This will give you a symmetric function distribution from -.5A to +.5A, instead of 0 to A.
 
Status
Not open for further replies.
Back
Top