plot function

Discussion in 'SolidWorks' started by Bernhard Hidding, Aug 2, 2004.

  1. Hi,
    I have an object that is basically a cuboid. However, one edge shall be
    curved, follwing a function like f(x) = x^2. Can I plot such a function with
    SolidWorks? Alternatively, it would be possible to approximate this function
    via a polyline that uses several xy-coordinates. Is it possible to
    automatically create a polyline from an ascii file containing those
    xy-coordinates?
    Thanks in advance,
    Bernhard
     
    Bernhard Hidding, Aug 2, 2004
    #1
  2. Bernhard Hidding

    MM Guest

    Bernhard,

    You can't plot a formula "directly" in SW. You "can" write an API program
    that does this though. Phillippe Guglielmetti http://www.dynabits.com used
    to have a SW plugin called Mathworks that would probably do this. If you
    look on his site you may find something that will help.

    You can read in tabular X,Y,Z data points and create a "spline".
    "Insert-curve-through XYZ points" and browse to the text (.txt) file that
    contains the data.

    SW doesn't do polylines like ACAD, just NURBS.

    Regards

    Mark
     
    MM, Aug 2, 2004
    #2
  3. Bernhard Hidding

    matt Guest

    I have a macro on my website that does this using excel. Select a plane,
    write an equation and it will draw a spline through points on the curve.


    www.frontiernet.net/~mlombard

    go to the macro library link and look for eqcurve.

    matt
     
    matt, Aug 3, 2004
    #3
  4. You can read in tabular X,Y,Z data points and create a "spline".
    Thanks a bunch. However, I am starting with a 2D draw, which I intend to
    convert into 3D later. So, I don't have XYZ points but only XY points to
    draw a curve through. This 2D-spline shall be expanded into 3D later. Is it
    possible to draw a 2D spline through XY-points too?

    Regards,
    Bernhard
     
    Bernhard Hidding, Aug 3, 2004
    #4
  5. I have a macro on my website that does this using excel. Select a plane,
    Thank you. I used that makro, however, it does not seem to work fine on the
    following equation:

    (0.04444*x^3-0.00952*x^2-0.00606*x+0.00748)/1000

    Should it be capable of doing that or can it only plot quadratic functions?
    If it is able to do that, then I am doing something else wrong..

    Regards,
    Bernhard
     
    Bernhard Hidding, Aug 3, 2004
    #5
  6. Bernhard Hidding

    MM Guest

    Bernhard,

    Just leave out the third (Z) value and it'll plot to a plane.

    Mark
     
    MM, Aug 3, 2004
    #6
  7. This is the equation of a parabola, and you can sketch parabola directly.
    More generally, for simple curves, you can sketch a few points that you
    position with equations and fit a spline through them.
     
    Philippe Guglielmetti, Aug 4, 2004
    #7
  8. Bernhard Hidding

    P. Guest

    Well, if it is f(x) = x^2 then just use the parabola tool. It is in the
    menu.
     
    P., Aug 4, 2004
    #8
  9. Just leave out the third (Z) value and it'll plot to a plane.

    Ok, I filled the 3 column of the file with zeros, and it worked!

    But now I am encountering a new (beginners) problem: I have created a new
    "part" in which I have drawn some lines and plotted my curve via
    "Insert-curve-through XYZ points", now I want to save the data in .dxf
    format which is needed to adress kind of a CNC machine. How do I do that?
    It seems one can only export into .dxf from a "draw" object. So how do I
    include my "part" into a "draw" object?
    I hope I made myself clear enough..

    Thanks again for the support,
    Bernhard

    P.S.: I do not even succeed in combining the lines I have drawn with the
    curve, the FeatureManager shows 2 different objects..
     
    Bernhard Hidding, Aug 4, 2004
    #9
  10. Bernhard Hidding

    MM Guest

    Bernhard,

    You create a single (plan) view drawing and export as DXF.

    I don't think DXF supports NURBS, so what you end up with is a linearized
    approximation of the curve. If your using a CAM system, IGES or Parasolid
    (x_t, x_b), from the solid, will give you a true spline.

    Regards

    Mark
     
    MM, Aug 4, 2004
    #10
  11. Bernhard Hidding

    matt Guest

    works fine for me. I copied and pasted your formula into the macro, and it
    draws a spline. were you using other settings? are you sure it's valid
    over the range you were using?

    matt
     
    matt, Aug 4, 2004
    #11
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.