Coder Social home page Coder Social logo

Comments (7)

bhouston avatar bhouston commented on July 19, 2024 2

CSG usually refers to a rendering trick that makes Boolean operations look right, but doesn't actually compute them.

I was refering to actually intersecting the meshes and calculating the mesh result live in the browser. Similar to what we did with Clara.io back in 2013 here - and this isn't a rendering trick, try it in the editor, it is live Boolean mesh result (and completely unreliable on complex meshes):

CSG Substraction Animation  (1)

https://clara.io/view/86e0579a-4dc8-4145-81a8-6ad9f765b30b

from manifold.

bhouston avatar bhouston commented on July 19, 2024 1

Ah, I understand. CSG often refers to building from primitive shapes using Boolean operations. I guess I've seen CSG misused so many times (e.g. https://evanw.github.io/csg.js ) then I've conflated it with Boolean operations and continued the confusion.

I am interested in Boolean operations only. I've edited the title.

from manifold.

elalish avatar elalish commented on July 19, 2024 1

@manthrax Here here! And agreed that CSG and so many other terms in the CAD space tend to be overloaded and confusing. In any case, it sounds like this library is well-aligned with your desires. Of course it isn't JS, but there are a variety of ways we could look at making it web-accessible (WASM, REST API, ...).

from manifold.

elalish avatar elalish commented on July 19, 2024

CSG usually refers to a rendering trick that makes Boolean operations look right, but doesn't actually compute them. For graphics that is often much simpler. This library is for actually intersecting meshes, so more in the realm of a design tool than a rendering tool.

from manifold.

manthrax avatar manthrax commented on July 19, 2024

imo Constructive solid geometry/CSG is a fine term for geometric boolean operations or for the visual only version. They are not mutually exclusive.
There are already a number of visual/stencil buffer tricks available for rendering only. i.e. Goldfeather and ZBuffer. but they rely on having a well structured graph of operations that isn't always trivial to construct/implement.

Here's a demo of a CSG lib I maintain that is based on evanw's CSG but extended to preserve uvs/normals/colors and materials:
https://manthrax.github.io/THREE-CSGMesh/demos/CSGShinyDemo.html
(you can hit W to see wireframe.. and show that it's actual geometry and not a stencil effect.)

What would be lovely to find is something that can do this but faster! and for more complex objects! :)

Right now it's N squared with the number of polygons involved since there is no search acceleration/culling strategy.

Having something more optimal could unlock a whole host of runtime web procedural generation tools!

from manifold.

pca006132 avatar pca006132 commented on July 19, 2024

@elalish is this considered finished? Or do we want to extend the three.js example?

from manifold.

elalish avatar elalish commented on July 19, 2024

I definitely want more, but agreed that we now have a simple three.js booleans example: https://elalish.github.io/manifold/bindings/wasm/examples/index.html

from manifold.

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.