Author Topic: "mathematical / geometrical meaning of the dxf code 40 on the spline?  (Read 12984 times)

0 Members and 1 Guest are viewing this topic.

SOFITO_SOFT

  • Guest
I can not get to know how it works. :| Any help is welcome.  :-)
Greetings. 

SEANT

  • Bull Frog
  • Posts: 345
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #1 on: February 19, 2011, 09:20:32 AM »
Here are a couple of good resources to investigate how knots play a role in a NURB curve (spline) definition.

http://www.rhino3d.com/4/help/Information/NURBS_About.htm

http://www.cs.mtu.edu/~shene/COURSES/cs3621/NOTES/

It does take some commitment to get a grip (some want to change the acronym to “Nobody Understands Rational B spline”  :?) but it is well worth the effort if splines are part of the standard workflow.
Sean Tessier
AutoCAD 2016 Mechanical

SOFITO_SOFT

  • Guest
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #2 on: February 19, 2011, 02:22:18 PM »
Here are a couple of good resources to investigate how knots play a role in a NURB curve (spline) definition.
 
Thanks. Greetings.   :-)

SEANT

  • Bull Frog
  • Posts: 345
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #3 on: February 20, 2011, 06:33:48 AM »
I’ve got some time so I thought I try my hand at paraphrasing the information in those two links. 

A Spline curve forms a continuous interpolation between the control points(CP).  So, any point on a curve is the result of processing several nearby CPs.  The two notable exceptions are the Start- and EndPoint. 

Due to the condition that several CPs influence any particualr point on the curve, the mathematical processing requires a method of ‘weighting’ each CP along the entire span (parametic range).    The knots divide the full range, and help define when and how much each CP is contributing. 

If we consider a degree 3 spline with 7 CPs, and a knot sequence 0 0 0 1 2 3 4 4 4 we can see that the knots match the technical condition where the quantity =  Degree + N – 1 ( 9 = 3 + 7 – 1).  I should point out that AutoCAD uses the alternate algorithm that uses Degree + N +1.   I’m using this example because it matches the information contained within the links.

Even though there are 9 knots, there are only 4 specific intervals (0-1, 1-2, 2-3, 3-4).  Typically, 4 CPs are involved through any interval evaluation, and that evaluation continually modifies how much each CP contributes to the position of a point on the curve.  Where an interval is bordered by high multiplicity sequence, 0 0 0 and 4 4 4 for instance,  the position uses that associated CP more time in the calculations.  This way the Start- and EndPoint contribute 100% at that point in the interval.

Given that the whole purpose for a Spline is as a continuous interpolation scheme, finding evidence of when and where a knot comes into play is tough.  Degree 3 splines are G2 continuous throughout the entire span – which is to say there is no point where the curvature changes abruptly.  The rate of change of the curvature, however, does change abruptly at the change from one knot interval to the next.

The attached picture is a curve analysis diagram from rhino.  The attached DXF is that same spline.   
Sean Tessier
AutoCAD 2016 Mechanical

SOFITO_SOFT

  • Guest
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #4 on: February 20, 2011, 12:08:44 PM »
Hi all:
All this is more or less important for what I do. The most important thing now for me is to know the meaning of the code dxf 40. The other codes I have them  decipherment and I can safely handle the data provided to the geometry of the spline. I find no correlation between the dxf codes 40 of the entity and change its geometry. In case you used to something: I am trying to apply a homography to a spline. Acad other entities (line, point, arc, circle, etc) are controlled (including ray ), but the spline is reluctant to twist as I need.  :-(


White is 2 frames homografy, center-lines is the vertex correspondences, magenta and blue is examples of splines entyties....
The quadratic ( magenta ) fit, but the cube is a rebel ...   :pissed:
Thanks for your time and interest. :-)
Greetings from Madrid.:)

SEANT

  • Bull Frog
  • Posts: 345
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #5 on: February 20, 2011, 02:04:08 PM »
I don’t think Knots are related directly to this problem, though I can see that they will be required when the time comes to recreate the spline.

Generally, this type of transformation can reconstruct the curve correctly with the proper repositioning of the Control Vertices.  Something does seem to be wrong with any control point outside the prescribed box.  When I kept the CVs within the box the transformation worked pretty well.  See attached.
Sean Tessier
AutoCAD 2016 Mechanical

SOFITO_SOFT

  • Guest
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #6 on: February 20, 2011, 03:59:35 PM »
Hello everyone:
That sounds perfect. I'll review code. I'm going to generate the spline with entmake ... making homography of control vertices and spline points. You do that too?
Greetings.

SEANT

  • Bull Frog
  • Posts: 345
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #7 on: February 21, 2011, 01:41:57 AM »
I have had to wrangle with CVs before.  I haven’t, though, worked with homographic projection.  It looks interesting, and I’ll probably look into your routine some more.

Based on the comments between you and ElpanovEvgeniy it sounds like you will soon be dealing with this situation.  The process is manageable with NURB curves, but a circle requires CVs with different weights (Rational Curve), and those weights would require adjustment to maintain fidelity.  Actually, I believe the same is true with non-rational splines such as my earlier example.  If you noticed, there wasn't a perfect match.  I’m still trying to figure out what the modification needs to be.

I suppose an ellipse could recreate the circle.  How the axis and ratios are modified would be the trick.  I’ll be interested to see how you guys deal with that.
« Last Edit: February 21, 2011, 02:05:24 AM by SEANT »
Sean Tessier
AutoCAD 2016 Mechanical

SOFITO_SOFT

  • Guest
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #8 on: February 21, 2011, 05:22:25 AM »
I have had to wrangle with CVs before.  I haven’t, though, worked with homographic projection.  It looks interesting, and I’ll probably look into your routine some more.

Based on the comments between you and ElpanovEvgeniy it sounds like you will soon be dealing with this situation.  The process is manageable with NURB curves, but a circle requires CVs with different weights (Rational Curve), and those weights would require adjustment to maintain fidelity.  Actually, I believe the same is true with non-rational splines such as my earlier example. 

If you noticed, there wasn't a perfect match. <<<< accurate, small deviations.... 
I’m still trying to figure out what the modification needs to be.

I suppose an ellipse could recreate the circle.  How the axis and ratios are modified would be the trick.  I’ll be interested to see how you guys deal with that.

I use homograf_2.lsp, down from thread
"Unperspective? (in Autocad) May Be of Interest? 2 Test in b / w &"
This is becoming too complicated for me. I have a very good solution: discretize "difficult entities" in many contiguous points. The look is fantastic, but before I have an ellipse and then I have a polyline.  :-(
I think this theme park to focus more on the process of tiling. I see that this will be more practical. I do not pretend to solve mathematical problems too complicated (I have no good mathematical knowledge base). The tessellation itself would solve practical problems.
Thanks for your interest and greetings from Madrid. :-)

SEANT

  • Bull Frog
  • Posts: 345
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #9 on: February 21, 2011, 05:42:34 AM »
I know what you mean.  The application for these types of routines may not require absolute precision.  The process is very interesting none the less.

Greetings from Rhode Island.
Sean Tessier
AutoCAD 2016 Mechanical

SOFITO_SOFT

  • Guest
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #10 on: February 21, 2011, 08:17:29 AM »
I know what you mean. <<< thanks, my english is very poor.
 The application for these types of routines may not require absolute precision.  <<happily
The process is very interesting none the less.

Greetings from Rhode Island.

A question only as a hypothesis:
in view of the drawing,


you see feasible to attempt a 3D homography, or at least a substitute for it.
The computational cost will ernorme, it is necessary to calculate the transformation matrix of each plane (green) of each point (magenta). I think however that it is feasible.    :|
You know a transformation matrix, displacement, rotation, scale, stretch, allowing to do that quickly? :lol:

I have found this method in Spanish (attached), but I see very poor as it is based on 5 points. The method of my picture is complicated because the 2 planes (white) must be parallel to calculate the intermediate auxiliary plane (green) ...Or... find the plane "bisector"of the white planes passing through the origin point of the magenta lines ... more computational cost. :-(
I would like to know your opinion. :-)
Thanks very much.  :wink:
Greetings. :-)

SEANT

  • Bull Frog
  • Posts: 345
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #11 on: February 21, 2011, 08:53:11 AM »
I think it is feasible, though I don’t know of any quick transformation method.  I imagine mapping a transformation through a specific interval should be fairly straightforward, especially with a uniform rotation/Z relationship.  Like you say, it would get more complex with increased distortion.

But, even though feasible, would it be practical?  Perhaps:  It's tough to predict all the possible applications. 

I have to admit most of the stuff I get involved with has limited practicality, and I certainly understand a desire to code something for no reason other than it is interesting.  I did something similar here:

http://www.theswamp.org/index.php?topic=29329

Keep us posted on your progress.
« Last Edit: February 25, 2011, 03:40:44 AM by SEANT »
Sean Tessier
AutoCAD 2016 Mechanical

SOFITO_SOFT

  • Guest
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #12 on: February 21, 2011, 09:27:36 AM »
Hi all.
demo spectacular painting on 3D objects. BRAVO!!!.
But, even though feasible, would it be practical?  Perhaps:  It tough to predict all the possible applications.  <<<< That is a truth like a castle, savvy users are able to use something for the creator never intended. :lol:

I think in this anecdote of anthropologist searching for the source, the casus of Paleolithic cave paintings, traveled to Australia where some natives still painted on the cliffs on the occasion of some ancient festivals.
The native told the anthropologist: "If you paint something well, you've taken half of his soul." These programs really help to understand the "soul " of the objects manipulated, I think.
Although the native I wanted to say that painting "medium hunting" the animal painted ...The hunting provides many proteins ... but little mystique. :-)
Greetings.


SEANT

  • Bull Frog
  • Posts: 345
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #13 on: February 21, 2011, 09:43:44 AM »
The native told the anthropologist: "If you paint something well, you've taken half of his soul." These programs really help to understand the "soul " of the objects manipulated, I think.
Although the native I wanted to say that painting "medium hunting" the animal painted ...The hunting provides many proteins ... but little mystique. :-)
Greetings.

I like that. That is a very eloquent statement, and poetic sentiment.  Apparently the talent extends well beyond just Autolisp.
Sean Tessier
AutoCAD 2016 Mechanical

SOFITO_SOFT

  • Guest
Re: "mathematical / geometrical meaning of the dxf code 40 on the spline?
« Reply #14 on: February 21, 2011, 10:21:41 AM »
Hi all:
The biggest talent is just a little common sense. :-)
Indeed, the anecdote is true, so at least I've read.
Greetings. :-)