Permalink
Browse files

Minor updates for symbolic rendering code.

(It's still using old, out of date code.)
  • Loading branch information...
1 parent edf82d5 commit f95696b5e1de71a469aa66b81ce69fbad3f1b650 @colah committed Jan 6, 2013
Showing with 4 additions and 3 deletions.
  1. +4 −3 Graphics/Implicit/Export/SymbolicObj3.hs
@@ -26,6 +26,7 @@ import Graphics.Implicit.Export.Symbolic.Rebound2
import Graphics.Implicit.Export.Symbolic.Rebound3
--import Graphics.Implicit.Export.Util (divideMeshTo, dividePolylineTo)
import Graphics.Implicit.Export.Util (normTriangle)
+import Data.VectorSpace
instance DiscreteAproxable SymbolicObj3 TriangleMesh where
@@ -38,15 +39,15 @@ symbolicGetMesh :: ℝ -> SymbolicObj3 -> [(ℝ3, ℝ3, ℝ3)]
-- A translated objects mesh is its mesh translated.
symbolicGetMesh res (Translate3 v obj) =
- map (\(a,b,c) -> (a S.+ v, b S.+ v, c S.+ v) ) (symbolicGetMesh res obj)
+ map (\(a,b,c) -> (a ^+^ v, b ^+^ v, c ^+^ v) ) (symbolicGetMesh res obj)
-- A scaled objects mesh is its mesh scaled
symbolicGetMesh res (Scale3 s obj) =
let
mesh :: [(ℝ3, ℝ3, ℝ3)]
mesh = symbolicGetMesh res obj
scaleTriangle :: (ℝ3, ℝ3, ℝ3) -> (ℝ3, ℝ3, ℝ3)
- scaleTriangle (a,b,c) = (s S.⋯* a, s S.⋯* b, s S.⋯* c)
+ scaleTriangle (a,b,c) = (s ⋯* a, s ⋯* b, s ⋯* c)
in map scaleTriangle mesh
-- A couple triangles make a cube...
@@ -132,7 +133,7 @@ symbolicGetMesh res (ExtrudeR r obj2 h) =
side_tris ++ bottom_tris ++ top_tris
-symbolicGetMesh res (ExtrudeRM r twist scale translate obj2 h) =
+symbolicGetMesh res (ExtrudeRM r@0 twist scale translate obj2 h@(Left _)) =
let
-- Get a Obj2 (magnitude descriptor object)
obj2mag :: Obj2 -- = ℝ2 ->

0 comments on commit f95696b

Please sign in to comment.