Skip to content

Commit

Permalink
Merge pull request #365 from isovector/remove-extruderotater
Browse files Browse the repository at this point in the history
Remove ExtrudeRotateR
  • Loading branch information
julialongtin authored Dec 21, 2020
2 parents e302b92 + 0c016d9 commit 444e0ea
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 23 deletions.
4 changes: 0 additions & 4 deletions Graphics/Implicit/Definitions.hs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ module Graphics.Implicit.Definitions (
Cylinder,
Rotate3,
ExtrudeR,
ExtrudeRotateR,
ExtrudeRM,
ExtrudeOnEdgeOf,
RotateExtrude,
Expand Down Expand Up @@ -303,7 +302,6 @@ data SymbolicObj3 =
| Rotate3 (Quaternion ) SymbolicObj3
-- 2D based
| ExtrudeR SymbolicObj2
| ExtrudeRotateR SymbolicObj2
| ExtrudeRM
-- rounding radius
(Either ( -> )) -- twist
Expand Down Expand Up @@ -336,8 +334,6 @@ instance Show SymbolicObj3 where
showCon "cylinder2" @| r1 @| r2 @| h
Rotate3 qd s -> showCon "rotate3" @| quaternionToEuler qd @| s
ExtrudeR d s d2 -> showCon "extrudeR" @| d @| s @| d2
ExtrudeRotateR d d1 s d3 ->
showCon "extrudeRotateR" @| d @| d1 @| s @| d3
ExtrudeRM d edfdd e ep_ddfdp_dd s edfp_ddd ->
showCon "extrudeRM" @| d @|| edfdd @| e @|| ep_ddfdp_dd @| s @|| edfp_ddd
RotateExtrude d md ep_ddfdp_dd edfdd s ->
Expand Down
4 changes: 1 addition & 3 deletions Graphics/Implicit/Export/SymbolicFormats.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ module Graphics.Implicit.Export.SymbolicFormats (scad2, scad3) where

import Prelude((.), fmap, Either(Left, Right), ($), (*), ($!), (-), (/), pi, error, (+), (==), take, floor, (&&), const, pure, (<>), sequenceA, (<$>))

import Graphics.Implicit.Definitions(, SymbolicObj2(Shared2, SquareR, Circle, PolygonR, Rotate2), SymbolicObj3(Shared3, CubeR, Sphere, Cylinder, Rotate3, ExtrudeR, ExtrudeRotateR, ExtrudeRM, RotateExtrude, ExtrudeOnEdgeOf), isScaleID, SharedObj(Empty, Full, Complement, UnionR, IntersectR, DifferenceR, Translate, Scale, Mirror, Outset, Shell, EmbedBoxedObj), quaternionToEuler)
import Graphics.Implicit.Definitions(, SymbolicObj2(Shared2, SquareR, Circle, PolygonR, Rotate2), SymbolicObj3(Shared3, CubeR, Sphere, Cylinder, Rotate3, ExtrudeR, ExtrudeRM, RotateExtrude, ExtrudeOnEdgeOf), isScaleID, SharedObj(Empty, Full, Complement, UnionR, IntersectR, DifferenceR, Translate, Scale, Mirror, Outset, Shell, EmbedBoxedObj), quaternionToEuler)
import Graphics.Implicit.Export.TextBuilderUtils(Text, Builder, toLazyText, fromLazyText, bf)

import Control.Monad.Reader (Reader, runReader, ask)
Expand Down Expand Up @@ -134,7 +134,6 @@ buildS3 (Rotate3 q obj) =

buildS3 (ExtrudeR r obj h) | r == 0 = callNaked "linear_extrude" ["height = " <> bf h] [buildS2 obj]

buildS3 (ExtrudeRotateR r twist obj h) | r == 0 = callNaked "linear_extrude" ["height = " <> bf h, "twist = " <> bf twist] [buildS2 obj]

-- FIXME: handle scale, center.
buildS3 (ExtrudeRM r twist scale (Left translate) obj (Left height)) | r == 0 && isScaleID scale && translate == V2 0 0 = do
Expand All @@ -155,7 +154,6 @@ buildS3 (ExtrudeRM r twist scale (Left translate) obj (Left height)) | r == 0 &&

buildS3 CubeR{} = error "cannot provide roundness when exporting openscad; unsupported in target format."
buildS3 ExtrudeR{} = error "cannot provide roundness when exporting openscad; unsupported in target format."
buildS3 ExtrudeRotateR {} = error "cannot provide roundness when exporting openscad; unsupported in target format."
buildS3 ExtrudeRM{} = error "cannot provide roundness when exporting openscad; unsupported in target format."
buildS3 RotateExtrude{} = error "cannot provide roundness when exporting openscad; unsupported in target format."
buildS3(ExtrudeOnEdgeOf _ _) = error "cannot provide roundness when exporting openscad; unsupported in target format."
Expand Down
6 changes: 2 additions & 4 deletions Graphics/Implicit/ObjectUtil/GetBox3.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

module Graphics.Implicit.ObjectUtil.GetBox3 (getBox3) where

import Prelude(uncurry, pure, Bool(False), Either (Left, Right), (==), max, (/), (-), (+), fmap, unzip, ($), (<$>), (.), minimum, maximum, min, (>), (*), (<), abs, either, error, const, otherwise, take, fst, snd)
import Prelude(uncurry, pure, Bool(False), Either (Left, Right), (==), max, (/), (-), (+), fmap, unzip, ($), (<$>), (.), minimum, maximum, min, (>), (*), (<), abs, either, const, otherwise, take, fst, snd)

import Graphics.Implicit.Definitions
( Fastℕ,
fromFastℕ,
ExtrudeRMScale(C2, C1),
SymbolicObj3(Shared3, CubeR, Sphere, Cylinder, Rotate3, ExtrudeR, ExtrudeOnEdgeOf, ExtrudeRM, RotateExtrude, ExtrudeRotateR),
SymbolicObj3(Shared3, CubeR, Sphere, Cylinder, Rotate3, ExtrudeR, ExtrudeOnEdgeOf, ExtrudeRM, RotateExtrude),
Box3,
,
fromFastℕtoℝ,
Expand Down Expand Up @@ -144,8 +144,6 @@ getBox3 (RotateExtrude rot _ (Right f) rotate symbObj) =
else (x2 + xmax', y1 + ymin', y2 + ymax')
in
(V3 (-r) (-r) $ y1 + ymin', V3 r r $ y2 + ymax')
-- FIXME: add case for ExtrudeRotateR!
getBox3 ExtrudeRotateR{} = error "ExtrudeRotateR implementation incomplete!"


unpack :: V2 a -> (a, a)
Expand Down
8 changes: 2 additions & 6 deletions Graphics/Implicit/ObjectUtil/GetImplicit3.hs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

module Graphics.Implicit.ObjectUtil.GetImplicit3 (getImplicit3) where

import Prelude (Either(Left, Right), abs, (-), (/), (*), sqrt, (+), atan2, max, cos, minimum, ($), sin, pi, (.), Bool(True, False), ceiling, floor, pure, error, (==), otherwise)
import Prelude (Either(Left, Right), abs, (-), (/), (*), sqrt, (+), atan2, max, cos, minimum, ($), sin, pi, (.), Bool(True, False), ceiling, floor, pure, (==), otherwise)

import Graphics.Implicit.Definitions
( , SymbolicObj3(CubeR, Sphere, Cylinder, Rotate3, ExtrudeR, ExtrudeRM, ExtrudeOnEdgeOf, RotateExtrude, Shared3, ExtrudeRotateR), Obj3, ℝ2, , fromℕtoℝ, toScaleFn )
( , SymbolicObj3(CubeR, Sphere, Cylinder, Rotate3, ExtrudeR, ExtrudeRM, ExtrudeOnEdgeOf, RotateExtrude, Shared3), Obj3, ℝ2, , fromℕtoℝ, toScaleFn )

import Graphics.Implicit.MathUtil ( rmax, rmaximum )

Expand Down Expand Up @@ -150,7 +150,3 @@ getImplicit3 (RotateExtrude totalRotation round translate rotate symbObj) =
else obj rz_pos
getImplicit3 (Shared3 obj) = getImplicitShared obj


-- FIXME: implement this, or implement a fallthrough function.
--getImplicit3 (ExtrudeRotateR) =
getImplicit3 ExtrudeRotateR{} = error "ExtrudeRotateR unimplimented!"
6 changes: 0 additions & 6 deletions Graphics/Implicit/Primitives.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ module Graphics.Implicit.Primitives (
getImplicit,
extrudeR,
extrudeRM,
extrudeRotateR,
extrudeOnEdgeOf,
sphere,
cubeR, rect3R,
Expand Down Expand Up @@ -76,7 +75,6 @@ import Graphics.Implicit.Definitions (ℝ, ℝ2, ℝ3, Box2,
Cylinder,
Rotate3,
ExtrudeR,
ExtrudeRotateR,
ExtrudeRM,
RotateExtrude,
ExtrudeOnEdgeOf,
Expand Down Expand Up @@ -343,10 +341,6 @@ extrudeR
-> SymbolicObj3
extrudeR = ExtrudeR

-- | This function is not implemented
extrudeRotateR :: -> -> SymbolicObj2 -> -> SymbolicObj3
extrudeRotateR = ExtrudeRotateR

extrudeRM :: -- ^ rounding radius (in mm)
-> Either ( -> ) -- ^ twist
-> ExtrudeRMScale -- ^ scale
Expand Down

0 comments on commit 444e0ea

Please sign in to comment.