Haskell-Things / ImplicitCAD

A math-inspired CAD program in haskell. CSG, bevels, and shells; 2D & 3D geometry; 2D gcode generation...
https://implicitcad.org/
GNU Affero General Public License v3.0
1.41k stars 142 forks source link

cube False (V3 3 0.095 0.045) produces no geometry #418

Closed mokshasoft closed 2 years ago

mokshasoft commented 2 years ago

This code:

someFunc :: IO ()
someFunc = do
  putStrLn "Generating model3.stl"
  writeSTL 1 "model3.stl" $ cube False (V3 3 0.095 0.045)
  putStrLn "Done"

produces this "empty" stl-file:

solid ImplictCADExport
endsolid ImplictCADExport

Trigger using https://github.com/mokshasoft/hus/tree/cube-no-output/Elements

$ stack build
...
$ stack exec Elements
Generating model3.stl
Done
sorki commented 2 years ago

Hi! You're asking the engine to render at resolution 1 (the first parameter to writeSTL) but your object is smaller than this. The resolution needs to be less than the minimum size of the feature you want to render (in your case something like 0.045 and lower should work).

mokshasoft commented 2 years ago

Oh, a long time ago I tried to find out what that parameter were doing, but couldn't find it. Now I see that it's there in the docs. Thanks!