I need to draw a filled 3D triangle that is curved on the interior. I wish to have parabolic edges and a smooth NURBS presentation and not a collection of small triangles on the interior of the triangle. The information that I have for the triangle are the (x,y,z) locations of the three corners and the three mid-edges. Any advise would be greatly appreciated!
import three;
settings.render=8;
size(10cm);
currentprojection=perspective(50,80,50);
// Rational Bezier patch: // udegree=3, vdegree=3, nu=4, nv=4;
real[] uknot={0,0,0,0,1,1,1,1};
real[] vknot={0,0,0,0,1,1,1,1};
triple[][] P=scale3(20)*octant1.P;
// Optional weights:
real[][] weights=array(P.length,array(P[0].length,1.0));
write("P=");
write(P);
draw(P,uknot,vknot,weights,gray);
The above was a sample code that I found and edited from the web produces the image shown below. I printed the "P" variable data, but I don't understand it's meaning.
P=
(20,0,0) (20,0,11.0456949966159) (11.0456949966159,0,20) (0,0,20)
(20,11.0456949966159,0) (20,11.0456949966159,11.0456949966159) (11.0456949966159,6.10036889791324,20) (0,0,20)
(11.0456949966159,20,0) (11.0456949966159,20,11.0456949966159) (6.10036889791324,11.0456949966159,20) (0,0,20)
(0,20,0) (0,20,11.0456949966159) (0,11.0456949966159,20) (0,0,20)
Are these point the control point for the Nurbs surface? The problem that I want to display would be to provide a curved triangle like in that example, but I would only need to use the corner and mid-edge points to the triangle. Any help would be appreciated!
Thanks, Joe