logoalt Hacker News

jandreseyesterday at 9:12 PM7 repliesview on HN

> You can even load an existing 3D mesh and operate on it as an SDF. Great for hollowing, chopping, eroding/dilating, etc. existing models.

This has my instant interest. Multiple times I have wanted to take an existing .STL file and cut a hole on it or add another object to it and have never had success.

I've tried things like Meshlab, but while the interface has what appears to be a hundred different functions, attempting to use anything returns some error code that requires a PhD to understand and none of the "repair" functions seem to help.

I mean seriously: Mesh inputs must induce a piecewise constant winding number field.

How the hell am I supposed to accomplish that on a STL file?


Replies

Brian_K_Whitetoday at 12:02 AM

You can do that effortlessly right in openscad itself or in freecad for a more visual way, or in every single cad app in existence I think.

In freecad you first just open the stl file, then Part -> Create part from mesh, then you have a solid you can modify.

show 2 replies
fainpultoday at 9:44 AM

People should share the original files or at least step files along with the stl files. But if you must work with stl, Fusion works brilliantly for this. You can open the stl file, which gives you the usual mesh that's hard to work with. You then convert that mesh to a solid object, on which you can use "direct modeling". It's not the same as a parametric object, but the editing features are quite powerful and sort of mindblowing. [1]

If you have the paid version of Fusion, you can run "feature detection" to turn things like holes, fillets, extrusions etc. into dedicated features which are even easier to edit. [2]

[1] https://www.autodesk.com/learn/ondemand/curated/direct-model...

[2] https://www.autodesk.com/learn/ondemand/curated/direct-model...

yakytoday at 4:03 PM

If it's a one-time thing, Prusa Slicer (and some other slicers too, probably) allow adding and subtracting simple shapes. So if, for example, you need to add a hole for a screw, you can do it directly in the slicer without messing with (and breaking the mesh of) an STL.

foglemanyesterday at 9:30 PM

That feature requires getting pyopenvdb installed, which can be a headache, and I never really updated the README with examples, but it does work. There is one example script:

https://github.com/fogleman/sdf/blob/main/examples/mesh.py

You basically just say:

f = Mesh.from_file(path).sdf(voxel_size=0.25, half_width=1)

Then you can operate on `f`.

dekhnyesterday at 9:48 PM

Blender also has a high learning curve but you typically don't need a PhD to understand the errors (instead you just watch youtube videos and copy what they do).

Removing faces from an STL and adding other objects is quite straightforward. Previously, Autodesk had Meshmixer and 123D, I guess Meshmixer is still available: https://meshmixer.org/ and I found it to be great for quick editing of the type you're describing.

kesoryesterday at 9:14 PM

OpenSCAD can load STLs and cut holes in them.

btbuildemyesterday at 10:51 PM

Tinkercad is a very low-barrier-to-entry option here