Add various helpers for creating polyhedra

This commit is contained in:
2021-06-27 18:53:06 +02:00
parent 06f22a3ea5
commit 089dcc3f5d
14 changed files with 155 additions and 65 deletions
+10 -3
View File
@@ -1,3 +1,4 @@
{-# LANGUAGE TupleSections #-}
module Dodge.Room.Foreground
where
import Dodge.Picture
@@ -5,6 +6,8 @@ import Dodge.Base
import Picture
import Geometry
import Geometry.Data
import Geometry.Vector3D
import Polyhedra
import Data.List
import Data.Maybe
@@ -45,13 +48,17 @@ diagonalLinesRect pa pb w d ang = zip lhsPoints $ map findDiPoint lhsPoints
yN = d * 0.5 *.* normalizeV (pa -.- pb)
highPipe :: Point2 -> Point2 -> Picture
highPipe x y = pictures
[setDepth 100 $ thickLine [x,y] 10
,setDepth 90 $ color orange $ thickLine [x,y] 10
highPipe x@(xx,xy) y = pictures
--[color orange . pictures . map (poly3D . map ( ( , black) . ( +.+.+ (x,y,50)))) $ boxXYZ
[ color orange . pictures . map (poly3D . map ( (,black) . (+.+.+ (xx,xy,50))))
$ boxABC (a,b,0) (a',b',0) (0,0,10)
,verticalPipe 5 orange x 0 100
,verticalPipe 5 orange y 0 100
,verticalPipe 5 orange (0.5 *.* (x +.+ y)) 50 100
]
where
(a,b) = y -.- x
(a',b') = 10 *.* (normalizeV $ vNormal (a,b))
girderZ :: Float -> Point2 -> Point2 -> Picture
girderZ w x y = setDepth 50 $ color red $ pictures $