GithubHelp home page GithubHelp logo

Comments (2)

yure-r avatar yure-r commented on September 17, 2024

Hi again!

I've been working with your library and I know there are different ways to categorize polygons, but basically my problem is kind of simple, yet I can't figure it out:

Screen Shot 2023-03-04 at 1 16 41 PM

The far left side of the image is a union operation, and the far right is an intersect operation.

The idea is that I'm looking to leave with only the original silhouette, the cube shape, but the materials changed where they share vertices. So I need to combine operations, or trim away the non-intersecting part of the union operation on the far left side, but keep the non intersecting part of the union operation for the cube.

Is there a way to only trim away one geometry but keep the material change?

Thank you

from three-csgmesh.

manthrax avatar manthrax commented on September 17, 2024

I don't think so. But if you don't care about efficiency.. you can merge the results of 2 operations and get something that looks identical to what you describe.
Do the intersect like you have on the right.. then swap the order and do it again to get the outer cube part.. and merge the 2 results into a single mesh using geometry.merge.
The final mesh will have multiple materials in its .material field (as an array [ material1,material2,material3]) and you can re-order/replace them as you see fit.

from three-csgmesh.

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.