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.

Creating a super elipses featurescript

Michael_GoldblattMichael_Goldblatt Member Posts: 3
Super elipses for reference: http://demonstrations.wolfram.com/VisualizingSuperellipses/

I'm trying to create a superelipses featurescript, but am having some trouble getting the shape to behave the way I want. 
The two solutions I can think of are to 1) make geometry and then constrain it (so that the corner fillets are tangent to the rest of the arcs) in featurescript.
or 2) to make a sketch that will plot equations with a selected origin. 

"The superellipse has parametric equations ,
 for  in the first quadrant (); multiplying by  gives the equations for the curve in the other quadrants."

Any insight would be great.

Comments

  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,211
    I think the best way is to make a sketch.  Calculate the points all around the superellipse explicitly and use a single skFitSpline call (or if the superellipse has four sharp corners, use four skFitSpline calls).  Let me know if that's enough to get you through or if more info is needed.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Michael_GoldblattMichael_Goldblatt Member Posts: 3
    I think the best way is to make a sketch.  Calculate the points all around the superellipse explicitly and use a single skFitSpline call (or if the superellipse has four sharp corners, use four skFitSpline calls).  Let me know if that's enough to get you through or if more info is needed.
    That is what I ended up trying to do. Actually stuck now on skfitspline. I get no errors but it won't create the geometry.
    This is what I have:

      skFitSpline(sketch, "spline", {
              "points" : [
                  point1,point2,point3,point4,point5,point6,point7,point8,point1
              ]
      });

    Where the points are skPoint that I can see.

    Thanks
  • Michael_GoldblattMichael_Goldblatt Member Posts: 3
    Woops just figured it out. My spline was crossing over itself.
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,211
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • mahirmahir Member, Developers Posts: 1,307 ✭✭✭✭✭
    Very nice, Ilya. I did something similar in SW. I'm currently working on a more versatile parametric XYZ curve, but I'm having trouble getting FeatureScript to evaluate string expressions as values, e.g. "tan(45)" should evaluate to 1.
  • ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,211
    @mahir_abrahim
    Unfortunately I think having the feature user input the equation is very difficult to do for now, since we don't allow much even in the isAnything input and FS isn't great for string parsing.  We will need to do a bit of work on our side to make this possible...
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
Sign In or Register to comment.