Do we like using third party libraries?

Hi,

During my work on calculating oriented bounding boxes I started implementing the QR algorithm for finding eigenvectors, but also I wanted to check third party libs and I’ve found a great open library for such calculations and many others.

It is called NumericJS http://www.numericjs.com/. These are the calculations it can do: http://www.numericjs.com/documentation.html.

It has point, vector and matrix calculations.

I would like to ask, if I can use this lib, or Cesium does not like to depend on third party libs?

Thank you!

Ogi

Is the license compatible?

It is under MIT license.

https://github.com/sloisel/numeric/blob/master/resources/LICENSE.quadprog

https://github.com/sloisel/numeric/blob/master/license.txt

Hi Ogi,

Yes, we use third-party libraries. There is a list of them in LICENSE.md.

As Chris mentioned, the license must be compatible with our Apache 2.0 license. The most popular compatible licenses are MIT, BSD, and Apache. GPL and its variants are not compatible. From a license perspective, numeric is compatible with Cesium.

We use third-party licenses that:

  • Provide capabilities we don’t have the time and/or expertise to code ourselves.

  • Are small and light.

  • Are reasonably popular, tested, and maintained.

  • Provide enough value that we are willing to add another third-party library whose integration needs to be maintained and has the potential to slightly count against us when folks evaluate Cesium (generally, less third-party is better).

numeric looks like a quality library, but it is quite large at 74 KB minified. When not using AMD, Cesium.js is 1.2 MB minified, and we are always thinking about making it smaller, not larger.

Given this, I recommend

  1. Using numeric as-is if we have other high-impact near-to-medium term uses for it. I don’t have any off the top of my head, but there may be some. Or -

  2. Using just the part of numeric that we need if it pulls out of the library easily. This has the potential to create a maintain problem for us, but given the nature of this kind of code and its GitHub history, I suspect this code won’t change often. Also, this is allowed by their MIT license. Or -

  3. Use numeric as a guide for your own implementation. If we use any parts of numeric, we will credit them and include their license.

(2) is probably the best path here.

Also - with your work in general - the community would love to see a pull request with some of your initial code. It doesn’t need to be big; just some foundations will do, but we like to get folks up to speed with integrating code into the main repo and practice transparency. Dan can even setup a branch for you to pull into, instead of going into master.

Patrick

Hi Patrick,

Thank you for the detailed information!

I will solve the problem using the lib, and later if it is ok I will pull out only the used parts.

Dan forked the Cesium repo for me already. I will create a pull request in a day or two.

Thank you,

Ogi

Hi,

Can you help in this please? I got stuck a little bit. I wanted to use numeric.js, so I added it to the ThirdParty folder. In my ObjectOrientedBoundingBox.js I added to the defines as ‘…/ThirdParty/numeric’, and as a function parameter numeric. The parameters are in the same order.

After building and combining I find it in the Cesium.js, but not in Cesium unminified. When I start the server and check sandcastle I get an error that I should run combine because it cannot find numeric.

What do I miss?

Thank you!

Ogi

Hi Ogi,

Dan is out today. Did you put it in Source/ThirdParty? Not ThirdParty? It should be in Source/ThirdParty and copy the pattern of the other .js files like Tween.js. Also try clearing your browsers cache.

What fork are you working in? In general, when you need help, it will help us if we are able to see and build your code.

Patrick

Hi Patrick,

Yes it was in the right place. It took a while, but I found the solution. The numeric.js was not prepared for including.

I enclosed it with define(function() { //code }); and Cesium started working.

I pushed the initial commit in my own fork. Soon I will open a pull request on Dan’s fork.

Thank you for your time,

Ogi

Unfortunately numericJS is in bad state. It took me a lot of hours to figure out that the problem is not on my side. NumericJS contains references because of some historical reason, to it’s own functions which are renamed, removed (I checked it’s git log), so I fixed some parts of numericJS, but I don’t like this way. I will create a pull request with this hack and change it later.

Ogi

Ogi,

Sorry NumericJS is causing you problems. Given what I saw about the library, I am very surprised to hear this.

You are welcome to open pull requests with hacks into Dan’s fork or even into a branch in the main repo if Dan made one for merging, but we won’t merge them into the master branch in the main repo until it is production quality. In general, you should strive to open high-quality fine-grained pull requests so you can get prompt focused feedback and get into the rhythm of contributing code.

Patrick