2 comments on “Creating an STL file from a PythonOCC Shape

  1. Thank you for your post! Is there an easy way to specify the output resolution of the STL file? I would like to control how fine/course of a tessellation is outputted.

  2. Yes, see the SetRelativeMode(), SetDeflection() and SetCoefficient() methods. If relative mode is enabled, the coefficient (relative to the shape dimensions) is used for meshing/tesselation. Otherwise, the (absolute) deflection is used. You may have a look at StlAPI.py in Lib/site-packages/OCC of your python installation/env.

Leave a comment