Message Boards Message Boards

0
|
3419 Views
|
5 Replies
|
2 Total Likes
View groups...
Share
Share this post:

Merge two cubes. (Cuboctahedron)

Posted 3 years ago

I need to create a Cuboctahedron. Cuboctahedron

I was able to build a cube or cylinder by using Cylinder or Cube Methods... I found the Polyhydron["Cuboctahedron"] method and wondered What is different between:

c = Cylinder[...]
vs
c = Polyhydron["Cuboctahedron"]

As i can't figure out what the difference is i am trying to merge two cubes to get the same effect. It seems to me that I can create two cubes and rotate one of the 45,45,45... Then I can use RegionDifference to create the object.... However I'm not sure I know. how to rotate the second 3D cube 45,45,45.. Help?

POSTED BY: Brian OBrien
5 Replies
Posted 3 years ago

An example of applying rotation:

cuboctas = Table[
    Rotate[PolyhedronData["Cuboctahedron", "Polyhedron"], i Degree, {0, 0, 1}],
    {i, 0, 90, 15}
  ];

Manipulate[
    Graphics3D[cuboctas[[angle]], Axes -> True, PlotRange -> 1.1],
    {{angle, 1}, {1 -> 0, 2 -> 15, 3 -> 30, 4 -> 45, 5 -> 60, 6 -> 75, 7 -> 90}, SetterBar},
    SaveDefinitions -> True
 ]

See also the functions Scale and Translate

POSTED BY: Hans Milton
Posted 3 years ago

Thank you! Unlike the Cylinder method which you can supply additional parameters, the Polyhydron method seems to lack constructors, how does one apply a scale and rotation to this object at construction?

I was afraid to say that the return type seems typeless... but it does. I am relieved to here it does have a type... but why am i not seeing that in the documentation the method? Am i missing something?

POSTED BY: Brian OBrien
Posted 3 years ago

PolyhedronData["Cuboctahedron"] returns a Graphics3D object, so cannot be used with RegionDifference. But PolyhedronData["Cuboctahedron","ImplicitRegion"] will return a region.

cy = Cylinder[{{-1, 0, 0}, {1, 0, 0}}, .25];
sc = PolyhedronData["Cuboctahedron", "ImplicitRegion"];
rd = RegionDifference[sc, cy];
RegionPlot3D[rd, PlotPoints -> 42, Boxed -> False]

enter image description here

POSTED BY: Hans Milton
Posted 3 years ago

The following code shows a ball being combined with a cylinder. I need to change the ball to the Cuboctahedron. This section of code works:

cy = Cylinder[{{-1, 0, 0}, {1, 0, 0}}, .25];
ba = Ball[{0, 0, 0}, 1];
sc = PolyhedronData["Cuboctahedron"];
rd = RegionDifference[ba, cy];
o = RegionPlot3D[rd, PlotPoints -> 42]

However this code fails:

rd = RegionDifference[sc, cy];
o = RegionPlot3D[rd, PlotPoints -> 42]

And I don't know why.

POSTED BY: Brian OBrien
Posted 3 years ago

Maybe this will help

Entity["Polyhedron", "Cuboctahedron"]["Dataset"]
POSTED BY: Rohit Namjoshi
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract