I had simple code for making 3dfaces between all points each point with each... If I use afterwards command region and command surfsculpt, I get desired result, but this method is too slow...
(defun c:ptscloud
-3dfaces
( / ss n pt ptlst
) )
)
)
)
)
(defun c:pts
-3df
nil (c:ptscloud
-3dfaces
))
(prompt "\nShortcut for c:ptscloud-3dfaces is c:pts-3df [Start with : Command: pts-3df]")
So I decided to try to make just outer 3dfaces, but I am getting error on this code :
(defun Clockwise
-p
( p1 p2 p3
) )
(defun pt
-cir
-3df
( p1 ptlst
) (setq cl
(Clockwise
-p p1 p2 p3
)) )
(defun p33
( p3lst clock
/ p32
) (if (eq (Clockwise
-p p1 p2 p32
) clock
) )
)
(defun pt
-cir
-3dfs
( p1 ptlst clock
) (if (not (eq (Clockwise
-p p1 p2 p3
) clock
)) (p33
(cdr p3lst
) clock
)) (if clock
(if (>= (abs (- an4 an3
)) an4
) (setq p2 p3 p3 pst
)) (if (<= (abs (- an4 an3
)) an4
) (setq p2 p3 p3 pst
)) ) )
(defun c:ptscloud
-sphere
-3dfaces
( / ss n pt ptlst
) )
(pt-cir-3df pt1 ptlst)
)
)
(defun c:pts
-sph
-3df
nil (c:ptscloud
-sphere
-3dfaces
))
(prompt "\nShortcut for c:ptscloud-sphere-3dfaces is c:pts-sph-3df [Start with : Command: pts-sph-3df]")
Error has to do something with recursion of p33 subfunction (stack limit reached)... So if you know how to solve this - perhaps I need completely new routine, I hope this will be your new challenge...
Attached dwg with random sphere points - 100 of them - I think it's enough, but I suggest that you don't try firstly described method for it's very hardware demanding...
Thanks, M.R.
EDIT : Last code little changed, but still no success... At least I solved recursion, now I get error :
; error: bad argument type: 2D/3D point: nil