SMath Studio Forum
»
SMath Studio
»
Questions
»
Jean Giraud!!! Help with the spline line
Rank: Advanced Member Groups: Registered
Joined: 02/02/2016(UTC) Posts: 35 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).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 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
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 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.
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/02/2016(UTC) Posts: 35 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.gifSorry for the incorrect mathematical terminology!
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 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).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/02/2016(UTC) Posts: 35 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. 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.
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: veb 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).
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/02/2016(UTC) Posts: 35 Was thanked: 1 time(s) in 1 post(s)
|
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: veb 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
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
Originally Posted by: Jean Giraud 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).
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 02/02/2016(UTC) Posts: 35 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 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
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 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
|
|
|
|
Rank: Guest
Groups: Registered
Joined: 04/07/2015(UTC) Posts: 6,866 Was thanked: 981 time(s) in 809 post(s)
|
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Jean Giraud!!! Help with the spline line
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.