Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Spline to Polyline

0 views
Skip to first unread message

alle...@my-deja.com

unread,
Feb 25, 2000, 3:00:00 AM2/25/00
to
I need to convert a Spline in AC2000/ADT to apolyine so I can convert it
to a wall ... anyone got a LISP that can convert it to interpolated
arcs?

Samir
714-843-6685


Sent via Deja.com http://www.deja.com/
Before you buy.

Vladimir Nesterovsky

unread,
Feb 27, 2000, 3:00:00 AM2/27/00
to
Yes, I have such lisp utilities, which will let you
convert splines into a series of tangential arcs polylines
having the specified precision (tolerance; deviation).

I wouldn't like provide them for free, though. :-(

The SAVEASR12 route will convert the splines
into a series of straight line segments, not arcs,
*and* you can't control the precision of the resulting
polyline nor the number of resulting vertices.
With the lisps I developed, you can.

Also, if there's anyone interested in clothoids (Euler spirals
used widely in road and railway design) I also have
routines to draw them as tangential arcs with controlled
precision. Softdesk has something similar, but my algorithm
is more precise and creates less arcs then theirs for the same
deviation. :) The softdesk's clothoids also have a bug where the
arcs aren't exactly tangential to one another (at least that's what I
saw in files we've got from contractors who'd used this software).
Of course now it's called land development desktop.

It's also possible to create other types of curves, like involutes etc.
In fact, just about any parametric curve that is "usual" in a sense
that it has some continuity in it, can be represented as tangential
arcs. It has an effect of a HUGE reduction in DWG file's size as it
reduces the number of vertices needed for a representation with
a given tolerance _dramatically_.

Vlad,
http://vnestr.tripod.com

<alle...@my-deja.com> wrote in message news:8971pp$e31$1...@nnrp1.deja.com...

js_...@my-deja.com

unread,
Feb 28, 2000, 3:00:00 AM2/28/00
to
Here's a routine for FREE. It works ok fine in R14. Try it in A2K.
It converts a spline to a splined 3d polyline. Although not a precise
duplicate, it usually makes a good enough replica.


;================
;SPLINE-PLINE converts splines to splined polylines
;John Snow, 1999

(defun c:spline-pline()
(command "undo" "m")

;get entities, initialize

(setq aa (ssget) n (sslength aa) i 0)

;for each entity in aa, test for spline

(repeat n
(setq spline_name (ssname aa i)
spline_entity (entget spline_name)
i (1+ i)
)

;if is spline, get vertex list, make pline, turn pline into spline

(if (= (cdr (assoc 0 spline_entity)) "SPLINE")
(progn
(splverts)
(setvar "CLAYER" (cdr (assoc 8 spline_entity)))
(command "3dpoly")
(foreach a vtx_list (command a))
(command "")
(command "pedit" "l" "s" "")
(entdel spline_name)
);progn
);if
);repeat
);defun spline-pline

;======================================

;SPLVERTS takes SPLINE and returns vertex list

(defun splverts()

;determine length of spline_entity list
(setq m (length spline_entity)
j 0
vtx_list nil
)

;for each member of spline_entity list
(repeat m
;get the member
(setq vtx (nth j spline_entity))
(cond ((= 10 (car vtx))
(progn
; (print vtx)
(setq vtx_list (cons (list (cadr vtx) (caddr vtx) (cadddr
vtx)) vtx_list))
)
);set x,y,z
);cond
(setq j (1+ j));increment counter
);repeat n
)


;====================================
(princ "\nType SPLINE-PLINE to convert splines to splined 3dpolylines")
(princ)

;======================

js_...@my-deja.com

unread,
Feb 28, 2000, 3:00:00 AM2/28/00
to
Oh, yeah. Try copying the splines and changing their color so that you
can compare the resulting polylines after conversion (only convert one
set of splines).
0 new messages