Menu

My STL to CAD tool can now give you a rounded box you can edit with one number
📰

My STL to CAD tool can now give you a rounded box you can edit with one number

DEV Community: python·Emir Mrkaljević·7 days ago
#39cETr67
#devtopython#devto#dev#mesh2cad#instead
Reading 0:00
15s threshold

When you download a rounded enclosure as an STL, every round corner is just hundreds of tiny triangles. If you want the corners a bit softer, or a hole 1 mm bigger, you usually redraw the whole part.

I have been working on mesh2cad , an open source tool that turns STL meshes of simple mechanical parts back into editable CAD. Over the last few releases (0.20.0 to 0.23.0) it learned to handle a box where every edge is rounded.

What changed

0.20.0: a fully rounded box is rebuilt as an exact STEP solid: 6 planes, 12 cylinders and 8 sphere corners, instead of a triangle soup.

0.21.0: the same box is written as a CadQuery, OpenSCAD or FreeCAD script with one parameter, edge_fillet_r .

0.22.0: the box can also have a through hole ( hole_1_d , position).

0.23.0: the box can also have a round boss on top ( boss_1_d , boss_1_h , position).

So the workflow is:

pip install mesh2cad mesh2cad convert box.stl --cadquery box.py mesh2cad params box.py mesh2cad edit box.py --set edge_fillet_r = 4 --set hole_1_d = 10…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.