T-Splines Opensource Library

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
JeffWitz
Posts: 54
Joined: Fri Mar 27, 2015 9:14 am
Location: Lille, France

T-Splines Opensource Library

Post by JeffWitz »

A new library has been released in order to manipulate T-splines : https://github.com/GrapeTec/T-SPLINE

For the recall the T-splines are an extension to NURBS that allows to only refine locally the geometry. The authors of this lib had written an intersting article about the standardization of the T-Splines file exchange (STEP improvement), but it is not freely available (science direct ...).

It is really interesting and it solves a lots of CAD issues on sewing several NURBS patches. It could really be interesting to experiment such geometry basis.
There are a lot of interesting technical papers in : http://www.tsplines.com/technicalpapers.html

One interesting application of such representation could be the FEM using this geometry (known as Iso Geometric Analysis IGA), it avoid the meshing step.
Their is OpenSource software that exists such as PetIGA : http://www.mcs.anl.gov/petsc/petsc-20/c ... lcin_L.pdf
that already allows one to perform IGA analysis with the best opensource linear algebra solver that exists : Petsc.
But you can't easly construct complex geometries.

One main issue is the fact that the classical FEM (Or IGA) needs 3D solid and not Boundary representation (that is the way it is stores in OCC). Once bivariate T-splines are ok, it is not quite complex to extend to trivariate splines and it could allow extremely fast simulation based on the geometry. Moreover fillets and chamfers are really easy to defined so the use of such geometry could help to have a very stable kernel. NURBS and T-splines are compatible i.e: you can pass from one to another (even if it is not trivial).
One interesting thing is that a software as CATIA will takes decade before using such geometry due to their strong NURBS dependency.
Complex NURBS geometries are made with trimmed NURBS and trimmed NURBS are not easily taken into account in IGA. With T-Spline you don't have to deal with trimmed geometries as you can easily change topology by T-jonction specific insertion (T-stars). More over joining two NURBS patch is a complex task that is quite simple in T-Splines

If you think about the CSG classical workflow, for now you have to store the the tree of boolean operation to know the 3D aspect but in OCC only the final BRep is stored when you read IGES files. It means that you loose every interesting part of the CSG approach.
This very interesting article : https://www.ices.utexas.edu/media/reports/2013/1319.pdf explain how to extend classical CSG to trivariate T-Splines and then perform IGA on it.

As you can see there are a lot of people that are involved in this area and that shows how powerful this can be.
So it seems that everything goes it that direction but the fact that there is a lot of CAD development make it a perspective for everyone.
The main issues is that mechanics scientists are not the kind of people that really like to deal with User Interfaces, and I think it is the point where FreeCAD community is brilliant !
If we could bring this new way of thinking from research to engineer it would be disruptive innovation !

Do you think it could be possible to try T-Splines in FreeCAD ?
User avatar
saso
Veteran
Posts: 1924
Joined: Fri May 16, 2014 1:14 pm
Contact:

Re: T-Splines Opensource Library

Post by saso »

This indeed does look quite interesting :)
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: T-Splines Opensource Library

Post by Chris_G »

Yes, that's interesting.
I compiled the lib and ran the demo file successfully.
Such a shame the author's article is not freely available. I guess it gives useful information about the data structures.
Do you think it could be possible to try T-Splines in FreeCAD ?
Technically, this could probably be integrated into FreeCAD.
But there is some work :
- create the FreeCAD T-spline object and link it to the lib
- create the python bindings.
- and eventually create the UI tools.
So the main problem will be to find someone who has the ability and the interest in that task.
Considering that Nurbs support is still lacking UI tools in FreeCAD, I am afraid it may not happen anytime soon ...
Chris
JeffWitz
Posts: 54
Joined: Fri Mar 27, 2015 9:14 am
Location: Lille, France

Re: T-Splines Opensource Library

Post by JeffWitz »

I don't really understand your what you want to say by :
Such a shame the author's article is not freely available.
xiaowenlei, the authors gives an adress on his github page and he answers to e-mails.

I have some mails exchanges with him and he thinks about adding a python binding in order to get users.
Considering that Nurbs support is still lacking UI tools in FreeCAD, I am afraid it may not happen anytime soon ...
I think that there are less issues that implementing NURBS as the trimming curves are not mandatory and it make NURBS operation quite complex.
For me the main issue is that the geometry strongly depends on OCC and T-Splines are not integrated in OCC.
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

Re: T-Splines Opensource Library

Post by looo »

I have some mails exchanges with him and he thinks about adding a python binding in order to get users.
This sounds really great. I had a short look at the mouse example, but it looks difficult. A T-Spline needs all kind of information. Python will definitely help to get more user understand the approach.
I can offer help with bindings (especially with pybind11), but without documentation this won't be very productive.
For me the main issue is that the geometry strongly depends on OCC and T-Splines are not integrated in OCC.
I don't think T-Splines can replace NURBS in OCC in near future. But the T-Spline library looks very nice and I would love to experiment and understand this new modelling technique.
Is there any chance to get the document. This would be really helpful.

regarding fem:
As I understand, going from boundary representation to a volumetric representation is nearly the same problem as going from boundary mesh to volume-mesh. So I don't see much advantages in meshing.

one questions about T-Splines:

how to model sharp edges? There isn't something like a knot-sequence. So for a sharp edge more points have to lie on the same position? or is there any other possibility to model sharp edges.
User avatar
Chris_G
Veteran
Posts: 2601
Joined: Tue Dec 31, 2013 4:10 pm
Location: France
Contact:

Re: T-Splines Opensource Library

Post by Chris_G »

Hi,
how to model sharp edges? There isn't something like a knot-sequence. So for a sharp edge more points have to lie on the same position? or is there any other possibility to model sharp edges.
From what I understood, knot-sequence is not explicitly defined, but inferred from the T-Mesh construction. Sharp edges are possible; have a look at this interesting article : http://www.tsplines.com/m/T-SplinesChesapeakepaper.pdf
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: T-Splines Opensource Library

Post by ickby »

Interesting read (i only have gone through it superficialy).
For me the main issue is that the geometry strongly depends on OCC and T-Splines are not integrated in OCC.
The paper proposes the following workflow: Model a surface/shape with TSplines and then convert it to nurbs for further processing. I could imagine this for freecad as wel: Provide a TSpline shaping workbench with the library mentioned here and then expose the created shape as nurbs for occ handling. Would be interesting to have it :)
JeffWitz
Posts: 54
Joined: Fri Mar 27, 2015 9:14 am
Location: Lille, France

Re: T-Splines Opensource Library

Post by JeffWitz »

to : ickby
Model a surface/shape with TSplines and then convert it to nurbs for further processing
That seems indeed interesting but I don't really know how you manage the rendering with NURBS. I assume that you use the OpenCascade BRepMesh faceter and then you send it to Coin3d. So for the T-Spline as one can't call this method it is probably needed to convert to polygon befor sending to Coin3d ?
Finally the rendering is something that could be a big issue id it is not fast enough.

The other solution is to create the current displayed object by converting it to NURBS but I'm not sure it is easily doable in real time.
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: T-Splines Opensource Library

Post by ickby »

JeffWitz wrote:to : ickby
Model a surface/shape with TSplines and then convert it to nurbs for further processing
That seems indeed interesting but I don't really know how you manage the rendering with NURBS. I assume that you use the OpenCascade BRepMesh faceter and then you send it to Coin3d. So for the T-Spline as one can't call this method it is probably needed to convert to polygon befor sending to Coin3d ?
Finally the rendering is something that could be a big issue id it is not fast enough.

The other solution is to create the current displayed object by converting it to NURBS but I'm not sure it is easily doable in real time.
It depends, if the library you showed provides tesselation algorithms for TSplines it should be used directly for the "TSpline Edit Mode", as this would result in the fastest visualisation for changing surface (and then NURBS convertion would only be done outside of edit mode for interaction with other shapes). The tesselation triangles could be easily be added to the coin3d scene graph, we could help with that.

If no tesselation is provided by the library than also the edit mode can convert to OCC Nurbs for which visualisation can be done automatically by FreeCAD, no work with tesselation and coin3d involved. Just use the Part::Feature class and assign the "shape" property.
JeffWitz
Posts: 54
Joined: Fri Mar 27, 2015 9:14 am
Location: Lille, France

Re: T-Splines Opensource Library

Post by JeffWitz »

to: looo
I don't think T-Splines can replace NURBS in OCC in near future. But the T-Spline library looks very nice and I would love to experiment and understand this new modelling technique.
I agree on the idea to experiment with it. All the operation on complex shape are facilitated with T-Splines so I hope it will be tested before going to a surface modelling wotkbench
Is there any chance to get the document. This would be really helpful.
I don't think the document will help you as it is mainly publish to help at the standardisation of the file storage.
If you want the basis you can read this document: http://www.tsplines.com/technology/edu/ ... roduct.pdf
and the others on this page: http://www.tsplines.com/educationportal.html
It will give you all the math behind.
Post Reply