Unify config files, add capability to remember window position
This commit is contained in:
@@ -11,7 +11,6 @@ module Polyhedra
|
||||
)
|
||||
where
|
||||
import Geometry
|
||||
--import Geometry.Data
|
||||
import Geometry.Vector3D
|
||||
import Polyhedra.Data
|
||||
import Picture.Data
|
||||
@@ -21,7 +20,6 @@ import Data.Maybe
|
||||
import Data.List
|
||||
import Data.Bifunctor
|
||||
import Control.Lens
|
||||
--import qualified Data.Vector.Fusion.Stream.Monadic as VS
|
||||
|
||||
translateXY :: Float -> Float -> Polyhedra -> Polyhedra
|
||||
translateXY x y = pyFaces %~ map (map $ first tran)
|
||||
@@ -31,12 +29,6 @@ translateXY x y = pyFaces %~ map (map $ first tran)
|
||||
rotateXY :: Float -> Polyhedra -> Polyhedra
|
||||
rotateXY a = over pyFaces $ map $ map $ first $ rotate3 a
|
||||
|
||||
-- Another representation of polyhedra is as a list of edges.
|
||||
-- Each edge is a tuple containing four points: the first two are the two edge
|
||||
-- coordinates, the last two being the normals of two planes of the polyhedra
|
||||
-- that the edge connects.
|
||||
--, _pyEdges :: [(Point3,Point3,Point3,Point3)]
|
||||
|
||||
constructEdges :: [[Point3]] -> [(Point3,Point3,Point3,Point3)]
|
||||
constructEdges (face:faces) = mapMaybe (findReverseEdge otherEdges) (faceEdges face)
|
||||
++ constructEdges faces
|
||||
@@ -53,7 +45,6 @@ constructEdgesList (face:faces) = concatMap (findReverseEdgeList otherEdges) (fa
|
||||
otherEdges = concatMap faceEdges faces
|
||||
constructEdgesList _ = []
|
||||
|
||||
|
||||
findReverseEdge
|
||||
:: [(Point3,Point3,Point3)]
|
||||
-> (Point3,Point3,Point3)
|
||||
@@ -130,7 +121,6 @@ polyToPics :: Polyhedra -> [Picture]
|
||||
polyToPics = map helpPoly3D . _pyFaces
|
||||
|
||||
helpPoly3D :: [(Point3, Point4)] -> Picture
|
||||
--{-# INLINE helpPoly3D #-}
|
||||
helpPoly3D vs = map f $ polyToTris vs
|
||||
where
|
||||
f (pos,col) = Verx pos col [] 0 polyNum
|
||||
@@ -147,6 +137,5 @@ denormalEdges (a,b,n,m) = (a,b,a - x, b - y)
|
||||
x = crossProd (b - a) n
|
||||
y = crossProd (a - b) m
|
||||
|
||||
|
||||
polyToGeoRender :: Polyhedra -> [Point3]
|
||||
polyToGeoRender = concatMap (polyToTris . map fst) . _pyFaces
|
||||
|
||||
Reference in New Issue
Block a user