Integrate open cascade geometry kernel?

Hi everyone,
here is my question first:

Would it be helpful to integrate the open cascade geometry kernel into three.js ? Would it be possible?
(Of course the kernel needs to be translated into JS / TS first.)

I used three.js in my master’s thesis and I appreciated it a lot. Nevertheless I always thought that there are some fundamental geometry-featurers missing. A view days ago I was reading about Open Cascade and pythonOCC. The geoemtry kernel they provide looks very extensive. So I was thinking, if it would be possible to have this for three.js.

1 Like

The scope of three.js was often discussed in the past. In general, it’s not the aim of the project to provide an extensive set of functions for manipulating geometric and topological information. If you can manage to run a JavaScript version of Open Cascade in the browser, it would be best to place this code in a separate repo similar to csg.js.

1 Like

If an geometric functionality is missing, you can add it yourself.

This can easily be realized as an addon.

You can use the basic geometry of three.js and integrate the extended functionality.

That’s how I realized it in my addon:

hofk (Klaus Hoffmeister) · GitHub

Addon. Produces almost infinite many time-varying geometries with functions

geometry = new THREE.BufferGeometry();    // base class buffer-geometry object from three.js

geometry.createMorphGeometry = THREEf.createMorphGeometry;    // insert the methode from THREEf.js


geometry.createMorphGeometry();    // apply the methode ( here without parameters: all default )

mesh = new THREE.Mesh( geometry, materials ); // create a material array: materials
scene.add( mesh );
2 Likes

No. Yes.

It would be a horrible idea. Integrating both three.js and occ into a modeling application would make a lot of sense though.

1 Like

horrrible - because it would dispropportionately blow up three.js ?

1 Like

Thank you. Do you know where I can find this discussion about the scope of three.js?

It is spread around pull requests and issues at github. One example:

I expect that the threejs community is already aware of this, but for anyone finding this through a web search, this type of thing was implemented a few months ago. CascadeStudio integrates opencascade.js with threejs (as well as several other packages) to provide a web client-side modeling app.

4 Likes