GithubHelp home page GithubHelp logo

Import STL? about sdfx HOT 5 OPEN

deadsy avatar deadsy commented on May 24, 2024
Import STL?

from sdfx.

Comments (5)

soypat avatar soypat commented on May 24, 2024 2

Late to the party but hey, I'll drop this here in case it interest's yall:
https://github.com/soypat/sdf/blob/main/helpers/sdfexp/import.go.
image

Left: original 128 cell on longest side model render using SDFs. 140k triangles

Right: Imported triangles using ImportModel (from left model) and rendering using 128 cells on longest side. The resulting amount of triangles is near identical and model quality is preserved. 6.5s elapsed.

from sdfx.

deadsy avatar deadsy commented on May 24, 2024

Right - the library has no current ability to import an STL file as an object. Could be a good thing though. ie import a per-existing object and then hack upon it with various additions, subtractions, etc. Implemtation-wise the challenge is to efficiently do an SDF on the triangle mesh of the STL.

from sdfx.

kbrafford avatar kbrafford commented on May 24, 2024

FWIW I'd love to see this capability too. I actually have a couple of workflows now where I take portions I make in sdfx and combine them with openjscad.org to finish:

https://imgur.com/a/fTE4ud8

from sdfx.

deadsy avatar deadsy commented on May 24, 2024

To be clear- importing STLs is not a big deal. It's a bunch of 3d triangles. Working out a minimum distance to a triangle is fairly obvious- so working out the minimum distance to N triangles is likewise obvious. The problem is doing this efficiently. I assume this means partitioning the triangle set in some way so that you can eliminate large groups of triangles that you cannot be closer to.

There's an analogous problem in 2D. ie - closest distance to a polygon made of line segments. You can brute force this - in fact the current code does- but it'd be nice to have an algo that did a more efficient search of the line segment set.

Both of these are areas of nagging interest, some sort of BSP perhaps...

from sdfx.

celer avatar celer commented on May 24, 2024

So I use 3DCoat a lot and what it does is convert mesh's to voxels at a specific resolution, so you say I want a resolution of 1mm and it will the convert to a voxel, which feels like it might efficient with SDFs.

from sdfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.