|
 |
> The question is why are some parts of the tube flatened as indicated in the
> image T_HeartCurve_00a1.png??
Angles.
A torus goes around smoothly, and the outward pointing normal is always pointing
away from the center.
You have a heart / cardioid, and the amount of rotation is 1.5 times that,
because you have that dip in the top of the heart.
I wasn't gonna figure all of that out, but what I did was essentially mirror the
curve by using select, and change the signs.
Try this and see if this is what you're after: (Not sure about that dip)
#declare rr = 1.00;
// Parametric function sets for HeartCurve and their derivatives:
#declare FX = function(u) {16*pow(sin(u),3)};
#declare FdX = function(u) {48*pow(sin(u),2)*cos(u)};
#declare FY = function(u) {13*cos(u)-5*cos(2*u)-2*cos(3*u)-cos(4*u)};
#declare FdY = function(u) {-13*sin(u)+10*sin(2*u)+6*sin(3*u)+4*sin(4*u)};
// Cross section of tube:
#declare QX = function(v) {u};
#declare QY = function(v) {rr*cos(v)};
#declare QZ = function(v) {rr*sin(v)};
// Rotation angle of cross section of tube:
#declare PHI =
function(u) {
select (pi-u,
atan2(abs(FdX((tau-u)/2)), FdY((tau-u)/2)) - pi/2,
-atan2(abs(FdX(u/2)), FdY(u/2)) + pi/2
)
};
#declare F1 = function(u,v) {QY(v) * cos(PHI(u)) + FX(u)};
#declare F2 = function(u,v) {QY(v) * sin(PHI(u)) + FY(u)}
- BW
Post a reply to this message
|
 |