|
Action:
|
Controls whether sorting of solutions proceeds on convexity and then distance or on distance and then on convexity.
|
|
|
Name String:
|
lop_sort_on_convexity
|
|
|
Scheme:
|
boolean
|
#f, #t
|
#t
|
|
|
Test Harness:
|
integer
|
0, 1
|
1
|
|
|
C++:
|
logical
|
FALSE, TRUE
|
TRUE
|
|
|
Description:
|
When there are multiple solutions for an edge during a local operation, the tweak algorithm's default behavior is to first try to match the new edge convexity as closely as possible with the old edge convexity. If there are still multiple solutions after this initial pruning, the algorithm chooses the edge solution that is closest to the original as measured with a Euclidean distance at three points along the original and new edges.
|
|
|
This option allows the user to modify this default behavior. Because the tweak algorithm is the basis for every local operation (and shelling), this option modifies the behavior of all the local operations, not just tweak.
|
|
|
If this option is on (true), sorting is first done on convexity, and then on distance. If the option is off (false), sorting is done on distance first and then on convexity.
|
|
|
Example:
|
; lop_sort_on_convexity
|
|
; The following example shows tweak picking a nearer
|
|
; but concave solution over a convex solution for an
|
|
; edge. (The option is off.)
|
|
(define cylinder (solid:cylinder (position 0 0 -10)
|
|
|
(position 0 0 10) 10))
|
|
;; cylinder
|
|
(define block (solid:block (position -20 -20 -10)
|
|
|
(position 10 0 10)))
|
|
;; block
|
|
(bool:unite block cylinder)
|
|
;; #[entity 6 1]
|
|
(define f (pick:face (ray (position 0 -15 0)
|
|
|
(gvector 1 0 0))))
|
|
;; f
|
|
(entity:set-highlight f #t)
|
|
;; #[entity 7 1]
|
|
|
(define block1 (solid:block (position 9.8 -22 -11)
|
|
|
(position 10.2 15 11)))
|
|
;; block1
|
|
(entity:transform block1 (transform:rotation
|
|
|
(position 10 -2 0) (gvector 0 0 1) 45))
|
|
;; #[entity 8 1]
|
|
(entity:fix-transform block1)
|
|
;; #[entity 8 1]
|
|
(define t (car (pick:face (ray (position 12 -10 0)
|
|
|
(gvector 0 1 0)))))
|
|
;; t
|
|
(entity:set-highlight t #t)
|
|
;; #[entity 9 1]
|
|
|
; Make sure the option is off
|
|
(option:set "lop_sort_on_convexity" #f)
|
|
;; #t
|
|
(lop:tweak-faces f t #f)
|
|
;; #[entity 6 1]
|
|
(entity:delete block1)
|
|
;; ()
|
|
|
|
|
|
Figure 4-6. lop_sort_on_convexity off
|
|
|
; example 2: option on
|
|
; RESTART SCHEME AIDE AND REDO EXAMPLE WITH OPTION ON
|
|
; This example shows tweak picking a farther
|
|
; but convex solution.
|
|
(define cylinder (solid:cylinder (position 0 0 -10)
|
|
|
(position 0 0 10) 10))
|
|
;; cylinder
|
|
(define block (solid:block (position -20 -20 -10)
|
|
|
(position 10 0 10)))
|
|
;; block
|
|
(bool:unite block cylinder)
|
|
;; #[entity 3 1]
|
|
(define f (pick:face (ray (position 0 -15 0)
|
|
|
(gvector 1 0 0))))
|
|
;; f
|
|
(entity:set-highlight f #t)
|
|
;; #[entity 4 1]
|
|
|
(define block1 (solid:block (position 9.8 -22 -11)
|
|
|
(position 10.2 15 11)))
|
|
;; block1
|
|
(entity:transform block1 (transform:rotation
|
|
|
(position 10 -2 0) (gvector 0 0 1) 45))
|
|
;; #[entity 5 1]
|
|
(entity:fix-transform block1)
|
|
;; #[entity 5 1]
|
|
(define t (car (pick:face (ray (position 12 -10 0)
|
|
|
(gvector 0 1 0)))))
|
|
;; t
|
|
(entity:set-highlight t #t)
|
|
;; #[entity 6 1]
|
|
|
; Make sure the option is on
|
|
(option:set "lop_sort_on_convexity" #t)
|
|
;; #t
|
|
(lop:tweak-faces f t #f)
|
|
;; #[entity 3 1]
|
|
(entity:delete block1)
|
|
;; ()
|
|
|
|
|
|
Figure 4-7. lop_sort_on_convexity on
|