Minor cleanups
This commit is contained in:
+5
-10
@@ -55,16 +55,12 @@ upperPrismPoly
|
||||
-> [Point2]
|
||||
-> Shape
|
||||
{-# INLINE upperPrismPoly #-}
|
||||
upperPrismPoly h ps = [ShapeObj (TopPrism n) (f upps downps)]
|
||||
upperPrismPoly h ps = [ShapeObj (TopPrism n) (f ps)]
|
||||
where
|
||||
n = length ps
|
||||
upps = map f' ps
|
||||
downps = map f'' ps
|
||||
f (a:as) (b:bs) = a:b:f as bs
|
||||
f [] _ = []
|
||||
f _ [] = []
|
||||
f' (V2 x y) = pairToSV (V3 x y h, black)
|
||||
f'' (V2 x y) = pairToSV (V3 x y 0, black)
|
||||
g h' (V2 x y) = pairToSV (V3 x y h', black)
|
||||
f (x:xs) = g h x : g 0 x : f xs
|
||||
f _ = []
|
||||
|
||||
upperPrismPolyHalf
|
||||
:: Float -- ^ height, expected to be strictly positive
|
||||
@@ -77,8 +73,7 @@ upperPrismPolyHalf h ps = [ShapeObj (TopPrism n) (f upps downps)]
|
||||
upps = map f' ps
|
||||
downps = map f'' ps
|
||||
f (a:as) (b:bs) = a:b:f as bs
|
||||
f [] _ = []
|
||||
f _ [] = []
|
||||
f _ _ = []
|
||||
f' (V2 x y) = pairToSV (V3 (0.5 * x) (0.5 * y) h, black)
|
||||
f'' (V2 x y) = pairToSV (V3 x y 0, black)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user