Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations The Obturator on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel VBA Circle from 3 Points

Status
Not open for further replies.

rnordquest

New member
Jul 17, 2003
148
I have points (x,y,z) around an airfoil from a measuring device. It uses a ball to touch the surface. My xyz points are from the ball center. I need a macro to calculate the actual surface. How do I do it?

I was thinking of taking 3 points to get a circle, then get a line from the middle pt to the center, and then use my ball radius to move down that line and get a new xyz point. Then you move over one point and do it again.

Any other methods would be appreciated along with the macro that makes it go. I've got 1300 points per cut, 4 cuts per airfoil, and 6 airfoils per wing and at least 2 wings so speed may be important.

Thanks,

Roger
 
Replies continue below

Recommended for you

There are a variety of ways to program the output and the way chosen by the expert ended up with some problems. The ball center data is perfectly fine but requires a lot more math processing to turn it into something usable hence the reason he chose the original method. With our expert out of the country for 10 days I was trying to see if progress could be made without him.
 
Well, I think you have the gist of the basic approach.

An alternative approach might be to feed the coordinates into a 3-D CAD program, which could probably then come up with a bounding curve and then "shrink" the object by 5 mm total.

TTFN

FAQ731-376
 
I have another question on this. The files come to me in groups e.g. Key2 - pressure side, suction side, leading edge. How do I write a macro to sort the groups, not the individual points? Example:

Key1=A
Key2=1 Key3=2.0
Npts 3
1
2
3

Key1=A
Key2=2 Key3=1.5
Npts 5
1
2
3
4
5

Key1=A
Key2=1 Key3=1.5
Npts 4
1
2
3
4

The files are in csv format but it's easy enough to either change that or pull the necessary values out of the 3 header strings.

How do I sort by Key1, Key2, then Key3 without changing the actual data?

The final result would look like this:

Key1=A
Key2=1 Key3=1.5
Npts 4
1
2
3
4

Key1=A
Key2=2 Key3=1.5
Npts 5
1
2
3
4
5

Key1=A
Key2=1 Key3=2.0
Npts 3
1
2
3
 
No easy way. Each group needs to somehow get onto a single line, from whence you can sort however you want.

TTFN

FAQ731-376
 
I would use a vba macro to pull it into excel as a table. Each record will have Key1value, Key2value, Key3value, followed by the data.

Then use excel's sort function.

What does the data look like for example where 1 is?
A set of 3 floating point numbers for X, Y, Z coordinates?
Any delmiters?

Can you post a small excerpt of the actual file?

If I get time, I might try to write a macro to do it. The logic is pretty simple.

You might also try posting the question along with the sample data at the vba forum on (sister site to ). They have people there that could do this in their sleep.

=====================================
Eng-tips forums: The best place on the web for engineering discussions.
 
Data File D:\Work\
Serial Number xxxxxxxx-A Blade 1
LeadingEdge Section Y1.50
NPTS 72
-0.0117912193095768 1.50014072437008 -0.0361111128431496
-0.0140347175575217 1.50013940003197 -0.0340299219190519
-0.0162581880711581 1.50013792304094 -0.0319672791692395

Good idea. If I write out additional columns for the keys then the sort would be a piece of cake.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor