Effacer les filtres
Effacer les filtres

Interpolate Helix in 3d

3 vues (au cours des 30 derniers jours)
Robert Wu
Robert Wu le 14 Mar 2017
Commenté : Robert Wu le 16 Mar 2017
I have three helices with 39 data points for each helix:
t=linspace(0,8.6*pi,39);
plot3(35*cos(t)+35,35*sin(t)+35,t,'LineWidth',3);
hold on;
plot3(25*cos(t)+35,25*sin(t)+35,t,'LineWidth',3);
plot3(15*cos(t)+35,15*sin(t)+35,t,'LineWidth',3);
hold off;
I am wondering how I could interpolate the area between the helices in the x,y,z direction? Thanks!

Réponses (1)

John D'Errico
John D'Errico le 14 Mar 2017
Modifié(e) : John D'Errico le 15 Mar 2017
If you want to interpolate the helices smoothly, download interparc from the file exchange.
t=linspace(0,8.6*pi,39);
x = 35*cos(t)+35;
y = 35*sin(t)+35;
xyzi = interparc(1000,x,y,t,'spline');
plot3(x,y,t,'ro')
hold on
plot3(xyzi(:,1),xyzi(:,2),xyzi(:,3),'-b')
box on
grid on
But re-reading your question, you asked to interpolate the area BETWEEN the helices.
Are you asking how to make the three curves into a plottable surface, connecting them together? This is quite doable, but I won't do so without affirmation from you as to my guess.
  6 commentaires
John D'Errico
John D'Errico le 16 Mar 2017
I don't know what you have shown me there. You need to be careful in what variables you treat as the dependent and independent variables. Perhaps you might attach the actual data that you have.
The -pi/pi boundary will be an issue here, as gridfit would need to be modified to solve your problem. It would almost be easier to write a hacked (and very simple version) that did have periodic boundary conditions in one variable.
Anyway, there are other solutions one might look at. For example, given all three curves, generate a 3-d delaunay tessellation. Of course, that will include the volume internal to the central helix. Now, delete any tetrahedra that cross that internal region. The result will be a tessellation of the annular volume in question. The only issue would be how to delete the stuff in the middle. That would be doable though, and it completely eliminates the periodic boundary problem.
Robert Wu
Robert Wu le 16 Mar 2017
Thanks for the info! That row of numbers in the previous comment is the data points that winds down a cylinder in a helical fashion. I want to make something like this 2D plot, but on 3D cylinder:
This is a cross-section view of the cylinder. The 3 sine waves are the helices in 2D. The dots on the wave is where the data points are. The area is interpolated by what the value of the dots are.
What I am having trouble with is representing this in 3D.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Graphics Object Properties dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by