![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176972/image.png)
please help me to program of this equation of triangular patch bezier
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
amina lk
am 2 Dez. 2014
Kommentiert: Mike Garrity
am 26 Mai 2015
<</matlabcentral/answers/uploaded_files/22004/Capture
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/146299/image.jpeg)
.JPG>> please help me to program of this equation of triangular patch bezier
0 Kommentare
Akzeptierte Antwort
Mike Garrity
am 2 Dez. 2014
Bearbeitet: Mike Garrity
am 2 Dez. 2014
It's 2D because you'll find that you probably want to rewrite it in terms of two independent variables and derive the third from those. For example, you could have something like this:
[u,v] = meshgrid(linspace(0,1,50));
w = 1-(u+v)
out = w<0;
u(out) = nan;
v(out) = nan;
w(out) = nan;
If you do surf(u,v,w) at this point, you'll see something like this:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/176972/image.png)
Now you can use the same kron technique I described in that blog post to multiply these three arrays by your input points.
In the teapotdemo I was doing square patches instead of triangular patches, but you might find something you can mine from there.
I hope that's enough to get you rolling. Have fun, this is an interesting problem! There's a lot of interesting math hiding in these simple objects.
5 Kommentare
Mike Garrity
am 26 Mai 2015
I don't remember the rules for triangular patches, but I know that for a rectangular cubic you get C1 continuity when the lines through the shared edge vertices to the control points in the next row are collinear. I would assume it's pretty similar for triangular.
This paper has an interesting derivation in terms of barycentric coordinates.
Weitere Antworten (1)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!