Feature Request - "Sphere Tangent Cone Interior"

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
thx1111
Posts: 1
Joined: Wed May 10, 2023 3:27 pm

Feature Request - "Sphere Tangent Cone Interior"

Post by thx1111 »

I was not able to find any existing feature like this.

Consider a circular cone and a spheroid with the axis of the cone and the axis of rotation of the spheroid coincident. The cone and spheroid surfaces may be positioned tangent along a contact circle or contact ellipse.

Any arc may infer a sphere with the same radius and center. Any rotation of an ellipse around its major or minor axis may infer a spheroid with the same axis.

Any line tangent to that arc, or to that spheroid and coplaner with its axis of rotation, may infer a circular cone and a common axis of rotation which passes through the apex of the cone and the center of the sphere, or is otherwise collinear with the axis of the spheroid. That tangent line is a directrix of the cone.

By calculating the distance between the center of a sphere and the apex of a cone in an assembly, the sphere and cone can be automatically positioned exactly tangent, by selecting the corresponding surfaces or by selecting the generating arc and a tangent line, to create a "Sphere Tangent Cone Interior" feature.

Perhaps the most common application for this feature is the positioning of a spheric pipe seal in a conical pipe flange. The purpose of these spheric seals is to accommodate angular misalignment in a pipe coupling. This feature would simplify assembly of pipes using these seals. Note that the center of the sphere corresponding to the spheric seal would be coincident with the center of the angle between the axes of the joined pipes. For this reason it can be preferable to position the cone relative to the sphere rather than position the sphere relative to the cone. A similar application is the positioning of spheric washers and their bolts into countersunk mounting holes. The spherical face of the seal may be easily constructed as a Revolution of a Sketch of a cross section through the seal. The conical face of a flange or hole is easily constructed as a Chamfer on a hole.

That sphere can be made tangent to the interior of that cone by constraining the center of that sphere to coincide with the axis of that cone, and setting the distance between the apex of that cone and the center of that sphere to a distance determined by the radius of the arc and the half angle of the inferred cone.

Presumably, the parameters of the arc or spheroid and the line tangent thereto are all known from their construction.

The half angle of the cone may be visualized using a cross section through an arrangement of Dandelin spheres. There is a useful graphic and discussion to illustrate at https://en.wikipedia.org/wiki/Dandelin_spheres .

Since the structures being considered in this case are all circularly symmetric, the geometry may be analyzed by considering a planar section through the axis of rotation.

When the cone and sphere are tangent, the points, 1) apex of the cone, 2) point of tangency at the contact circle, between the cone and the sphere, and 3) point of intersection between the axis of rotation and a line perpendicular to that point of tangency, which is to say, the center of the sphere in this case, form a right triangle.

The distance between the apex of the cone and the center of a sphere tangent to the cone is the hypotenuse of this right triangle, which is then simply equal to the radius of the sphere divided by the sine of the half angle of the cone.

R radius of curvature of the arc or curve generating the sphere
D distance between the apex of the implied cone and the center of the implied sphere
α full angle of the cone

D = R/sin(α/2)

This value D may then be used to set a Relative Offset between the conical object and the spherical object.

To actually set the relative positions and orientation of the implied cone and sphere, the reference planes of some base of the cone and some solid part of the sphere must also be determined and incorporated. That calculation typically involves the above calculated distance D, four distances along the axis of rotation, and the perpendicular cone base radius and cone half angle. For instance, being careful with the vector signs:

Δ Relative Offset from conical object to spherical object
e cone apex to chamfered edge's face
f chamfered object's origin to chamfered edge's face
g spherical object's origin to sphere center
h spherical object's origin to some selectable face on the spherical object, Plane Aligned with the chamfered object's origin
i cone base radius

Distance e must be calculated,
e = i/tan(α/2)

Then, the required Relative Offset is:
Δ = D - (e - f) - g + h

However, preferably, the position of the spherical object will be offset, to make the center of the sphere coincident with the object's origin, so that the object may be directly rotated while maintaining tangent contact between the conical and spherical surfaces. The Relative Offset of the spherical object in the Assembly will then be adjusted to recover that offset away from the object's origin, to give:

Δ' = (Δ + g) = D - (e - f) + h


Separately, it may be noted that, where a plane intersecting a cone forms an ellipse, it is also possible to infer that plane and that cone from just the ellipse and a line through a vertex of the ellipse, perpendicular to the line tangent to the vertex. This may be seen from reference to the illustration of Dandelin Spheres, above, and noting that the apex of the cone and the vertexes of the ellipse form a triangle inscribing a circle, all in a plane which includes the axis of the cone. The vertexes of an ellipse are the end points of the major semi axis of the ellipse. That line through a vertex is a directrix of the cone.

Visualizing this triangle and inscribed circle in the plane, suppose that:

α angle of the cone
β angle at a vertex of the ellipse
γ angle at the opposite vertex of the ellipse

0 < α < 180°
β < γ
0 < γ < 90°
α + β + γ = 180°

a major semi radius from ellipse center to each vertex
b minor semi radius from ellipse center to each covertex
c distance from ellipse center to each focus

r radius of the inscribed circle
d distance between the apex of the implied cone and the center of the inscribed circle

then:

α/2 = 90° - γ/2 - β/2

The major semi axis of the ellipse is tangent to the inscribed circle at a focus of the ellipse, and the focus divides the major semi axis into segments of length (a+c) and (a-c), so that:

r = (a+c) tan(β/2) = (a-c) tan(γ/2)
β/2 = arctan ( ((a-c)/(a+c)) tan(γ/2) )

giving:

α/2 = 90° - γ/2 - arctan ( ((a-c)/(a+c)) tan(γ/2) )

with the axis of the cone passing through the center of the inscribed circle, and with a directrix of the cone both tangent to the inscribed circle and passing through a vertex of the ellipse. As above, the distance between the apex of the cone and the center of the inscribed circle is:

d = r/sin(α/2)

Expressing the half angle of the cone in terms of the lengths of the major and minor semi axes of the ellipse, note the substitution:

c = sqrt(a²-b²)

Here, as c -> 0, α/2 -> (90° - γ), β = γ, the ellipse becomes a circle, and still, there are no division by zero problems with these equations.

As an aside, note that, the center of an ellipse formed on the surface of a cylinder is always coaxial with the axis of that cylinder. In contrast, the center of an ellipse formed on the surface of a cone will *not* be coaxial with the axis of the cone, except when the ellipse is a circle.

Also, note that linear scaling of the space of a circular cone and sphere in various directions may transform the cone and sphere into various elliptic cones and spheroids while retaining a closed tangent curve between the two objects.

Anybody want to code this? Or, maybe offer some guidance about how it would be done?
Post Reply