(no title)
fogleman | 2 months ago
https://github.com/fogleman/sdf
One big plus to doing it this way is that it's "just" Python and you can use arbitrary logic to help construct your model.
You can even load an existing 3D mesh and operate on it as an SDF. Great for hollowing, chopping, eroding/dilating, etc. existing models.
I should probably do more with this project. I think there's a lot of interest in this space.
vhanda|2 months ago
I recently also got annoyed with OpenSCAD and its limitations and therefore started experimenting with Build123d. I'm very much a beginner in the CAD space and would love to understand what inspired you to build sdf.
My basic understanding is that STL files are essentially like Bitmap images and store a list of triangles and their positions, whereas STEP files are more like Vector art where there is a list of instructions on how to build the model. Most CAD GUI programs also operate on a similar model to vector art where they record a list of operations one on top of another. It's why STEP files are a standardized format and can be imported / exported from most GUI based CAD builders. I think.
Given that SDF also seems like it builds only STL files (I could be wrong), wouldn't learning build123d or CadQuery work better if one cares about compatibility with existing GUI based CAD modeling software?
Additionally, atleast build123d offers a similar conceptual model to using Fusion360 and FreeCad - I have limited experience here - but essentially you sketch something in 2D on a particular plane, and then apply some operations to convert it to 3d in a particular manner - the simplest being extruding. This means the mental modeling of how to construct something is very similar across both GUI based CAD programs and Build123d, and that makes it easier for me to jump between GUI based and code based CAD modelling.
I'd love to understand your point of view, and learn more.
[0] - https://github.com/gumyr/build123d
[1] - https://github.com/CadQuery/cadquery
fogleman|2 months ago
Like most of my projects, this was just for fun and I mainly made it for myself. I'm a DIY kind of guy when it comes to software. I just throw things up on GitHub in case anyone else can get some use or inspiration out of it.
ur-whale|2 months ago
Something like two precisely interlocking gears with a tooth geometry with a profile that's the developed curve of the opposite tooth is a nightmare to build with SDFs
Or precise fillets.
Or hard intersections and differences.
Very useful for doing soft, squishy shapes, less so for hard CAD.
Also, a suggestion: in your project, please consider using Wavefront OBJ as an output format, it is a much, much better choice than STL (STL can't represent the actual topology of the object, it has to be reconstructed).
unknown|2 months ago
[deleted]
jandrese|2 months ago
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?
Brian_K_White|2 months ago
In freecad you first just open the stl file, then Part -> Create part from mesh, then you have a solid you can modify.
fainpul|2 months ago
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...
fogleman|2 months ago
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`.
yaky|2 months ago
dekhn|2 months ago
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.
kesor|2 months ago
btbuildem|2 months ago
WillAdams|2 months ago
https://pythonscad.org/examples.php
(search for "sdf" about halfway down the page)
mosura|2 months ago
FeepingCreature|2 months ago
What do you use for sdf meshing? I never really got the perf where I wanted it.
fogleman|2 months ago
unknown|2 months ago
[deleted]
userbinator|2 months ago
mkl|2 months ago
JonathanRaines|2 months ago
zimpenfish|2 months ago
> I should probably do more with this project.
I, for one, would be glad.
the_cat_kittles|2 months ago