Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- 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.
Parametric Surface from f(x,y)
mahir
Member, Developers Posts: 1,309 ✭✭✭✭✭
I'm trying to build upon the Parametric Curve FS to create a Parametric Surface. The intention is to be able to input a function Z = f(#x,#y) and have that create a lofted surface. However, I'm running into problems getting the z equation to accept 2 inputs (x,y). @ilya_baran, @kevin_o_toole_1, maybe one of you can take a look at my code to see where it's getting hosed? I tested the rest of the code, and it seems to work well. It's just the part where I try to calculate Z as a function of X/Y that isn't working too well. Thanks.
https://cad.onshape.com/documents/57a4e196e4b04351c9604db5/w/9e4f338e07807b410d29e1d9/e/95f3ca6fb50c41817cfd6cae
https://cad.onshape.com/documents/57a4e196e4b04351c9604db5/w/9e4f338e07807b410d29e1d9/e/95f3ca6fb50c41817cfd6cae
0
Comments
Since you want functions of two inputs, great. You'll just need to change all the overloads defined to use two arguments like (x, y) instead of (t), everywhere in the file (the "all" button in the ctrl-f find dialog may help you )
Then x_ should be
function(x, y) { return x; }
, and y_ should befunction(x, y) { return y; }
Perhaps you'll want to rename Expression to something less generic like BiExpression to better communicate that it won't work with other numbers of parameters.
https://cad.onshape.com/documents/57a62df8e4b03de4c9fcf154/w/f6d71f3d862b522902efcd68/e/ece65382fcd820281a9ee704
PhD, Mechanical Engineering, Stanford University