[Sussex] Help! Equation for a surface wantted.

Mark Harrison (Groups) mph at ascentium.co.uk
Fri Oct 21 16:10:13 UTC 2005


On Fri, 2005-10-21 at 16:10 +0100, Steve Dobson wrote:
> > Too many circles to work out what you're after:
> 
> That maybe the case - but I have seen it, I just don't know who to 
> generated it.

Generating is is relatively easy. It's trying to describe it in plain
English that's the hard bit.

> > - Possibility 1, you are looking for something like a circle
> extruded
> > round an ellipse. (Think a normal doughnut that you are pulling
> apart
> > from opposite "corners".)
> 
> That's called a torus - that I know how to produce.  I gave the
> equation
> for this the grandparent post.

It looked to me like the equation you gave would have been a circle
extruded round a circle, not a circle extruded round an ellipse.
However, as you say, you're happy with what you've got at the moment.


> > - Possibility 2, you are looking for something like a doughnut, but
> at
> > some points of the doughnut the dough is thicker than others,
> however,
> > cutting through the dough at any point always gives a circle.
> 
> If the cut is being made perpendicular to the axis of rotation then
> this
> is what I want.  If you cut my odd shaped doughnut in half then the to
> circle cross sections, while perfectly circular, would nit necessarily
> have the same radius.  I only need to specify one maximum and one
> minimum 
> radius for the cross section circles - the others can be a linear
> progression from the max to the min.

Right - time for some definitions:

x, y, z - the variables for which we're trying to solve the equation
RMaj - the major radius, the thing you gave as C in yours
RMin - the minor radius, the "how fat is the dough" bit

If I can restate your equation, then we have:

	RMin^2 =  	(
				(
					sqrt (X^2 + Y^2)
					- RMaj
				) ^ 2
				+ Z^2
			)


Let us assume that the donut is at its thickest along one of the axes -
if I've got things the right way round, the X axis - because it makes
things way simpler.

Instead of RMin being a constant, RMin is now a function of x, y, and
two new constants RMinFixed = the smallest diameter of the dough, and
RMinVariable = the variable bit of the diameter of the dough, which can
be as low as zero.

To have a smooth curve, you'd use

	RMin = RminFixed + RMinVariable * ArcTan(x/y)

Sadly, this gives a nigh-on intractable set of formulae to unravel.

However, you can fudge things massively by instead assuming that instead
the thickness coefficient can be represented as 

	x / (ABS(x)+ABS(y))

	where ABS (n) = n, if n >= 0
			-n, otherwise

	which is to say

	x / (sqrt (x^2) + sqrt (y^2))

	RMin = RMinFixed + RMinVariable * x / (sqrt(x^2)+sqrt(y^2))

So, we now have :

	(RMinFixed + RMinVariable * x / (sqrt(x^2)+sqrt(y^2)))^2

		 =  	(
				(
					sqrt (X^2 + Y^2)
					- RMaj
				) ^ 2
				+ Z^2
			)

Which is a real sod to type, let me tell you :-) It's a lot neater on
the bit of paper I have in front of me where I can draw long sqrt signs
that cover the whole bit of thing of which they are trying to take the
root :-)

Hope that makes sense?

Mark





More information about the Sussex mailing list