Triangulation sphere with holes

There are two different simple versions of spheres with holes.
Sphere with up to 6 coordinate planes parallel holes

In order to arrange the holes freely, a different procedure is required.
A version uses a division of the hemispheres.
http://threejs.hofk.de/sphere/SphereCutAsWanted.html
20190522-1525-36123
The position and size of the circular holes is limited.


The triangulation according to an algorithm by E. Hartmann is much more flexible.

See
https://www2.mathematik.tu-darmstadt.de/~ehartmann/cdgen0104.pdf
Chapter 7
TRIANGULATION OF IMPLICIT SURFACES

I adapted / simplified the algorithm for the simple case of the sphere and also used an alternative angle calculation.
http://threejs.hofk.de/Triangulation/TriangulationSphereWithHoles.html

(Further developed February 2020 see Inner Geometry (Triangulation) )

also with a hole defined by points

How to add a circular hole:20190621-0902-39694


:white_check_mark: Update: October 7th

Another variant of the sphere with holes was created. A parameter object is used .The rough side length of the triangles is to be indicated. Thus the forms sphere and cylinder (later torus) can be connected exactly with each other.

const g = new THREE.BufferGeometry( );
	
const parameters = {
	
	d: 0.08, // rough side length of the triangles
	div4: 30, // division of the quarter of the great circle (orthodrome) 
	holes: [
		// circular hole, 3 elements: [ theta, phi, div4Hole ], div4Hole <= div4	
		[ 1.82,  0.41, 12 ],
		[ 0.72,  2.55, 13 ],
		
		// points hole,: array of points theta, phi, ...  (last point is connected to first)
		[ 0,0,  0.5,-0.8,  0.25,-0.27,  0.4,0.3,  0.3,0.72 ]
	]
}

sphereWithHoles( g, parameters );

Try it out: https://hofk.de/main/threejs/Triangulation/TriangulationSphereWithHolesP.html


:white_check_mark: Update: October 18th

The algorithm for the sphere with holes previously contained no check whether the current front overlaps.

In very many cases with few holes this is not a problem.
But it can lead to errors in more complicated cases!

The overlap check has been completed.

By the way: It is always necessary for the cylinder!


See also Addon for triangulation of implicit surfaces/ forms with holes

10 Likes

Severe maths! :+1: All that we like! :beers:

1 Like

With the sphere, it’s still elementary math.

When I have integrated the hole sphere into my addon THREEg I will try to implement the complete algorithm of Professor Hartmann. I contacted him about this.

There is a program by him, but it is written in Pascal and I can’t take it over immediately. The languages offer quite different possibilities. Besides, everyone has his own programming style. For threejs you should store the points and indices according to the requirements of BufferGeometry.

de / en
https://www2.mathematik.tu-darmstadt.de/~ehartmann/ see B) 2) 2’)

2 Likes

The procedure has been a little simplified and updated. The properties chg and check of the front are omitted.

The angle value 0 is used for this. ( .ang === 0 )


43


Also in the version in the addon THREEi.


see Addon for triangulation of implicit surfaces

1 Like

Can you open the model efficiently?

I don’t know what you mean exactly.

The addon does not generate a model like software like Blender.

The addon creates an indexed BufferGeometry directly. Just like three.js does with a sphere or a cylinder etc… But the algorithm and the calculation is much more complex.

Because the calculation takes time, I created the script https://github.com/hofk/THREEi.js/blob/61ba83531881d9c6f7a5125dec63a27410ea3f50/examples/triangulationImplicitSurfaceExportGeo.html.
This exports the attribute fields: Positions and indexes.
You get a complete three.js definition. You can copy these into your project and have the BufferGeometry ( object, form, … ) without calculating.

The last paragraph in the readme describes this. https://github.com/hofk/THREEi.js/blob/master/README.md

This concerns triangulation.


Triangulation of Implicit Surfaces …

Algorithm modified.

The implicit surfaces are defined in separate js files. See examples folder.


I’m still working on the export for the sphere with holes. In addition there are cylinders and torus with holes.

1 Like

See at the end of the original post. :slightly_smiling_face:

1 Like

:white_check_mark: Update: October 18th

The algorithm for the sphere with holes previously contained no check whether the current front overlaps. The overlap check has been completed.
See original post.

1 Like

:new:

The generation of the surfaces sphere, cylinder and others use the same core functions of triangulation.

If you need several different surfaces in a scene, this is repetitive code.
Therefore I summarize triangulation of sphere, cylinder and other surfaces with holes.

In the test example you can observe the birth of the :stars: with the slider.
https://hofk.de/main/threejs/1TEST/InnerGeometryTriangulation221219.html


Further surfaces will be added.


Update February 2020 see Inner Geometry (Triangulation)


Coming soon on GitHub. :christmas_tree:

2 Likes

this has to be the most WTF thread I saw in relation to 3js, keep it going :smiley:

3 Likes