Saving STL options request

I work in inches, and am often saving out STL’s for 3D printing. Is there a way when I am saving to have it switch the units to MM, I always forget to change the units before I export and have to go back once the client complains the file is microscopic :skull:

Hi futureViking,

STL is a unitless format

The STL file format does not store unit information. The industry standard assumption by most applications (slicers, CAM software, etc.) is that STL files are in millimeters. If your Rhino model is in inches, this mismatch will cause your geometry to come out ~25.4x too small in the receiving application.

Your client needs to understand that STL files don’t have units and how easy it is to convert between inches and mm.

1 Like

:rofl: if only it was that simple

Right, I guess what I am asking for would be an addition to the STL export options to warn of this or and option to quickly scale from model unit to mm… or I could start working in mm but that’s crazy talk

you could do a command macro.. something like this..

_SelAll _Scale 0,0,0 25.4 _-Export "fileName" _Enter _Enter _Undo
1 Like

I use this button script for exports to 3d printers. This sends it out in the right scale no matter what you start with:

! _-RunPythonScript (
import rhinoscriptsyntax as rs

def main():
UnitConv = rs.UnitScale(2,rs.UnitSystem())
lstObjs = rs.GetObjects(‘Pick some mesh objects to export’,32,preselect=True,select=False)
rs.UnselectAllObjects()
rs.SelectObjects(lstObjs)
if lstObjs:
rs.EnableRedraw(False)
rs.UnselectAllObjects()
lstScaled = rs.ScaleObjects( lstObjs, (0,0,0), (UnitConv,UnitConv,UnitConv), True )
PrintPath = rs.GetDocumentUserText(“3DPrintPath”)
if PrintPath:
filepath = rs.SaveFileName (‘Export’, “STL Files (.stl)|.stl|All Files (.)|.||”,PrintPath)
else:
filepath = rs.SaveFileName (‘Export’, ‘STL Files (.stl)|.stl|All Files (.)|.||’)
if filepath:
lstSplitPath = filepath.split(‘\’)
lstSplitPath = lstSplitPath[:-1]
strPathToSave = ‘\’.join(lstSplitPath)
rs.SetDocumentUserText(“3DPrintPath”,strPathToSave)
if filepath[-4:] != ‘.stl’:filepath=filepath + ‘.stl’
rs.SelectObjects(lstScaled)
rs.Command (‘_-export “’ + filepath + ‘” enterend’)
rs.DeleteObjects(lstScaled)
rs.SelectObjects(lstObjs)
rs.EnableRedraw(True)
if filepath:rs.Command (‘Run “’ + strPathToSave + ‘”’)

main()
)

1 Like