Skip to content

Conversation

lf94
Copy link

@lf94 lf94 commented Apr 2, 2023

the time is near for a new era of code cad

@lf94
Copy link
Author

lf94 commented Apr 2, 2023

So uh, it segfaults. Gonna need some help on that one. I think the source may be the fact Parameters is being freed?

@lf94
Copy link
Author

lf94 commented Apr 2, 2023

Here's a test you can use:

$ cat test.scad
sdf(function(x,y,z) sqrt(x^2+ y^2 + z^2)-1, [-1,-1,-1,1,1,1], 1.0);

Yeah, we should change the parameters around, so that the sdf comes last.

@t-paul t-paul marked this pull request as draft April 10, 2023 15:56
@lf94 lf94 changed the title libfive SDF support via libfive Apr 12, 2023
@pca006132
Copy link
Member

I wonder if you are interested in trying the sdf function of manifold, which is already included in experimental features. It would also be interesting to compare the performance of manifold and libfive (we do not use eigen so it may be slower).

@gsohler
Copy link
Member

gsohler commented Sep 21, 2023 via email

@pca006132
Copy link
Member

OK thanks for the pointer. We currently don't have that many builtin functions for sdf in manifold, so porting the example to manifold will likely take a bit of time. Also, I originally thought that libfive does JIT, but it seems that they don't have this function (but should not be too hard to implement I guess, considering they are all numerical operations).

Manifold currently has this nice SDF example: https://github.com/elalish/manifold/blob/master/samples/src/gyroid_module.cpp
I can try to see if I can get this to work on your fork.

@pca006132
Copy link
Member

(the sdf example is available on manifoldcad.org as well)

@leokeba
Copy link

leokeba commented Sep 21, 2023

I wonder if you are interested in trying the sdf function of manifold, which is already included in experimental features. It would also be interesting to compare the performance of manifold and libfive (we do not use eigen so it may be slower).

Hi, is this already available for use in OpenScad, or are you just saying it's doable because manifold supports it ubnder the hood ?

@pca006132
Copy link
Member

Doable because manifold supports it under the hood. It is not yet supported by OpenSCAD for now.

The Python PR by @gsohler provides libfive integration, but it is only exposed for python.

@lf94
Copy link
Author

lf94 commented Sep 21, 2023

From what we discussed in the IRC channels months ago, it seems manifold is quite slow compared to libfive. At the same time, it's not a good idea to duplicate functionality. So I'm not sure what should be done. The only reason I've abandoned this is because the lack of (understandable) motivation from others :) Feel free to pick up everything.

@pca006132
Copy link
Member

Indeed, manifold is slower for more complicated cases (at least for now) as the SDF code is very simple. But we guarantee manifoldness and we have plans to make it faster. More users can help us improve better.

@lf94
Copy link
Author

lf94 commented Sep 25, 2023

All I can wish you is good luck 🙂 I did this for OpenSCAD out of the motivation to hopefully pull more people into code CAD, but extending the problem space OpenSCAD can solve. Given I've spent enough time on the proof of concept, all I can do is hope someone else (maybe you!) to continue. I'm working on my own code CAD system where SDFs are first class. OpenSCAD has been a deadend for me for many years now tool-wise. I still recommend OpenSCAD to those starting out regardless since the community is extremely nice and there's lots of resources :)

@t-paul
Copy link
Member

t-paul commented Sep 25, 2023

The treading model of libfive makes it a bit difficult to call back into OpenSCAD expression evaluation. Depending on the API Manifold uses, it could be easier to integrate.

@lf94 lf94 closed this Dec 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants