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.

Options

Importing 3D point coordinates

jaschaaajaschaaa Member Posts: 21 PRO
edited July 2016 in Community Support
Hi all,

I am new to Onshape and I am starting to like it. I have something I have difficulties with though: importing 3D (point) data to use as a basis for building a propeller blade model.

External software (Octave) calculates the point coordinates of radial blade sections. If the sections where planar, I think I could easily get away by using dxf as an intermediate file. In this case however, my data is three dimensional and the dxf import only seems to like 2D files. 

The next problem I may run into is how to create splines through my 3d points. Once I have the splines, I expect I can easily loft the surfaces together to a blade. 

I you the community can give me some advice. Other approaches to get it done are also welcome of course! 

Best Answer

Answers

  • Options
    ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,175
    This type of thing cannot currently be done with the Onshape UI, but it be done with FeatureScript -- start with the 3D spline example linked from here: https://www.onshape.com/featurescript
    You can copy/paste 3D points from Octave as an array of arrays [ [x1, y1, z1], [x2, y2, z2], ... ] and use a processed version of that instead of the selection points in the 3D spline feature.  Post here as you run into issues and we'll help.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Options
    jaschaaajaschaaa Member Posts: 21 PRO
    This type of thing cannot currently be done with the Onshape UI, but it be done with FeatureScript -- start with the 3D spline example linked from here: https://www.onshape.com/featurescript
    You can copy/paste 3D points from Octave as an array of arrays [ [x1, y1, z1], [x2, y2, z2], ... ] and use a processed version of that instead of the selection points in the 3D spline feature.  Post here as you run into issues and we'll help.
    Hi Ilya,

    Thanks for the hints! Following your advice I was able to draw some 3D splines from external data. 

    Now I am stuck again: 
    I have several radial blade sections drawn by the 3D splines. Now I want to combine them to a solid blade using the loft command (in the part studio). Somehow I can't select the splines when using the loft command. 

    Any advice?
  • Options
    ilya_baranilya_baran Onshape Employees, Developers, HDM Posts: 1,175
    Are you able to do it with a surface loft?
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Options
    jaschaaajaschaaa Member Posts: 21 PRO
    Surface loft works. Solid still does not, although I have closed curves.

    Another silly question: how do I tell the program this is in mm units? It now seems to assume inches...

    Here is a code example:

    FeatureScript 336;
    import(path : "onshape/std/geometry.fs", version : "336.0");

    const data1=[[29.121,7.2093,-19.415],[29.12,7.2119,-19.294],[29.119,7.2188,-18.933],[29.116,7.2272,-18.336],[29.115,7.233,-17.512],[29.116,7.2306,-16.47],[29.12,7.2141,-15.224],[29.129,7.1773,-13.789],[29.144,7.1139,-12.183],[29.168,7.0183,-10.424],[29.199,6.8852,-8.5345],[29.24,6.7095,-6.5368],[29.29,6.4867,-4.455],[29.35,6.2121,-2.3143],[29.418,5.881,-0.14117],[29.494,5.4885,2.0373],[29.575,5.03,4.1936],[29.66,4.5007,6.3016],[29.747,3.8868,8.3498],[29.83,3.1913,10.292],[29.903,2.4162,12.103],[29.959,1.5667,13.759],[29.993,0.6517,15.24],[29.998,-0.31668,16.53],[29.971,-1.3232,17.613],[29.908,-2.3507,18.481],[29.809,-3.3807,19.125],[29.676,-4.3957,19.541],[29.514,-5.3797,19.728],[29.327,-6.3204,19.686],[29.121,-7.2093,19.415],[29.121,-7.2093,19.415],[28.912,-8.0044,18.935],[28.721,-8.6667,18.268],[28.556,-9.1944,17.422],[28.428,-9.5845,16.407],[28.343,-9.8337,15.236],[28.306,-9.9386,13.923],[28.321,-9.8968,12.483],[28.386,-9.7076,10.933],[28.498,-9.3725,9.2871],[28.651,-8.8961,7.5622],[28.833,-8.286,5.7732],[29.034,-7.5531,3.935],[29.24,-6.7114,2.0628],[29.44,-5.7681,0.15458],[29.622,-4.7446,-1.7542],[29.776,-3.6615,-3.6452],[29.892,-2.54,-5.5012],[29.967,-1.4014,-7.3052],[29.999,-0.26617,-9.0398],[29.988,0.84568,-10.688],[29.939,1.9154,-12.234],[29.857,2.9255,-13.661],[29.751,3.8596,-14.956],[29.629,4.7027,-16.104],[29.502,5.4412,-17.096],[29.381,6.0631,-17.92],[29.274,6.5581,-18.569],[29.192,6.9178,-19.038],[29.139,7.1361,-19.32],[29.121,7.2093,-19.415]];

    const data3=[[43.983,11.865,-21.08],[43.988,11.847,-20.94],[44.003,11.79,-20.522],[44.029,11.693,-19.831],[44.066,11.552,-18.877],[44.116,11.363,-17.674],[44.177,11.12,-16.238],[44.252,10.82,-14.587],[44.339,10.458,-12.744],[44.438,10.03,-10.73],[44.547,9.5338,-8.573],[44.664,8.9678,-6.2987],[44.787,8.3304,-3.9361],[44.914,7.6208,-1.5153],[45.039,6.838,0.93255],[45.161,5.9817,3.3751],[45.275,5.0516,5.7798],[45.375,4.0471,8.1156],[45.46,2.9551,10.367],[45.52,1.7881,12.481],[45.552,0.55396,14.429],[45.55,-0.73602,16.184],[45.509,-2.0673,17.726],[45.427,-3.4222,19.036],[45.304,-4.7804,20.101],[45.143,-6.1203,20.913],[44.947,-7.4203,21.465],[44.725,-8.6601,21.757],[44.484,-9.8222,21.789],[44.234,-10.893,21.562],[43.983,-11.865,21.08],[43.983,-11.865,21.08],[43.751,-12.694,20.374],[43.559,-13.339,19.476],[43.415,-13.799,18.396],[43.328,-14.072,17.148],[43.3,-14.155,15.746],[43.336,-14.046,14.209],[43.433,-13.744,12.554],[43.586,-13.249,10.799],[43.788,-12.565,8.964],[44.027,-11.701,7.064],[44.289,-10.667,5.1152],[44.559,-9.4787,3.1324],[44.819,-8.1566,1.13],[45.059,-6.7091,-0.89577],[45.261,-5.1681,-2.9083],[45.416,-3.5619,-4.8902],[45.515,-1.9189,-6.8256],[45.555,-0.26727,-8.6983],[45.535,1.3655,-10.492],[45.46,2.9533,-12.19],[45.336,4.4713,-13.777],[45.172,5.8968,-15.239],[44.982,7.2087,-16.56],[44.777,8.3876,-17.729],[44.572,9.4165,-18.736],[44.38,10.28,-19.571],[44.216,10.966,-20.227],[44.09,11.463,-20.7],[44.01,11.764,-20.985],[43.983,11.865,-21.08]];

    const data5=[[58.881,16.359,-21.679],[58.892,16.318,-21.526],[58.926,16.194,-21.069],[58.983,15.985,-20.314],[59.063,15.689,-19.274],[59.164,15.303,-17.963],[59.286,14.822,-16.4],[59.428,14.245,-14.607],[59.586,13.57,-12.608],[59.757,12.795,-10.431],[59.937,11.922,-8.1036],[60.122,10.951,-5.6564],[60.306,9.8869,-3.1214],[60.484,8.7317,-0.53242],[60.65,7.4897,2.0758],[60.799,6.1653,4.6672],[60.925,4.7636,7.2056],[61.023,3.2891,9.6562],[61.087,1.7298,12],[61.111,0.10845,14.179],[61.091,-1.5613,16.163],[61.024,-3.2627,17.925],[60.908,-4.9759,19.442],[60.745,-6.6786,20.697],[60.538,-8.3465,21.678],[60.295,-9.9547,22.379],[60.023,-11.479,22.796],[59.735,-12.898,22.931],[59.44,-14.192,22.787],[59.152,-15.349,22.368],[58.881,-16.359,21.679],[58.881,-16.359,21.679],[58.647,-17.179,20.762],[58.471,-17.768,19.66],[58.361,-18.125,18.384],[58.322,-18.25,16.95],[58.356,-18.141,15.374],[58.462,-17.797,13.678],[58.635,-17.218,11.882],[58.867,-16.408,10.005],[59.146,-15.374,8.0673],[59.456,-14.125,6.0854],[59.782,-12.678,4.0747],[60.103,-11.053,2.049],[60.403,-9.2739,0.020948],[60.667,-7.351,-2.0151],[60.879,-5.326,-4.0232],[61.026,-3.2336,-5.9882],[61.101,-1.1083,-7.8965],[61.103,1.0156,-9.734],[61.032,3.105,-11.486],[60.896,5.1283,-13.139],[60.702,7.0557,-14.678],[60.465,8.8599,-16.089],[60.2,10.516,-17.362],[59.921,12,-18.484],[59.648,13.292,-19.448],[59.396,14.375,-20.244],[59.182,15.234,-20.87],[59.018,15.856,-21.319],[58.916,16.233,-21.589],[58.881,16.359,-21.679]];

    annotation { "Feature Type Name" : "Jspline" }
    export const Jspline = defineFeature(function(context is Context, id is Id, definition is map)
        precondition
        {
        }
        {
            const spline_id1 = id+'spline1';
            const spline_id2 = id+'spline2';
            const spline_id3 = id+'spline3';
            
            opFitSpline(context,spline_id1, { "points" : data1 });
            opFitSpline(context,spline_id2, { "points" : data3 });
            opFitSpline(context,spline_id3, { "points" : data5 });
        });

  • Options
    jaschaaajaschaaa Member Posts: 21 PRO
    Thanks a lot! Just what I needed.
Sign In or Register to comment.