Example using boundingbox in AngelCAD.
In this example we read an external model of unknown dimensions and use bounding box to center it on the origin. AngelCAD requires a quality checked model in OBJ,OFF or AMF format, so we use the polyfix utility to first convert from STL to OBJ and heal the model at the same time.
polyfix from https://github.com/arnholm/angelcad
Hook.stl from https://github.com/lar3ry/OpenSCAD---Move-STL-to-origin
polyfix Hook.stl -out=*.obj
Parameters:
input_file = Hook.stl
out = *.obj
polyhedron 0 ================= volume=4955, dtol=0.01, atol=1e-006, maxiter=10
iteration 0: vertices=17898 faces=5966
warning: 70 zero area faces.
warning: nonmanifold edges: uc(1)=17898
merged 15373 vertices
removed 939 collapsed or zero area faces
split 5 faces
total changes=16317
warning: nonmanifold edges: uc(1)=28
iteration 1: vertices=2525 faces=5028
warning: nonmanifold edges: uc(1)=28
merged 102 vertices
removed 196 collapsed or zero area faces
split 3 faces
total changes=301
warning: nonmanifold edges: uc(1)=19
iteration 2: vertices=2423 faces=4833
warning: nonmanifold edges: uc(1)=19
merged 32 vertices
removed 55 collapsed or zero area faces
total changes=87
no warnings
iteration 3: vertices=2391 faces=4778
merged 4 vertices
removed 8 collapsed or zero area faces
total changes=12
no warnings
iteration 4: vertices=2387 faces=4770
total changes=0
no warnings
Summary:
polyhedron 0: vertices=2387 faces=4770 : no warnings
Writing: Hook.obj
... polyfix finished, time used: 0d 00h 00m 01s