cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

Import STEP file and save as Shape object for STL conversion

Open michaelnicol opened this issue 2 years ago • 1 comments

Hello,

I am attempting to import and convert a STEP file to an STL file.

Currently, my code is the following for STEP to STL

import cadquery as cq
afile = cq.importers.importStep(fileNameFrom) # File in directory
cq.exporters.export(afile,fileNameOut) # Place the converted file in the same directory, ends with ".stl"

The issue is that this does not allow for tolerance modification, resulting in extremely large file sizes when going from STEP to STL (often 22 MB to 386 MB).

Instead, I would like to import the STEP file and save it to the Shape object to use the exportSTL method: https://cadquery.readthedocs.io/en/latest/importexport.html#exporting-stl

However, I can't find any documentation on this principle. How do I go about completing thing conversion?

michaelnicol avatar Aug 20 '23 00:08 michaelnicol

Have a look at the tolerance and angularTolerance options here.

jmwright avatar Aug 20 '23 01:08 jmwright