# Merge two cubes. (Cuboctahedron)

**URL:** <https://community.wolfram.com/t/merge-two-cubes-cuboctahedron/17608>\
**Category:** Questions\
**Tags:** geometry, graphics-and-visualization\
**Created:** [February 12, 2021, 8:36pm UTC](https://community.wolfram.com/t/merge-two-cubes-cuboctahedron/17608 "2021-02-12T20:36:28Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianobrien](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@brianobrien](https://community.wolfram.com/u/brianobrien)\
**Post date:** [February 12, 2021, 8:36pm UTC](https://community.wolfram.com/t/merge-two-cubes-cuboctahedron/17608/1 "2021-02-12T20:36:28Z")

</div>

I need to create a Cuboctahedron.

 ![Cuboctahedron_by_Cutting_Rhombic_Dodecahedron.svg.png](https://global.discourse-cdn.com/wolfram/original/3X/c/5/c588b598a2db6e06392f666c5e957c283d8e514f.png)

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?

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [February 12, 2021, 9:23pm UTC](https://community.wolfram.com/t/merge-two-cubes-cuboctahedron/17608/2 "2021-02-12T21:23:23Z")

</div>

Maybe this will help

```
Entity["Polyhedron", "Cuboctahedron"]["Dataset"]

```

---

<div class="post-metadata">

**Author:** ![brianobrien](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@brianobrien](https://community.wolfram.com/u/brianobrien)\
**Post date:** [February 12, 2021, 10:21pm UTC](https://community.wolfram.com/t/merge-two-cubes-cuboctahedron/17608/3 "2021-02-12T22:21:10Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hansmilton](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hansmilton/32/8656_2.png) [@hansmilton](https://community.wolfram.com/u/hansmilton)\
**Post date:** [February 13, 2021, 8:21am UTC](https://community.wolfram.com/t/merge-two-cubes-cuboctahedron/17608/4 "2021-02-13T08:21:59Z")

</div>

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]

```

 ![Cuboctahedron.png](https://global.discourse-cdn.com/wolfram/original/2X/b/b8a302ef2bcadc42f59267268f3933a177385c02.png)

---

<div class="post-metadata">

**Author:** ![brianobrien](https://avatars.discourse-cdn.com/v4/letter/b/b2d939/32.png) [@brianobrien](https://community.wolfram.com/u/brianobrien)\
**Post date:** [February 14, 2021, 5:35pm UTC](https://community.wolfram.com/t/merge-two-cubes-cuboctahedron/17608/5 "2021-02-14T17:35:51Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![hansmilton](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/hansmilton/32/8656_2.png) [@hansmilton](https://community.wolfram.com/u/hansmilton)\
**Post date:** [February 14, 2021, 7:42pm UTC](https://community.wolfram.com/t/merge-two-cubes-cuboctahedron/17608/6 "2021-02-14T19:42:40Z")

</div>

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](https://reference.wolfram.com/language/ref/Scale.html?q=Scale) and [Translate](https://reference.wolfram.com/language/ref/Translate.html?q=Translate)
