Splines in the DXF

Splines in the DXF

Anonymous
Not applicable
2,894 Views
5 Replies
Message 1 of 6

Splines in the DXF

Anonymous
Not applicable

Hi,

 

I have two questions related to splines in the DXF file:

I am using uniform knots and spline fit definition

  1. SPLINE FLAG: according to this section from the DXF documentation the only available flags are 1, 2, 4, 8 or 16. But after generating a spline in the autocad, the flag was set to 1161. Which is nowhere near the documentation values. And ideas?
  2. If I choose 6 fit points, I see +2 control vertices and knot values in the DXF. How is their location determined? Which knot values correspond to these two control vertices?
0 Likes
Accepted solutions (1)
2,895 Views
5 Replies
Replies (5)
Message 2 of 6

devitg
Advisor
Advisor

It have to be as BITWISE , flag 31=16+8+4+2+1 , i do not know from where do it come such 1161 

0 Likes
Message 3 of 6

phanaem
Collaborator
Collaborator

This is what I found regarding 70 bit code


1 = Closed spline
2 = Periodic spline
4 = Rational spline
8 = Planar
16 = Linear (planar bit is also set)

32.... 256 - knot param.

32 = chord
64 = sqrt. chord
128 = uniform
256 = custom


512 =  CV frame visibility
1024 = if present, the spline is defined by fit points. Otherwise, by control vertices.

 

Message 4 of 6

_gile
Consultant
Consultant

1161 means 1024 + 128 + 8 + 1 (or, more accurately: 1024 | 128 | 8 | 1)

With LISP:

(logior 1024 128 8 1)

So, according to @phanaem provided: a closed, planar, uniform spline defined by fit points.

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 5 of 6

Anonymous
Not applicable

Ok, this explains first part of my question. Thank you both!

 

Now I need to figure out the second part.

0 Likes
Message 6 of 6

_gile
Consultant
Consultant
Accepted solution

You can display the control points by selectioning the spline and changing the "Method" property to "Control vertices" in the properties palette.

You'll see there's one control point per fit point plus two (just after the first one and just before the last one) which define the start and end tangents.

If you want to know how there're calculated, you can start here (good luck...).



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub