MoI discussion forum
MoI discussion forum

Full Version: Sphere Sweep, Canal Surface

From: bemfarmer
5 Apr 2020   [#1]
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 :-)
From: wayne hill (WAYNEHILL5202)
6 Apr 2020   [#2] In reply to [#1]
Brian,

To stitch with a variable sphere surface radius from zero to largest gap? Looking up "Canal surface" came up with "Dupin Cyclides" that pointed back to Brian McMillin's script from Dec 2013.

Graphic illustrations work better in my case.

-Wayne
From: bemfarmer
6 Apr 2020   [#3] In reply to [#2]
Hi Wayne.
Right now it is intended to do a sphere sweep along a curve.
This can be different than just a circle sweep. In other cases, MoI already can do such things as Pipes, with circle sweep.

Reuleaux modWedge will be a very simple example, to be trimmed with the Reuleaux Tetrahedron sides.

I'll post more, as time allows.

- Brian
From: bemfarmer
25 Apr 2020   [#4]
I wrote a canal surface/sphere sweep script, but it did not work.
MoI did not like my vector math, which was likely due to my error(S). :-)
It is hard to understand the vector/scalar formulas in various math papers. Notations vary.

I'll revisit the faulty script, but first, have reverted to a special case of the spheres/envelope being tangent to the plane z = 0.
For this simple case, the characteristic circles for the modWedge can be manually built in MoI4, say for 21 points, by using tangents and mirror and circle factory and Loft.
I'm slowly working on a simple script version...
The sphere sweep is often NOT the same as a circle sweep.
(The resulting modWedge does not like to boolean union or trim with the Reuleaux tetrahedron, which is another story.)

The new MoI4beta curve methods, such as crv.dropPoint( pt ),
and crv.evaluateTangent( t, 2 ) are very useful.

So: Is the second derivative at NURBS parameter "t" associated with point on the curve <<<Equivalent>>> to the Normal at the point ?
(un_normalized) ?

- Brian
From: Michael Gibson
25 Apr 2020   [#5] In reply to [#4]
Hi Brian,

> So: Is the second derivative at NURBS parameter "t" associated with point on the curve
> <<<Equivalent>>> to the Normal at the point ?

No, but they are related. The curvature vector is calculated from the first and second derivative.


- Michael
From: bemfarmer
25 Apr 2020   [#6] In reply to [#5]
Thank's Michael,

Back to vector math calculus class for me :-)

- Brian
From: bemfarmer
15 May 2021   [#7]
Todays idea is to perform a sphere sweep on a curve, using Flow.

Unwrap the curve.
Sphere radii vary along the arc length.
The envelope, for the unwrapped curve (straight line), is a surface of revolution.
The rate of change of the radii equation with arclength to be limited by ?
To get the planar curve to revolve... ???

- Brian