Bspline strange behaviour

A forum dedicated to the Draft, Arch and BIM workbenches development.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Bspline strange behaviour

Post by carlopav »

Hello! playing with bspline to allow edit tool preview, i noticed a strange behaviour when the spline is closed:
Cattura.JPG
Cattura.JPG (23.39 KiB) Viewed 773 times
it seems strange to me that a closed spline (red one) generated from rectangle's midpoints, it's not simmetrical.
I highlighted the spline points in every attempt to be clearer. Maybe it's just my low math skills :)

Code: Select all

OS: Windows 7
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.16687 (Git)
Build type: Release
Branch: master
Hash: ff1fb11af15a7c5f7f0ba3ef79588e128f397c2c
Python version: 3.6.6
Qt version: 5.6.2
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: Italian/Italy (it_IT)
follow my experiments on BIM modelling for architecture design
renatorivo
Veteran
Posts: 2611
Joined: Tue Feb 21, 2012 8:07 pm
Location: Torino - Italy

Re: Bspline strange behaviour

Post by renatorivo »

This also:
Cattura-b-spline.PNG
Cattura-b-spline.PNG (20.48 KiB) Viewed 720 times
B-spline with SolidWorks
splineSolidW.PNG
splineSolidW.PNG (54.24 KiB) Viewed 720 times
User avatar
bitacovir
Veteran
Posts: 1570
Joined: Sat Apr 19, 2014 6:23 am
Contact:

Re: Bspline strange behaviour

Post by bitacovir »

renatorivo wrote: Tue Jun 11, 2019 11:46 am This also:
Cattura-b-spline.PNG
Here I think is because the last points are not curves.
::bitacovir::
==================
One must be absolutely modern.
Arthur Rimbaud (A Season in Hell -1873)

Canal Youtube Grupo Telegram de FreeCAD Español

My personal web site
My GitHub repository
Mini Airflow Tunnel Project
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: Bspline strange behaviour

Post by yorik »

I think these b-splines as created "as is" by opencascade I think (might be wrong there, I'll have a look), in that case there isn't much that we can do on our side...
chrisb
Veteran
Posts: 54273
Joined: Tue Mar 17, 2015 9:14 am

Re: Bspline strange behaviour

Post by chrisb »

All these B-splines seem to be correct. The problem is that we cannot add additional constraints, especially tangents.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Bspline strange behaviour

Post by carlopav »

I think open bspline works quite good, and the example Renato added is correct. (Imagine a thin wooden board that have to go around nails, represented by knots: second knot will never have an horizontal tangent if the first one is free to rotate). How does it behave in SW? A CAD ask you to set first and lastpoint tangent, but then it leads to awful representation when u move them, and it's hard to change them also...
It looks more what crisb pointed out: the problem occurs when the spline is closed because it seems to me that the tangent of the first and last point is not correctly calculated (last point takes the tangent of the first point as is, without modifying it).
Of course if Yorik is right we have to keep it like this... At the end it's not a major issue and we can always use bezcurves :)
follow my experiments on BIM modelling for architecture design
Post Reply