I tried playing with the VTOptions and it didnt seem to make a difference.
The code as it stands now only works under specific set of circumstances.
I have pasted the main loop which is really choppy.
Code:
(while (= LoopBreak nil)
(setq LoopBreak "T")
(foreach Trail TrailList
(setq i2 0
dist 0
Tdist 0
Visited (cons CurrentPoint Visited)
)
(if (> (length Trail) 1)
(repeat (- (length Trail) 1)
(setq i2 (+ i2 1)
dist (distance (nth (- i2 1) Trail) (nth i2 Trail))
TDist (+ TDist dist)
)
)
)
(setq LoopBreak (if (< TDist (+ MaxRadius (* Increment 20))) nil "T"))
(progn
(setq CurrentPoint (nth 0 Trail)
Frontier (vl-remove CurrentPoint Frontier)
i1 1
TrailList (if (member Trail TrailList) (vl-remove Trail TrailList) TrailList)
)
(repeat 8
(setq FrontierProposed
(cond ((= i1 8) (list (nth 0 CurrentPoint) (+ (nth 1 CurrentPoint) Increment) (nth 2 CurrentPoint)))
((= i1 7) (list (+ (nth 0 CurrentPoint) Increment) (nth 1 CurrentPoint) (nth 2 CurrentPoint)))
((= i1 6) (list (nth 0 CurrentPoint) (- (nth 1 CurrentPoint) Increment) (nth 2 CurrentPoint)))
((= i1 5) (list (- (nth 0 CurrentPoint) Increment) (nth 1 CurrentPoint) (nth 2 CurrentPoint)))
((= i1 4) (list (+ (nth 0 CurrentPoint) Increment) (+ (nth 1 CurrentPoint) Increment) (nth 2 CurrentPoint)))
((= i1 3) (list (+ (nth 0 CurrentPoint) Increment) (- (nth 1 CurrentPoint) Increment) (nth 2 CurrentPoint)))
((= i1 2) (list (- (nth 0 CurrentPoint) Increment) (- (nth 1 CurrentPoint) Increment) (nth 2 CurrentPoint)))
((= i1 1) (list (- (nth 0 CurrentPoint) Increment) (+ (nth 1 CurrentPoint) Increment) (nth 2 CurrentPoint)))
)
tempfrontier frontier
Frontier (if (and (= nil (member FrontierProposed Visited)) (= nil (member FrontierProposed Frontier)))
(if (ClashDetection CurrentPoint FrontierProposed)
Frontier
(cons FrontierProposed Frontier)
)
Frontier
)
TrailList (if (and (= nil (member FrontierProposed Visited)) (= nil (member FrontierProposed tempFrontier)))
(if (ClashDetection CurrentPoint FrontierProposed)
TrailList
(cons (cons FrontierProposed Trail) TrailList)
)
TrailList
)
HosePaths (if (and (> Tdist IntRadius) (< Tdist ExtRadius))
(if (and (= nil (member FrontierProposed Visited)) (= nil (member FrontierProposed tempFrontier)))
(if (ClashDetection CurrentPoint FrontierProposed)
HosePaths
(cons (cons FrontierProposed Trail) HosePaths)
)
HosePaths
)
HosePaths
)
i1 (+ i1 1)
)
)
(if (< TDist IntRadius) (command "clayer" "InternalDots" "point" currentpoint) nil)
(if (and (> Tdist IntRadius) (< Tdist ExtRadius)) (command "clayer" "ExternalDots" "point" currentpoint))
(if (and (> TDist ExtRadius) (< TDist IntMaxRadius)) (command "clayer" "SprayDots" "point" currentpoint) nil)
(if (and (> Tdist IntMaxRadius) (< Tdist MaxRadius)) (command "clayer" "ExternalDots" "point" currentpoint))
)
)
)