fix #216. Thanks, sergey!

This commit is contained in:
Julia Longtin 2019-06-28 09:33:21 +01:00
parent 8716766ed4
commit f5139e15bc
2 changed files with 14 additions and 8 deletions

6
Examples/example19.escad Normal file
View File

@ -0,0 +1,6 @@
// Example 19 -- The union of a cube and a sphere.
union()
{
cube(20);
translate(20,20,20) sphere (15);
}

View File

@ -80,10 +80,6 @@ cube = moduleWithoutSuite "cube" $ do
-- examples -- examples
example "cube(size = [2,3,4], center = true, r = 0.5);" example "cube(size = [2,3,4], center = true, r = 0.5);"
example "cube(4);" example "cube(4);"
-- arguments shared between forms
r :: <- argument "r"
`doc` "radius of rounding"
`defaultTo` 0
-- arguments (two forms) -- arguments (two forms)
((x1,x2), (y1,y2), (z1,z2)) <- ((x1,x2), (y1,y2), (z1,z2)) <-
do do
@ -110,6 +106,10 @@ cube = moduleWithoutSuite "cube" $ do
`defaultTo` False `defaultTo` False
let (x,y, z) = either (\w -> (w,w,w)) id size let (x,y, z) = either (\w -> (w,w,w)) id size
return (toInterval center x, toInterval center y, toInterval center z) return (toInterval center x, toInterval center y, toInterval center z)
-- arguments shared between forms
r :: <- argument "r"
`doc` "radius of rounding"
`defaultTo` 0
-- Tests -- Tests
test "cube(4);" test "cube(4);"
`eulerCharacteristic` 2 `eulerCharacteristic` 2
@ -123,10 +123,6 @@ square = moduleWithoutSuite "square" $ do
example "square(x=[-2,2], y=[-1,5]);" example "square(x=[-2,2], y=[-1,5]);"
example "square(size = [3,4], center = true, r = 0.5);" example "square(size = [3,4], center = true, r = 0.5);"
example "square(4);" example "square(4);"
-- arguments shared between forms
r :: <- argument "r"
`doc` "radius of rounding"
`defaultTo` 0
-- arguments (two forms) -- arguments (two forms)
((x1,x2), (y1,y2)) <- ((x1,x2), (y1,y2)) <-
do do
@ -150,6 +146,10 @@ square = moduleWithoutSuite "square" $ do
`defaultTo` False `defaultTo` False
let (x,y) = either (\w -> (w,w)) id size let (x,y) = either (\w -> (w,w)) id size
return (toInterval center x, toInterval center y) return (toInterval center x, toInterval center y)
-- arguments shared between forms
r :: <- argument "r"
`doc` "radius of rounding"
`defaultTo` 0
-- Tests -- Tests
test "square(2);" test "square(2);"
`eulerCharacteristic` 0 `eulerCharacteristic` 0