Open source licences

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
j-dowsett
Posts: 204
Joined: Wed Sep 07, 2011 9:37 am

Open source licences

Postby j-dowsett » Sun Sep 10, 2017 9:40 am

Hi.

Returning after a long absence. I'm currently thinking about a little feature I used quite a lot back when I was using a commercial CAD package. I've only just started thinking about it so I don't really want to go into it until/if I have something to show.

It will likely require using third party code so I wanted to check the situation of the licences under which code we use can be licenced. I believe we can't use anything that is GPL/LGPL v3? How about using something that is under MIT licence? I understood that this should be compatible, but would I be able to incorporate the code directly or would it have to be as a separate library? Same with Apache?

Any pointers would be much appreciated

Joe
chrisb
Posts: 29177
Joined: Tue Mar 17, 2015 9:14 am

Re: Open source licences

Postby chrisb » Sun Sep 10, 2017 10:43 am

j-dowsett wrote:
Sun Sep 10, 2017 9:40 am
I'm currently thinking about a little feature I used quite a lot back when I was using a commercial CAD package. I've only just started thinking about it so I don't really want to go into it until/if I have something to show.
Please share your thoughts before the code, albeit as very general ideas. Here is much expertise and knowledge about similar systems. Better discuss it now than to start running in the wrong direction; or start running and others are waiting at the goal when you arrive.
A Sketcher Lecture with in-depth information is available in English, auf deutsch, en français, en español.
wmayer
Site Admin
Posts: 16666
Joined: Thu Feb 19, 2009 10:32 am

Re: Open source licences

Postby wmayer » Sun Sep 10, 2017 11:24 am

I believe we can't use anything that is GPL/LGPL v3? How about using something that is under MIT licence? I understood that this should be compatible, but would I be able to incorporate the code directly or would it have to be as a separate library? Same with Apache?
LGPL v2+ (which includes v3+) is not a problem. MIT or BSD or ASL (Apache Software License) are even more permissive than LGPL and thus no problem either.

Even GPL wouldn't be a problem with FreeCAD itself as we nowhere use a library that is incompatible to it. However, we want others using FreeCAD allow them to link it with proprietary code so GPL is no option after all.
but would I be able to incorporate the code directly or would it have to be as a separate library?
If further libraries are needed then I prefer to have them as external libraries as adding them to our repo causes additional maintenance work.
j-dowsett
Posts: 204
Joined: Wed Sep 07, 2011 9:37 am

Re: Open source licences

Postby j-dowsett » Mon Sep 11, 2017 5:25 pm

Thanks for the responses.

Ultimately what I'd like is a 'curve-by-equation' to be available in a sketch, whereby the user can define multiple functions which are evaluated over the domain of a parameter to define a curve. This could end up being quite complex - my use for it previously required solving fourth-order polynomials - so definitely more than a single y = f(x) scenario.

I've recently (for work, for a different purpose) been using an expression parser in C# which is what's prompted me to start thinking about it here. Right now I'm just looking at different possibilities for the parser and it will be a while before I think about anything integrating with FreeCAD (at which point I'll have a massive learning curve figuring how and where to fit it in), but I wanted to be sure that I didn't get too far with a library that couldn't be used.

I agree that linking as an external library would be preferable, but I'm not sure these are available as libraries 'off-the-shelf' as it were. I've been looking at the options here https://github.com/ArashPartow/math-par ... rk-project, primarily ExprTk (which looks powerful and useful but weighty) or TinyExpr, and I'm not sure these come ready packaged (and look like being only a file or two). I suppose I could still compile it into it's own library? Maybe someone knows of something already packaged that I should consider?

I hope nothing above sounds unreasonable, I'm keen to get back into FreeCAD and it's easier when driven by a mini-project of my own.

Thanks
Joseph.
eivindkvedalen
Posts: 602
Joined: Tue Jan 29, 2013 10:35 pm

Re: Open source licences

Postby eivindkvedalen » Mon Sep 11, 2017 7:07 pm

j-dowsett wrote:
Mon Sep 11, 2017 5:25 pm
Thanks for the responses.

Ultimately what I'd like is a 'curve-by-equation' to be available in a sketch, whereby the user can define multiple functions which are evaluated over the domain of a parameter to define a curve. This could end up being quite complex - my use for it previously required solving fourth-order polynomials - so definitely more than a single y = f(x) scenario.

I've recently (for work, for a different purpose) been using an expression parser in C# which is what's prompted me to start thinking about it here. Right now I'm just looking at different possibilities for the parser and it will be a while before I think about anything integrating with FreeCAD (at which point I'll have a massive learning curve figuring how and where to fit it in), but I wanted to be sure that I didn't get too far with a library that couldn't be used.

I agree that linking as an external library would be preferable, but I'm not sure these are available as libraries 'off-the-shelf' as it were. I've been looking at the options here https://github.com/ArashPartow/math-par ... rk-project, primarily ExprTk (which looks powerful and useful but weighty) or TinyExpr, and I'm not sure these come ready packaged (and look like being only a file or two). I suppose I could still compile it into it's own library? Maybe someone knows of something already packaged that I should consider?

I hope nothing above sounds unreasonable, I'm keen to get back into FreeCAD and it's easier when driven by a mini-project of my own.
We already have a generic mathematical expression parser in FreeCAD; see https://freecadweb.org/wiki/Expressions and
https://github.com/FreeCAD/FreeCAD/blob ... pression.h This parser understands all numeric properties in FreeCAD, and it can also do calculations with units (I think this is quite unique to FreeCAD).

Instead of integrating something new, I think you should consider using (and possibly extending) the one we have already.

Eivind
j-dowsett
Posts: 204
Joined: Wed Sep 07, 2011 9:37 am

Re: Open source licences

Postby j-dowsett » Tue Sep 12, 2017 7:08 am

Excellent, thanks, looks like it should work well, I'll have a deeper look at that later.

Cheers