Thought I'd begin describing a SphereSweep script.
SphereSweepAlpha01 script For MoI4.
Uses some of the MoI4 curve functions. Does not work for MoI3.
Brian McMillin, April 2, 2020
A Sphere Sweep is the envelope of a sphere with its center point sweeping along a path curve C(t), with its radius r(t) either constant, or varying along the path.
Another description is that of a Canal surface, which is the envelope of a family of spheres with their center points located along a profile curve C(t). Their radii may vary. (This "t" parameter may be different from the NURBS "t" parameter.)
Except for the simple case that the radiusCurve and the centerPath curve are equivalent: It is necessary to "synchronize" the radiusCurve parameter t1 with the centerPath parameter t2, so that the variable radius sphere has the proper radius along the sweep centerPath. This is done by arraying numpoints points, equally spaced, along each curve. A pair of points, one from each curve, in order, correspond to each other.
The new script method of MoI4Beta, curve.dropPoint( pt ) is used for each member of a pair of points, to return the parameter value "t" of the curve at that point.
radiusCurve.dropPoint( pt1(i) ) returns the associated t1 parameter.
centerPath.dropPoint( pt2(i) ) returns the associated t2 parameter.
This also permits the radiusCurve to be of different length than the centerPath.
Each parameter t1 or t2 is used with other new script interface curve methods.
radiusCurve.evaluateTangent(t1) yields the normalized tangent, at t1 associated with point1.
radiusCurve.evaluateDerivatives(t1...) yields first and second derivatives at said point.
centerPath.evaluateTangent(t2) yields the normalized tangent at t2 associated with point2.
centerPath.evaluateDerivatives(t2...) yields first and second derivatives at said point.
Set up the radiusCurve with its z_coordinates the radius values.
It is easiest to think of the radius curve as planar in the plane y=0. (But not essential.)
A given point on the radius curve has (x,y,z) coordinates = (x,0,radius)
Note conditions: C(t) has C2-continuity, r(t)>0. If r(t) = 0 the sphere is a point. Also, square( ||C_prime(t)|| ) >= square( r_prime(t) ). (prime = derivative)
Using the above values, Calculate and gather the characteristic circles of the spheres, (and points if any),
into an objectlist, and perform Loft.
Voila.
- Brian (more to come)
It is so simple now, but does take a lot of time and work to script :-)
|