Integrate open cascade geometry kernel?

geometry
open-cascade

#1

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.


#2

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.


#3

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:

https://github.com/hofk

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 );

#4

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.


#5

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


#6

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


#7

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