Perfect curve through points

Hello Everybody,

So, I am trying to model a wind turbine blade in Rhino 5.0. I have imported the list of points. Now when I try to make the curve of out the points it does not fit perfectly.

Following are the steps:

  1. Curve>Freeform>Fit to Points.
  2. Select the points (individual airfoil)
  3. Done.

I want to have a perfectly shaped airfoil. I have attached the screenshot for the reference (2 screenshots with curve - Closed and Open).

Any help is appreciated on this topic.

Thank you

Pranav Bhatnagar

Hi Pranav,

Check this python script, maybe it will give somewhat better results.

Hello @djordje

Thank you for the solution. Can you explain me how do I run this script. I am not aware of programming languages. Sorry about that!!

Thanks,
Pranav

The problem occurs because Rhino is sorting the points based on closest points. For some of the points, the closest point is on the other surface.

Two solutions:

  1. Select the points individually in the order the curve should go through them.

  2. Use Curve>Freeform>Interpolate Points (InterpCrv) with the Point Osnap on, and select the points individually in the order the curve should go through them. This method has the advantage you can watch curve linking the points.

1 Like

If you are using Rhino for Windows, then open Tools -> PythonScript -> Run, and select the downloaded .py file.
You may need to download the .py file again, as I added checking for duplicate points.

1 Like

Hello @davidcockey

Thank you for your solution, I tried it. but the problem is that I have a large no of points as the blade is 27m long and has 27 sections. Trying to connect all the points is troublesome and may create multiple errors. Anyways that’s the last option.

Pranav

@djordje

Thank you for your prompt reply. I tried to run the file (new one). It tells me to select the unordered points, but i cannot select any points. I think I am missing something.

Anyways, I have attached the blade coordinates files, can you work on that and let me know. Sorry for the added work.

New_Blade.txt (654.1 KB)

Thanks

You can also try “Surface > From point grid”, or box-select all the 6 to 8 points at the flap, inverse-select and hide all the rest, and individually go through each point. After that inverse-hide the flap, and do the rest of the wing. Unhide all, and join.

You have pointclouds, not points. Explode your pointcloud to get the points, then run the script.

Hello Pranav, how did you create the point cloud at first. If you have point coordinates, you can create sections using interpCrv command. Do you have points as a table?

I think the best way would be to write a little script that reads the text file directly - I am assuming that the points are in order in the text file and it looks like each section has the same number of points (42) - plus there is a blank line between each section. Shouldn’t be too difficult to do, but I don’t have time right now… Maybe later, or someone like djordje will beat me to it…

–Mitch

pranav.py (613 Bytes)

OK, here is my script.
Is it the first one ? :smile:
( … After some fighting against the weird points order … :wink: )

Cheers

p.s.
Please, check carefully the resulting curves, no warranty unfortunately …

1 Like

pranav.py (644 Bytes)
I have though that the ‘special’ point in any section could have a special meaning.
This script also draws that ‘special’ point

2 Likes

@0netech - thank you for you answer, I tried it, but it was a bit difficult. Actually i have huge no of points and doing it manually makes it very difficult.

@djordje - yes, i worked on exploding the points. It works till the last when it asks “Minimal Distance Between Two Points” After entering a value or default. It gives an error.

Message: ‘Point3d’ object has no attribute 'EpsilonEquals’
Traceback:
Line 35 in CullduplPts, in line 8 of the script.
Line 8, in fitCurveThroughPoints
Line 59 in module

@metinsaylan @Helvetosaur - The file I have is imported from a blade design software which exports only STL and coordinates files. The file arranges each section of airfoil with xyz cordinates (42 points for 1 airfoil) and then the blank line indicates the start of the new airfoil. In this sense I have 30 section ranging 25m of length. For Creating point cloud, i have just imported the .txt file and uncheck the option create point clouds. In this case using manual interpCrv command makes it prone to errors. But thats the final option if nothing works perfectly.

@emilio - You have nailed it. This is what exactly, I was looking for. Very simple way to putting in. Bothe the files are amazing. Thank you very much for the effort. Appreciated.

Now to create a 3d - should I use loft or some other command and is there any way to give thickness to it. Also how can I provide a smooth closing to the one end of the blade. I used to work for CATIA for all these times. Surface modelling is been quite tricky there. Rhino provides the most easiest way.

Thank you all!! Appreciated your efforts and time.

Pranav

That has to be the most bizarre points file format I have ever seen. The way of organizing the points is incomprehensible to me, especially after about 2/3 of the sections, the points are duplicated in the same section; the blank space only happens every 84 lines instead of 42…

–Mitch

@Helvetosaur - This is the way it is exported because of the design of the blade in 3d space. The blank space happens only after 42 lines. You can cross check them. By bizzare you mean e+001 or e-001??

No, that’s OK, although for the size of the object, I don’t see why the e notation is needed.

The problem I see with the NewBlade.txt file you posted is after line 6450 there is no longer a space after 42 lines, and the points start repeating for the same section - the space comes only after 84 lines. It’s that way all the way to the end of the file except for the last section… Unless there was an error writing the file somewhere, that’s not very reliable/predictable. The repeated points for each section are also not really desirable and need to be filtered out…

–Mitch

Huh … I did not look into the file up to that point … thanks for doing that …
I only tried to understand the first section (bizarre enough … :wink: ) so the script assumes that the section format is constant until the end of the file, which is not.

@Pranav : The curve drawn by the script may be wrong (or missing or … ) after the section format changes. Please check the curves against the imported points before using them to build surfaces.

This is what I have for the moment… Completely wacky…

–Mitch

ImportXYZSpecial.py (1.8 KB)

@emilio I think there is a difference in between both of them. In terms of dimensions. I had sent you a message did you receive it?

@Helvetosaur - Very true, I actually didn’t notice it till now untill you rejustified back. Yes thats weired, I am not sure why it is like that. Btw thank you for the script. I tried to run it, but it hits back an error. I have attached it for you reference. Thank you very much.

@emilio @Helvetosaur - This was a test blade design. I am working on the final one. Should be finialized in 2-3 days. I will seed the files to you for making a phython script. If you could do that, it would be amazing.