Jump to content

Smooth Out Spline

Bill Tillman

Recommended Posts

I prepared a spline which fits the pattern I need almost perfectly. It contains 10 points and I use these to form a spline. When I'm working with it in 2D all is well. But I use this spline to create an extruded shape, and I've tried it several different way, but it looks well until I set SHA to Realistic. Then those smooth curves appear as very segmented straight sections. Total looses all it's eye appeal.


So I'm looking for advice on how I can maybe add vertices, etc... to keep this thing smoother looking in 3D views?

Arch Spline.dwg

Edited by Bill Tillman
Link to comment
Share on other sites

Maybe something like this its a re-interpretation of the existing spline. Make it into a new spline. Its just adding facets maybe more than 50.


(defun AHpllst ( lst / x)
(command "_pline")
(while (= (getvar "cmdactive") 1 )
(repeat (setq x (length lst))
(command (nth (setq x (- x 1)) lst))
(command "")
(setvar 'osmode 0)
(setq obj (vlax-ename->vla-object (car  (entsel "Pick obj"))))
(setq len (/ (vlax-curve-getDistAtPoint Obj (vlax-curve-getEndPoint Obj)) 50.0))
(setq d 0.0 lst '())
(repeat 49
(setq lst (cons (vlax-curve-getpointatdist obj d) lst))
(setq d (+ d len))

(AHpllst  lst)


Edited by BIGAL
Link to comment
Share on other sites

In general, the fewer points (Fit or Control Vertices) that are used to define a spline the more smooth the resulting spline.  So I would recommend using less points not more.

Here's your spline extruded by 200 in the Realistic visual style.  It looks pretty smooth to me. Facetres = 0.5 for this image.



Note that the tessellation used to display the surface looks like this with facetres = 0.5


Changing facetres = 0.1 yields:


While a value of 5 yields:



So your problem may be due to a small value for facet res.


It is worth examining the CVs used to define the spline.  In the image below the green curve is your original spline with 15 CVs while the magenta one is a copy of the spline with several CVs deleted by using splinedit resulting in just 8 CVs.  Some of the remaining CVs have been move to best approximate the original curve but without the undesired undulations.



Keep in mind that the second and next to the last CV control both the slope and the radius of curvature at the ends of the spline. With this in mind excessive CVs near the spline ends can be deleted.   I deleted a couple of the mid-span CVs as they appeared to be influencing a reversal of curvature.






Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...