tube.lsp - Extrude Profiles along Paths in Autocad
Download tube.lsp version 1.2.
What is tube.lsp?
-
Tube.lsp is an autocad extension to extrude profiles along
3D-polylines, standard polylines and lightweight polylines.
It can spline fit the path to any polynomal degree (though
I can't recommend more than 3) and extrude along the fitted path.
As a side effect it can also produce the
spline fit version of any polyline without extruding a profile.
The advantage of spline fitting "manually" over fitting the
path with the "pedit" command in the first place is in the possibility to
control the number of segments created, and to use a spline factor other
than those offered by autocad.
-
The result is a 3D-Polgon mesh, which is closed or open in N direction
depending on the state of the selected profile polyline. The M direction
is open or closed depending on the state of the path polyline.
-
If several segments of the resulting curve that follow a straight
line, the intermediate points are removed.
-
Tube.lsp offers the option to "ignore" the z directional
bend when computing the new profile at each vertex relative to the
current ucs. This avoids the
twist of the resulting tube observed when extruding along a helical or
other 3D path.
Care has to be taken about what kind of profile and path to select
with this option.
Use this eg. when creating handrails for spiral stairs etc.
As a sidenote: The "extrude" command of the acis solid modeller in
autocad will also twist helical profiles as of release 14.0.
-
The standard omnidirectional option is completely independent of the
current ucs settings. Use it in any coordinate system you like!
Installation
-
Copy the application file "tube.lsp" to a location on
your systems hard disk that autocad searches from its "acadprefix"
system variable
The autocad system variable "acadprefix" is automatically set
from the "ACAD" environment variable on startup. Please refer
to your systems user manual of your specific operating system platform
to find out about how to set environment variables.
With autocad R14, the search paths are set up in the configuration
dialog.
-
Type (load "tube")at the autocad "Command:"
prompt to load the application.
You can also put this statement into your "acad.lsp" file to
load tube.lsp automatically at startup, or you can put the line
(autoload "tube" '("tube" "fitpoly"))into the
file "acadr12.lsp" if you are running autocad R12, or "acadr13.lsp"
if you are running R13 (can you guess the file name for R14?).
This will load tube.lsp automatically the first time one of its commands
is entered the first time in a drawing session.
-
With autocad releases that support it, you can also load tube.lsp in
the "appload" dialog.
Usage
Tube.lsp defines three commands:
- FITPOLY
- This command is used to create a new polyline on the current layer,
which represents the spline fit version of the selected existing
polyline.
Command: Fitpoly
select polyline: <select a polyline>
number of segments: <enter an integer>
After a certain delay the curve will be drawn.
- TUBE
- This command will create a mesh, representing the volume for
extruding the profile selected along the path selected.
Command: tube
select Polyline as profile: <select a polyline>
select Polyline as path: <select another polyline>
Fit path-curve Yes/<No>:
If you enter "No" (or just <Return>) then the tube will
be drawn immediately.
If you enter "Yes", the fitpoly prompts follow:
select polyline: <select a polyline>
number of segments: <enter an integer>
After a certain delay the spline fitted tube will be drawn.
- ZTUBE
- This is identical to TUBE in handling,
but provides results that are special in relation to the Z
direction of the current UCS.
When determining the new profile for each segment,
ZTUBE will ignore any bend in Z direction.
This avoids a problem with the normal TUBE eg.
when creating helical shapes like spiral stair handrails.
Those would normally be twisted around their own axis,
as the helical path results in oblique bending angles in space.
With ZTUBE, the absolute cross section of each segment
may vary depending on the vertical angle of the segment.
ZTUBE works best when using a planar profile
parallel to current ucs Z direction.
The ending section will be in a vertical plane also,
which allows easier chaining of seperately created tubes.
Limitations and bugs
-
Only Polylines can be selected as profile or path.
-
There is no collision detection. If your path is bent in narrow curves
relative to the size of the profile, then the extrusion volume may
intersect itself.
-
Spline fitting in lisp is very slow. If you have a long path curve,
or use spline factors higher than 5, the process may take minutes or even
hours to finish, depending on the horsepower of your computer.
tube.lsp will write dots to the command line to indicate
progression of spline fitting.
-
There is almost no sanity check on input values. You are free to set
the polynomal degree of the spline curve to 147 or more (and to never see
the result) or to set the number of segments to one (resulting in a straight
line) etc. If you set the number of segments to more than 255, the
3dmesh command will bark, and tube.lsp will stop in an
undefined state (command still active).
-
The spline fitting does not wrap around the endpoints of closed polylines.
Though the resulting mesh will be closed in N direction, The curve shape
will look as if the curve was open. This can also be a problem with open
curves, where both ends straighten out, which may not be
the desired effect.
Workaround: Create your original path in such a way that the density
of vertexes increases shortly before each end. This can be done by inserting
another vertex halfways between the first and second (resp. last and
second last) vertex, and then repeating this step once or maybe twice
with the resulting path. Of course, inserting those additional vertexes on
the straight connection line between the original vertexes will not help.
-
Curves of polynominal degree 2 with more than 49 segments had their
last point at the origin of the current ucs. I haven't seen this behaviour
with R14 anymore, so maybe I fixed it without noticing.
-
Extrusions may look different than expected if the profile polyline is not
planar and not perpendicular to the first path segment
with the standard TUBE option.
-
Extrusions may look different than expected if the profile polyline is
not planar and not in a plane parallel to the current ucs z direction
with the ZTUBE option.
-
Extrusions may look different than expected if the path polyline
has segments of different z angles relative to the current ucs, or
if it has vertical segments relative to the current ucs
with the ZTUBE option.
If you like, you can reduce your profile to a singe line this way.
"Support"
I expect
tube.lsp to be self explanatory for users who
have some experience with Autocad and who allready know what a
spline curve is.
If you still have questions that cannot be answered neither
through the manuals and FAQs to Autocad, nor by the local guru,
you might try to mail me through the link below.
Author
Georg Mischler
Legalese
tube.lsp 1.0, Copyright © 1993 Georg Mischler
tube.lsp 1.1/1.2, Copyright © 1998 Georg Mischler
Permission to use, copy, modify, and distribute this software
for any purpose and without fee is hereby granted, provided
that the above copyright notice appears in all copies and
that both that copyright notice and this permission notice
appear in all supporting documentation.
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.