# Sphere with up to 6 coordinate planes parallel holes

**URL:** <https://discourse.threejs.org/t/sphere-with-up-to-6-coordinate-planes-parallel-holes/7267>\
**Category:** Resources\
**Tags:** sphere, buffergeometry, geometry\
**Created:** [April 27, 2019, 6:49pm UTC](https://discourse.threejs.org/t/sphere-with-up-to-6-coordinate-planes-parallel-holes/7267 "2019-04-27T18:49:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)\
**Post date:** [April 27, 2019, 6:49pm UTC](https://discourse.threejs.org/t/sphere-with-up-to-6-coordinate-planes-parallel-holes/7267/1 "2019-04-27T18:49:19Z")

</div>

Some examples of holes with three.js

[https://discourse.threejs.org/t/restrict-an-object-to-another/1780](https://discourse.threejs.org/t/restrict-an-object-to-another/1780)  
[https://discourse.threejs.org/t/in-the-orb-shaders/3286](https://discourse.threejs.org/t/in-the-orb-shaders/3286)  
[https://discourse.threejs.org/t/experiment-geometry-holes/5555](https://discourse.threejs.org/t/experiment-geometry-holes/5555)

[https://discourse.threejs.org/t/how-to-allow-duplicate-vertices-in-extrudegeometry/6333/3](https://discourse.threejs.org/t/how-to-allow-duplicate-vertices-in-extrudegeometry/6333/3)  
[https://jsfiddle.net/Lg458tof/](https://jsfiddle.net/Lg458tof/)

[https://discourse.threejs.org/t/looking-for-updated-plug-in-for-csg/6785](https://discourse.threejs.org/t/looking-for-updated-plug-in-for-csg/6785)

My contribution are two variants of a sphere with up to 6 coordinate planes parallel holes. One variant is completely symmetrical, the other variant is more efficient.

See **Updated April 29** _(There was a typo. Only one m in symmetry.)_

[http://discourse.threejs.hofk.de/2019/SphereCut/SphereCutSymmetric.html](http://discourse.threejs.hofk.de/2019/SphereCut/SphereCutSymmetric.html)  
 ![20190424-1939-4710](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/2X/3/3e199af28ffc258217a3e39f2afcbe59d93f0d7c.png)

[http://discourse.threejs.hofk.de/2019/SphereCut/SphereCut.html](http://discourse.threejs.hofk.de/2019/SphereCut/SphereCut.html)  
 ![20190424-1944-39510](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/2X/a/a316256581b4da2854851c49f45513e761f181c2.jpeg)

With these spheres you can e.g. create a labyrinth similar to [https://discourse.threejs.org/t/addon-to-create-special-extended-geometries/1855/4](https://discourse.threejs.org/t/addon-to-create-special-extended-geometries/1855/4) , but with round shapes.

![20190427-2003-10309](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/2X/b/b63cc5124d54d5757ff687c7a4bb52e1e2d70fe5.png)

These properties are helpful for this.

```
	g.cutRadius = []; // calculated radius of cut circles px, nx, py, ny, pz, nz - for external use
	g.cutDistance = []; // calculated distance of the cut circles to the center px, nx, py, ny, pz, nz - for external use
	g.cutSegments = []; // segments of the cut circles - for external use

```

![20190420-1838-05860](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/2X/d/d57d853f2931d467edff9bf709d207d173352c38.png)

I’m gonna put the spheres in the addon.

---

<div class="post-metadata">

**Author:** ![hofk](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/hofk/32/44944_2.png) [@hofk](https://discourse.threejs.org/u/hofk)\
**Post date:** [April 28, 2019, 7:24pm UTC](https://discourse.threejs.org/t/sphere-with-up-to-6-coordinate-planes-parallel-holes/7267/2 "2019-04-28T19:24:23Z")

</div>

It is now possible to create only some of the eight sphere parts.

**Updated April 29** _(There was a typo. Only one m in symmetry.)_

```
function createSphereCutSymmetric( g, radius, fineness, cut, parts ) {

	// BufferGeometry, radius, fineness (1/4 equator),
	// cut[px, nx, py, ny, pz, nz] max. 2*fineness
	// parts [1, 1, 1, 1, 1, 0, 0, 1] 1 for create part, otherwise arbitrary

```

![20190428-2110-46201](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/2X/c/cb1369784db097620e14dc4b6b1446fc125731c4.png)

```
function createSphereCut( g, radius, equator, cut, parts ) {

	// BufferGeometry, radius, equator,
	// cut[px, nx, py, ny, pz, nz] max. equator, non-overlapping,
	// parts [1, 1, 1, 1, 1, 0, 0, 1] 1 for create part, otherwise arbitrary

```

![20190428-2104-33851](https://cdck-file-uploads-canada1.s3.dualstack.ca-central-1.amazonaws.com/flex035/uploads/threejs/original/2X/8/89f51427cab28fe12b4e9b131e440f8de2db9eeb.png)
