Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

FeatureScript Parametric Surface and Curve: Can't change equation Z = f(x,y), X,Y,Z = f(t)

I've been playing with Parametric Surface and Parametric Curve.

I am unable to change the equation Z = f(#x, #y) or X = f(#t), etc.

I can change min,max x,y or t
I can change number of curves/points
I can hide/show curves
I can visualize before and after using the slider
... but when I change the equation the surface/curve remains unaltered.

This happens in copies of FeatureScript examples as well as original documents.

Any ideas what I'm missing?

Answers

  • mahirmahir Member, Developers Posts: 1,307 ✭✭✭✭✭
    edited May 2017
    Hi 7weal..... I wrote those featurescripts, and I agree they can be a bit particular regarding equation input. Unfortunately, that is a byproduct of using a FS workaround to allow native parsing of built-in functions like sin/cos.

    That said, if you follow these specific rules (mentioned in the FS info doc), you should be ok.
    1. Create a Define Parameter feature that names the free variable ("t" by default).
    2. Create a Variable with the same name (in this case "t"). I usually set it equal to 1.
    3. Create the Parametric curve feature, making sure each XYZ equation evaluates to a length. For example, assuming 0<t<1, the equations below will create a helix with 10 rotations and diameter/length equal 20mm.
         X = 10*cos(#t*10*360*deg)*mm
         Y = 10*sin(#t*10*360*deg)*mm
         Z = 20*#t*mm
      As you're writing the equations, after you move to a different input field, the equation field should change to evaluate to a length.
    4. After clicking ok in the FS dialog, suppress the #t variable (but not the Define Parameter).
    5. Your curve should generate.
    Very important: anytime you want to edit the equations, you will need to unsuppress the variable(s). After editing, you must then resuppress for the curve/surface to generate.
Sign In or Register to comment.