Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions Graphics/OpenSCAD.hs
Original file line number Diff line number Diff line change
Expand Up @@ -619,13 +619,13 @@ diam :: Double -> Double
diam = (/ 2)

-- Now, let Haskell work it's magic
instance Vector v => Semigroup (Model v) where
(Solid (Box 0 0 0)) <> b = b
a <> (Solid (Box 0 0 0)) = a
a <> b = union [a, b]

instance Vector v => Monoid (Model v) where
mempty = Solid $ Box 0 0 0
mappend (Solid (Box 0 0 0)) b = b
mappend a (Solid (Box 0 0 0)) = a
mappend a b = union [a, b]
mconcat [a] = a
mconcat as = union as


-- | You can use '(#)' to write transformations in a more readable postfix form,
Expand Down