sdf
bauble.studio
sdf | bauble.studio | |
---|---|---|
18 | 7 | |
1,485 | 340 | |
- | - | |
0.0 | 5.1 | |
3 months ago | 4 months ago | |
Python | Janet | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
sdf
- Sdf – Generate 3D meshes based on SDFs
-
FreeCAD User Book (2019)
I used to like OpenSCAD for its simple approach but then I discovered SDF-based modelling with Python made possible with this neat library: [1]. This is perfect if you are a programmer that doesn't know anything about CAD-Software.
1.: https://github.com/fogleman/sdf
-
CAD Sketcher, free and open-source project bringing CAD like tools to Blender3d
>these the the central core that understands BREP and implements the geometric operations.
I've seen people quote a good modern CAD kernal as a 100 man year project. It's probably not going to happen, maybe there's some avenue for government funding?
Alternatively Signed-Distance-Functions are pretty nice. They're not BREP, but they're a lot easier to implement, and it might be possible to shove them into a BREP-shaped hole.
Here's a signed-distance-function based CAD kernal written in a few thousand lines of python+numpy, that seems to be about as fast as openscad. Maybe faster. https://github.com/fogleman/sdf
-
Signed distance functions in 46 lines of Python
Excellent. You might be interested in a Python library that I wrote for generating 3D meshes (STL files) from SDFs : https://github.com/fogleman/sdf
It just uses marching cubes for triangulation but the SDFs are all numpy'd and the SDF is evaluated in batches on multiple threads so it's relatively fast.
-
Plot of triangle mesh with py5
I used the SDF repo by Michael Fogleman. Check out his website, there's a ton of useful stuff on there. He contributes a lot to the open source community and has been mentioned in r/PlotterArt before.
-
10 ways to get the best out of OpenSCAD
Try out fogleman/sdf[1]. It is like OpenSCAD in many ways but the distance field model gives you offsets and fillets more easily.
[1] https://github.com/fogleman/sdf
-
Is it possible to 3d print signed distance functions?
https://github.com/fogleman/sdf this python project can create mesh from sdf
- Curated Code CAD
-
Guerrilla guide to CNC machining, mold making, and resin casting (2015)
> https://github.com/fogleman/sdf
Holy crap, why have I not seen this before?!?!!? I was even planning to start coding something like this myself. This is awesome!
- I am planning on creating a programming language for my Informatics Bachelor Thesis. What are your ideas for such a project?
bauble.studio
-
Domain Repetition
If you aren't familiar with SDFs, some rough intuition for what's going on here: you have some primitive functions that define shapes, you have combinators that distort shapes, and you then have combinators that distort space. And then when you trace rays through distorted space, you render an image that looks like your combinators distorted the shapes themselves, but really you're distorting the path that your rays travel along.
The operation here is that you distort space with the modulo operator. So now you have space that repeats -- and when you trace rays through this repeated space, you're basically teleporting the rays back to the origin (using mod in the classic "wrapping around" fashion) every time they pass out of a section of space.
And then ultimately the ray will collide with the shape -- the one shape -- that exists in this distorted space, after wrapping around some number of times.
If the idea of "taking the mod of space" is intriguing, I would encourage you to try playing with SDFs! It's a really incredible technique for real-time rendering of "3D vector graphics."
Also shameless plug for my SDF playground https://bauble.studio, and an example program that uses instanced repetition to render an "infinite" number of varying shapes:
(tile [400 0 300] (fn [i]
-
Why Janet?
Depending on what you're doing, Janet might be a great fit! I wrote a DSL for [expressing and shading 3D shapes](https://bauble.studio), and it was pretty easy. Depending on exactly what you're trying to do, the ease of embedding the Janet interpreter inside of other programs might be a big point in its favor.
- Signed distance functions in 46 lines of Python
-
Is there a name for this? -- Intermediate Representation with Graphics Primitives
For other inspiration check out Pyret in DCIC and the term Constructive Solid Geometry like Bauble
- Bauble: an interactive tutorial that will teach you everything you need to know to make art with lisp and math
- Bauble: A playground for making art with Lisp and math
What are some alternatives?
meshlab - The open source mesh processing system
3d-game-shaders-for-beginners - 🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
trimesh - Python library for loading and using triangular meshes.
sdf-viewer - A fast and cross-platform Signed Distance Function (SDF) viewer, easily integrated with your SDF library.
sdfx - A simple CAD package using signed distance functions
toodle.studio - turtle graphics playground
meshio - :spider_web: input/output for many mesh formats
janetroids - This was a paint program and then became asteroids
vedo - A python module for scientific analysis of 3D data based on VTK and Numpy
glyph.janet - Personal Data Manager for the command line
opencascade-emscripten-port - Open CASCADE - Emscripten / Webassembly port
conjure - Interactive evaluation for Neovim (Clojure, Fennel, Janet, Racket, Hy, MIT Scheme, Guile, Python and more!)