Remove unnecessary use of `remove-duplicates'
This commit is contained in:
parent
87cfce97f9
commit
c1550b673b
|
@ -499,8 +499,7 @@
|
|||
(cond
|
||||
[(empty? ps) #f]
|
||||
[else
|
||||
(define vs (remove-duplicates (bsp-polys->vertices ps)))
|
||||
(define axes (vertices->axes vs))
|
||||
(define axes (vertices->axes (bsp-polys->vertices ps)))
|
||||
(define center (list->flvector (map axis-mid axes)))
|
||||
|
||||
;; Planes defined by neighboring polygon vertices
|
||||
|
@ -530,8 +529,7 @@
|
|||
(cond
|
||||
[(empty? ls) #f]
|
||||
[else
|
||||
(define vs (remove-duplicates (bsp-lines->vertices ls)))
|
||||
(define axes (vertices->axes vs))
|
||||
(define axes (vertices->axes (bsp-lines->vertices ls)))
|
||||
(define center (list->flvector (map axis-mid axes)))
|
||||
|
||||
;; Planes defined by line segments and basis vectors (i.e. one basis in normal is zero)
|
||||
|
@ -560,9 +558,8 @@
|
|||
(cond
|
||||
[(and (empty? ls) (empty? ps)) #f]
|
||||
[else
|
||||
(define vs (remove-duplicates (append (append* (map lines-vertices ls))
|
||||
(define axes (vertices->axes (append (append* (map lines-vertices ls))
|
||||
(append* (map points-vertices ps)))))
|
||||
(define axes (vertices->axes vs))
|
||||
(define center (list->flvector (map axis-mid axes)))
|
||||
|
||||
(: try-nondisjoint-split (-> (U #f BSP-Tree)))
|
||||
|
|
|
@ -1,23 +1,5 @@
|
|||
#lang racket
|
||||
|
||||
#|
|
||||
TODO
|
||||
|
||||
BSP
|
||||
- deal better with polygon + many non-polygon shapes
|
||||
- avoid more recomputation in build-bsp3d (i.e. precompute bounding and central planes)
|
||||
- make middle shapes in bsp-node a BSP-Tree
|
||||
- speed up disjoint splitting
|
||||
|
||||
insert line segments into BSP as polygonal clipping regions?
|
||||
|
||||
slow parts
|
||||
- 22.3: build-bsp-tree
|
||||
- 15.6: contour renderer proc
|
||||
- 12.7: clip-polygon
|
||||
- 6.0: bin-shapes
|
||||
|#
|
||||
|
||||
(require plot
|
||||
(except-in plot/utils sum flsum sample)
|
||||
math
|
||||
|
@ -95,6 +77,7 @@ slow parts
|
|||
(points3d xyzs #:sym 'dot)))))
|
||||
|
||||
(time
|
||||
(for/last ([_ (in-range 1)])
|
||||
(plot3d
|
||||
(list (contour-intervals3d
|
||||
(λ (x y)
|
||||
|
@ -129,7 +112,7 @@ slow parts
|
|||
#:x-min -1 #:x-max 1
|
||||
#:y-min -1 #:y-max 1
|
||||
;#:out-file "test.pdf"
|
||||
))
|
||||
)))
|
||||
|
||||
(plot3d (list (surface3d * -1 1 -1 1 #:samples 6 #:alpha 0.75 #:color 1)
|
||||
(surface3d (λ (x y) (+ 0.1 (* x y))) -1 1 -1 1 #:samples 6 #:alpha 0.75 #:color 2)
|
||||
|
@ -140,7 +123,7 @@ slow parts
|
|||
(plot3d (list
|
||||
(isosurface3d (λ (x y z) (+ (- 1 x) (- 1 y) (- z 1.5))) 0
|
||||
#:alpha 0.85 #:color 2 #:line-color 2
|
||||
#:samples 2)
|
||||
#:samples 4)
|
||||
(discrete-histogram3d (list (vector 'a 'a 1)
|
||||
(vector 'a 'b 2)
|
||||
(vector 'b 'b 3))
|
||||
|
|
Loading…
Reference in New Issue
Block a user