Menu

"Make the hole 2 mm bigger" is now one command for an STL you converted to CAD
📰

"Make the hole 2 mm bigger" is now one command for an STL you converted to CAD

DEV Community: opensource·Emir Mrkaljević·15 days ago
#iyAs1qKZ
#devtoopensource#devto#dev#mesh2cad#script
Reading 0:00
15s threshold

When I started mesh2cad , the sentence I kept in my head was "make the hole 2 mm bigger". You have an STL of a bracket, the hole is a little too tight for your bolt, and the original CAD file is gone. Editing triangles is miserable, so mesh2cad fits the mesh and writes a CadQuery, OpenSCAD or FreeCAD script with named numbers at the top.

That got you a file where hole_1_d = 10.0 was sitting right there. You still had to open it, find the line, change it, run the script and hope the result was sane. 0.17.0 closes that loop with two commands: params and edit .

pip install -U "mesh2cad[cadquery]" mesh2cad convert bracket.stl --cadquery bracket.py mesh2cad params bracket.py mesh2cad edit bracket.py --set hole_1_d = +2 --output-script bracket_12.py -o bracket_12.step

Enter fullscreen mode

Exit fullscreen mode

What you can change

The demo part is a 50 x 30 x 6 mm plate with rounded corners, a 10 mm hole in the middle and two 5.5 mm holes for M5 bolts.…

Continue reading — create a free account

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