Implicit Definition of Other Shapes

Higher-dimensional geometry (previously "Polyshapes").

Implicit Definition of Other Shapes

Postby ICN5D » Mon Nov 03, 2014 11:53 pm

All right, so, Ive graphed and rendered a ton of toratopes by now. I have a really good understanding of how their implicit function works. This brings me to my next goal of rendering the cuts of non-toroidal shapes, like hypercubes, simplicies, cartesian products, etc. It will be really awesome to animate the rotations of a (triangle,circle) prism in 3D slices.

Probably the first step, is how to graph a non-infinite cylinder by implicit function. Is this possible, with one all-inclusive function, to make a discrete shape with flat sides and sharp edges? How about the implicit for a fully enclosed square pyramid? Its my understanding that the implicit surface has no limit to complexity. I think I saw somewhere a cylinder will have the height along Z as an absolute value of a non-squared Z, added to the typical circle implicit.

the infinite, open ended cylinder is very easy, but Im looking for a closed up, discrete surface. Id like to explore a method to plot a cube in CalcPlot, in addition to flat+curved sides. Seems like it would lead to more interesting renders!
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby PWrong » Tue Nov 04, 2014 5:03 am

Here's a cylinder for you.
|sqrt(x^2 + y^2) + z| + |sqrt(x^2 + y^2) - z| = 1

The top answer here will help with polygons, and you can probably extend it to any dimension.
https://math.stackexchange.com/questions/41940/is-there-an-equation-to-describe-regular-polygons
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Implicit Definition of Other Shapes

Postby Marek14 » Tue Nov 04, 2014 6:22 am

PWrong wrote:Here's a cylinder for you.
|sqrt(x^2 + y^2) + z| + |sqrt(x^2 + y^2) - z| = 1

The top answer here will help with polygons, and you can probably extend it to any dimension.
https://math.stackexchange.com/questions/41940/is-there-an-equation-to-describe-regular-polygons


My function for cylinder is max((x^2+y^2),z^2) = 1 (it treats a cylinder as a sphere under a particular mix of Euclidean and maximum metrics).
This relates to graphotopes, shapes I researched years ago. There are four in 3D:

Cube, max(x^2, y^2, z^2) = 1
Cylinder, max((x^2 + y^2), z^2) = 1
Dome (or crind), x^2 + max(y^2, z^2) = 1
Sphere, x^2 + y^2 + z^2 = 1

Basically, they are shapes whose 2D cuts are particular set of squares and circles which can be expressed as a graph where nodes represent dimensions and edge between two nodes exists if the cut in these two dimensions is a circle.
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Implicit Definition of Other Shapes

Postby wendy » Tue Nov 04, 2014 10:15 am

The construction of the cylinder as [(xy)z] is by the form []=max, ()=rss, <> = sum, gives the product:

[(xy)z] = max(rss(x,y), z)

The coordinates are put as absolute values first, the equity for the surface is to be equal to 1, so:

[(x,y),z] = max(rss(abs(x),abs(y)),abs(z)).

Since x, y, and z can be themselves polytopes, the radiant equations are used, where r=0 at the centre, and r=1 at the surface. The abs() does this for the canonical coordinates of the "brick" polytopes, eg (-1 to +1) in various axies.
The dream you dream alone is only a dream
the dream we dream together is reality.

\ ( \(\LaTeX\ \) \ ) [no spaces] at https://greasyfork.org/en/users/188714-wendy-krieger
User avatar
wendy
Pentonian
 
Posts: 2014
Joined: Tue Jan 18, 2005 12:42 pm
Location: Brisbane, Australia

Re: Implicit Definition of Other Shapes

Postby ICN5D » Tue Nov 04, 2014 9:19 pm

Oh, awesome. I see how that cylinder equation works. It looks like a straightforward line segment times a circle. I have yet to plot it, but soon I will.

Prisms seem fairly simple, so how about a cone? How does one taper a base shape to a vertex? Maybe by removing the second circle from the second term for cylinder?

Another thing is, does calcplot recognize the max and sum functions?

The parametric stuff is unfamiliar to me, so the triangle equation in implicit form would help me a lot. From there, I can experiment with other shapes.

This may lead us to the equation for a six legged mantis, something youve been searching for, Marek. We could do a cartesian product of hexagon and circle, then establish a set of points equally distant from its margin.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby Marek14 » Tue Nov 04, 2014 9:48 pm

ICN5D wrote:Oh, awesome. I see how that cylinder equation works. It looks like a straightforward line segment times a circle. I have yet to plot it, but soon I will.

Prisms seem fairly simple, so how about a cone? How does one taper a base shape to a vertex? Maybe by removing the second circle from the second term for cylinder?

Another thing is, does calcplot recognize the max and sum functions?

The parametric stuff is unfamiliar to me, so the triangle equation in implicit form would help me a lot. From there, I can experiment with other shapes.

This may lead us to the equation for a six legged mantis, something youve been searching for, Marek. We could do a cartesian product of hexagon and circle, then establish a set of points equally distant from its margin.


Not sure the mantis would work this way...

As for a cone, I think that max(x^2 + y^2 - z^2 + 1,z^2) = 1 would be double cone...
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Implicit Definition of Other Shapes

Postby ICN5D » Wed Nov 05, 2014 5:57 am

Graphed the cylinder in calcplot using

|sqrt(x^2 + y^2) + z| + |sqrt(x^2 + y^2) - z| = 1

came out perfectly. It needs to be rendered in a very high resolution, like 150 to 200 cubes to really sharpen the edges. Really neat to see it work.

I also experimented with a cone equation, and got something close. Using

abs(z/2) + abs(sqrt(x^2 + y^2) + z/2) - 4

you get a cylinder with conic ends in place of circles. How would one get a perfect cone, with a flat circular base? Calcplot doesnt recognize the max, rss, sum . This is kind of an interesting problem. Maybe if I can define a triangle implicitly, I could then put a bisecting rotation in it. Going from square to cylinder makes a very clear change to the equation.

EDIT : played around some more with the equation. Found that a double cone can be made by

abs(sqrt(x^2 + y^2)) + abs(z) - 4

which comes as close as I can get to a cone. Not quite sure how to mathematically restrict it to just one half, with an enclosed circle base.

Also found that abs(x) + abs(y) + abs(z) - 4 graphs an octahedron.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby PWrong » Thu Nov 06, 2014 1:18 pm

This will make your equations look horrible, but you can define max in terms of abs.
max[x,y] = (x + y + (x - y)^2/Abs[x - y])/2

rss (root sum square) and sum you can just do manually unless you have a large number of variables, in which case you'll need a better program.
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Implicit Definition of Other Shapes

Postby ICN5D » Thu Nov 06, 2014 11:44 pm

Some results I got lately:


[X,Y,Z]min = -5
[X,Y,Z]max = +5


• I , line segment
------------------
abs(-x) + abs(x) - a


• IO circle
---------------
sqrt(x^2 + y^2) - a^2


• I> Triangle
----------------
abs(-x) + abs(x) + abs(y) - a
- Ymin=0


• II square
----------
abs(x) + abs(y) - a
AND
abs(abs(x) - y) + abs(abs(x) + y) - 4 , as other orientation


octahedron
--------------
abs(x) + abs(y) + abs(z) - a



• IO> cone
---------------
abs(sqrt(x^2 + y^2)) + abs(z) - a^2
- Zmin=0



• III cube
-------------------
abs(abs(x) + abs(y) - z ) + abs(abs(x) + abs(y) + z) - a

AND

abs((abs(abs(x) - y) + abs(abs(x) + y) - z)) + abs((abs(abs(x) - y) + abs(abs(x) + y) + z)) - 4

ALSO
x^100 + y^100 + z^100 = 100
-- perfect unit cube, centered at origin


• II(I) , sq ring with sq crosscut
----------------------------------------------------
abs(abs(x) + abs(y) - z - a) + abs(abs(x) + abs(y) + z - b) - c


• II> sq pyr
--------------------
abs(x) + abs(y) + z - a
- Zmin=0


• I>I triangle prism
---------------------
abs(abs(-x)/2 + abs(x)/2 + abs(y) - z) + abs(abs(-x)/2 + abs(x)/2 + abs(y) + z) - a
- Ymin=0


• I>> tetrahedron
-------------------------
abs(-x) + abs(x) + abs(y) + abs(z) - a
- Ymin,Zmin=0


For anything pyramid-like or triangular, one of the negative regions needs to be restricted to 0 to cut the shape in half, making an approximate shape. For the triangle prism, it made closed ends of a triangle, but one of the square faces is missing. Just about all bases of tapertopes will be missing using these equations. I still have yet to find an equation form that gives only the positive region for the shapes graphed so far. This would cut the double shape in half, and seal the base off. It's easy to make an octahedron : abs(x) + abs(y) + abs(z) - a , so how does one render only the +z region, with a filled-in square base?

I tried using the generic equation in the Stack Exchange response to make polygons. No luck with it. Maybe I am missing something?

For n-gon of radius r:

fn(x + iy) = abs(abs(rSn - abs(y)) - (rSn - abs(y))) + abs(x - rCn)

Sn = sin(3.14/n)
Cn = cos(3.14/n)

abs(abs(r*sin(3.14/n) - abs(y)) - (r*sin(3.14/n) - abs(y))) + abs(x - r*cos(3.14/n))

I tried out triangle and square, but graphs nothing. Though, when adding " - a " term at the end, it makes octagon with rounded vertices, for both.

I'm not sure how the converted max[xy] equation works with the cone. I used

(x + y + (x - y)^2/abs(x - y))/2 + z - 1

but didn't work.

Another neat little experiment was using the line atop square method to define a triangle prism. By using the generic line segment abs(-x) + abs(x) , I established a square xy in -z and a parallel line x in +z. It made something very close to a fully enclosed triangle prism, but with shifted edges. Check it out:

abs((abs(x) + abs(y)) - z) + abs(abs((-x) + abs(x)) + z) - 4

If you take a look at how the skewed center section works, with just the right terms to compliment it, we may actually get a fully enclosed triangle prism. I'm not sure what terms would be needed. Clearly something that defines the central 1-frame edges. Maybe just a shifting of some of them, so they occupy a ± region?
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby ICN5D » Sun Nov 09, 2014 5:39 am

PWrong wrote:This will make your equations look horrible, but you can define max in terms of abs.
max[x,y] = (x + y + (x - y)^2/Abs[x - y])/2



• How is max[x,y] defining x and y? Is that for a specific shape?

• What would max[x,y,z] be, and things like that?
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby Marek14 » Sun Nov 09, 2014 6:25 am

ICN5D wrote:
PWrong wrote:This will make your equations look horrible, but you can define max in terms of abs.
max[x,y] = (x + y + (x - y)^2/Abs[x - y])/2



• How is max[x,y] defining x and y? Is that for a specific shape?

• What would max[x,y,z] be, and things like that?


Well, let's have a look what this equation does for various options:

x > y:
(x + y + (x - y)^2/Abs[x - y])/2
(x + y + (x - y)^2/(x - y))/2
(x + y + (x - y))/2
(2x)/2
x

y > x:
(x + y + (x - y)^2/Abs[x - y])/2
(x + y + (x - y)^2/(y - x))/2
(x + y + (y - x))/2
(2y)/2
y

However, it fails for x = y. A better approach would be to put (x + y + Abs[x - y])/2. It's simpler and there are no fractions.

As for max of more than two variables, this doesn't look that easy to generalize. Fortunately, maximum can be built gradually: max[x,y,z] = max[max[x,y],z].
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Implicit Definition of Other Shapes

Postby ICN5D » Sun Nov 09, 2014 6:14 pm

So, depending on what shape Im defining, would I use max[x,y] in place of a variable? Using the double cone equation

abs(sqrt(x^2 + y^2)) + abs(z) - a^2

am I able to restrict it to just the +z region? This will also apply to the triangle, in trying to make a closed off 3 sided infinite triangle prism. From there, I can easily write the triangle prism equation if it works.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby PWrong » Wed Nov 12, 2014 1:50 am

In general, you're looking for a way to describe the intersection of two implicit regions with a single implicit equation.

"f(x,y) < 0 and g(x,y) < 0" is equivalent to "max(f(x,y),g(x,y)) < 0".

So to get the closed cone, you have a cone sqrt(x^2 + y^2) - z = 0, and a plane z - 1 = 0. The combination is
Max[sqrt(x^2 + y^2) - z, z - 1] = 0, or

Sqrt[x^2 + y^2] - z + (z - 1) + Abs[Sqrt[x^2 + y^2] - z - (z - 1)] = 0,
which simplifies to
Sqrt[x^2 + y^2] - 1 + Abs[Sqrt[x^2 + y^2] - 2z + 1] = 0
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Implicit Definition of Other Shapes

Postby ICN5D » Wed Nov 12, 2014 7:21 am

Graphed it. Freaking works, man. Awesome! That's what I was looking for. And, I completely see how the max definition works now. I wasn't seeing how to apply it. This is good stuff. I'm going to experiment with that for a bit, and see what I can make.


I've given up on triangular shapes for now, and focused on cylindrical. Tonight, I tested an equation for a duocylinder, and it works 100% . Check it out:

Cylinder (II)I
abs(sqrt(x^2 + y^2) - z) + abs(sqrt(x^2 + y^2) + z) - a^2

Duocylinder (II)(II)
abs(sqrt(x^2 + y^2) - sqrt(z^2 + w^2)) + abs(sqrt(x^2 + y^2) + sqrt(z^2 + w^2)) - 3^2

3D Cross Section of (II)(II)
abs(sqrt(x^2 + y^2) - sqrt(z^2 + a^2)) + abs(sqrt(x^2 + y^2) + sqrt(z^2 + a^2)) - 3^2

--- Set box XYZ = -8 , +8
--- Makes cylinder with max height at A = 0 , 0-height at A = 4.5


Duocylinder Rotation (IY)(Iy)
abs(sqrt(x^2 + (y*sin(a))^2) - sqrt(z^2 + (y*cos(a))^2)) + abs(sqrt(x^2 + (y*sin(a))^2) + sqrt(z^2 + (y*cos(a))^2)) - 3^2

--- set A = 0 ~ 1.57
--- adjusting A will turn 90 degrees


The ultimate equation for (II)(II)
Duocylinder Rotate + Translate
abs(sqrt(x^2 + (y*sin(b) + a*cos(b))^2) - sqrt(z^2 + (y*cos(b) - a*sin(b))^2)) + abs(sqrt(x^2 + (y*sin(b) + a*cos(b))^2) + sqrt(z^2 + (y*cos(b) - a*sin(b))^2)) - 3^2

--- set a = -4.5 , +4.5
--- set b = 0 , 1.57
--- "a" will slide duocylinder in 4D , a=0 is midsection
--- "b" will turn 90 degrees in 4D

And, there it is. The first hypersolid rotatope I graphed and explored. Very cool. This is only going to lead to more awesome things, especially now that I have the cone equation. Been wanting to see the rotations of coninder, or cylconinder for that matter! Triangle*circle prism is still in my sights, though.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby ICN5D » Wed Nov 12, 2014 11:42 pm

Well, today has been extremely productive, as I rendered many of the shapes I was setting out to do. Including a new 4D shape.

Triangle I>
----------------
abs(abs(-x/2) + abs(x/2) - 2y) + abs(-x/2) + abs(x/2) - a


Triangle Prism I>I
------------------------
abs(abs(abs(-x/2) + abs(x/2) - 2y) + abs(-x/2) + abs(x/2) - z) + abs(abs(abs(-x/2) + abs(x/2) - 2y) + abs(-x/2) + abs(x/2) + z) - a


Square Pyramid II>
--------------------------
abs(abs(x) + abs(y) - 2z- 1) + abs(x) + abs(y) - 1 - a


Tetrahedron I>>
----------------------
abs(abs(abs(-x) + abs(x) - 3y) + abs(-x) + abs(x) - 3z ) + abs(abs(-x) + abs(x) - 3y) + abs(-x) + abs(x) - a



And, for the first time ever, the Implicit Definition of 4D Cyltrianglinder, (triangle,circle)-prism

Implicit Definition of I>IO
------------------------------------------------
abs(abs(abs(-x/2) + abs(x/2) - 2y) + abs(-x/2) + abs(x/2) - sqrt(z^2 + w^2)) + abs(abs(abs(-x/2) + abs(x/2) - 2y) + abs(-x/2) + abs(x/2) + sqrt(z^2 + w^2)) - 2*H



3D Cross Sections

Cutting circular parameter to line , I>I with circular height

abs(abs(abs(-x/2) + abs(x/2) - 2y) + abs(-x/2) + abs(x/2) - sqrt(z^2 + a^2)) + abs(abs(abs(-x/2) + abs(x/2) - 2y) + abs(-x/2) + abs(x/2) + sqrt(z^2 + a^2)) - 6

--- makes I>I with circular height prism
--- min height at a = H , a = 2.9999 for 2D triangle
--- max height at a = 0


Cutting triangular parameter to mid-length line , IOI with triangle symmetry

abs(abs(abs(-x/2) + abs(x/2) - 2a) + abs(-x/2) + abs(x/2) - sqrt(y^2 + z^2)) + abs(abs(abs(-x/2) + abs(x/2) - 2a) + abs(-x/2) + abs(x/2) + sqrt(y^2 + z^2)) - 6

--- makes IOI with triangular height prism
--- min height at a = -1.5 or -H/2
--- max height at a = 1.5 or +H/2


Rotation of I>IO
----------------------
abs(abs(abs(-x/2) + abs(x/2) - 2(y*sin(a))) + abs(-x/2) + abs(x/2) - sqrt(z^2 + (y*cos(a))^2)) + abs(abs(abs(-x/2) + abs(x/2) - 2(y*sin(a))) + abs(-x/2) + abs(x/2) + sqrt(z^2 + (y*cos(a))^2)) - 6

I've been waiting for a long time to see this strange morphing. This equation makes a cylinder transform into a triangle prism by rotation of a 4D hypersolid. That's pretty freaking awesome.


And, for the super-equation of I>IO, that allows full control over sliding and rotating in 4D
Rotate + Translate of I>IO
-----------------------------------
abs(abs(abs(-x/2) + abs(x/2) - 2(y*sin(b) + a*cos(b))) + abs(-x/2) + abs(x/2) - sqrt(z^2 + (y*cos(b) - a*sin(b))^2)) + abs(abs(abs(-x/2) + abs(x/2) - 2(y*sin(b) + a*cos(b))) + abs(-x/2) + abs(x/2) + sqrt(z^2 + (y*cos(b) - a*sin(b))^2)) - 6

--- Sliding : a = -3 ~ 3
--- Rotating : b = 0 ~ 1.57
--- good oblique angle is b = 0.445
--- put a = min/max height for IOI cut ( -1.49 or +1.49 ), then rotate b for cool stuff



I studied cyltrianglinder over 7 years ago, and I just now defined and rendered it. The sky is the limit with these mathematical tools you all keep teaching me. Keep it coming :)
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby ICN5D » Fri Nov 14, 2014 6:26 am

Rotating a cyltrianglinder, I>IO , (triangle,circle)-prism:

Using the rotate + translate function, setting a = 1.412, and animating b for 90 degree rotation


Image

Little grainy, but really cool. That's some mathematical wizardry right there, transmuting one shape into another. Since I>IO is a fundamental shape in my notation, I can now implicitly define every single one of them, including the wild ones, like contrianglinder IO>[I>] , cylhemoctahedrinder II>IO , or whatever. Definitely all rotatopes, since they are the simplest. But, even then, the triangular shapes have a really simple pattern. What would be really cool, is a 6D duohemoctahedrinder, II>[II>] , the cartesian product of two square pyramids. Now I have a way to define the bisecting rotate, extrude, taper, and cartesian product, all of which are in my notation, which is major breakthrough stuff for me. I'm using linear operation and products to write those implicit equations, which is stunningly close to my first methods of defining a shape.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby Marek14 » Fri Nov 14, 2014 8:13 am

Maybe I should tell you more about graphotopes :)

Graphotopes were originally expansion on the rotatope concept.They are shapes where all coordinate plane cuts are either circles or squares.

In 3D, there are four of them -- cube (three squares), cylinder (two squares and one circle), dome/crind (one square and two circles) and sphere (three circles).

Now, I realized that line can be imagined as a solitary node of a graph, circle as two nodes joined by an edge, sphere as three joined nodes, and generally n-sphere as complete graph Kn. Also, Cartesian product of these would be simply a disjointed graph with components corresponding to the shapes.

Then you can get some interesting properties. For example, if you remove a node, you get a lower-dimensional cut. If you remove a node and all nodes it's connected to, you'll get a "trace" of graphotope, i.e. how it touches the ground. This shows how the graphotope "rolls".

Let's have a look:

Cube: Three disjointed nodes. Removing any one gets a square, cut of cube, and that's also its trace: If a cube lies on the table, it touches it in a full square. Since the dimension of cut and trace is the same, cube doesn't roll.
Equation: max(x^2, y^2, z^2) = 1

Cylinder. Two nodes joined by an edge, third separate node. Removing one of the joined nodes results in square cut and line trace, allowing the cylinder to roll in the one dimension the cut has "in addition" to the trace. Removing the separate node results in circle cut and circle trace, so the cylinder cannot roll if it stands on the circular face.
Equation: max(x^2 + y^2, z^2) = 1

Dome/crind. A line of three joined nodes. Removing one of the end nodes results in circle cut and line trace, removing of the middle node results in square cut and point trace. Now, when you roll the shape, technically you move along a line in the graph. So when you're in circle/line orientation and roll the dome along the one allowed dimension, you'll end up in square/point orientation, and any of two rolls allowed from there will take you to circle/line once again.
Equation: max(x^2, y^2) + z^2 = 1

Sphere. A triangle. Removing any node results in a circle cut and point trace, so a sphere can roll in two perpendicular directions.
Equation: x^2 + y^2 + z^2 = 1

Now, for the 4D cases. I'll use notation shape A/shape B for cut/trace:

Tesseract: four disjointed nodes. Cube/cube x4. Cannot roll.
Equation: max(x^2, y^2, z^2, w^2) = 1

Cubinder: two joined nodes, two more disjointed nodes. Cylinder/cylinder x2, cube/square x2. Can roll in one dimension when in the cube/square orientation.
Equation: max(x^2 + y^2, z^2, w^2) = 1

Dominder: line of three nodes, one more disjointed node. Dome/dome x1, cylinder/square x2, cube/line x1. From cylinder/square orientation can roll in one dimension into cube/line orientation. From cube/line orientation can roll in two dimensions, both leading to cylinder/square orientation.
Equation: max(max(x^2, y^2) + z^2, w^2) = 1

Duocylinder: two pairs of joined nodes. Cylinder/circle x4. Can always roll in one dimension.
Equation: max(x^2 + y^2, z^2 + w^2) = 1

Spherinder: triangle of three nodes, one more disjointed node. Sphere/sphere x1, cylinder/vertical line x3. Can roll in two directions if in cylinder/vertical line orientation.
Equation: max(x^2 + y^2 + z^2, w^2) = 1

Tridome: one node joined to three others. Dome/square x3, cube/point x1. From dome/square orientation can roll in one direction into cube/point. From cube/point orientation can roll in three directions into various dome/square orientations.
Equation: max(x^2, y^2, z^2) + w^2 = 1

Longdome: line of four nodes. Dome/circle x2, cylinder/horizontal line x2. From dome/circle orientation can roll in one direction to cylinder/horizontal line orientation. From cylinder/horizontal line orientation can roll in two directions, one leading to dome/circle orientation, one leading to another cylinder/horizontal line orientation (differently oriented).
Equation: ???

Spheridome: triangle of three nodes with four attached node. Sphere/circle x1, dome/horizontal line x2, cylinder/point x1. From sphere/circle orientation can roll in one direction to cylinder/point. From dome/horizontal line orientation can roll in one direction to the same orientation or in second direction to cylinder/point. From cylinder/point orientation can roll in two directions to dome/horizontal line orientation or in third direction to sphere/circle.
Equation: max(x^2 + y^2, z^2) + w^2 = 1

Cyclodome: square of four nodes. Dome/vertical line x4. Can always roll in two dimensions, but the orientation of its cut/trace will change as it rolls.
Equation: max(x^2, y^2) + max(z^2, w^2) = 1

Semiglome: K4 minus one edge. Sphere/line x2, dome/point x2. From sphere/line orientation, can roll in two directions into dome/point orientation. From dome/point orientation, can roll in two directions to sphere/line orientation or in third direction to the same dome/point orientation.
Equation: max(x^2, y^2) + z^2 + w^2 = 1

Glome: K4. Sphere/point x4. Can always roll in three dimensions to the same sphere/point orientation.
Equation: x^2 + y^2 + z^2 + w^2 = 1

As you can see, 10 of these 11 shapes can be formed by simple expressions involving squares, sums and maximums.

Generally, if you have graph A with equation A and graph B with equation B, then max(A, B) = 1 is their cartesian product and A + B = 1 is a graph where you put the two together and join each node from A with each node from B. Longdome is the only 4-node graph that cannot be created in this way, I think Wendy derived its equation years ago, but it's a bit more complicated.
Last edited by Marek14 on Sat Nov 15, 2014 3:43 pm, edited 1 time in total.
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Implicit Definition of Other Shapes

Postby ICN5D » Sat Nov 15, 2014 5:43 am

Awesome, thanks Marek. I remember you telling me about these a while back. But, I wasn't anywhere near prepared to explore them, not like now. Longdome is mysterious, I wonder what that equation looked like. I'm still searching for a general poly n-gon equation. With it, I can create many more unique shapes, plus an equilateral triangle, which is an important feature. No luck on the equation in the stack exchange response.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby Marek14 » Sat Nov 15, 2014 10:25 am

The 4 3D cuts of longdome are:
1) max(y^2, w^2) + z^2 = 1
2) max(x^2, z^2 + w^2) = 1
3) max(x^2 + y^2, w^2) = 1
4) max(x^2, z^2) + y^2 = 1

Now, there are some distributive relations that hold:
max(y^2, w^2) + z^2 = max(y^2 + z^2, z^2 + w^2)
max(x^2, z^2) + y^2 = max(x^2 + y^2, y^2 + z^2)

So we can rewrite all four equations as maximums:

1) max(y^2 + z^2, z^2 + w^2) = 1
2) max(x^2, z^2 + w^2) = 1
3) max(x^2 + y^2, w^2) = 1
4) max(x^2 + y^2, y^2 + z^2) = 1

And we can gather them to a single function:
max(x^2 + y^2, y^2 + z^2, z^2 + w^2) = 1

Let's have a look at it: x-cut will be:

max(y^2, y^2 + z^2, z^2 + w^2) = 1
and since z^2 >=0, we y^2 + z^2 >= y^2 and we can omit y^2 to get
max(y^2 + z^2, z^2 + w^2) = 1

y-cut will be:
max(x^2, z^2, z^2 + w^2) = 1
and we can analogically omit z^2 (because z^2 + w^2 >= z^2) to get
max(x^2, z^2 + w^2) = 1

z- and w-cuts are completely analogical, so it looks like we have our longdome equation. Can you check, ICN5D? :)
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Implicit Definition of Other Shapes

Postby PWrong » Sat Nov 15, 2014 4:19 pm

I'm still searching for a general poly n-gon equation.


For each j = 1, ..., n consider the line
x cos(2 pi j/n) + y sin(2 pi j/n) - a = 0.

This line includes the j'th side of the n-gon of apothem a.

So Max_j [x cos(2 pi j/n) + y sin(2 pi j/n)] = a

This might be tricky to implement if the program you're using doesn't have a max function.
Last edited by PWrong on Mon Nov 17, 2014 8:29 am, edited 1 time in total.
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Implicit Definition of Other Shapes

Postby Marek14 » Sat Nov 15, 2014 5:04 pm

So, now, equipped with this knowledge, I can have a proper look at the 5D graphotopes, based on my first post on the forum, over 9 years ago (viewtopic.php?f=24&t=350&p=4436&hilit=longdome#p4436) :) It's fun since I didn't specify the exact graphs (exercise to the reader indeed) and now I have to recreate them myself :) Well, the good news is that now I got the understanding of longdome function and I think I can extend it to arbitrary graphotope.

Penteract: max(x^2, y^2, z^2, w^2, v^2) = 1. Tesseract/tesseract x5. Doesn't roll.
Cubicircle: max(x^2 + y^2, z^2, w^2, v^2) = 1. Cubinder/cubinder x3, Tesseract/cube x2. In tesseract/cube, can freely roll in one direction.
Domisquare: max(max(x^2, y^2) + z^2, w^2, v^2) = 1. Dominder/dominder x2, cubinder/cube x2, tesseract/square x1. From cubinder/cube, can roll in one direction to tesseract/square. From tesseract/square, can roll in two directions to cubinder/cube.
Dual cylinder: max(x^2 + y^2, z^2 + w^2, v^2) = 1. Duocylinder/duocylinder x1, cubinder/cylinder x4. From cubinder/cylinder, can freely roll in one direction.
Tridominder: max(max(x^2, y^2, z^2) + w^2, v^2) = 1. Tridome/tridome x1, dominder/cube x3, tesseract/line x1. From dominder/cube, can roll in one direction to tesseract/line. From tesseract/line, can roll in three directions to dominder/cube.
Spherisquare: max(x^2 + y^2 + z^2, w^2, v^2) = 1. Spherinder/spherinder x2, cubinder/square x3. From cubinder/square, can freely roll in two directions.
Longdominder: max(x^2 + y^2, y^2 + z^2, z^2 + w^2, v^2) = 1. Longdome/longdome x1, dominder/cylinder x2, cubinder/square x2. From dominder/cylinder, can roll in one direction to cubinder/square. From cubinder/square, can roll in one direction to dominder/cylinder or in second direction to cubinder/square.
Domicircle: max(max(x^2, y^2) + z^2, w^2 + v^2) = 1. Dominder/dome x2, duocylinder/cylinder x2, cubinder/circle x1. From dominder/dome, can freely roll in one direction. From duocylinder/cylinder, can roll in one direction to cubinder/circle. From cubinder/circle, can roll in two directions to duocylinder/cylinder.
Tetradome: max(x^2, y^2, z^2, w^2) + v^2 = 1. Tridome/cube x4, tesseract/point x1. From tridome/cube, can roll in one direction to tesseract/point. From tesseract/point, can roll in four directions to tridome/cube.
Spheridominder: max(max(x^2 + y^2, z^2) + w^2, v^2) = 1. Spheridome/spheridome x1, spherinder/cylinder x1, dominder/square x2, cubinder/line x1. From spherinder/cylinder, can roll in one direction to cubinder/line. From dominder/square, can freely roll in one direction, or can roll in second direction to cubinder/line. From cubinder/line, can freely roll in two directions to dominder/square, or can roll in third direction to spherinder/cylinder.
Branchdome: max(x^2 + y^2, y^2 + z^2, z^2 + w^2, z^2 + v^2) = 1. Tridome/dome x1, longdome/cylinder x2, dominder/square x1, cubinder/line x1. From tridome/dome, can roll in one direction to dominder/square. From longdome/cylinder, can roll in one direction to cubinder/line. From dominder/square, can roll in one direction to tridome/dome, or in second direction to cubinder/line. From cubinder/line, can roll in two directions to longdome/cylinder, or in third direction to dominder/square.
Sphericircle: max(x^2 + y^2 + z^2, w^2 + v^2) = 1. Spherinder/sphere x2, duocylinder/circle x3. From spherinder/sphere, can freely roll in one direction. From duocylinder/circle, can freely roll in two directions.
Cyclodominder: max(max(x^2, y^2) + max(z^2, w^2), v^2) = 1. Cyclodome/cyclodome x1, dominder/square x4. From dominder square, can roll in two directions to dominder/square.
Superdome: max(x^2 + y^2, y^2 + z^2, z^2 + w^2, w^2 + v^2) = 1. Longdome/dome x2, dominder/circle x2, duocylinder/square x1. From longdome/dome, can roll in one direction to dominder/circle. From dominder/circle, can roll in one direction to longdome/dome, or in second direction to duocylinder/square. From duocylinder/square, can roll in two directions to dominder/circle.
Spheritridome: max(x^2 + y^2, z^2, w^2) + v^2 = 1. Spheridome/cylinder x2, tridome/square x2, cubinder/point x1. From spheridome/cylinder, can roll in one direction to cubinder/point. From tridome/square, can freely roll in one direction, or can roll in second direction to cubinder/point. From cubinder/point, can roll in two directions to spheridome/cylinder, or can freely roll in two other directions to tridome/square.
Semiglominder: max(max(x^2, y^2) + z^2 + w^2, v^2) = 1. Semiglome/semiglome x1, spherinder/square x2, dominder/line x2. From spherinder/square, can freely roll in two directions to dominder/line. From dominder/line, can roll in two directions to spherinder/square, or can freely roll in third direction.
Bicesphere: max(x^2 + y^2 + z^2, y^2 + w^2, z^2 + v^2) = 1. Spheridome/dome x2, longdome/square x1, dominder/line x2. From spheridome/dome, can roll in one direction to dominder/line. From longdome/square, can roll in two directions to dominder/line. From dominder/line, can roll in one direction to spheridome/dome, in second direction to longdome/square, or in third direction to dominder/line.
Longspheridome: max(x^2 + y^2 + z^2, z^2 + w^2, w^2 + v^2) = 1. Spheridome/sphere x1, spherinder/circle x1, longdome/circle x2, duocylinder/line x1. From spheridome/sphere, can roll in one direction to spherinder/circle. From spherinder/circle, can roll in one direction to spheridome/sphere, or in second direction to duocylinder/line. From longdome/circle, can freely roll in one direction, or can roll in second direction to duocylinder/line. From duocylinder/line, can roll in one direction to spherinder/circle, or can freely roll in two other directions to longdome/circle.
Branchcyclodome: max(x^2 + y^2, x^2 + z^2, y^2 + w^2, z^2 + w^2, x^2 + v^2) = 1. Cyclodome/dome x1, tridome/circle x1, longdome/square x2, dominder/line x1. From cyclodome/dome, can roll in one direction to dominder/line. From tridome/circle, can roll in two directions to longdome/square. From longdome/square, can roll in one direction to tridome/circle, or in second direction to dominder/line. From dominder/line, can roll in one direction to cyclodome/dome, or in two other directions to longdome/square.
Cyclongdome: max(x^2 + y^2, x^2 + z^2, y^2 + w^2, z^2 + v^2, w^2 + v^2) = 1. Longdome/circle x5. From longdome/circle, can roll in two directions to longdome/circle.
Bispheridome: max(max(x^2, y^2) + z^2, w^2) + v^2 = 1. Semiglome/dome x1, spheridome/square x2, tridome/line x1, dominder/point x1. From semiglome/dome, can roll in one direction to dominder/point. From spheridome/square, can roll in one direction to tridome/line, or in second direction to dominder/point. From tridome/line, can roll in two directions to spheridome/square, or in third direction to dominder/point. From dominder/point, can roll in one direction to semiglome/dome, in two other directions to spheridome/square, or in a fourth direction to tridome/line.
Duospheridome: max(x^2 + y^2, z^2 + w^2) + v^2 = 1. Spheridome/circle x4, duocylinder/point x1. From spheridome/circle, can freely roll in one direction, or can roll in second direction to duocylinder/point. From duocylinder/point, can freely roll in two pairs of directions to spheridome/circle.
Glominder: max(x^2 + y^2 + z^2 + w^2, v^2) = 1. Glome/glome x1, spherinder/line x4. From spherinder/line, can freely roll in three directions.
Sesquispheridome: max(x^2 + y^2 + z^2, y^2 + z^2 + w^2, w^2 + v^2) = 1. Semiglome/sphere x1, spheridome/circle x1, spherinder/line x1, longdome/line x2. From semiglome/sphere, can roll in one direction to spherinder/line. From spheridome/circle, can freely roll in two directions to longdome/line. From spherinder/line, can roll in one direction to semiglome/sphere, or can freely roll in two other directions to longdome/line. From longdome/line, can roll in one direction to spheridome/circle, or in second direction to spherinder/line, or can freely roll in a third direction.
Triquad: max(x^2 + y^2 + z^2, y^2 + w^2, z^2 + v^2, w^2 + v^2) = 1. Spheridome/circle x2, cyclodome/circle x1, longdome/line x2. From spheridome/circle, can roll in one direction to spheridome/circle, or in a second direction to longdome/line. From cyclodome/circle, can roll in two directions to longdome/line. From longdome/line, can roll in one direction to spheridome/circle, in second direction to cyclodome/circle, or in a third direction to longdome/line.
Tricycle: max(x^2, y^2, z^2) + max(w^2, v^2) = 1. Cyclodome/square x3, tridome/line x2. From cyclodome/square, can roll in two directions to tridome/line. From tridome/line, can roll in three directions to cyclodome/square.
Sesquiglome: max(x^2, y^2, z^2) + w^2 + v^2 = 1. Semiglome/square x3, tridome/point x2. From semiglome/square, can freely roll in two directions to tridome/point. From tridome/point, can roll in three directions to semiglome/square, or can freely roll in the fourth direction.
Glomidome: max(x^2 + y^2 + z^2, w^2) + v^2 = 1. Glome/sphere x1, spheridome/line x3, spherinder/point x1. From glome/sphere, can roll in one direction to spherinder/point. From spheridome/line, can freely roll in two directions, or can roll in third direction to spherinder/point. From spherinder/point, can roll in one direction to glome/sphere, or can freely roll in the remaining three directions to spheridome/line.
Trialong: max(x^2 + y^2 + z^2, x^2 + z^2 + w^2, x^2 + w^2 + v^2) = 1. Semiglome/circle x2, spheridome/line x2, longdome/point x1. From semiglome/circle, can roll in one direction to spheridome/line, or in a second direction to longdome/point. From spheridome/line, can roll in one direction to semiglome/circle, in second direction to spheridome/line, or in a third direction to longdome/point. From longdome/point, can roll in two directions to semiglome/circle, or in the remaining two directions to spheridome/line.
Siamese spheridome: max(x^2 + y^2, z^2) + max(w^2, v^2) = 1. Semiglome/circle x1, spheridome/line x2, cyclodome/line x2. From semiglome/circle, can roll in two directions to spheridome/line. From spheridome/line, can roll in one direction to semiglome/circle, or can freely roll in two other directions to cyclodome/line. From cyclodome/line, can roll in two directions to spheridome/line, or can freely roll in a third direction.
Spheriglome: max(x^2 + y^2, z^2) + w^2 + v^2 = 1. Glome/circle x2, semiglome/line x2, spheridome/point x1. From glome/circle, can roll in two directions to spheridome/point. From semiglome/line, can freely roll in one direction, or can freely roll in two other directions to spheridome/point. From spheridome/point, can roll in one direction to glome/circle, or can freely roll in two other directions to semiglome/line, or can freely roll in the fourth direction.
Pyraglome: max(x^2, y^2) + max(z^2, w^2) + v^2 = 1. Semiglome/line x4, cyclodome/point x1. From semiglome/line, can roll in two directions to semiglome/line, or in a third direction to cyclodome/point. From cyclodome/point, can roll in four directions to semiglome/line.
Semipentaglome: max(x^2, y^2) + z^2 + w^2 + v^2 = 1. Glome/line x2, semiglome/point x3. From glome/line, can freely roll in three directions to semiglome/point. From semiglome/point, can freely roll in two directions to glome/line, or can freely roll in two other directions.
Pentaglome: x^2 + y^2 + z^2 + w^2 + v^2 = 1. Glome/point x5. From glome/point, can freely roll in four directions.

So, the general formula for graphotope turns out to be a maximum of:
x1^2, x2^2, ..., xn^2
xa^2 + xb^2, where nodes a and b are joined by edge
xa^2 + xb^2 + xc^2, where nodes a, b and c are all joined
xa^2 + xb^2 + xc^2 + xd^2, where nodes a, b, c and d are all joined (they form a K4 subgraph)
and so on. It can be imagined as starting with a hypercube and then "rounding" some of its elements. The equation can then be simplified by omitting any sum that is absorbed in a higher sum and by distributing sum over maximum.
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Implicit Definition of Other Shapes

Postby ICN5D » Mon Nov 17, 2014 2:46 am

Wow, excellent. There's so many avenues of research now. Cut arrays of graphotopes would be cool to see.

A friend of mine suggested a simplified triangle equation, abs(abs(x) -2y) + abs(x) - a . This is much nicer looking. So, to rewrite previous equations,

1D
line segment I : 2*abs(x) - a and/or abs(-x) + abs(x) - a

2D
circle IO : x^2 + y^2 - a^2
square II : abs(x) + abs(y) - a
triangle I> : abs(abs(x) - 2y) + abs(x) - a

3D
square pyramid II> : abs(abs(x) + abs(y) - 2z) + abs(x) + abs(y) - a
tetrahedron I>> : abs(abs(abs(x) - 2y) + abs(x) - 2z) + abs(abs(x) - 2y) + abs(x) - a
triangle prism I>I : abs(abs(abs(x) - 2y) + abs(x) - z) + abs(abs(abs(x) - 2y) + abs(x) + z) - a
cone IO> : abs(sqrt(x^2 + y^2) - 2z) + sqrt(x^2 + y^2) - a^2
cylinder IOI : abs(sqrt(x^2 + y^2) - z) + abs(sqrt(x^2 + y^2) + z) - a^2

4D
duocylinder IOIO : abs(sqrt(x^2 + y^2) - sqrt(z^2 + w^2)) + abs(sqrt(x^2 + y^2) + sqrt(z^2 + w^2)) - a^2
cyltrianglinder I>IO : abs(abs(abs(x) - 2y) + abs(x) - sqrt(z^2 + w^2)) + abs(abs(abs(x) - 2y) + abs(x) + sqrt(z^2 + w^2)) - 2a

and so many more.

Had to put this together:

Image


Much better. I always wondered how the combinatoric structure looked in some form of equation for these shapes. I was really gunning for cyltrianglinder, since it has a bit of everything in it. A tapering, an extrusion, a bisecting rotate, and a cartesian product are all in I>IO. Time to write a crap load of equations, you know it. This is all really awesome :)




PWrong wrote:For each j = 1, ..., n consider the line
x cos(2 pi j/n) + y sin(2 pi j/n) - a = 0.

This line includes the j'th side of the n-gon of apothem r.

So Max_j [x cos(2 pi j/n) + y sin(2 pi j/n)] = 0



So, for triangle, would I write,

Max[x*cos(2*pi*1/3) + y*sin(2*pi*1/3) , x*cos(2*pi*2/3) + y*sin(2*pi*2/3) , x*cos(2*pi*3/3) + y*sin(2*pi*3/3) ] = 0

?



Let's have a look at it: x-cut will be:

max(y^2, y^2 + z^2, z^2 + w^2) = 1
and since z^2 >=0, we y^2 + z^2 >= y^2 and we can omit y^2 to get
max(y^2 + z^2, z^2 + w^2) = 1

y-cut will be:
max(x^2, z^2, z^2 + w^2) = 1
and we can analogically omit z^2 (because z^2 + w^2 >= z^2) to get
max(x^2, z^2 + w^2) = 1



Implicit equations of Longdome

Full equation
abs(abs(x^2 + z^2) + x^2 + 2y^2 + w^2) + abs(x^2 + z^2) + x^2 + 2y^2 + 2z^2 + w^2 = a

x-cut
max(y^2 + z^2, z^2 + w^2) = a
abs(x^2 + z^2) + x^2 + 2y^2 + z^2 - a
--- makes sphere

but, if I use
max(y^2, y^2 + z^2, z^2 + w^2) = 1
abs(abs(y^2) + 2x^2 + z^2) + abs(y^2) + 2x^2 + 2y^2 + z^2 - a
--- ellipsoid


y-cut
max(x^2, z^2 + w^2)
abs(x^2 - y^2 + z^2) + x^2 + y^2 + z^2 - a
--- makes cylinder

or using the three-term max

max(x^2, z^2, z^2 + w^2) = 1
abs(abs(x^2 - y^2) + x^2 + z^2) + abs(x^2 - y^2) + x^2 + 2y^2 + z^2 - a
--- makes crind ( is that what you call dome?)

Using the max definition before you simplify it, then applying max[a,b,c] = max[max[a,b],c], the 3D cuts come out differently. Not sure what's going on there. For these functions, I'm using max[a,b] = abs(a - b) + a + b . Would that be the correct format? I've seen a few forms of it, but this simplified one works for all newly defined shapes above.



So, if maximum is built gradually, then, as a general rule,

max[a,b,c] = abs(abs(a - b) + a + b - c) + abs(a - b) + a + b + c
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby PWrong » Mon Nov 17, 2014 8:29 am

Sorry I forgot the apothem in my final equation. I'll edit my post.

So, for triangle, would I write,

Max[x*cos(2*pi*1/3) + y*sin(2*pi*1/3) , x*cos(2*pi*2/3) + y*sin(2*pi*2/3) , x*cos(2*pi*3/3) + y*sin(2*pi*3/3) ] = 0


This should have = a on the end, but apart from that it's correct. The apothem is the circumradius times cos(pi/n).
User avatar
PWrong
Pentonian
 
Posts: 1599
Joined: Fri Jan 30, 2004 8:21 am
Location: Perth, Australia

Re: Implicit Definition of Other Shapes

Postby Marek14 » Mon Nov 17, 2014 8:54 am

ICN5D: If you get different results for three-term maximum than for two, that shouldn't be right... max(x^2, x^2 + y^2) should be equivalent to x^2 + y^2 because y^2 can't be negative (unless you're in complex numbers, in which case you don't have a valid definition for max anyway).
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Implicit Definition of Other Shapes

Postby ICN5D » Mon Nov 17, 2014 6:33 pm

Hmm, maybe I did the three-term max wrong, or I don't fully understand how to simplify max. Does that expansion look right?

max[a,b,c] = max[max[a,b],c] = abs(abs(a - b) + a + b - c) + abs(a - b) + a + b + c



Was a sphere for x, and cylinder for y the right cuts for longdome? Before I move on to others, I need to nail down a three term max function. I'm sure a better program would make things easier, but I like the challenge of converting it into plain old implicit.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby Marek14 » Mon Nov 17, 2014 7:35 pm

ICN5D wrote:Hmm, maybe I did the three-term max wrong, or I don't fully understand how to simplify max. Does that expansion look right?

max[a,b,c] = max[max[a,b],c] = abs(abs(a - b) + a + b - c) + abs(a - b) + a + b + c



Was a sphere for x, and cylinder for y the right cuts for longdome? Before I move on to others, I need to nail down a three term max function. I'm sure a better program would make things easier, but I like the challenge of converting it into plain old implicit.


Well, no, longome has two dome (crind) and two cylinder cuts, no sphere.

As for max, shouldn't it be max[a,b] = (a + b + abs(a - b))/2? You don't divide anywhere... That would make max[max[a,b],c]:

max[(a + b + abs(a - b))/2, c]
((a + b + abs(a - b))/2 + c + abs((a + b + abs(a - b))/2 - c))/2
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Implicit Definition of Other Shapes

Postby ICN5D » Mon Nov 17, 2014 10:44 pm

Trying again for Longdome


max[a,b] = (a + b + abs(a - b))/2

max[a,b,c] = (abs((abs(a - b) + a + b)/2 - c) + (abs(a - b) + a + b)/2 + c)/2

Longdome Max Function
max(x^2 + y^2, y^2 + z^2, z^2 + w^2)

(abs((abs(x^2 + y^2 - y^2 + z^2) + x^2 + y^2 + y^2 + z^2)/2 - z^2 + w^2) + (abs(x^2 + y^2 - y^2 + z^2) + x^2 + y^2 + y^2 + z^2)/2 + z^2 + w^2)/2
simplifies to
(abs((abs(x^2 + z^2) + x^2 + 2y^2 + z^2)/2 - z^2 + w^2) + (abs(x^2 + z^2) + x^2 + 2y^2 + z^2)/2 + z^2 + w^2)/2


3D Cuts

x-cut
(abs((abs(z^2) + 2y^2 + z^2)/2 - z^2 + w^2) + (abs(z^2) + 2y^2 + z^2)/2 + z^2 + w^2)/2 = a

becomes

(abs((abs(y^2) + 2x^2 + y^2)/2 - y^2 + z^2) + (abs(y^2) + 2x^2 + y^2)/2 + y^2 + z^2)/2 = a
--- sphere



y-cut
(abs((abs(x^2 + z^2) + x^2 + z^2)/2 - z^2 + w^2) + (abs(x^2 + z^2) + x^2 + z^2)/2 + z^2 + w^2)/2 = a

becomes

(abs((abs(x^2 + y^2) + x^2 + y^2)/2 - y^2 + z^2) + (abs(x^2 + y^2) + x^2 + y^2)/2 + y^2 + z^2)/2 = a
--- sphere again

Hmm. Maybe I need to use the original one PWrong posted at first?


max[a,b] = ((a - b)^2/abs(a - b) + a + b)/2


max[a,b,c] = max[max[a,b],c] = ((((a - b)^2/abs(a - b) + a + b)/2 - c)^2/abs(((a - b)^2/abs(a - b) + a + b)/2 - c) + ((a - b)^2/abs(a - b) + a + b)/2 + c)/2


((((a - b)^2/abs(a - b) + a + b)/2 - c)^2/abs(((a - b)^2/abs(a - b) + a + b)/2 - c) + ((a - b)^2/abs(a - b) + a + b)/2 + c)/2


Modified Longdome Equations
max(x^2 + y^2, y^2 + z^2, z^2 + w^2)

((((x^2 + y^2 - y^2 + z^2)^2/abs(x^2 + y^2 - y^2 + z^2) + x^2 + y^2 + y^2 + z^2)/2 - z^2 + w^2)^2/abs(((x^2 + y^2 - y^2 + z^2)^2/abs(x^2 + y^2 - y^2 + z^2) + x^2 + y^2 + y^2 + z^2)/2 - z^2 + w^2) + ((x^2 + y^2 - y^2 + z^2)^2/abs(x^2 + y^2 - y^2 + z^2) + x^2 + y^2 + y^2 + z^2)/2 + z^2 + w^2)/2 - a

((((x^2 + z^2)^2/abs(x^2 + z^2) + x^2 + 2y^2 + z^2)/2 - z^2 + w^2)^2/abs(((x^2 + z^2)^2/abs(x^2 + z^2) + x^2 + 2y^2 + z^2)/2 - z^2 + w^2) + ((x^2 + z^2)^2/abs(x^2 + z^2) + x^2 + 2y^2 + z^2)/2 + z^2 + w^2)/2 - a


3D cuts


x-cut
((((y^2)^2/abs(y^2) + 2x^2 + y^2)/2 - y^2 + z^2)^2/abs(((y^2)^2/abs(y^2) + 2x^2 + y^2)/2 - y^2 + z^2) + ((y^2)^2/abs(y^2) + 2x^2 + y^2)/2 + y^2 + z^2)/2 - a
--- sphere

y-cut
((((x^2 + y^2)^2/abs(x^2 + y^2) + x^2 + y^2)/2 - y^2 + z^2)^2/abs(((x^2 + y^2)^2/abs(x^2 + y^2) + x^2 + y^2)/2 - y^2 + z^2) + ((x^2 + y^2)^2/abs(x^2 + y^2) + x^2 + y^2)/2 + y^2 + z^2)/2 - a
--- sphere


am I missing something here? The y-cut that made cylinder is:

abs(x^2 - y^2 + z^2) + x^2 + y^2 + z^2 - a

following max[a,b] = abs(a - b) + a + b , which the simplest format that worked for all shapes so far. I got a dome by using the simplified max[a,b,c] function for y-cut. Maybe it's when I try to turn the equation into a 3D equation? All I do is y -> x , z -> y , w -> z for the conversion. It's ambiguous for toratopes, but maybe there is something different about graphotopes?
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby Marek14 » Mon Nov 17, 2014 11:19 pm

Well, one thing is that you substract sums wrong. (x^2 + y^2 - y^2 + z^2) should be (x^2 + y^2 - y^2 - z^2). Repent.

Now, if we use the maximum function, it works out:

x = 0
max(y^2, y^2 + z^2, z^2 + w^2) = max(y^2 + z^2, z^2 + w^2) = max(y^2, w^2) + z^2 = dome

Let's try max(y^2, y^2 + z^2):
(y^2 + y^2 + z^2 + abs(y^2 - y^2 - z^2))/2
(2 y^2 + z^2 + abs(- z^2))/2
(2 y^2 + 2 z^2)/2
y^2 + z^2
So that works as expected. For max(y^2 + z^2, z^2 + w^2), we get:
(y^2 + z^2 + z^2 + w^2 + abs(y^2 + z^2 - z^2 - w^2))/2
(y^2 + 2 z^2 + w^2 + abs(y^2 - w^2))/2
(y^2 + w^2 + abs(y^2 - w^2))/2 + z^2
which corresponds to max(y^2, w^2) + z^2.

Expanding the maximum function to three parameters, I get max[a,b,c] as
((a + b + abs(a - b))/2 + c + abs((a + b + abs(a - b))/2 - c))/2

For longdome, this is
((x^2 + y^2 + y^2 + z^2 + abs(x^2 + y^2 - y^2 - z^2))/2 + z^2 + w^2 + abs((x^2 + y^2 + y^2 + z^2 + abs(x^2 + y^2 - y^2 - z^2))/2 - z^2 - w^2))/2
((x^2 + 2 y^2 + z^2 + abs(x^2 - z^2))/2 + z^2 + w^2 + abs((x^2 + 2 y^2 + z^2 + abs(x^2 - z^2))/2 - z^2 - w^2))/2
((x^2 + z^2 + abs(x^2 - z^2))/2 + y^2 + z^2 + w^2 + abs((x^2 + z^2 + abs(x^2 - z^2))/2 + y^2 - z^2 - w^2))/2

and x-cut will be:
((z^2 + abs(- z^2))/2 + y^2 + z^2 + w^2 + abs((z^2 + abs(- z^2))/2 + y^2 - z^2 - w^2))/2
((2 z^2)/2 + y^2 + z^2 + w^2 + abs((2 z^2))/2 + y^2 - z^2 - w^2))/2
(z^2 + y^2 + z^2 + w^2 + abs(z^2 + y^2 - z^2 - w^2))/2
(y^2 + 2 z^2 + w^2 + abs(y^2 - w^2))/2
(y^2 + w^2 + abs(y^2 - w^2))/2 + z^2
See? A dome.
y-cut will be:
((x^2 + z^2 + abs(x^2 - z^2))/2 + z^2 + w^2 + abs((x^2 + z^2 + abs(x^2 - z^2))/2 - z^2 - w^2))/2
which is harder to parse, but we can just use the z-cut instead:
((x^2 + abs(x^2))/2 + y^2 + w^2 + abs((x^2 + abs(x^2))/2 + y^2 - w^2))/2
((2 x^2)/2 + y^2 + w^2 + abs((2x^2)/2 + y^2 - w^2))/2
(x^2 + y^2 + w^2 + abs(x^2 + y^2 - w^2))/2
which corresponds to max(x^2 + y^2, w^2), equation of cylinder.
Marek14
Pentonian
 
Posts: 1191
Joined: Sat Jul 16, 2005 6:40 pm

Re: Implicit Definition of Other Shapes

Postby ICN5D » Tue Nov 18, 2014 4:03 am

Welp, looks like I need to learn more about this max function. Tonight, I found a good working unit cube equation, and wrote the rest of 4D implicits. Compiled into full list 1D to 4D:


1-D
X
I - LINE : 2*abs(x) - a

----------------------------------

2-D
XY
IO - CIRCLE : sqrt(x^2 + y^2) - a^2
I> - TRIANGLE : abs(abs(x) - 2y) + abs(x) - a
II - SQUARE : abs(x - y) + abs(x + y) - a

----------------------------------------

3-D
XYZ
IOO - SPHERE : sqrt(x^2 + y^2 + z^2) - a^2

IO> - CONE : abs(sqrt(x^2 + y^2) - 2z) + sqrt(x^2 + y^2) - a^2

IIO - CYLINDER : abs(sqrt(x^2 + y^2) - z) + abs(sqrt(x^2 + y^2) + z) - a

I>> - TETRAHEDRON : abs(abs(abs(x) - 2y) + abs(x) - 2z) + abs(abs(x) - 2y) + abs(x) - a

I>I - TRIANGLE PRISM : abs(abs(abs(x) - 2y) + abs(x) - z) + abs(abs(abs(x) - 2y) + abs(x) + z) - a

II> - SQUARE PYRAMID : abs(abs(x - y) + abs(x + y) - 3z) + abs(x - y) + abs(x + y) - a

III - UNIT CUBE : abs(abs(x - y) + abs(x + y) - 2z) + abs(abs(x - y) + abs(x + y) + 2z) - a

IO(O) - TORUS : (sqrt(x^2 + y^2) - a)^2 + z^2 - b^2

II(O) - SQUARE TORUS : abs(abs((sqrt(x^2 + y^2) - a)^2) - z) + abs(abs((sqrt(x^2 + y^2) - a)^2) + z) - b

I>(O) - TRIANGLE TORUS : abs(abs((sqrt(x^2 + y^2) - a)^2) - 2z) + abs((sqrt(x^2 + y^2) - a)^2) - b *** top is round, but mostly works

IO(>) - CIRCLE TRIANGULUS : (abs(abs(x) - 2y) + abs(x) - a)^2 + z^2 - b^2 *** circle over triangle frame, important pattern here
----------------------------------

4-D
XYZW

((II)(II)) - TIGER , S1 x C2 : sqrt(x^2 + y^2) - a)^2 + (sqrt(z^2 + w^2) - b)^2 - c^2

(((II)I)I) - DITORUS , T3 : (sqrt((sqrt(x^2 + y^2) - a)^2 + z^2) - b)^2 - c^2

((III)I) - TORISPHERE , S1 x S2 : (sqrt(x^2 + y^2 + z^2) - a)^2 + w^2 - b^2

((II)II) - SPHERITORUS , S2 x S1 : sqrt(x^2 + y^2) - a)^2 + z^2 + w^2 - b^2

IOOO / (IIII) - GLOME , S3 : sqrt(x^2 + y^2 + z^2 + w^2) - a^2

IOO> - SPHONE : abs(sqrt(x^2 + y^2 + z^2) - 2w) + sqrt(x^2 + y^2 + z^2) - a^2

IOOI - SPHERINDER : abs(sqrt(x^2 + y^2 + z^2) - w) + abs(sqrt(x^2 + y^2 + z^2) + w) - a

IO>> - DICONE : abs(abs(sqrt(x^2 + y^2) - 2z) + sqrt(x^2 + y^2) - 2w) + abs(sqrt(x^2 + y^2) - 2z) + sqrt(x^2 + y^2) - a^2

IO>I - CONINDER : abs(abs(sqrt(x^2 + y^2) - 2z) + sqrt(x^2 + y^2) - w) + abs(abs(sqrt(x^2 + y^2) - 2z) + sqrt(x^2 + y^2) + w) - a

IOIO - DUOCYLINDER : abs(sqrt(x^2 + y^2) - sqrt(z^2 + w^2)) + abs(sqrt(x^2 + y^2) + sqrt(z^2 + w^2)) - a^2

IIO> - CYLINDRONE : abs(abs(sqrt(x^2 + y^2) - z) + abs(sqrt(x^2 + y^2) + z) - 2w) + abs(sqrt(x^2 + y^2) - z) + abs(sqrt(x^2 + y^2) + z) - a

I>>> - PENTACHORON : abs(abs(abs(abs(x) - 2y) + abs(x) - 2z) + abs(abs(x) - 2y) + abs(x) - 2w) + abs(abs(abs(x) - 2y) + abs(x) - 2z) + abs(abs(x) - 2y) + abs(x) - a

I>>I - TETRAHEDRINDER : abs(abs(abs(abs(x)-2y)+abs(x)-2z)+abs(abs(x)-2y)+abs(x) - w) + abs(abs(abs(abs(x)-2y)+abs(x)-2z)+abs(abs(x)-2y)+abs(x) + w) - a

I>IO - CYLTRIANGLINDER : abs(abs(abs(x) - 2y) + abs(x) - sqrt(z^2 + w^2)) + abs(abs(abs(x) - 2y) + abs(x) + sqrt(z^2 + w^2)) - a

I>I> - TRIANGLE PRISM PYRAMID : abs(abs(abs(abs(x)-2y)+abs(x)-z)+abs(abs(abs(x)-2y)+abs(x)+z) - 2w) + abs(abs(abs(x)-2y)+abs(x)-z)+abs(abs(abs(x)-2y)+abs(x)+z) - a

I>II - TRIANGLE DIPRISM : abs(abs(abs(x) - 2y) + abs(x) - abs(z-w) - abs(z+w)) + abs(abs(abs(x) - 2y) + abs(x) + abs(z-w) + abs(z+w)) - a

II>> - DIPYRAMID : abs(abs(abs(x-y) + abs(x+y) - 3z) + abs(x-y) + abs(x+y) - 3w) + abs(abs(x-y) + abs(x+y) - 3z) + abs(x-y) + abs(x+y) - a

II>I - PYRAMID PRISM : abs(abs(abs(x-y) + abs(x+y) - 3z) + abs(x-y) + abs(x+y) - w) + abs(abs(abs(x-y) + abs(x+y) - 3z) + abs(x-y) + abs(x+y) + w) - a

IIIO - CUBINDER : abs(abs(x-y) + abs(x+y) - sqrt(z^2 + w^2)) + abs(abs(x-y) + abs(x+y) + sqrt(z^2 + w^2)) - a

III> - CUBE PYRAMID : abs(abs(abs(x-y) + abs(x+y) - 2z) + abs(abs(x-y) + abs(x+y) + 2z) - 3w) + abs(abs(x-y) + abs(x+y) - 2z) + abs(abs(x-y) + abs(x+y) + 2z) - a

IIII - TESSERACT : abs(abs(x-y) + abs(x+y) - abs(z-w) - abs(z+w)) + abs(abs(x-y) + abs(x+y) + abs(z-w) + abs(z+w)) - a

I>[I>] - DUOTRIANGLINDER : abs(abs(abs(x) - 2y) + abs(x) - abs(abs(z) - 2w) - abs(z)) + abs(abs(abs(x) - 2y) + abs(x) + abs(abs(z) - 2w) + abs(z)) - a


EDIT : corrected and simplified many equations
Last edited by ICN5D on Fri Jan 09, 2015 12:18 am, edited 1 time in total.
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Re: Implicit Definition of Other Shapes

Postby ICN5D » Sun Nov 23, 2014 6:09 am

Wrote the equation of II>IO cylhemoctahedrinder today. Had a look at its cuts, and rotation morphs. Watching this shape come to life after so many years .... most excellent.


Rotations to 4 Distinct Mid-Cuts
Image



II>IO : 5D Cylhemoctahedrinder Explore Functions
---------------------------------------------------------------

Building the function with linear operators

I = 2*abs(x) - a

II = abs(x-y) + abs(x+y) - a

II> = abs(abs(x-y) + abs(x+y) - 3z) + abs(x-y) + abs(x+y) - a

II>I = abs(abs(abs(x-y)+abs(x+y) - 3z) + abs(x-y)+abs(x+y) - w) + abs(abs(abs(x-y)+abs(x+y) - 3z) + abs(x-y)+abs(x+y) + w) - a

II>IO = abs(abs(abs(x-y)+abs(x+y) - 2z) + abs(x-y)+abs(x+y) - 3sqrt(w^2 + v^2)) + abs(abs(abs(x-y)+abs(x+y) - 2z) + abs(x-y)+abs(x+y) + 3sqrt(w^2 + v^2)) - a

|||x-y|+|x+y| - 2z| + |x-y|+|x+y| - 3√(w^2 + v^2)| + |||x-y|+|x+y| - 2z| + |x-y|+|x+y| + 3√(w^2 + v^2)| - a



---3D Cross Sections---


• Cube III , 3-plane XYW : cutting through > along Z, and O along V
----------------------------------------------------------------------------------
abs(abs(abs(x-y)+abs(x+y) - 2a) + abs(x-y)+abs(x+y) - 3sqrt(z^2 + b^2)) + abs(abs(abs(x-y)+abs(x+y) - 2a) + abs(x-y)+abs(x+y) + 3sqrt(z^2 + b^2)) - 3.6

--- a : cube LxW has triangle symmetry
--- b : cube H has circular symm



• cylinder IIO , 3-plane XWV : cutting through I along Y , and > along Z
----------------------------------------------------------------------------------------
abs(abs(abs(x-a)+abs(x+a) - b) + abs(x-a)+abs(x+a) - 3sqrt(y^2 + z^2)) + abs(abs(abs(x-a)+abs(x+a) - b) + abs(x-a)+abs(x+a) + 3sqrt(y^2 + z^2)) - 2.5

--- a : cylinder LxW has line symm
--- b : cylinder H has triangle symm



• square pyramid II> , 3-plane XYZ : cutting through I along W , and O along V
-------------------------------------------------------------------------------------------------
abs(abs(abs(x-y)+abs(x+y) - 2z) + abs(x-y)+abs(x+y) - 3sqrt(a^2 + b^2)) + abs(abs(abs(x-y)+abs(x+y) - 2z) + abs(x-y)+abs(x+y) + 3sqrt(a^2 + b^2)) - 3.5

--- a : pyramid has line symmetry
--- b : pyramid has line symmetry



• triangle prism I>I , 3-plane XZW : cutting through I along Y , and O along V
----------------------------------------------------------------------------------------------
abs(abs(abs(x-a)+abs(x+a) - 2y) + abs(x-a)+abs(x+a) - 3sqrt(z^2 + b^2)) + abs(abs(abs(x-a)+abs(x+a) - 2y) + abs(x-a)+abs(x+a) + 3sqrt(z^2 + b^2)) - 3.5

--- a : square atop triangle prism morph, with circular symm
--- b : triangle prism H has circular symm



• IIO , III , II> , I>I Rotation Morph
-------------------------------------------
abs(abs(abs(x-(y*sin(a)))+abs(x+(y*sin(a))) - 2(z*sin(b))) + abs(x-(y*sin(a)))+abs(x+(y*sin(a))) - 3sqrt((y*cos(a))^2 + (z*cos(b))^2)) + abs(abs(abs(x-(y*sin(a)))+abs(x+(y*sin(a))) - 2(z*sin(b))) + abs(x-(y*sin(a)))+abs(x+(y*sin(a))) + 3sqrt((y*cos(a))^2 + (z*cos(b))^2)) - 3.5

[a,b] Rotate Positions

[0,0] - IIO cylinder
[1.57,0] - III cube
[1.57,1.57] - II> square pyramid
[0,1.57] - I>I triangle prism
It is by will alone, I set my donuts in motion
ICN5D
Pentonian
 
Posts: 1135
Joined: Mon Jul 28, 2008 4:25 am
Location: the Land of Flowers

Next

Return to Other Geometry

Who is online

Users browsing this forum: No registered users and 10 guests

cron