{"action":"opened","issue":{"url":"https://api.github.com/repos/openscad/openscad/issues/1128","labels_url":"https://api.github.com/repos/openscad/openscad/issues/1128/labels{/name}","comments_url":"https://api.github.com/repos/openscad/openscad/issues/1128/comments","events_url":"https://api.github.com/repos/openscad/openscad/issues/1128/events","html_url":"https://github.com/openscad/openscad/issues/1128","id":53210465,"number":1128,"title":"Up-sized numbers","user":{"login":"MichaelAtOz","id":1972961,"avatar_url":"https://avatars.githubusercontent.com/u/1972961?v=3","gravatar_id":"","url":"https://api.github.com/users/MichaelAtOz","html_url":"https://github.com/MichaelAtOz","followers_url":"https://api.github.com/users/MichaelAtOz/followers","following_url":"https://api.github.com/users/MichaelAtOz/following{/other_user}","gists_url":"https://api.github.com/users/MichaelAtOz/gists{/gist_id}","starred_url":"https://api.github.com/users/MichaelAtOz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MichaelAtOz/subscriptions","organizations_url":"https://api.github.com/users/MichaelAtOz/orgs","repos_url":"https://api.github.com/users/MichaelAtOz/repos","events_url":"https://api.github.com/users/MichaelAtOz/events{/privacy}","received_events_url":"https://api.github.com/users/MichaelAtOz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-01T01:16:08Z","updated_at":"2015-01-01T01:16:08Z","closed_at":null,"body":"The manual describes numbers as;\r\n\r\n>OpenSCAD has only a single kind of number, which is an IEEE floating point number. [OpenSCAD does not distinguish integers and floating point numbers as two different types, nor does it support complex numbers.] Because OpenSCAD uses the IEEE floating point standard, there are a few deviations from the behaviour of numbers in mathematics:\r\n>\r\nThe largest representable number is about 1e308. If a numeric result is too large, then the result can be infinity (printed as inf by echo).\r\nThe smallest representable number is about -1e308. If a numeric result is too small, then the result can be -infinity (printed as -inf by echo).\r\nIf a numeric result is invalid, then the result can be Not A Number (printed as nan by echo).\r\nIf a non-zero numeric result is too close to zero to be representable, then the result will be -0 if the result is negative, otherwise it will be 0. Zero (0) and negative zero (-0) are treated as two distinct numbers by some of the math operations, and are printed differently by 'echo', although they compare equal.\r\n>\r\nNote that 'inf' and 'nan' are not supported as numeric constants by OpenSCAD, even though you can compute numbers that are printed this way by 'echo'. You can define variables with these values by using:\r\n>\r\ninf = 1e200 * 1e200;\r\nnan = 0 / 0;\r\necho(inf,nan);\"\r\n\r\nI was fiddling with this code;\r\n```\r\nmodule flatten() {\r\ninf = 1e4;\r\ndifference() {\r\n\tchildren();\r\n\ttranslate([-inf,-inf,-inf]) \r\n\t\tcube([2*inf,2*inf,inf]);\r\n        }\r\n}\r\n\r\nflatten() \r\n{\r\n\tcube(30,true);\r\n\tcylinder(d=10,h=100,center=true);\r\n}\r\n```\r\nand basically wanted a huge cube, so theoretically it could cut any sized children.\r\n\r\nI initially tried inf=1e200*1e200, it didn't produce a cube, then I tried just 1e200, then started low and got cubes with 1e4, but not 1e5.\r\n\r\nTesting just with big cubes produced cubes for larger numbers, so\r\nIssue A. difference() is not handling cubes bigger than ~1e4.\r\n\r\nWhile fiddling I came across other issues;\r\n\r\nIssue B. F6 Assertion violation with big cube (or difference) ie >1e13\r\n```\r\nCompiling design (CSG Tree generation)...\r\nECHO: inf = 1e+050, 2e+050\r\nECHO: inf = 100000, 200000 <== other bug, ignore\r\nRendering Polygon Mesh using CGAL...\r\nCGAL error in CGAL_Nef_polyhedron3(): CGAL ERROR: assertion violation!\r\nExpr: pe != 0\r\nFile: /data/OpenSCAD/libraries-mingw64-master/mxe-w64/usr/x86_64-w64-mingw32.static/include/CGAL/Nef_3/polyhedron_3_to_nef_3.h\r\nLine: 212\r\nGeometries in cache: 32\r\nGeometry cache size in bytes: 26016\r\nCGAL Polyhedrons in cache: 9\r\nCGAL cache size in bytes: 694656\r\nTotal rendering time: 0 hours, 0 minutes, 0 seconds\r\n   Top level object is a 3D object:\r\n   Simple:        yes\r\n   Vertices:       72\r\n   Halfedges:     216\r\n   Edges:         108\r\n   Halffacets:     80\r\n   Facets:         40\r\n   Volumes:         2\r\nRendering finished.\r\n```\r\n\r\nIssue C. \r\nI also found issues with plain cubes, in Orthogonal mode 4/6 views (the back/front/left/right buttons) show as blank with size 1e6 (oops double all these numbers ie 2e6 - the code was inf*2 see below), the cube is there just not showing for both F5 & F6. With size 1e15 Perspective loses the same views, at 1e16 top view goes (for F5 not F6), [ strangely,  Orthogonal bottom view returned ~1e16]. At 1e17 & Perspective all views are gone.\r\n\r\nSimilar issues with cylinder (1e33), sphere (goes at 1e6) square (1e36), circle (1e18).\r\n\r\nThe manual says the largest 'representable number', is there a largest Geometry number? (but 1e6 is not that big).\r\n\r\n```\r\nmodule f() {\r\n\r\n\tinf = 1e16;\r\n\techo(inf=inf,inf*2);\r\n\ttranslate([-inf,-inf,-inf]) \r\n\t\tcube([2*inf,2*inf,inf]);\r\n}\r\n\r\n!f();\r\n```\r\n\r\n"}}