Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline veb  
#1 Posted : 09 October 2017 22:21:10(UTC)
veb


Rank: Advanced Member

Groups: Registered
Joined: 02/02/2016(UTC)
Posts: 35
Man
Russian Federation

Was thanked: 1 time(s) in 1 post(s)
Hello!
Based on your examples, you love math. I and my friend Andrey (not Ivashov) are engaged in development of the program ZCAD with open source code. I am an amateur programmer (this is my hobby), I write rarely when I have time. In the ZCAD project I am 2 years old, at first I wrote narrowly focused things to facilitate the work, now I want to develop the interface and the convenience of work for everyone. At the moment the program can draw a spline line in 3D, by reference points. But you can not create a line in the program, it is created by user vertices. We can not devote so much time to math, so that having custom vertices get the spline line reference points. For us it is a very complex mathematics.
You recently posted an example of "Spline De Boor", I did not find this topic so I created a new one. In this example, you draw a spline line in 2D using reference points.
Actually, please. Help, please, solve the mathematical problem: Having the user vertices, got the spline point reference points in 3D. Also in the program Smath.
Below is the files of your website "Spline De Boor" and my file.
Original user points (XYZuser)
reference points of the spline line (XYZreferpt)

Thank you in advance!

PS Sorry that the question is not on the program smath

Spline%20De%20Boor%20[Colibri].sm (33kb) downloaded 27 time(s). splineHelp.sm (4kb) downloaded 14 time(s).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Jean Giraud  
#2 Posted : 10 October 2017 14:23:38(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Presumably, I understand what you are after ...
... Create a 3D system of vertices, you need 3 matrices.
We have it in Mathcad from Russia. Even if it is possible
to code in Smath, no way to plot because Smath does not plot
stacked matrices [it does not plot matrices at all].
Smath plots matrices as image but not as 3D.

The Mathcad 11 program subdivides by 2 each step from
the Catmul-Clark B_Spline. On the other hand, Mathcad
is on ORIGIN [0], it adds difficulty to code Smath.

In short: I can attempt to code wrt Smath ORIGIN [1].
If your base 3D system does not plot 3 stacked matrices... zap !

Chers, Jean

Spline Catmul-Clark [3].bmp

Spline Catmul-Clark [Ref].bmp
Offline Jean Giraud  
#3 Posted : 10 October 2017 17:00:12(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
(xt,yt,zt) => original
(Xt,Yt,Zt) => 1rst subdivision

Spline Catmul-Clark Details.bmp (2,693kb) downloaded 30 time(s).

No problem to make image of Mathcad ORIGIN [0] program.
Offline veb  
#4 Posted : 11 October 2017 01:17:49(UTC)
veb


Rank: Advanced Member

Groups: Registered
Joined: 02/02/2016(UTC)
Posts: 35
Man
Russian Federation

Was thanked: 1 time(s) in 1 post(s)
Hello!
I have poorly explained and you misunderstood me. Our spline is NURBS. https://en.wikipedia.org...niform_rational_B-spline . We are interested only in the spline line which consists of 3 coordinates.
There are points that lie on the line, I call them user points
There are points that lie outside the line, I call them reference points
In your example, you point the reference points to draw a spline.
Below I bring an animated gif, so you understand what I'm talking about.
We would like to understand how from points lying on the line, get points outside the line, and vice versa.
It is not yet clear how to get an Knot value and a degree of the spline curve for constructing a spline. At the moment the program uses that knot value and the degree that we read from a file created in another CAD

Here, also shows the construction of the spline, and there is a switch between points lying on the line and points outside the line. Pay attention to the degree that is being changed. https://en.wikipedia.org/wiki/File:Spline01.gif

Sorry for the incorrect mathematical terminology!


splines.gif

Offline Jean Giraud  
#5 Posted : 11 October 2017 19:51:20(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
All those things are most confusing. I couldn't download the animated GIF
from the Wikipedia link ... Why ? Essentially, what you are after is a way
to pass a spline through a set of control points to any adjustable curvature.
In short: a way to reproduce what CAD system do under the hood.
The first answer is easy in Smath from Hermite polyline. I just have a simple
example. There is no limit but will take some time to construct a good demo.
This feature is most essential in robotics to allow the path be convex and
adjustable curvature. Will work on that.
... Cheers, Jean

Spline De Boor [Loop].sm (73kb) downloaded 19 time(s).
Spline De Casteljau SVG Companion.sm (101kb) downloaded 18 time(s).
Spline Hermite Polyline.sm (36kb) downloaded 21 time(s).
Spline Bezier_DeBoor.sm (41kb) downloaded 17 time(s).
Spline Bezier_Bernstein.sm (56kb) downloaded 19 time(s).
Offline veb  
#6 Posted : 11 October 2017 23:39:53(UTC)
veb


Rank: Advanced Member

Groups: Registered
Joined: 02/02/2016(UTC)
Posts: 35
Man
Russian Federation

Was thanked: 1 time(s) in 1 post(s)
I looked at the example of Hermite's polyline, the resulting spline is not similar to the spline obtained in the CAD system. I send the superimposed spline of the CAD system to the graph of the Hermite polyline.

2.png

Bézier Cubic 4 cntrl points looks more like the desired spline.
Spline used in CAD systems non-uniform rational B-spline (NURBS).
I spread an animated gif from Wikipedia, it will explain very well how the spline is drawn in the CAD system and how it is edited.

Spline01.gif
Offline Jean Giraud  
#7 Posted : 12 October 2017 04:46:14(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: veb Go to Quoted Post
I looked at the example of Hermite's polyline, the resulting spline is not similar to the spline obtained in the CAD system. I send the superimposed spline of the CAD system to the graph of the Hermite polyline.
.

The CAD example [image] is probably Bézier parametric.
They just perform differently, especially if the end
points aren't duplicated. In other applications,
Hermite has much better smoothing properties than
DeBoor, Bézier .

Spline Hermite Polyline.sm (40kb) downloaded 25 time(s).

Offline veb  
#8 Posted : 12 October 2017 09:28:04(UTC)
veb


Rank: Advanced Member

Groups: Registered
Joined: 02/02/2016(UTC)
Posts: 35
Man
Russian Federation

Was thanked: 1 time(s) in 1 post(s)
We can not choose any other type of spline. Between the CAD systems should be a single approach to the construction and display of the spline. We are limited to the dxf specification:
https://www.autodesk.com...00/dxf/spline_dxf_06.htm

Here is another link to the presentation of splines. as I understand, the 38.40 page shows the NURBS spline and the text says about the meaning of roots and degree
https://www.cs.drexel.ed.../L-09_BSplines_NURBS.pdf
Offline Jean Giraud  
#9 Posted : 12 October 2017 20:43:44(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: veb Go to Quoted Post
We can not choose any other type of spline. Between the CAD systems should be a single approach to the construction and display of the spline. We are limited to the dxf specification:


If you can't choose splines that work for Engineers, what's the point of the exercise.
When AutoDesk formed [~ 1985], it is just after meeting Pierre Bézier, which was sponsored by
Sergei Natanovich Bernstein: 1880 .. 1968
Alma Mater: Université de Paris

I believe AutoCad is based on Bernstein.

I will have more for you on that.

Cheers, Jean
Offline Jean Giraud  
#10 Posted : 12 October 2017 21:03:28(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
Originally Posted by: Jean Giraud Go to Quoted Post
I will have more for you on that.


The UFO that was done for Russian Friends [mid 2000]

Spline Bernstein OVNI.sm (22kb) downloaded 25 time(s).


Offline Jean Giraud  
#11 Posted : 13 October 2017 05:36:11(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
... please, revisit these 6 documents.
The Gaussian spline is very useful at times.
It was the main tool to help fit Carbon 12 α.
There is lot more past this 1rst step. Final gorgeous fit
that Matlab muffed so badly with their "Splinesmooth" !

Spline Esplina [AI2000].sm (22kb) downloaded 19 time(s).
Spline Esplina [DeBoor].sm (34kb) downloaded 20 time(s).
Spline Esplina [Hermite].sm (36kb) downloaded 18 time(s).
Spline Bernstein OVNI.sm (26kb) downloaded 24 time(s).
Spline Gaussian.sm (46kb) downloaded 22 time(s).
Spline Hermite Polyline.sm (55kb) downloaded 24 time(s).
Offline veb  
#12 Posted : 16 October 2017 00:38:32(UTC)
veb


Rank: Advanced Member

Groups: Registered
Joined: 02/02/2016(UTC)
Posts: 35
Man
Russian Federation

Was thanked: 1 time(s) in 1 post(s)
Hi!
Sorry that I did not answer for a long time, these days were very busy.

Originally Posted by: Jean Giraud Go to Quoted Post

If you can't choose splines that work for Engineers, what's the point of the exercise.


As part of our program, we can add many kinds of spline lines, but we need a spline that supports all the other KADs.

I studied the spline lines sent by you. below the picture. I also added the information that AutoCAD adds to the file for the correct display of the spline line description

black dashed line - this is because the points outside the spline line are located
pink - this is the spline line obtained by auto cadence

Hermite Parametric Polyline.pngGaussian.pngHermite Polyline to Esplina.pngOVNI-Bezier-Bernstein control points.pngDe Boor parametric.png
Offline Jean Giraud  
#13 Posted : 16 October 2017 13:39:16(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
... from what your system shows, I guess the spline is Bézier polyline.
This type of multipoint is executed from the DeCasteljau algorithm,
more numerically stable. We can't reproduce it scalar algo style Mathcad 8.
I may still have the Bézier polyline demo in what's left from Mathcad 11.
Will be back later on.

Cheers, Jean
Offline Jean Giraud  
#14 Posted : 16 October 2017 16:27:27(UTC)
Jean Giraud

Rank: Guest

Groups: Registered
Joined: 04/07/2015(UTC)
Posts: 6,868
Canada

Was thanked: 980 time(s) in 808 post(s)
... that confirms your CAD system is Bézier-DeCasteljau.

Polylines HermiteBezier.PNG

Spline Polyline Hermite_Bezier.sm (50kb) downloaded 25 time(s).
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.